=============================================================================== 4000941c <_CORE_RWLock_Obtain_for_reading>: Objects_Id id, bool wait, Watchdog_Interval timeout, CORE_RWLock_API_mp_support_callout api_rwlock_mp_support ) { 4000941c: 9d e3 bf a0 save %sp, -96, %sp ISR_Level level; Thread_Control *executing = _Thread_Executing; 40009420: 03 10 00 82 sethi %hi(0x40020800), %g1 * If unlocked, then OK to read. * If locked for reading and no waiters, then OK to read. * If any thread is waiting, then we wait. */ _ISR_Disable( level ); 40009424: 7f ff e7 e2 call 400033ac 40009428: e0 00 63 5c ld [ %g1 + 0x35c ], %l0 ! 40020b5c <_Thread_Executing> 4000942c: a2 10 00 08 mov %o0, %l1 switch ( the_rwlock->current_state ) { 40009430: c2 06 20 44 ld [ %i0 + 0x44 ], %g1 40009434: 80 a0 60 00 cmp %g1, 0 40009438: 22 80 00 06 be,a 40009450 <_CORE_RWLock_Obtain_for_reading+0x34> 4000943c: c2 06 20 48 ld [ %i0 + 0x48 ], %g1 40009440: 80 a0 60 01 cmp %g1, 1 40009444: 12 80 00 16 bne 4000949c <_CORE_RWLock_Obtain_for_reading+0x80> 40009448: 80 8e a0 ff btst 0xff, %i2 4000944c: 30 80 00 06 b,a 40009464 <_CORE_RWLock_Obtain_for_reading+0x48> case CORE_RWLOCK_UNLOCKED: the_rwlock->current_state = CORE_RWLOCK_LOCKED_FOR_READING; 40009450: 84 10 20 01 mov 1, %g2 the_rwlock->number_of_readers += 1; 40009454: 82 00 60 01 inc %g1 */ _ISR_Disable( level ); switch ( the_rwlock->current_state ) { case CORE_RWLOCK_UNLOCKED: the_rwlock->current_state = CORE_RWLOCK_LOCKED_FOR_READING; 40009458: c4 26 20 44 st %g2, [ %i0 + 0x44 ] the_rwlock->number_of_readers += 1; 4000945c: c2 26 20 48 st %g1, [ %i0 + 0x48 ] _ISR_Enable( level ); 40009460: 30 80 00 0a b,a 40009488 <_CORE_RWLock_Obtain_for_reading+0x6c> executing->Wait.return_code = CORE_RWLOCK_SUCCESSFUL; return; case CORE_RWLOCK_LOCKED_FOR_READING: { Thread_Control *waiter; waiter = _Thread_queue_First( &the_rwlock->Wait_queue ); 40009464: 40 00 07 b7 call 4000b340 <_Thread_queue_First> 40009468: 90 10 00 18 mov %i0, %o0 if ( !waiter ) { 4000946c: 80 a2 20 00 cmp %o0, 0 40009470: 12 80 00 0b bne 4000949c <_CORE_RWLock_Obtain_for_reading+0x80><== NEVER TAKEN 40009474: 80 8e a0 ff btst 0xff, %i2 the_rwlock->number_of_readers += 1; 40009478: c2 06 20 48 ld [ %i0 + 0x48 ], %g1 4000947c: 82 00 60 01 inc %g1 40009480: c2 26 20 48 st %g1, [ %i0 + 0x48 ] _ISR_Enable( level ); 40009484: 90 10 00 11 mov %l1, %o0 40009488: 7f ff e7 cd call 400033bc 4000948c: 01 00 00 00 nop executing->Wait.return_code = CORE_RWLOCK_SUCCESSFUL; 40009490: c0 24 20 34 clr [ %l0 + 0x34 ] return; 40009494: 81 c7 e0 08 ret 40009498: 81 e8 00 00 restore /* * If the thread is not willing to wait, then return immediately. */ if ( !wait ) { 4000949c: 32 80 00 08 bne,a 400094bc <_CORE_RWLock_Obtain_for_reading+0xa0> 400094a0: f2 24 20 20 st %i1, [ %l0 + 0x20 ] _ISR_Enable( level ); 400094a4: 7f ff e7 c6 call 400033bc 400094a8: 90 10 00 11 mov %l1, %o0 executing->Wait.return_code = CORE_RWLOCK_UNAVAILABLE; 400094ac: 82 10 20 02 mov 2, %g1 400094b0: c2 24 20 34 st %g1, [ %l0 + 0x34 ] 400094b4: 81 c7 e0 08 ret 400094b8: 81 e8 00 00 restore _Thread_queue_Enter_critical_section( &the_rwlock->Wait_queue ); executing->Wait.queue = &the_rwlock->Wait_queue; executing->Wait.id = id; executing->Wait.option = CORE_RWLOCK_THREAD_WAITING_FOR_READ; executing->Wait.return_code = CORE_RWLOCK_SUCCESSFUL; 400094bc: c0 24 20 34 clr [ %l0 + 0x34 ] /* * We need to wait to enter this critical section */ _Thread_queue_Enter_critical_section( &the_rwlock->Wait_queue ); executing->Wait.queue = &the_rwlock->Wait_queue; 400094c0: f0 24 20 44 st %i0, [ %l0 + 0x44 ] executing->Wait.id = id; executing->Wait.option = CORE_RWLOCK_THREAD_WAITING_FOR_READ; 400094c4: c0 24 20 30 clr [ %l0 + 0x30 ] 400094c8: 82 10 20 01 mov 1, %g1 400094cc: c2 26 20 30 st %g1, [ %i0 + 0x30 ] executing->Wait.return_code = CORE_RWLOCK_SUCCESSFUL; _ISR_Enable( level ); 400094d0: 90 10 00 11 mov %l1, %o0 400094d4: 7f ff e7 ba call 400033bc 400094d8: 35 10 00 25 sethi %hi(0x40009400), %i2 _Thread_queue_Enqueue_with_handler( 400094dc: b2 10 00 1b mov %i3, %i1 400094e0: 40 00 06 b8 call 4000afc0 <_Thread_queue_Enqueue_with_handler> 400094e4: 95 ee a2 6c restore %i2, 0x26c, %o2 =============================================================================== 40009574 <_CORE_RWLock_Release>: */ CORE_RWLock_Status _CORE_RWLock_Release( CORE_RWLock_Control *the_rwlock ) { 40009574: 9d e3 bf a0 save %sp, -96, %sp ISR_Level level; Thread_Control *executing = _Thread_Executing; 40009578: 03 10 00 82 sethi %hi(0x40020800), %g1 * Otherwise, we have to block. * If locked for reading and no waiters, then OK to read. * If any thread is waiting, then we wait. */ _ISR_Disable( level ); 4000957c: 7f ff e7 8c call 400033ac 40009580: e0 00 63 5c ld [ %g1 + 0x35c ], %l0 ! 40020b5c <_Thread_Executing> 40009584: 84 10 00 08 mov %o0, %g2 if ( the_rwlock->current_state == CORE_RWLOCK_UNLOCKED){ 40009588: c2 06 20 44 ld [ %i0 + 0x44 ], %g1 4000958c: 80 a0 60 00 cmp %g1, 0 40009590: 12 80 00 08 bne 400095b0 <_CORE_RWLock_Release+0x3c> 40009594: 80 a0 60 01 cmp %g1, 1 _ISR_Enable( level ); 40009598: 7f ff e7 89 call 400033bc 4000959c: b0 10 20 00 clr %i0 executing->Wait.return_code = CORE_RWLOCK_UNAVAILABLE; 400095a0: 82 10 20 02 mov 2, %g1 400095a4: c2 24 20 34 st %g1, [ %l0 + 0x34 ] 400095a8: 81 c7 e0 08 ret 400095ac: 81 e8 00 00 restore return CORE_RWLOCK_SUCCESSFUL; } if ( the_rwlock->current_state == CORE_RWLOCK_LOCKED_FOR_READING ) { 400095b0: 32 80 00 0b bne,a 400095dc <_CORE_RWLock_Release+0x68> 400095b4: c0 24 20 34 clr [ %l0 + 0x34 ] the_rwlock->number_of_readers -= 1; 400095b8: c2 06 20 48 ld [ %i0 + 0x48 ], %g1 400095bc: 82 00 7f ff add %g1, -1, %g1 if ( the_rwlock->number_of_readers != 0 ) { 400095c0: 80 a0 60 00 cmp %g1, 0 400095c4: 02 80 00 05 be 400095d8 <_CORE_RWLock_Release+0x64> 400095c8: c2 26 20 48 st %g1, [ %i0 + 0x48 ] /* must be unlocked again */ _ISR_Enable( level ); 400095cc: 7f ff e7 7c call 400033bc 400095d0: b0 10 20 00 clr %i0 return CORE_RWLOCK_SUCCESSFUL; 400095d4: 30 80 00 24 b,a 40009664 <_CORE_RWLock_Release+0xf0> } } /* CORE_RWLOCK_LOCKED_FOR_WRITING or READING with readers */ executing->Wait.return_code = CORE_RWLOCK_SUCCESSFUL; 400095d8: c0 24 20 34 clr [ %l0 + 0x34 ] /* * Implicitly transition to "unlocked" and find another thread interested * in obtaining this rwlock. */ the_rwlock->current_state = CORE_RWLOCK_UNLOCKED; 400095dc: c0 26 20 44 clr [ %i0 + 0x44 ] _ISR_Enable( level ); 400095e0: 7f ff e7 77 call 400033bc 400095e4: 90 10 00 02 mov %g2, %o0 next = _Thread_queue_Dequeue( &the_rwlock->Wait_queue ); 400095e8: 40 00 06 13 call 4000ae34 <_Thread_queue_Dequeue> 400095ec: 90 10 00 18 mov %i0, %o0 if ( next ) { 400095f0: 80 a2 20 00 cmp %o0, 0 400095f4: 22 80 00 1c be,a 40009664 <_CORE_RWLock_Release+0xf0> 400095f8: b0 10 20 00 clr %i0 if ( next->Wait.option == CORE_RWLOCK_THREAD_WAITING_FOR_WRITE ) { 400095fc: c2 02 20 30 ld [ %o0 + 0x30 ], %g1 40009600: 80 a0 60 01 cmp %g1, 1 40009604: 32 80 00 05 bne,a 40009618 <_CORE_RWLock_Release+0xa4> 40009608: c2 06 20 48 ld [ %i0 + 0x48 ], %g1 the_rwlock->current_state = CORE_RWLOCK_LOCKED_FOR_WRITING; 4000960c: 82 10 20 02 mov 2, %g1 return CORE_RWLOCK_SUCCESSFUL; 40009610: 10 80 00 14 b 40009660 <_CORE_RWLock_Release+0xec> 40009614: c2 26 20 44 st %g1, [ %i0 + 0x44 ] /* * Must be CORE_RWLOCK_THREAD_WAITING_FOR_READING */ the_rwlock->number_of_readers += 1; the_rwlock->current_state = CORE_RWLOCK_LOCKED_FOR_READING; 40009618: 84 10 20 01 mov 1, %g2 } /* * Must be CORE_RWLOCK_THREAD_WAITING_FOR_READING */ the_rwlock->number_of_readers += 1; 4000961c: 82 00 60 01 inc %g1 the_rwlock->current_state = CORE_RWLOCK_LOCKED_FOR_READING; 40009620: c4 26 20 44 st %g2, [ %i0 + 0x44 ] } /* * Must be CORE_RWLOCK_THREAD_WAITING_FOR_READING */ the_rwlock->number_of_readers += 1; 40009624: c2 26 20 48 st %g1, [ %i0 + 0x48 ] /* * Now see if more readers can be let go. */ while ( 1 ) { next = _Thread_queue_First( &the_rwlock->Wait_queue ); 40009628: 40 00 07 46 call 4000b340 <_Thread_queue_First> 4000962c: 90 10 00 18 mov %i0, %o0 if ( !next || 40009630: 92 92 20 00 orcc %o0, 0, %o1 40009634: 22 80 00 0c be,a 40009664 <_CORE_RWLock_Release+0xf0> 40009638: b0 10 20 00 clr %i0 next->Wait.option == CORE_RWLOCK_THREAD_WAITING_FOR_WRITE ) 4000963c: c2 02 60 30 ld [ %o1 + 0x30 ], %g1 40009640: 80 a0 60 01 cmp %g1, 1 40009644: 02 80 00 07 be 40009660 <_CORE_RWLock_Release+0xec> <== NEVER TAKEN 40009648: 90 10 00 18 mov %i0, %o0 return CORE_RWLOCK_SUCCESSFUL; the_rwlock->number_of_readers += 1; 4000964c: c2 06 20 48 ld [ %i0 + 0x48 ], %g1 40009650: 82 00 60 01 inc %g1 _Thread_queue_Extract( &the_rwlock->Wait_queue, next ); 40009654: 40 00 06 eb call 4000b200 <_Thread_queue_Extract> 40009658: c2 26 20 48 st %g1, [ %i0 + 0x48 ] } 4000965c: 30 bf ff f3 b,a 40009628 <_CORE_RWLock_Release+0xb4> } /* indentation is to match _ISR_Disable at top */ return CORE_RWLOCK_SUCCESSFUL; } 40009660: b0 10 20 00 clr %i0 40009664: 81 c7 e0 08 ret 40009668: 81 e8 00 00 restore =============================================================================== 4000966c <_CORE_RWLock_Timeout>: void _CORE_RWLock_Timeout( Objects_Id id, void *ignored ) { 4000966c: 9d e3 bf 98 save %sp, -104, %sp Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); 40009670: 90 10 00 18 mov %i0, %o0 40009674: 40 00 05 0d call 4000aaa8 <_Thread_Get> 40009678: 92 07 bf fc add %fp, -4, %o1 switch ( location ) { 4000967c: c2 07 bf fc ld [ %fp + -4 ], %g1 40009680: 80 a0 60 00 cmp %g1, 0 40009684: 12 80 00 08 bne 400096a4 <_CORE_RWLock_Timeout+0x38> <== NEVER TAKEN 40009688: 01 00 00 00 nop #if defined(RTEMS_MULTIPROCESSING) case OBJECTS_REMOTE: /* impossible */ #endif break; case OBJECTS_LOCAL: _Thread_queue_Process_timeout( the_thread ); 4000968c: 40 00 07 69 call 4000b430 <_Thread_queue_Process_timeout> 40009690: 01 00 00 00 nop */ RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void ) { RTEMS_COMPILER_MEMORY_BARRIER(); _Thread_Dispatch_disable_level -= 1; 40009694: 03 10 00 82 sethi %hi(0x40020800), %g1 40009698: c4 00 62 a0 ld [ %g1 + 0x2a0 ], %g2 ! 40020aa0 <_Thread_Dispatch_disable_level> 4000969c: 84 00 bf ff add %g2, -1, %g2 400096a0: c4 20 62 a0 st %g2, [ %g1 + 0x2a0 ] 400096a4: 81 c7 e0 08 ret 400096a8: 81 e8 00 00 restore =============================================================================== 40016af4 <_CORE_message_queue_Broadcast>: Objects_Id id __attribute__((unused)), CORE_message_queue_API_mp_support_callout api_message_queue_mp_support __attribute__((unused)), #endif uint32_t *count ) { 40016af4: 9d e3 bf a0 save %sp, -96, %sp Thread_Control *the_thread; uint32_t number_broadcasted; Thread_Wait_information *waitp; if ( size > the_message_queue->maximum_message_size ) { 40016af8: c2 06 20 4c ld [ %i0 + 0x4c ], %g1 Objects_Id id __attribute__((unused)), CORE_message_queue_API_mp_support_callout api_message_queue_mp_support __attribute__((unused)), #endif uint32_t *count ) { 40016afc: a0 10 00 18 mov %i0, %l0 Thread_Control *the_thread; uint32_t number_broadcasted; Thread_Wait_information *waitp; if ( size > the_message_queue->maximum_message_size ) { 40016b00: 80 a6 80 01 cmp %i2, %g1 40016b04: 18 80 00 17 bgu 40016b60 <_CORE_message_queue_Broadcast+0x6c><== NEVER TAKEN 40016b08: b0 10 20 01 mov 1, %i0 * NOTE: This check is critical because threads can block on * send and receive and this ensures that we are broadcasting * the message to threads waiting to receive -- not to send. */ if ( the_message_queue->number_of_pending_messages != 0 ) { 40016b0c: c2 04 20 48 ld [ %l0 + 0x48 ], %g1 40016b10: 80 a0 60 00 cmp %g1, 0 40016b14: 02 80 00 0a be 40016b3c <_CORE_message_queue_Broadcast+0x48> 40016b18: a2 10 20 00 clr %l1 *count = 0; 40016b1c: c0 27 40 00 clr [ %i5 ] return CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL; 40016b20: 81 c7 e0 08 ret 40016b24: 91 e8 20 00 restore %g0, 0, %o0 const void *source, void *destination, size_t size ) { memcpy(destination, source, size); 40016b28: d0 04 a0 2c ld [ %l2 + 0x2c ], %o0 40016b2c: 40 00 27 11 call 40020770 40016b30: a2 04 60 01 inc %l1 buffer, waitp->return_argument_second.mutable_object, size ); *(size_t *) the_thread->Wait.return_argument = size; 40016b34: c2 04 a0 28 ld [ %l2 + 0x28 ], %g1 40016b38: f4 20 40 00 st %i2, [ %g1 ] * There must be no pending messages if there is a thread waiting to * receive a message. */ number_broadcasted = 0; while ((the_thread = _Thread_queue_Dequeue(&the_message_queue->Wait_queue))) { 40016b3c: 40 00 0a 30 call 400193fc <_Thread_queue_Dequeue> 40016b40: 90 10 00 10 mov %l0, %o0 40016b44: 92 10 00 19 mov %i1, %o1 40016b48: a4 10 00 08 mov %o0, %l2 /* * There must be no pending messages if there is a thread waiting to * receive a message. */ number_broadcasted = 0; while ((the_thread = 40016b4c: 80 a2 20 00 cmp %o0, 0 40016b50: 12 bf ff f6 bne 40016b28 <_CORE_message_queue_Broadcast+0x34> 40016b54: 94 10 00 1a mov %i2, %o2 if ( !_Objects_Is_local_id( the_thread->Object.id ) ) (*api_message_queue_mp_support) ( the_thread, id ); #endif } *count = number_broadcasted; 40016b58: e2 27 40 00 st %l1, [ %i5 ] 40016b5c: b0 10 20 00 clr %i0 return CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL; } 40016b60: 81 c7 e0 08 ret 40016b64: 81 e8 00 00 restore =============================================================================== 40010644 <_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 ) { 40010644: 9d e3 bf a0 save %sp, -96, %sp size_t message_buffering_required; size_t allocated_message_size; the_message_queue->maximum_pending_messages = maximum_pending_messages; the_message_queue->number_of_pending_messages = 0; 40010648: c0 26 20 48 clr [ %i0 + 0x48 ] ) { size_t message_buffering_required; size_t allocated_message_size; the_message_queue->maximum_pending_messages = maximum_pending_messages; 4001064c: f4 26 20 44 st %i2, [ %i0 + 0x44 ] the_message_queue->number_of_pending_messages = 0; the_message_queue->maximum_message_size = maximum_message_size; 40010650: f6 26 20 4c st %i3, [ %i0 + 0x4c ] CORE_message_queue_Control *the_message_queue, CORE_message_queue_Notify_Handler the_handler, void *the_argument ) { the_message_queue->notify_handler = the_handler; 40010654: c0 26 20 60 clr [ %i0 + 0x60 ] the_message_queue->notify_argument = the_argument; 40010658: c0 26 20 64 clr [ %i0 + 0x64 ] /* * Round size up to multiple of a pointer for chain init and * check for overflow on adding overhead to each message. */ allocated_message_size = maximum_message_size; if (allocated_message_size & (sizeof(uint32_t) - 1)) { 4001065c: 80 8e e0 03 btst 3, %i3 40010660: 02 80 00 07 be 4001067c <_CORE_message_queue_Initialize+0x38> 40010664: a2 10 00 1b mov %i3, %l1 allocated_message_size += sizeof(uint32_t); 40010668: a2 06 e0 04 add %i3, 4, %l1 allocated_message_size &= ~(sizeof(uint32_t) - 1); 4001066c: a2 0c 7f fc and %l1, -4, %l1 } if (allocated_message_size < maximum_message_size) 40010670: 80 a4 40 1b cmp %l1, %i3 40010674: 0a 80 00 23 bcs 40010700 <_CORE_message_queue_Initialize+0xbc><== NEVER TAKEN 40010678: 01 00 00 00 nop /* * Calculate how much total memory is required for message buffering and * check for overflow on the multiplication. */ message_buffering_required = (size_t) maximum_pending_messages * (allocated_message_size + sizeof(CORE_message_queue_Buffer_control)); 4001067c: a0 04 60 14 add %l1, 0x14, %l0 /* * Calculate how much total memory is required for message buffering and * check for overflow on the multiplication. */ message_buffering_required = (size_t) maximum_pending_messages * 40010680: 92 10 00 1a mov %i2, %o1 40010684: 40 00 4f df call 40024600 <.umul> 40010688: 90 10 00 10 mov %l0, %o0 (allocated_message_size + sizeof(CORE_message_queue_Buffer_control)); if (message_buffering_required < allocated_message_size) 4001068c: 80 a2 00 11 cmp %o0, %l1 40010690: 0a 80 00 1c bcs 40010700 <_CORE_message_queue_Initialize+0xbc><== NEVER TAKEN 40010694: 01 00 00 00 nop return false; /* * Attempt to allocate the message memory */ the_message_queue->message_buffers = (CORE_message_queue_Buffer *) 40010698: 40 00 0b d3 call 400135e4 <_Workspace_Allocate> 4001069c: 01 00 00 00 nop 400106a0: d0 26 20 5c st %o0, [ %i0 + 0x5c ] _Workspace_Allocate( message_buffering_required ); if (the_message_queue->message_buffers == 0) 400106a4: 80 a2 20 00 cmp %o0, 0 400106a8: 02 80 00 16 be 40010700 <_CORE_message_queue_Initialize+0xbc> 400106ac: 92 10 00 08 mov %o0, %o1 /* * Initialize the pool of inactive messages, pending messages, * and set of waiting threads. */ _Chain_Initialize ( 400106b0: 90 06 20 68 add %i0, 0x68, %o0 400106b4: 94 10 00 1a mov %i2, %o2 400106b8: 40 00 15 80 call 40015cb8 <_Chain_Initialize> 400106bc: 96 10 00 10 mov %l0, %o3 allocated_message_size + sizeof( CORE_message_queue_Buffer_control ) ); _Chain_Initialize_empty( &the_message_queue->Pending_messages ); _Thread_queue_Initialize( 400106c0: c2 06 40 00 ld [ %i1 ], %g1 RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); the_chain->permanent_null = NULL; 400106c4: c0 26 20 54 clr [ %i0 + 0x54 ] 400106c8: 82 18 60 01 xor %g1, 1, %g1 400106cc: 80 a0 00 01 cmp %g0, %g1 */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 400106d0: 82 06 20 54 add %i0, 0x54, %g1 400106d4: c2 26 20 50 st %g1, [ %i0 + 0x50 ] the_chain->permanent_null = NULL; the_chain->last = _Chain_Head(the_chain); 400106d8: 82 06 20 50 add %i0, 0x50, %g1 400106dc: 90 10 00 18 mov %i0, %o0 400106e0: c2 26 20 58 st %g1, [ %i0 + 0x58 ] 400106e4: 92 60 3f ff subx %g0, -1, %o1 400106e8: 94 10 20 80 mov 0x80, %o2 400106ec: 96 10 20 06 mov 6, %o3 400106f0: 40 00 08 9e call 40012968 <_Thread_queue_Initialize> 400106f4: b0 10 20 01 mov 1, %i0 THREAD_QUEUE_DISCIPLINE_PRIORITY : THREAD_QUEUE_DISCIPLINE_FIFO, STATES_WAITING_FOR_MESSAGE, CORE_MESSAGE_QUEUE_STATUS_TIMEOUT ); return true; 400106f8: 81 c7 e0 08 ret 400106fc: 81 e8 00 00 restore } 40010700: 81 c7 e0 08 ret 40010704: 91 e8 20 00 restore %g0, 0, %o0 =============================================================================== 40010708 <_CORE_message_queue_Seize>: void *buffer, size_t *size_p, bool wait, Watchdog_Interval timeout ) { 40010708: 9d e3 bf a0 save %sp, -96, %sp ISR_Level level; CORE_message_queue_Buffer_control *the_message; Thread_Control *executing; executing = _Thread_Executing; 4001070c: 23 10 00 b1 sethi %hi(0x4002c400), %l1 40010710: e0 04 61 cc ld [ %l1 + 0x1cc ], %l0 ! 4002c5cc <_Thread_Executing> void *buffer, size_t *size_p, bool wait, Watchdog_Interval timeout ) { 40010714: a4 10 00 19 mov %i1, %l2 ISR_Level level; CORE_message_queue_Buffer_control *the_message; Thread_Control *executing; executing = _Thread_Executing; executing->Wait.return_code = CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL; 40010718: c0 24 20 34 clr [ %l0 + 0x34 ] _ISR_Disable( level ); 4001071c: 7f ff db 00 call 4000731c 40010720: a6 10 00 18 mov %i0, %l3 40010724: 82 10 00 08 mov %o0, %g1 */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 40010728: f2 06 20 50 ld [ %i0 + 0x50 ], %i1 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 4001072c: 84 06 20 54 add %i0, 0x54, %g2 40010730: 80 a6 40 02 cmp %i1, %g2 40010734: 02 80 00 24 be 400107c4 <_CORE_message_queue_Seize+0xbc> 40010738: 86 06 20 50 add %i0, 0x50, %g3 { Chain_Node *return_node; Chain_Node *new_first; return_node = the_chain->first; new_first = return_node->next; 4001073c: c4 06 40 00 ld [ %i1 ], %g2 the_chain->first = new_first; 40010740: c4 26 20 50 st %g2, [ %i0 + 0x50 ] the_message = _CORE_message_queue_Get_pending_message( the_message_queue ); if ( the_message != NULL ) { 40010744: 80 a6 60 00 cmp %i1, 0 40010748: 02 80 00 1f be 400107c4 <_CORE_message_queue_Seize+0xbc> <== NEVER TAKEN 4001074c: c6 20 a0 04 st %g3, [ %g2 + 4 ] the_message_queue->number_of_pending_messages -= 1; 40010750: c2 06 20 48 ld [ %i0 + 0x48 ], %g1 40010754: 82 00 7f ff add %g1, -1, %g1 40010758: c2 26 20 48 st %g1, [ %i0 + 0x48 ] _ISR_Enable( level ); 4001075c: 7f ff da f4 call 4000732c 40010760: a0 06 60 10 add %i1, 0x10, %l0 *size_p = the_message->Contents.size; 40010764: d4 06 60 0c ld [ %i1 + 0xc ], %o2 _Thread_Executing->Wait.count = 40010768: c2 04 61 cc ld [ %l1 + 0x1cc ], %g1 the_message = _CORE_message_queue_Get_pending_message( the_message_queue ); if ( the_message != NULL ) { the_message_queue->number_of_pending_messages -= 1; _ISR_Enable( level ); *size_p = the_message->Contents.size; 4001076c: d4 26 c0 00 st %o2, [ %i3 ] _Thread_Executing->Wait.count = 40010770: c4 06 60 08 ld [ %i1 + 8 ], %g2 40010774: c4 20 60 24 st %g2, [ %g1 + 0x24 ] const void *source, void *destination, size_t size ) { memcpy(destination, source, size); 40010778: 92 10 00 10 mov %l0, %o1 4001077c: 40 00 23 07 call 40019398 40010780: 90 10 00 1a mov %i2, %o0 * is not, then we can go ahead and free the buffer. * * NOTE: If we note that the queue was not full before this receive, * then we can avoid this dequeue. */ the_thread = _Thread_queue_Dequeue( &the_message_queue->Wait_queue ); 40010784: 40 00 07 71 call 40012548 <_Thread_queue_Dequeue> 40010788: 90 10 00 18 mov %i0, %o0 if ( !the_thread ) { 4001078c: 80 a2 20 00 cmp %o0, 0 40010790: 32 80 00 04 bne,a 400107a0 <_CORE_message_queue_Seize+0x98> 40010794: d4 02 20 30 ld [ %o0 + 0x30 ], %o2 RTEMS_INLINE_ROUTINE void _CORE_message_queue_Free_message_buffer ( CORE_message_queue_Control *the_message_queue, CORE_message_queue_Buffer_control *the_message ) { _Chain_Append( &the_message_queue->Inactive_messages, &the_message->Node ); 40010798: 7f ff ff 7a call 40010580 <_Chain_Append> 4001079c: 91 ee 20 68 restore %i0, 0x68, %o0 CORE_message_queue_Buffer_control *the_message, int priority ) { #if defined(RTEMS_SCORE_COREMSG_ENABLE_MESSAGE_PRIORITY) the_message->priority = priority; 400107a0: c2 02 20 24 ld [ %o0 + 0x24 ], %g1 */ _CORE_message_queue_Set_message_priority( the_message, the_thread->Wait.count ); the_message->Contents.size = (size_t) the_thread->Wait.option; 400107a4: d4 26 60 0c st %o2, [ %i1 + 0xc ] 400107a8: c2 26 60 08 st %g1, [ %i1 + 8 ] const void *source, void *destination, size_t size ) { memcpy(destination, source, size); 400107ac: d2 02 20 2c ld [ %o0 + 0x2c ], %o1 400107b0: 40 00 22 fa call 40019398 400107b4: 90 10 00 10 mov %l0, %o0 the_thread->Wait.return_argument_second.immutable_object, the_message->Contents.buffer, the_message->Contents.size ); _CORE_message_queue_Insert_message( 400107b8: f4 06 60 08 ld [ %i1 + 8 ], %i2 400107bc: 40 00 15 4d call 40015cf0 <_CORE_message_queue_Insert_message> 400107c0: 81 e8 00 00 restore return; } #endif } if ( !wait ) { 400107c4: 80 8f 20 ff btst 0xff, %i4 400107c8: 12 80 00 08 bne 400107e8 <_CORE_message_queue_Seize+0xe0> 400107cc: 84 10 20 01 mov 1, %g2 _ISR_Enable( level ); 400107d0: 7f ff da d7 call 4000732c 400107d4: 90 10 00 01 mov %g1, %o0 executing->Wait.return_code = CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED_NOWAIT; 400107d8: 82 10 20 04 mov 4, %g1 400107dc: c2 24 20 34 st %g1, [ %l0 + 0x34 ] executing->Wait.return_argument = size_p; /* Wait.count will be filled in with the message priority */ _ISR_Enable( level ); _Thread_queue_Enqueue( &the_message_queue->Wait_queue, timeout ); } 400107e0: 81 c7 e0 08 ret 400107e4: 81 e8 00 00 restore RTEMS_INLINE_ROUTINE void _Thread_queue_Enter_critical_section ( Thread_queue_Control *the_thread_queue ) { the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; 400107e8: c4 24 e0 30 st %g2, [ %l3 + 0x30 ] _Thread_queue_Enter_critical_section( &the_message_queue->Wait_queue ); executing->Wait.queue = &the_message_queue->Wait_queue; executing->Wait.id = id; executing->Wait.return_argument_second.mutable_object = buffer; executing->Wait.return_argument = size_p; 400107ec: f6 24 20 28 st %i3, [ %l0 + 0x28 ] return; } _Thread_queue_Enter_critical_section( &the_message_queue->Wait_queue ); executing->Wait.queue = &the_message_queue->Wait_queue; executing->Wait.id = id; 400107f0: e4 24 20 20 st %l2, [ %l0 + 0x20 ] executing->Wait.return_argument_second.mutable_object = buffer; 400107f4: f4 24 20 2c st %i2, [ %l0 + 0x2c ] executing->Wait.return_code = CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED_NOWAIT; return; } _Thread_queue_Enter_critical_section( &the_message_queue->Wait_queue ); executing->Wait.queue = &the_message_queue->Wait_queue; 400107f8: e6 24 20 44 st %l3, [ %l0 + 0x44 ] executing->Wait.id = id; executing->Wait.return_argument_second.mutable_object = buffer; executing->Wait.return_argument = size_p; /* Wait.count will be filled in with the message priority */ _ISR_Enable( level ); 400107fc: 90 10 00 01 mov %g1, %o0 40010800: 7f ff da cb call 4000732c 40010804: 35 10 00 4a sethi %hi(0x40012800), %i2 _Thread_queue_Enqueue( &the_message_queue->Wait_queue, timeout ); 40010808: b0 10 00 13 mov %l3, %i0 4001080c: b2 10 00 1d mov %i5, %i1 40010810: 40 00 07 b1 call 400126d4 <_Thread_queue_Enqueue_with_handler> 40010814: 95 ee a2 34 restore %i2, 0x234, %o2 =============================================================================== 40007054 <_CORE_mutex_Seize>: Objects_Id _id, bool _wait, Watchdog_Interval _timeout, ISR_Level _level ) { 40007054: 9d e3 bf a0 save %sp, -96, %sp _CORE_mutex_Seize_body( _the_mutex, _id, _wait, _timeout, _level ); 40007058: 03 10 00 76 sethi %hi(0x4001d800), %g1 4000705c: c2 00 61 70 ld [ %g1 + 0x170 ], %g1 ! 4001d970 <_Thread_Dispatch_disable_level> 40007060: 80 a0 60 00 cmp %g1, 0 40007064: 02 80 00 0d be 40007098 <_CORE_mutex_Seize+0x44> 40007068: f8 27 a0 54 st %i4, [ %fp + 0x54 ] 4000706c: 80 8e a0 ff btst 0xff, %i2 40007070: 02 80 00 0b be 4000709c <_CORE_mutex_Seize+0x48> <== NEVER TAKEN 40007074: 90 10 00 18 mov %i0, %o0 40007078: 03 10 00 76 sethi %hi(0x4001d800), %g1 4000707c: c2 00 63 10 ld [ %g1 + 0x310 ], %g1 ! 4001db10 <_System_state_Current> 40007080: 80 a0 60 01 cmp %g1, 1 40007084: 08 80 00 05 bleu 40007098 <_CORE_mutex_Seize+0x44> 40007088: 90 10 20 00 clr %o0 4000708c: 92 10 20 00 clr %o1 40007090: 40 00 01 b4 call 40007760 <_Internal_error_Occurred> 40007094: 94 10 20 13 mov 0x13, %o2 40007098: 90 10 00 18 mov %i0, %o0 4000709c: 40 00 15 03 call 4000c4a8 <_CORE_mutex_Seize_interrupt_trylock> 400070a0: 92 07 a0 54 add %fp, 0x54, %o1 400070a4: 80 a2 20 00 cmp %o0, 0 400070a8: 02 80 00 09 be 400070cc <_CORE_mutex_Seize+0x78> 400070ac: 80 8e a0 ff btst 0xff, %i2 400070b0: 12 80 00 09 bne 400070d4 <_CORE_mutex_Seize+0x80> 400070b4: 35 10 00 76 sethi %hi(0x4001d800), %i2 400070b8: 7f ff eb 29 call 40001d5c 400070bc: d0 07 a0 54 ld [ %fp + 0x54 ], %o0 400070c0: c2 06 a2 2c ld [ %i2 + 0x22c ], %g1 400070c4: 84 10 20 01 mov 1, %g2 400070c8: c4 20 60 34 st %g2, [ %g1 + 0x34 ] 400070cc: 81 c7 e0 08 ret 400070d0: 81 e8 00 00 restore 400070d4: c4 06 a2 2c ld [ %i2 + 0x22c ], %g2 400070d8: 03 10 00 76 sethi %hi(0x4001d800), %g1 400070dc: c6 00 61 70 ld [ %g1 + 0x170 ], %g3 ! 4001d970 <_Thread_Dispatch_disable_level> 400070e0: f2 20 a0 20 st %i1, [ %g2 + 0x20 ] 400070e4: f0 20 a0 44 st %i0, [ %g2 + 0x44 ] 400070e8: 84 00 e0 01 add %g3, 1, %g2 400070ec: c4 20 61 70 st %g2, [ %g1 + 0x170 ] RTEMS_INLINE_ROUTINE void _Thread_queue_Enter_critical_section ( Thread_queue_Control *the_thread_queue ) { the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; 400070f0: 82 10 20 01 mov 1, %g1 400070f4: c2 26 20 30 st %g1, [ %i0 + 0x30 ] 400070f8: 7f ff eb 19 call 40001d5c 400070fc: d0 07 a0 54 ld [ %fp + 0x54 ], %o0 40007100: 90 10 00 18 mov %i0, %o0 40007104: 7f ff ff bb call 40006ff0 <_CORE_mutex_Seize_interrupt_blocking> 40007108: 92 10 00 1b mov %i3, %o1 4000710c: 81 c7 e0 08 ret 40007110: 81 e8 00 00 restore =============================================================================== 400072b8 <_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 ) { 400072b8: 9d e3 bf a0 save %sp, -96, %sp 400072bc: a0 10 00 18 mov %i0, %l0 ISR_Level level; CORE_semaphore_Status status; status = CORE_SEMAPHORE_STATUS_SUCCESSFUL; if ( (the_thread = _Thread_queue_Dequeue(&the_semaphore->Wait_queue)) ) { 400072c0: b0 10 20 00 clr %i0 400072c4: 40 00 05 d2 call 40008a0c <_Thread_queue_Dequeue> 400072c8: 90 10 00 10 mov %l0, %o0 400072cc: 80 a2 20 00 cmp %o0, 0 400072d0: 12 80 00 0e bne 40007308 <_CORE_semaphore_Surrender+0x50> 400072d4: 01 00 00 00 nop if ( !_Objects_Is_local_id( the_thread->Object.id ) ) (*api_semaphore_mp_support) ( the_thread, id ); #endif } else { _ISR_Disable( level ); 400072d8: 7f ff ea 9d call 40001d4c 400072dc: 01 00 00 00 nop if ( the_semaphore->count < the_semaphore->Attributes.maximum_count ) 400072e0: c2 04 20 48 ld [ %l0 + 0x48 ], %g1 400072e4: c4 04 20 40 ld [ %l0 + 0x40 ], %g2 400072e8: 80 a0 40 02 cmp %g1, %g2 400072ec: 1a 80 00 05 bcc 40007300 <_CORE_semaphore_Surrender+0x48> <== NEVER TAKEN 400072f0: b0 10 20 04 mov 4, %i0 the_semaphore->count += 1; 400072f4: 82 00 60 01 inc %g1 400072f8: b0 10 20 00 clr %i0 400072fc: c2 24 20 48 st %g1, [ %l0 + 0x48 ] else status = CORE_SEMAPHORE_MAXIMUM_COUNT_EXCEEDED; _ISR_Enable( level ); 40007300: 7f ff ea 97 call 40001d5c 40007304: 01 00 00 00 nop } return status; } 40007308: 81 c7 e0 08 ret 4000730c: 81 e8 00 00 restore =============================================================================== 40005edc <_Event_Seize>: rtems_event_set event_in, rtems_option option_set, rtems_interval ticks, rtems_event_set *event_out ) { 40005edc: 9d e3 bf a0 save %sp, -96, %sp rtems_event_set pending_events; ISR_Level level; RTEMS_API_Control *api; Thread_blocking_operation_States sync_state; executing = _Thread_Executing; 40005ee0: 03 10 00 76 sethi %hi(0x4001d800), %g1 40005ee4: e0 00 62 2c ld [ %g1 + 0x22c ], %l0 ! 4001da2c <_Thread_Executing> executing->Wait.return_code = RTEMS_SUCCESSFUL; 40005ee8: c0 24 20 34 clr [ %l0 + 0x34 ] api = executing->API_Extensions[ THREAD_API_RTEMS ]; _ISR_Disable( level ); 40005eec: 7f ff ef 98 call 40001d4c 40005ef0: e4 04 21 5c ld [ %l0 + 0x15c ], %l2 pending_events = api->pending_events; 40005ef4: c2 04 80 00 ld [ %l2 ], %g1 seized_events = _Event_sets_Get( pending_events, event_in ); if ( !_Event_sets_Is_empty( seized_events ) && 40005ef8: a2 8e 00 01 andcc %i0, %g1, %l1 40005efc: 02 80 00 0e be 40005f34 <_Event_Seize+0x58> 40005f00: 80 8e 60 01 btst 1, %i1 40005f04: 80 a4 40 18 cmp %l1, %i0 40005f08: 02 80 00 04 be 40005f18 <_Event_Seize+0x3c> 40005f0c: 80 8e 60 02 btst 2, %i1 40005f10: 02 80 00 09 be 40005f34 <_Event_Seize+0x58> <== NEVER TAKEN 40005f14: 80 8e 60 01 btst 1, %i1 (seized_events == event_in || _Options_Is_any( option_set )) ) { api->pending_events = 40005f18: 82 28 40 11 andn %g1, %l1, %g1 40005f1c: c2 24 80 00 st %g1, [ %l2 ] _Event_sets_Clear( pending_events, seized_events ); _ISR_Enable( level ); 40005f20: 7f ff ef 8f call 40001d5c 40005f24: 01 00 00 00 nop 40005f28: e2 26 c0 00 st %l1, [ %i3 ] 40005f2c: 81 c7 e0 08 ret 40005f30: 81 e8 00 00 restore *event_out = seized_events; return; } if ( _Options_Is_no_wait( option_set ) ) { 40005f34: 22 80 00 09 be,a 40005f58 <_Event_Seize+0x7c> 40005f38: f2 24 20 30 st %i1, [ %l0 + 0x30 ] _ISR_Enable( level ); 40005f3c: 7f ff ef 88 call 40001d5c 40005f40: 01 00 00 00 nop executing->Wait.return_code = RTEMS_UNSATISFIED; 40005f44: 82 10 20 0d mov 0xd, %g1 ! d 40005f48: c2 24 20 34 st %g1, [ %l0 + 0x34 ] *event_out = seized_events; 40005f4c: e2 26 c0 00 st %l1, [ %i3 ] 40005f50: 81 c7 e0 08 ret 40005f54: 81 e8 00 00 restore * * NOTE: Since interrupts are disabled, this isn't that much of an * issue but better safe than sorry. */ executing->Wait.option = (uint32_t) option_set; executing->Wait.count = (uint32_t) event_in; 40005f58: f0 24 20 24 st %i0, [ %l0 + 0x24 ] executing->Wait.return_argument = event_out; 40005f5c: f6 24 20 28 st %i3, [ %l0 + 0x28 ] _Event_Sync_state = THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; 40005f60: 84 10 20 01 mov 1, %g2 40005f64: 03 10 00 78 sethi %hi(0x4001e000), %g1 40005f68: c4 20 62 a4 st %g2, [ %g1 + 0x2a4 ] ! 4001e2a4 <_Event_Sync_state> _ISR_Enable( level ); 40005f6c: 7f ff ef 7c call 40001d5c 40005f70: 01 00 00 00 nop if ( ticks ) { 40005f74: 80 a6 a0 00 cmp %i2, 0 40005f78: 02 80 00 0f be 40005fb4 <_Event_Seize+0xd8> 40005f7c: 90 10 00 10 mov %l0, %o0 _Watchdog_Initialize( 40005f80: c2 04 20 08 ld [ %l0 + 8 ], %g1 ) { the_watchdog->initial = units; _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 40005f84: 11 10 00 76 sethi %hi(0x4001d800), %o0 void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; the_watchdog->id = id; 40005f88: c2 24 20 68 st %g1, [ %l0 + 0x68 ] Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 40005f8c: 03 10 00 18 sethi %hi(0x40006000), %g1 40005f90: 82 10 61 88 or %g1, 0x188, %g1 ! 40006188 <_Event_Timeout> Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 40005f94: f4 24 20 54 st %i2, [ %l0 + 0x54 ] Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 40005f98: c0 24 20 50 clr [ %l0 + 0x50 ] the_watchdog->routine = routine; the_watchdog->id = id; the_watchdog->user_data = user_data; 40005f9c: c0 24 20 6c clr [ %l0 + 0x6c ] Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 40005fa0: c2 24 20 64 st %g1, [ %l0 + 0x64 ] ) { the_watchdog->initial = units; _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 40005fa4: 90 12 22 4c or %o0, 0x24c, %o0 40005fa8: 40 00 0e 02 call 400097b0 <_Watchdog_Insert> 40005fac: 92 04 20 48 add %l0, 0x48, %o1 NULL ); _Watchdog_Insert_ticks( &executing->Timer, ticks ); } _Thread_Set_state( executing, STATES_WAITING_FOR_EVENT ); 40005fb0: 90 10 00 10 mov %l0, %o0 40005fb4: 40 00 0b fb call 40008fa0 <_Thread_Set_state> 40005fb8: 92 10 21 00 mov 0x100, %o1 _ISR_Disable( level ); 40005fbc: 7f ff ef 64 call 40001d4c 40005fc0: 01 00 00 00 nop sync_state = _Event_Sync_state; 40005fc4: 03 10 00 78 sethi %hi(0x4001e000), %g1 40005fc8: f0 00 62 a4 ld [ %g1 + 0x2a4 ], %i0 ! 4001e2a4 <_Event_Sync_state> _Event_Sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; 40005fcc: c0 20 62 a4 clr [ %g1 + 0x2a4 ] if ( sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) { 40005fd0: 80 a6 20 01 cmp %i0, 1 40005fd4: 12 80 00 04 bne 40005fe4 <_Event_Seize+0x108> 40005fd8: b2 10 00 10 mov %l0, %i1 _ISR_Enable( level ); 40005fdc: 7f ff ef 60 call 40001d5c 40005fe0: 91 e8 00 08 restore %g0, %o0, %o0 * An interrupt completed the thread's blocking request. * The blocking thread was satisfied by an ISR or timed out. * * WARNING! Returning with interrupts disabled! */ _Thread_blocking_operation_Cancel( sync_state, executing, level ); 40005fe4: 40 00 08 15 call 40008038 <_Thread_blocking_operation_Cancel> 40005fe8: 95 e8 00 08 restore %g0, %o0, %o2 =============================================================================== 40006048 <_Event_Surrender>: */ void _Event_Surrender( Thread_Control *the_thread ) { 40006048: 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 ]; 4000604c: e2 06 21 5c ld [ %i0 + 0x15c ], %l1 option_set = (rtems_option) the_thread->Wait.option; 40006050: e4 06 20 30 ld [ %i0 + 0x30 ], %l2 _ISR_Disable( level ); 40006054: 7f ff ef 3e call 40001d4c 40006058: a0 10 00 18 mov %i0, %l0 4000605c: b0 10 00 08 mov %o0, %i0 pending_events = api->pending_events; 40006060: c4 04 40 00 ld [ %l1 ], %g2 event_condition = (rtems_event_set) the_thread->Wait.count; 40006064: c6 04 20 24 ld [ %l0 + 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 ) ) { 40006068: 82 88 c0 02 andcc %g3, %g2, %g1 4000606c: 12 80 00 03 bne 40006078 <_Event_Surrender+0x30> 40006070: 09 10 00 76 sethi %hi(0x4001d800), %g4 _ISR_Enable( level ); 40006074: 30 80 00 42 b,a 4000617c <_Event_Surrender+0x134> /* * 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() && 40006078: c8 01 22 08 ld [ %g4 + 0x208 ], %g4 ! 4001da08 <_ISR_Nest_level> 4000607c: 80 a1 20 00 cmp %g4, 0 40006080: 22 80 00 1e be,a 400060f8 <_Event_Surrender+0xb0> 40006084: c8 04 20 10 ld [ %l0 + 0x10 ], %g4 40006088: 09 10 00 76 sethi %hi(0x4001d800), %g4 4000608c: c8 01 22 2c ld [ %g4 + 0x22c ], %g4 ! 4001da2c <_Thread_Executing> 40006090: 80 a4 00 04 cmp %l0, %g4 40006094: 32 80 00 19 bne,a 400060f8 <_Event_Surrender+0xb0> 40006098: c8 04 20 10 ld [ %l0 + 0x10 ], %g4 _Thread_Is_executing( the_thread ) && ((_Event_Sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || 4000609c: 09 10 00 78 sethi %hi(0x4001e000), %g4 400060a0: da 01 22 a4 ld [ %g4 + 0x2a4 ], %o5 ! 4001e2a4 <_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() && 400060a4: 80 a3 60 02 cmp %o5, 2 400060a8: 02 80 00 07 be 400060c4 <_Event_Surrender+0x7c> <== NEVER TAKEN 400060ac: 80 a0 40 03 cmp %g1, %g3 _Thread_Is_executing( the_thread ) && ((_Event_Sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || (_Event_Sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED)) ) { 400060b0: c8 01 22 a4 ld [ %g4 + 0x2a4 ], %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() && 400060b4: 80 a1 20 01 cmp %g4, 1 400060b8: 32 80 00 10 bne,a 400060f8 <_Event_Surrender+0xb0> 400060bc: c8 04 20 10 ld [ %l0 + 0x10 ], %g4 _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) ) { 400060c0: 80 a0 40 03 cmp %g1, %g3 400060c4: 02 80 00 04 be 400060d4 <_Event_Surrender+0x8c> 400060c8: 80 8c a0 02 btst 2, %l2 400060cc: 02 80 00 0a be 400060f4 <_Event_Surrender+0xac> <== NEVER TAKEN 400060d0: 01 00 00 00 nop api->pending_events = _Event_sets_Clear( pending_events,seized_events ); 400060d4: 84 28 80 01 andn %g2, %g1, %g2 400060d8: c4 24 40 00 st %g2, [ %l1 ] the_thread->Wait.count = 0; *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 400060dc: c4 04 20 28 ld [ %l0 + 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; 400060e0: c0 24 20 24 clr [ %l0 + 0x24 ] *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 400060e4: c2 20 80 00 st %g1, [ %g2 ] _Event_Sync_state = THREAD_BLOCKING_OPERATION_SATISFIED; 400060e8: 84 10 20 03 mov 3, %g2 400060ec: 03 10 00 78 sethi %hi(0x4001e000), %g1 400060f0: c4 20 62 a4 st %g2, [ %g1 + 0x2a4 ] ! 4001e2a4 <_Event_Sync_state> } _ISR_Enable( level ); 400060f4: 30 80 00 22 b,a 4000617c <_Event_Surrender+0x134> } /* * Otherwise, this is a normal send to another thread */ if ( _States_Is_waiting_for_event( the_thread->current_state ) ) { 400060f8: 80 89 21 00 btst 0x100, %g4 400060fc: 02 80 00 20 be 4000617c <_Event_Surrender+0x134> 40006100: 80 a0 40 03 cmp %g1, %g3 if ( seized_events == event_condition || _Options_Is_any( option_set ) ) { 40006104: 02 80 00 04 be 40006114 <_Event_Surrender+0xcc> 40006108: 80 8c a0 02 btst 2, %l2 4000610c: 02 80 00 1c be 4000617c <_Event_Surrender+0x134> <== NEVER TAKEN 40006110: 01 00 00 00 nop api->pending_events = _Event_sets_Clear( pending_events, seized_events ); 40006114: 84 28 80 01 andn %g2, %g1, %g2 40006118: c4 24 40 00 st %g2, [ %l1 ] the_thread->Wait.count = 0; *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 4000611c: c4 04 20 28 ld [ %l0 + 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; 40006120: c0 24 20 24 clr [ %l0 + 0x24 ] *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 40006124: c2 20 80 00 st %g1, [ %g2 ] _ISR_Flash( level ); 40006128: 7f ff ef 0d call 40001d5c 4000612c: 90 10 00 18 mov %i0, %o0 40006130: 7f ff ef 07 call 40001d4c 40006134: 01 00 00 00 nop if ( !_Watchdog_Is_active( &the_thread->Timer ) ) { 40006138: c2 04 20 50 ld [ %l0 + 0x50 ], %g1 4000613c: 80 a0 60 02 cmp %g1, 2 40006140: 02 80 00 06 be 40006158 <_Event_Surrender+0x110> 40006144: 82 10 20 03 mov 3, %g1 _ISR_Enable( level ); 40006148: 7f ff ef 05 call 40001d5c 4000614c: 90 10 00 18 mov %i0, %o0 RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 40006150: 10 80 00 08 b 40006170 <_Event_Surrender+0x128> 40006154: 33 04 00 ff sethi %hi(0x1003fc00), %i1 RTEMS_INLINE_ROUTINE void _Watchdog_Deactivate( Watchdog_Control *the_watchdog ) { the_watchdog->state = WATCHDOG_REMOVE_IT; 40006158: c2 24 20 50 st %g1, [ %l0 + 0x50 ] _Thread_Unblock( the_thread ); } else { _Watchdog_Deactivate( &the_thread->Timer ); _ISR_Enable( level ); 4000615c: 7f ff ef 00 call 40001d5c 40006160: 90 10 00 18 mov %i0, %o0 (void) _Watchdog_Remove( &the_thread->Timer ); 40006164: 40 00 0d f0 call 40009924 <_Watchdog_Remove> 40006168: 90 04 20 48 add %l0, 0x48, %o0 4000616c: 33 04 00 ff sethi %hi(0x1003fc00), %i1 40006170: b2 16 63 f8 or %i1, 0x3f8, %i1 ! 1003fff8 40006174: 40 00 08 3f call 40008270 <_Thread_Clear_state> 40006178: 91 e8 00 10 restore %g0, %l0, %o0 _Thread_Unblock( the_thread ); } return; } } _ISR_Enable( level ); 4000617c: 7f ff ee f8 call 40001d5c 40006180: 81 e8 00 00 restore =============================================================================== 40006188 <_Event_Timeout>: void _Event_Timeout( Objects_Id id, void *ignored ) { 40006188: 9d e3 bf 98 save %sp, -104, %sp Thread_Control *the_thread; Objects_Locations location; ISR_Level level; the_thread = _Thread_Get( id, &location ); 4000618c: 90 10 00 18 mov %i0, %o0 40006190: 40 00 09 3c call 40008680 <_Thread_Get> 40006194: 92 07 bf fc add %fp, -4, %o1 switch ( location ) { 40006198: c2 07 bf fc ld [ %fp + -4 ], %g1 4000619c: 80 a0 60 00 cmp %g1, 0 400061a0: 12 80 00 1c bne 40006210 <_Event_Timeout+0x88> <== NEVER TAKEN 400061a4: a0 10 00 08 mov %o0, %l0 * * 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 ); 400061a8: 7f ff ee e9 call 40001d4c 400061ac: 01 00 00 00 nop return; } #endif the_thread->Wait.count = 0; if ( _Thread_Is_executing( the_thread ) ) { 400061b0: 03 10 00 76 sethi %hi(0x4001d800), %g1 400061b4: c2 00 62 2c ld [ %g1 + 0x22c ], %g1 ! 4001da2c <_Thread_Executing> 400061b8: 80 a4 00 01 cmp %l0, %g1 400061bc: 12 80 00 09 bne 400061e0 <_Event_Timeout+0x58> 400061c0: c0 24 20 24 clr [ %l0 + 0x24 ] if ( _Event_Sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) 400061c4: 03 10 00 78 sethi %hi(0x4001e000), %g1 400061c8: c4 00 62 a4 ld [ %g1 + 0x2a4 ], %g2 ! 4001e2a4 <_Event_Sync_state> 400061cc: 80 a0 a0 01 cmp %g2, 1 400061d0: 32 80 00 05 bne,a 400061e4 <_Event_Timeout+0x5c> 400061d4: 82 10 20 06 mov 6, %g1 _Event_Sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT; 400061d8: 84 10 20 02 mov 2, %g2 400061dc: c4 20 62 a4 st %g2, [ %g1 + 0x2a4 ] } the_thread->Wait.return_code = RTEMS_TIMEOUT; 400061e0: 82 10 20 06 mov 6, %g1 400061e4: c2 24 20 34 st %g1, [ %l0 + 0x34 ] _ISR_Enable( level ); 400061e8: 7f ff ee dd call 40001d5c 400061ec: 01 00 00 00 nop 400061f0: 90 10 00 10 mov %l0, %o0 400061f4: 13 04 00 ff sethi %hi(0x1003fc00), %o1 400061f8: 40 00 08 1e call 40008270 <_Thread_Clear_state> 400061fc: 92 12 63 f8 or %o1, 0x3f8, %o1 ! 1003fff8 */ RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void ) { RTEMS_COMPILER_MEMORY_BARRIER(); _Thread_Dispatch_disable_level -= 1; 40006200: 03 10 00 76 sethi %hi(0x4001d800), %g1 40006204: c4 00 61 70 ld [ %g1 + 0x170 ], %g2 ! 4001d970 <_Thread_Dispatch_disable_level> 40006208: 84 00 bf ff add %g2, -1, %g2 4000620c: c4 20 61 70 st %g2, [ %g1 + 0x170 ] 40006210: 81 c7 e0 08 ret 40006214: 81 e8 00 00 restore =============================================================================== 4000c6d4 <_Heap_Allocate_aligned_with_boundary>: Heap_Control *heap, uintptr_t alloc_size, uintptr_t alignment, uintptr_t boundary ) { 4000c6d4: 9d e3 bf 90 save %sp, -112, %sp Heap_Statistics *const stats = &heap->stats; Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); Heap_Block *block = _Heap_Free_list_first( heap ); uintptr_t const block_size_floor = alloc_size + HEAP_BLOCK_HEADER_SIZE - HEAP_BLOCK_SIZE_OFFSET; 4000c6d8: ac 06 60 04 add %i1, 4, %l6 return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next; 4000c6dc: e4 06 20 08 ld [ %i0 + 8 ], %l2 uintptr_t const page_size = heap->page_size; uintptr_t alloc_begin = 0; uint32_t search_count = 0; if ( block_size_floor < alloc_size ) { 4000c6e0: 80 a5 80 19 cmp %l6, %i1 4000c6e4: 0a 80 00 6d bcs 4000c898 <_Heap_Allocate_aligned_with_boundary+0x1c4> 4000c6e8: e8 06 20 10 ld [ %i0 + 0x10 ], %l4 /* Integer overflow occured */ return NULL; } if ( boundary != 0 ) { 4000c6ec: 80 a6 e0 00 cmp %i3, 0 4000c6f0: 02 80 00 08 be 4000c710 <_Heap_Allocate_aligned_with_boundary+0x3c> 4000c6f4: 82 10 20 04 mov 4, %g1 if ( boundary < alloc_size ) { 4000c6f8: 80 a6 c0 19 cmp %i3, %i1 4000c6fc: 0a 80 00 67 bcs 4000c898 <_Heap_Allocate_aligned_with_boundary+0x1c4> 4000c700: 80 a6 a0 00 cmp %i2, 0 return NULL; } if ( alignment == 0 ) { 4000c704: 22 80 00 03 be,a 4000c710 <_Heap_Allocate_aligned_with_boundary+0x3c> 4000c708: b4 10 00 14 mov %l4, %i2 uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block ); uintptr_t const alloc_begin_ceiling = block_end - min_block_size + HEAP_BLOCK_HEADER_SIZE + page_size - 1; uintptr_t alloc_end = block_end + HEAP_BLOCK_SIZE_OFFSET; uintptr_t alloc_begin = alloc_end - alloc_size; 4000c70c: 82 10 20 04 mov 4, %g1 4000c710: 82 20 40 19 sub %g1, %i1, %g1 if ( boundary != 0 ) { if ( boundary < alloc_size ) { return NULL; } if ( alignment == 0 ) { 4000c714: a2 10 20 00 clr %l1 uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block ); uintptr_t const alloc_begin_ceiling = block_end - min_block_size + HEAP_BLOCK_HEADER_SIZE + page_size - 1; uintptr_t alloc_end = block_end + HEAP_BLOCK_SIZE_OFFSET; uintptr_t alloc_begin = alloc_end - alloc_size; 4000c718: c2 27 bf f4 st %g1, [ %fp + -12 ] /* Ensure that the we have a valid new block at the beginning */ if ( alloc_begin >= alloc_begin_floor ) { uintptr_t const alloc_block_begin = (uintptr_t) _Heap_Block_of_alloc_area( alloc_begin, page_size ); uintptr_t const free_size = alloc_block_begin - block_begin; 4000c71c: b8 10 3f f8 mov -8, %i4 uintptr_t const block_size = _Heap_Block_size( block ); uintptr_t const block_end = block_begin + block_size; uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block ); uintptr_t const alloc_begin_ceiling = block_end - min_block_size + HEAP_BLOCK_HEADER_SIZE + page_size - 1; 4000c720: 82 05 20 07 add %l4, 7, %g1 4000c724: 10 80 00 4b b 4000c850 <_Heap_Allocate_aligned_with_boundary+0x17c> 4000c728: c2 27 bf f8 st %g1, [ %fp + -8 ] /* * The HEAP_PREV_BLOCK_USED flag is always set in the block size_and_flag * field. Thus the value is about one unit larger than the real block * size. The greater than operator takes this into account. */ if ( block->size_and_flag > block_size_floor ) { 4000c72c: 80 a4 c0 16 cmp %l3, %l6 4000c730: 08 80 00 47 bleu 4000c84c <_Heap_Allocate_aligned_with_boundary+0x178> 4000c734: a2 04 60 01 inc %l1 if ( alignment == 0 ) { 4000c738: 80 a6 a0 00 cmp %i2, 0 4000c73c: 12 80 00 04 bne 4000c74c <_Heap_Allocate_aligned_with_boundary+0x78> 4000c740: aa 04 a0 08 add %l2, 8, %l5 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Alloc_area_of_block( const Heap_Block *block ) { return (uintptr_t) block + HEAP_BLOCK_HEADER_SIZE; 4000c744: 10 80 00 3f b 4000c840 <_Heap_Allocate_aligned_with_boundary+0x16c> 4000c748: a0 10 00 15 mov %l5, %l0 uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block ); uintptr_t const alloc_begin_ceiling = block_end - min_block_size + HEAP_BLOCK_HEADER_SIZE + page_size - 1; uintptr_t alloc_end = block_end + HEAP_BLOCK_SIZE_OFFSET; uintptr_t alloc_begin = alloc_end - alloc_size; 4000c74c: c4 07 bf f4 ld [ %fp + -12 ], %g2 uintptr_t alignment, uintptr_t boundary ) { uintptr_t const page_size = heap->page_size; uintptr_t const min_block_size = heap->min_block_size; 4000c750: ee 06 20 14 ld [ %i0 + 0x14 ], %l7 uintptr_t const block_begin = (uintptr_t) block; uintptr_t const block_size = _Heap_Block_size( block ); uintptr_t const block_end = block_begin + block_size; 4000c754: a6 0c ff fe and %l3, -2, %l3 4000c758: a6 04 80 13 add %l2, %l3, %l3 uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block ); uintptr_t const alloc_begin_ceiling = block_end - min_block_size + HEAP_BLOCK_HEADER_SIZE + page_size - 1; uintptr_t alloc_end = block_end + HEAP_BLOCK_SIZE_OFFSET; uintptr_t alloc_begin = alloc_end - alloc_size; 4000c75c: a0 00 80 13 add %g2, %l3, %l0 uintptr_t const block_size = _Heap_Block_size( block ); uintptr_t const block_end = block_begin + block_size; uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block ); uintptr_t const alloc_begin_ceiling = block_end - min_block_size + HEAP_BLOCK_HEADER_SIZE + page_size - 1; 4000c760: c4 07 bf f8 ld [ %fp + -8 ], %g2 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 4000c764: 90 10 00 10 mov %l0, %o0 4000c768: 82 20 80 17 sub %g2, %l7, %g1 4000c76c: 92 10 00 1a mov %i2, %o1 4000c770: 40 00 31 9f call 40018dec <.urem> 4000c774: a6 00 40 13 add %g1, %l3, %l3 4000c778: a0 24 00 08 sub %l0, %o0, %l0 uintptr_t alloc_begin = alloc_end - alloc_size; alloc_begin = _Heap_Align_down( alloc_begin, alignment ); /* Ensure that the we have a valid new block at the end */ if ( alloc_begin > alloc_begin_ceiling ) { 4000c77c: 80 a4 00 13 cmp %l0, %l3 4000c780: 08 80 00 07 bleu 4000c79c <_Heap_Allocate_aligned_with_boundary+0xc8> 4000c784: 80 a6 e0 00 cmp %i3, 0 4000c788: 90 10 00 13 mov %l3, %o0 4000c78c: 40 00 31 98 call 40018dec <.urem> 4000c790: 92 10 00 1a mov %i2, %o1 4000c794: a0 24 c0 08 sub %l3, %o0, %l0 } alloc_end = alloc_begin + alloc_size; /* Ensure boundary constaint */ if ( boundary != 0 ) { 4000c798: 80 a6 e0 00 cmp %i3, 0 4000c79c: 02 80 00 1d be 4000c810 <_Heap_Allocate_aligned_with_boundary+0x13c> 4000c7a0: 80 a4 00 15 cmp %l0, %l5 /* Ensure that the we have a valid new block at the end */ if ( alloc_begin > alloc_begin_ceiling ) { alloc_begin = _Heap_Align_down( alloc_begin_ceiling, alignment ); } alloc_end = alloc_begin + alloc_size; 4000c7a4: a6 04 00 19 add %l0, %i1, %l3 /* Ensure boundary constaint */ if ( boundary != 0 ) { uintptr_t const boundary_floor = alloc_begin_floor + alloc_size; 4000c7a8: 82 05 40 19 add %l5, %i1, %g1 4000c7ac: 92 10 00 1b mov %i3, %o1 4000c7b0: 90 10 00 13 mov %l3, %o0 4000c7b4: 10 80 00 0b b 4000c7e0 <_Heap_Allocate_aligned_with_boundary+0x10c> 4000c7b8: c2 27 bf fc st %g1, [ %fp + -4 ] uintptr_t boundary_line = _Heap_Align_down( alloc_end, boundary ); while ( alloc_begin < boundary_line && boundary_line < alloc_end ) { if ( boundary_line < boundary_floor ) { 4000c7bc: 80 a0 40 02 cmp %g1, %g2 4000c7c0: 2a 80 00 24 bcs,a 4000c850 <_Heap_Allocate_aligned_with_boundary+0x17c> 4000c7c4: e4 04 a0 08 ld [ %l2 + 8 ], %l2 4000c7c8: 40 00 31 89 call 40018dec <.urem> 4000c7cc: 01 00 00 00 nop 4000c7d0: 92 10 00 1b mov %i3, %o1 4000c7d4: a0 27 40 08 sub %i5, %o0, %l0 return 0; } alloc_begin = boundary_line - alloc_size; alloc_begin = _Heap_Align_down( alloc_begin, alignment ); alloc_end = alloc_begin + alloc_size; 4000c7d8: a6 04 00 19 add %l0, %i1, %l3 4000c7dc: 90 10 00 13 mov %l3, %o0 4000c7e0: 40 00 31 83 call 40018dec <.urem> 4000c7e4: 01 00 00 00 nop 4000c7e8: 92 10 00 1a mov %i2, %o1 4000c7ec: 82 24 c0 08 sub %l3, %o0, %g1 while ( alloc_begin < boundary_line && boundary_line < alloc_end ) { if ( boundary_line < boundary_floor ) { return 0; } alloc_begin = boundary_line - alloc_size; 4000c7f0: ba 20 40 19 sub %g1, %i1, %i5 /* Ensure boundary constaint */ if ( boundary != 0 ) { uintptr_t const boundary_floor = alloc_begin_floor + alloc_size; uintptr_t boundary_line = _Heap_Align_down( alloc_end, boundary ); while ( alloc_begin < boundary_line && boundary_line < alloc_end ) { 4000c7f4: 80 a0 40 13 cmp %g1, %l3 4000c7f8: 1a 80 00 05 bcc 4000c80c <_Heap_Allocate_aligned_with_boundary+0x138> 4000c7fc: 90 10 00 1d mov %i5, %o0 4000c800: 80 a4 00 01 cmp %l0, %g1 4000c804: 0a bf ff ee bcs 4000c7bc <_Heap_Allocate_aligned_with_boundary+0xe8> 4000c808: c4 07 bf fc ld [ %fp + -4 ], %g2 boundary_line = _Heap_Align_down( alloc_end, boundary ); } } /* Ensure that the we have a valid new block at the beginning */ if ( alloc_begin >= alloc_begin_floor ) { 4000c80c: 80 a4 00 15 cmp %l0, %l5 4000c810: 0a 80 00 0f bcs 4000c84c <_Heap_Allocate_aligned_with_boundary+0x178> 4000c814: a6 27 00 12 sub %i4, %l2, %l3 uintptr_t const alloc_block_begin = (uintptr_t) _Heap_Block_of_alloc_area( alloc_begin, page_size ); uintptr_t const free_size = alloc_block_begin - block_begin; 4000c818: 90 10 00 10 mov %l0, %o0 4000c81c: a6 04 c0 10 add %l3, %l0, %l3 4000c820: 40 00 31 73 call 40018dec <.urem> 4000c824: 92 10 00 14 mov %l4, %o1 if ( free_size >= min_block_size || free_size == 0 ) { 4000c828: 90 a4 c0 08 subcc %l3, %o0, %o0 4000c82c: 02 80 00 06 be 4000c844 <_Heap_Allocate_aligned_with_boundary+0x170> 4000c830: 80 a4 20 00 cmp %l0, 0 4000c834: 80 a2 00 17 cmp %o0, %l7 4000c838: 2a 80 00 06 bcs,a 4000c850 <_Heap_Allocate_aligned_with_boundary+0x17c> 4000c83c: e4 04 a0 08 ld [ %l2 + 8 ], %l2 boundary ); } } if ( alloc_begin != 0 ) { 4000c840: 80 a4 20 00 cmp %l0, 0 4000c844: 32 80 00 08 bne,a 4000c864 <_Heap_Allocate_aligned_with_boundary+0x190><== ALWAYS TAKEN 4000c848: c2 06 20 4c ld [ %i0 + 0x4c ], %g1 break; } block = block->next; 4000c84c: e4 04 a0 08 ld [ %l2 + 8 ], %l2 if ( alignment == 0 ) { alignment = page_size; } } while ( block != free_list_tail ) { 4000c850: 80 a4 80 18 cmp %l2, %i0 4000c854: 32 bf ff b6 bne,a 4000c72c <_Heap_Allocate_aligned_with_boundary+0x58> 4000c858: e6 04 a0 04 ld [ %l2 + 4 ], %l3 4000c85c: 10 80 00 09 b 4000c880 <_Heap_Allocate_aligned_with_boundary+0x1ac> 4000c860: a0 10 20 00 clr %l0 if ( alloc_begin != 0 ) { /* Statistics */ stats->searches += search_count; block = _Heap_Block_allocate( heap, block, alloc_begin, alloc_size ); 4000c864: 92 10 00 12 mov %l2, %o1 block = block->next; } if ( alloc_begin != 0 ) { /* Statistics */ stats->searches += search_count; 4000c868: 82 00 40 11 add %g1, %l1, %g1 block = _Heap_Block_allocate( heap, block, alloc_begin, alloc_size ); 4000c86c: 96 10 00 19 mov %i1, %o3 block = block->next; } if ( alloc_begin != 0 ) { /* Statistics */ stats->searches += search_count; 4000c870: c2 26 20 4c st %g1, [ %i0 + 0x4c ] block = _Heap_Block_allocate( heap, block, alloc_begin, alloc_size ); 4000c874: 90 10 00 18 mov %i0, %o0 4000c878: 7f ff eb 69 call 4000761c <_Heap_Block_allocate> 4000c87c: 94 10 00 10 mov %l0, %o2 uintptr_t alloc_size, uintptr_t alignment, uintptr_t boundary ) { Heap_Statistics *const stats = &heap->stats; 4000c880: c2 06 20 44 ld [ %i0 + 0x44 ], %g1 4000c884: 80 a0 40 11 cmp %g1, %l1 4000c888: 2a 80 00 02 bcs,a 4000c890 <_Heap_Allocate_aligned_with_boundary+0x1bc> 4000c88c: e2 26 20 44 st %l1, [ %i0 + 0x44 ] /* Statistics */ if ( stats->max_search < search_count ) { stats->max_search = search_count; } return (void *) alloc_begin; 4000c890: 81 c7 e0 08 ret 4000c894: 91 e8 00 10 restore %g0, %l0, %o0 } 4000c898: 81 c7 e0 08 ret 4000c89c: 91 e8 20 00 restore %g0, 0, %o0 =============================================================================== 40011cd0 <_Heap_Extend>: Heap_Control *heap, void *area_begin_ptr, uintptr_t area_size, uintptr_t *amount_extended ) { 40011cd0: 9d e3 bf a0 save %sp, -96, %sp Heap_Statistics *const stats = &heap->stats; uintptr_t const area_begin = (uintptr_t) area_begin_ptr; uintptr_t const heap_area_begin = heap->area_begin; uintptr_t const heap_area_end = heap->area_end; 40011cd4: c2 06 20 1c ld [ %i0 + 0x1c ], %g1 Heap_Control *heap, void *area_begin_ptr, uintptr_t area_size, uintptr_t *amount_extended ) { 40011cd8: a0 10 00 18 mov %i0, %l0 * 5. non-contiguous higher address (NOT SUPPORTED) * * As noted, this code only supports (4). */ if ( area_begin >= heap_area_begin && area_begin < heap_area_end ) { 40011cdc: 80 a6 40 01 cmp %i1, %g1 40011ce0: 1a 80 00 07 bcc 40011cfc <_Heap_Extend+0x2c> 40011ce4: e2 06 20 24 ld [ %i0 + 0x24 ], %l1 uintptr_t *amount_extended ) { Heap_Statistics *const stats = &heap->stats; uintptr_t const area_begin = (uintptr_t) area_begin_ptr; uintptr_t const heap_area_begin = heap->area_begin; 40011ce8: c4 06 20 18 ld [ %i0 + 0x18 ], %g2 40011cec: 80 a6 40 02 cmp %i1, %g2 40011cf0: 1a 80 00 28 bcc 40011d90 <_Heap_Extend+0xc0> 40011cf4: b0 10 20 01 mov 1, %i0 * As noted, this code only supports (4). */ if ( area_begin >= heap_area_begin && area_begin < heap_area_end ) { return HEAP_EXTEND_ERROR; /* case 3 */ } else if ( area_begin != heap_area_end ) { 40011cf8: 80 a6 40 01 cmp %i1, %g1 40011cfc: 12 80 00 25 bne 40011d90 <_Heap_Extend+0xc0> 40011d00: b0 10 20 02 mov 2, %i0 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 40011d04: d2 04 20 10 ld [ %l0 + 0x10 ], %o1 { Heap_Statistics *const stats = &heap->stats; uintptr_t const area_begin = (uintptr_t) area_begin_ptr; uintptr_t const heap_area_begin = heap->area_begin; uintptr_t const heap_area_end = heap->area_end; uintptr_t const new_heap_area_end = heap_area_end + area_size; 40011d08: b4 06 40 1a add %i1, %i2, %i2 * block and free it. */ heap->area_end = new_heap_area_end; extend_size = new_heap_area_end 40011d0c: b2 26 80 11 sub %i2, %l1, %i1 * Currently only case 4 should make it to this point. * The basic trick is to make the extend area look like a used * block and free it. */ heap->area_end = new_heap_area_end; 40011d10: f4 24 20 1c st %i2, [ %l0 + 0x1c ] extend_size = new_heap_area_end 40011d14: b2 06 7f f8 add %i1, -8, %i1 40011d18: 7f ff c9 0c call 40004148 <.urem> 40011d1c: 90 10 00 19 mov %i1, %o0 40011d20: 90 26 40 08 sub %i1, %o0, %o0 - (uintptr_t) last_block - HEAP_BLOCK_HEADER_SIZE; extend_size = _Heap_Align_down( extend_size, heap->page_size ); *amount_extended = extend_size; 40011d24: d0 26 c0 00 st %o0, [ %i3 ] if( extend_size >= heap->min_block_size ) { 40011d28: c2 04 20 14 ld [ %l0 + 0x14 ], %g1 40011d2c: 80 a2 00 01 cmp %o0, %g1 40011d30: 0a 80 00 18 bcs 40011d90 <_Heap_Extend+0xc0> <== NEVER TAKEN 40011d34: b0 10 20 00 clr %i0 uintptr_t size ) { uintptr_t flag = block->size_and_flag & HEAP_PREV_BLOCK_USED; block->size_and_flag = size | flag; 40011d38: c2 04 60 04 ld [ %l1 + 4 ], %g1 Heap_Block *const new_last_block = _Heap_Block_at( last_block, extend_size ); _Heap_Block_set_size( last_block, extend_size ); new_last_block->size_and_flag = 40011d3c: c4 04 20 20 ld [ %l0 + 0x20 ], %g2 40011d40: 82 08 60 01 and %g1, 1, %g1 40011d44: 82 12 00 01 or %o0, %g1, %g1 40011d48: c2 24 60 04 st %g1, [ %l1 + 4 ] RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 40011d4c: 82 02 00 11 add %o0, %l1, %g1 40011d50: 84 20 80 01 sub %g2, %g1, %g2 40011d54: 84 10 a0 01 or %g2, 1, %g2 40011d58: c4 20 60 04 st %g2, [ %g1 + 4 ] heap->last_block = new_last_block; /* Statistics */ stats->size += extend_size; ++stats->used_blocks; 40011d5c: c6 04 20 40 ld [ %l0 + 0x40 ], %g3 | HEAP_PREV_BLOCK_USED; heap->last_block = new_last_block; /* Statistics */ stats->size += extend_size; 40011d60: f2 04 20 2c ld [ %l0 + 0x2c ], %i1 ++stats->used_blocks; --stats->frees; /* Do not count subsequent call as actual free() */ 40011d64: c4 04 20 50 ld [ %l0 + 0x50 ], %g2 new_last_block->size_and_flag = ((uintptr_t) heap->first_block - (uintptr_t) new_last_block) | HEAP_PREV_BLOCK_USED; heap->last_block = new_last_block; 40011d68: c2 24 20 24 st %g1, [ %l0 + 0x24 ] /* Statistics */ stats->size += extend_size; ++stats->used_blocks; 40011d6c: 82 00 e0 01 add %g3, 1, %g1 | HEAP_PREV_BLOCK_USED; heap->last_block = new_last_block; /* Statistics */ stats->size += extend_size; 40011d70: 90 06 40 08 add %i1, %o0, %o0 ++stats->used_blocks; 40011d74: c2 24 20 40 st %g1, [ %l0 + 0x40 ] --stats->frees; /* Do not count subsequent call as actual free() */ 40011d78: 82 00 bf ff add %g2, -1, %g1 | HEAP_PREV_BLOCK_USED; heap->last_block = new_last_block; /* Statistics */ stats->size += extend_size; 40011d7c: d0 24 20 2c st %o0, [ %l0 + 0x2c ] ++stats->used_blocks; --stats->frees; /* Do not count subsequent call as actual free() */ 40011d80: c2 24 20 50 st %g1, [ %l0 + 0x50 ] _Heap_Free( heap, (void *) _Heap_Alloc_area_of_block( last_block )); 40011d84: 90 10 00 10 mov %l0, %o0 40011d88: 7f ff e8 fb call 4000c174 <_Heap_Free> 40011d8c: 92 04 60 08 add %l1, 8, %o1 } return HEAP_EXTEND_SUCCESSFUL; } 40011d90: 81 c7 e0 08 ret 40011d94: 81 e8 00 00 restore =============================================================================== 4000c8a0 <_Heap_Free>: #include #include #include bool _Heap_Free( Heap_Control *heap, void *alloc_begin_ptr ) { 4000c8a0: 9d e3 bf a0 save %sp, -96, %sp 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 ) 4000c8a4: d2 06 20 10 ld [ %i0 + 0x10 ], %o1 4000c8a8: 40 00 31 51 call 40018dec <.urem> 4000c8ac: 90 10 00 19 mov %i1, %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; 4000c8b0: c2 06 20 20 ld [ %i0 + 0x20 ], %g1 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 ) 4000c8b4: b2 06 7f f8 add %i1, -8, %i1 4000c8b8: 90 26 40 08 sub %i1, %o0, %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 4000c8bc: 80 a2 00 01 cmp %o0, %g1 4000c8c0: 0a 80 00 05 bcs 4000c8d4 <_Heap_Free+0x34> 4000c8c4: 84 10 20 00 clr %g2 4000c8c8: c4 06 20 24 ld [ %i0 + 0x24 ], %g2 4000c8cc: 80 a0 80 08 cmp %g2, %o0 4000c8d0: 84 60 3f ff subx %g0, -1, %g2 Heap_Block *next_block = NULL; uintptr_t block_size = 0; uintptr_t next_block_size = 0; bool next_is_free = false; if ( !_Heap_Is_block_in_heap( heap, block ) ) { 4000c8d4: 80 a0 a0 00 cmp %g2, 0 4000c8d8: 02 80 00 6a be 4000ca80 <_Heap_Free+0x1e0> 4000c8dc: 01 00 00 00 nop - 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; 4000c8e0: c8 02 20 04 ld [ %o0 + 4 ], %g4 4000c8e4: 86 09 3f fe and %g4, -2, %g3 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 4000c8e8: 84 02 00 03 add %o0, %g3, %g2 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 4000c8ec: 80 a0 80 01 cmp %g2, %g1 4000c8f0: 0a 80 00 05 bcs 4000c904 <_Heap_Free+0x64> <== NEVER TAKEN 4000c8f4: 9a 10 20 00 clr %o5 4000c8f8: da 06 20 24 ld [ %i0 + 0x24 ], %o5 4000c8fc: 80 a3 40 02 cmp %o5, %g2 4000c900: 9a 60 3f ff subx %g0, -1, %o5 } block_size = _Heap_Block_size( block ); next_block = _Heap_Block_at( block, block_size ); if ( !_Heap_Is_block_in_heap( heap, next_block ) ) { 4000c904: 80 a3 60 00 cmp %o5, 0 4000c908: 02 80 00 5e be 4000ca80 <_Heap_Free+0x1e0> <== NEVER TAKEN 4000c90c: 01 00 00 00 nop block->size_and_flag = size | flag; } RTEMS_INLINE_ROUTINE bool _Heap_Is_prev_used( const Heap_Block *block ) { return block->size_and_flag & HEAP_PREV_BLOCK_USED; 4000c910: da 00 a0 04 ld [ %g2 + 4 ], %o5 _HAssert( false ); return false; } if ( !_Heap_Is_prev_used( next_block ) ) { 4000c914: 80 8b 60 01 btst 1, %o5 4000c918: 02 80 00 5a be 4000ca80 <_Heap_Free+0x1e0> <== NEVER TAKEN 4000c91c: 9a 0b 7f fe and %o5, -2, %o5 return false; } next_block_size = _Heap_Block_size( next_block ); next_is_free = next_block != heap->last_block && !_Heap_Is_prev_used( _Heap_Block_at( next_block, next_block_size )); 4000c920: d2 06 20 24 ld [ %i0 + 0x24 ], %o1 _HAssert( false ); return false; } next_block_size = _Heap_Block_size( next_block ); next_is_free = next_block != heap->last_block 4000c924: 80 a0 80 09 cmp %g2, %o1 4000c928: 02 80 00 06 be 4000c940 <_Heap_Free+0xa0> 4000c92c: 96 10 20 00 clr %o3 4000c930: 98 00 80 0d add %g2, %o5, %o4 4000c934: d6 03 20 04 ld [ %o4 + 4 ], %o3 4000c938: 96 0a e0 01 and %o3, 1, %o3 4000c93c: 96 1a e0 01 xor %o3, 1, %o3 && !_Heap_Is_prev_used( _Heap_Block_at( next_block, next_block_size )); if ( !_Heap_Is_prev_used( block ) ) { 4000c940: 80 89 20 01 btst 1, %g4 4000c944: 12 80 00 26 bne 4000c9dc <_Heap_Free+0x13c> 4000c948: 80 a2 e0 00 cmp %o3, 0 uintptr_t const prev_size = block->prev_size; 4000c94c: d8 02 00 00 ld [ %o0 ], %o4 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 4000c950: 88 22 00 0c sub %o0, %o4, %g4 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 4000c954: 80 a1 00 01 cmp %g4, %g1 4000c958: 0a 80 00 04 bcs 4000c968 <_Heap_Free+0xc8> <== NEVER TAKEN 4000c95c: 94 10 20 00 clr %o2 4000c960: 80 a2 40 04 cmp %o1, %g4 4000c964: 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 ) ) { 4000c968: 80 a2 a0 00 cmp %o2, 0 4000c96c: 02 80 00 45 be 4000ca80 <_Heap_Free+0x1e0> <== NEVER TAKEN 4000c970: 01 00 00 00 nop 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) ) { 4000c974: c2 01 20 04 ld [ %g4 + 4 ], %g1 4000c978: 80 88 60 01 btst 1, %g1 4000c97c: 02 80 00 41 be 4000ca80 <_Heap_Free+0x1e0> <== NEVER TAKEN 4000c980: 80 a2 e0 00 cmp %o3, 0 _HAssert( false ); return( false ); } if ( next_is_free ) { /* coalesce both */ 4000c984: 22 80 00 0f be,a 4000c9c0 <_Heap_Free+0x120> 4000c988: 98 00 c0 0c add %g3, %o4, %o4 uintptr_t const size = block_size + prev_size + next_block_size; _Heap_Free_list_remove( next_block ); stats->free_blocks -= 1; 4000c98c: c2 06 20 38 ld [ %i0 + 0x38 ], %g1 } RTEMS_INLINE_ROUTINE void _Heap_Free_list_remove( Heap_Block *block ) { Heap_Block *next = block->next; Heap_Block *prev = block->prev; 4000c990: d6 00 a0 0c ld [ %g2 + 0xc ], %o3 return _Heap_Free_list_tail(heap)->prev; } RTEMS_INLINE_ROUTINE void _Heap_Free_list_remove( Heap_Block *block ) { Heap_Block *next = block->next; 4000c994: c4 00 a0 08 ld [ %g2 + 8 ], %g2 4000c998: 82 00 7f ff add %g1, -1, %g1 4000c99c: c2 26 20 38 st %g1, [ %i0 + 0x38 ] _HAssert( false ); return( false ); } if ( next_is_free ) { /* coalesce both */ uintptr_t const size = block_size + prev_size + next_block_size; 4000c9a0: 9a 00 c0 0d add %g3, %o5, %o5 Heap_Block *prev = block->prev; prev->next = next; next->prev = prev; 4000c9a4: d6 20 a0 0c st %o3, [ %g2 + 0xc ] 4000c9a8: 98 03 40 0c add %o5, %o4, %o4 RTEMS_INLINE_ROUTINE void _Heap_Free_list_remove( Heap_Block *block ) { Heap_Block *next = block->next; Heap_Block *prev = block->prev; prev->next = next; 4000c9ac: c4 22 e0 08 st %g2, [ %o3 + 8 ] _Heap_Free_list_remove( next_block ); stats->free_blocks -= 1; 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; 4000c9b0: d8 21 00 0c st %o4, [ %g4 + %o4 ] 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; 4000c9b4: 98 13 20 01 or %o4, 1, %o4 4000c9b8: 10 80 00 27 b 4000ca54 <_Heap_Free+0x1b4> 4000c9bc: d8 21 20 04 st %o4, [ %g4 + 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; 4000c9c0: 82 13 20 01 or %o4, 1, %g1 4000c9c4: c2 21 20 04 st %g1, [ %g4 + 4 ] next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 4000c9c8: c2 00 a0 04 ld [ %g2 + 4 ], %g1 next_block->prev_size = size; 4000c9cc: d8 22 00 03 st %o4, [ %o0 + %g3 ] _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; 4000c9d0: 82 08 7f fe and %g1, -2, %g1 4000c9d4: 10 80 00 20 b 4000ca54 <_Heap_Free+0x1b4> 4000c9d8: c2 20 a0 04 st %g1, [ %g2 + 4 ] next_block->prev_size = size; } } else if ( next_is_free ) { /* coalesce next */ 4000c9dc: 02 80 00 0d be 4000ca10 <_Heap_Free+0x170> 4000c9e0: 82 10 e0 01 or %g3, 1, %g1 Heap_Block *old_block, Heap_Block *new_block ) { Heap_Block *next = old_block->next; Heap_Block *prev = old_block->prev; 4000c9e4: c2 00 a0 0c ld [ %g2 + 0xc ], %g1 RTEMS_INLINE_ROUTINE void _Heap_Free_list_replace( Heap_Block *old_block, Heap_Block *new_block ) { Heap_Block *next = old_block->next; 4000c9e8: c4 00 a0 08 ld [ %g2 + 8 ], %g2 Heap_Block *prev = old_block->prev; new_block->next = next; new_block->prev = prev; 4000c9ec: c2 22 20 0c st %g1, [ %o0 + 0xc ] ) { Heap_Block *next = old_block->next; Heap_Block *prev = old_block->prev; new_block->next = next; 4000c9f0: c4 22 20 08 st %g2, [ %o0 + 8 ] new_block->prev = prev; next->prev = new_block; prev->next = new_block; 4000c9f4: d0 20 60 08 st %o0, [ %g1 + 8 ] Heap_Block *prev = old_block->prev; new_block->next = next; new_block->prev = prev; next->prev = new_block; 4000c9f8: d0 20 a0 0c st %o0, [ %g2 + 0xc ] uintptr_t const size = block_size + next_block_size; 4000c9fc: 82 03 40 03 add %o5, %g3, %g1 _Heap_Free_list_replace( next_block, block ); block->size_and_flag = size | HEAP_PREV_BLOCK_USED; next_block = _Heap_Block_at( block, size ); next_block->prev_size = size; 4000ca00: c2 22 00 01 st %g1, [ %o0 + %g1 ] 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; 4000ca04: 82 10 60 01 or %g1, 1, %g1 4000ca08: 10 80 00 13 b 4000ca54 <_Heap_Free+0x1b4> 4000ca0c: c2 22 20 04 st %g1, [ %o0 + 4 ] next_block->prev_size = size; } else { /* no coalesce */ /* Add 'block' to the head of the free blocks list as it tends to produce less fragmentation than adding to the tail. */ _Heap_Free_list_insert_after( _Heap_Free_list_head( heap), block ); block->size_and_flag = block_size | HEAP_PREV_BLOCK_USED; 4000ca10: c2 22 20 04 st %g1, [ %o0 + 4 ] next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 4000ca14: c2 00 a0 04 ld [ %g2 + 4 ], %g1 RTEMS_INLINE_ROUTINE void _Heap_Free_list_insert_after( Heap_Block *block_before, Heap_Block *new_block ) { Heap_Block *next = block_before->next; 4000ca18: c8 06 20 08 ld [ %i0 + 8 ], %g4 4000ca1c: 82 08 7f fe and %g1, -2, %g1 next_block->prev_size = block_size; 4000ca20: c6 22 00 03 st %g3, [ %o0 + %g3 ] } 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; 4000ca24: c2 20 a0 04 st %g1, [ %g2 + 4 ] next_block->prev_size = block_size; /* Statistics */ ++stats->free_blocks; 4000ca28: c2 06 20 38 ld [ %i0 + 0x38 ], %g1 new_block->next = next; 4000ca2c: c8 22 20 08 st %g4, [ %o0 + 8 ] new_block->prev = block_before; 4000ca30: f0 22 20 0c st %i0, [ %o0 + 0xc ] #include #include bool _Heap_Free( Heap_Control *heap, void *alloc_begin_ptr ) { Heap_Statistics *const stats = &heap->stats; 4000ca34: c4 06 20 3c ld [ %i0 + 0x3c ], %g2 block->size_and_flag = block_size | HEAP_PREV_BLOCK_USED; next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; next_block->prev_size = block_size; /* Statistics */ ++stats->free_blocks; 4000ca38: 82 00 60 01 inc %g1 block_before->next = new_block; next->prev = new_block; 4000ca3c: d0 21 20 0c st %o0, [ %g4 + 0xc ] { Heap_Block *next = block_before->next; new_block->next = next; new_block->prev = block_before; block_before->next = new_block; 4000ca40: d0 26 20 08 st %o0, [ %i0 + 8 ] #include #include bool _Heap_Free( Heap_Control *heap, void *alloc_begin_ptr ) { Heap_Statistics *const stats = &heap->stats; 4000ca44: 80 a0 80 01 cmp %g2, %g1 4000ca48: 1a 80 00 03 bcc 4000ca54 <_Heap_Free+0x1b4> 4000ca4c: c2 26 20 38 st %g1, [ %i0 + 0x38 ] next_block->prev_size = block_size; /* Statistics */ ++stats->free_blocks; if ( stats->max_free_blocks < stats->free_blocks ) { stats->max_free_blocks = stats->free_blocks; 4000ca50: c2 26 20 3c st %g1, [ %i0 + 0x3c ] } } /* Statistics */ --stats->used_blocks; 4000ca54: c4 06 20 40 ld [ %i0 + 0x40 ], %g2 ++stats->frees; 4000ca58: c2 06 20 50 ld [ %i0 + 0x50 ], %g1 stats->free_size += block_size; 4000ca5c: c8 06 20 30 ld [ %i0 + 0x30 ], %g4 stats->max_free_blocks = stats->free_blocks; } } /* Statistics */ --stats->used_blocks; 4000ca60: 84 00 bf ff add %g2, -1, %g2 ++stats->frees; stats->free_size += block_size; 4000ca64: 86 01 00 03 add %g4, %g3, %g3 stats->max_free_blocks = stats->free_blocks; } } /* Statistics */ --stats->used_blocks; 4000ca68: c4 26 20 40 st %g2, [ %i0 + 0x40 ] ++stats->frees; stats->free_size += block_size; 4000ca6c: c6 26 20 30 st %g3, [ %i0 + 0x30 ] } } /* Statistics */ --stats->used_blocks; ++stats->frees; 4000ca70: 82 00 60 01 inc %g1 4000ca74: c2 26 20 50 st %g1, [ %i0 + 0x50 ] stats->free_size += block_size; return( true ); 4000ca78: 81 c7 e0 08 ret 4000ca7c: 91 e8 20 01 restore %g0, 1, %o0 } 4000ca80: 81 c7 e0 08 ret 4000ca84: 91 e8 20 00 restore %g0, 0, %o0 =============================================================================== 4001b5e8 <_Heap_Size_of_alloc_area>: bool _Heap_Size_of_alloc_area( Heap_Control *heap, void *alloc_begin_ptr, uintptr_t *alloc_size ) { 4001b5e8: 9d e3 bf a0 save %sp, -96, %sp 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 ) 4001b5ec: d2 06 20 10 ld [ %i0 + 0x10 ], %o1 4001b5f0: 7f ff f5 ff call 40018dec <.urem> 4001b5f4: 90 10 00 19 mov %i1, %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; 4001b5f8: c2 06 20 20 ld [ %i0 + 0x20 ], %g1 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 ) 4001b5fc: 84 06 7f f8 add %i1, -8, %g2 4001b600: 90 20 80 08 sub %g2, %o0, %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 4001b604: 80 a2 00 01 cmp %o0, %g1 4001b608: 0a 80 00 05 bcs 4001b61c <_Heap_Size_of_alloc_area+0x34> 4001b60c: 84 10 20 00 clr %g2 4001b610: c4 06 20 24 ld [ %i0 + 0x24 ], %g2 4001b614: 80 a0 80 08 cmp %g2, %o0 4001b618: 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 ) ) { 4001b61c: 80 a0 a0 00 cmp %g2, 0 4001b620: 02 80 00 16 be 4001b678 <_Heap_Size_of_alloc_area+0x90> 4001b624: 01 00 00 00 nop RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 4001b628: c4 02 20 04 ld [ %o0 + 4 ], %g2 4001b62c: 84 08 bf fe and %g2, -2, %g2 4001b630: 84 02 00 02 add %o0, %g2, %g2 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 4001b634: 80 a0 80 01 cmp %g2, %g1 4001b638: 0a 80 00 05 bcs 4001b64c <_Heap_Size_of_alloc_area+0x64> <== NEVER TAKEN 4001b63c: 86 10 20 00 clr %g3 4001b640: c2 06 20 24 ld [ %i0 + 0x24 ], %g1 4001b644: 80 a0 40 02 cmp %g1, %g2 4001b648: 86 60 3f ff subx %g0, -1, %g3 } block_size = _Heap_Block_size( block ); next_block = _Heap_Block_at( block, block_size ); if ( 4001b64c: 80 a0 e0 00 cmp %g3, 0 4001b650: 02 80 00 0a be 4001b678 <_Heap_Size_of_alloc_area+0x90> <== NEVER TAKEN 4001b654: 01 00 00 00 nop 4001b658: c2 00 a0 04 ld [ %g2 + 4 ], %g1 4001b65c: 80 88 60 01 btst 1, %g1 4001b660: 02 80 00 06 be 4001b678 <_Heap_Size_of_alloc_area+0x90> <== NEVER TAKEN 4001b664: 84 20 80 19 sub %g2, %i1, %g2 || !_Heap_Is_prev_used( next_block ) ) { return false; } *alloc_size = (uintptr_t) next_block + HEAP_BLOCK_SIZE_OFFSET - alloc_begin; 4001b668: 84 00 a0 04 add %g2, 4, %g2 4001b66c: c4 26 80 00 st %g2, [ %i2 ] return true; 4001b670: 81 c7 e0 08 ret 4001b674: 91 e8 20 01 restore %g0, 1, %o0 } 4001b678: 81 c7 e0 08 ret 4001b67c: 91 e8 20 00 restore %g0, 0, %o0 =============================================================================== 4000859c <_Heap_Walk>: bool _Heap_Walk( Heap_Control *heap, int source, bool dump ) { 4000859c: 9d e3 bf 88 save %sp, -120, %sp uintptr_t const page_size = heap->page_size; uintptr_t const min_block_size = heap->min_block_size; Heap_Block *const last_block = heap->last_block; Heap_Block *block = heap->first_block; Heap_Walk_printer printer = dump ? _Heap_Walk_print : _Heap_Walk_print_nothing; 400085a0: 23 10 00 22 sethi %hi(0x40008800), %l1 400085a4: 80 8e a0 ff btst 0xff, %i2 400085a8: a2 14 62 74 or %l1, 0x274, %l1 Heap_Control *heap, int source, bool dump ) { uintptr_t const page_size = heap->page_size; 400085ac: e4 06 20 10 ld [ %i0 + 0x10 ], %l2 uintptr_t const min_block_size = heap->min_block_size; 400085b0: e6 06 20 14 ld [ %i0 + 0x14 ], %l3 Heap_Block *const last_block = heap->last_block; 400085b4: e8 06 20 24 ld [ %i0 + 0x24 ], %l4 Heap_Block *block = heap->first_block; Heap_Walk_printer printer = dump ? _Heap_Walk_print : _Heap_Walk_print_nothing; 400085b8: 12 80 00 04 bne 400085c8 <_Heap_Walk+0x2c> 400085bc: e0 06 20 20 ld [ %i0 + 0x20 ], %l0 400085c0: 23 10 00 21 sethi %hi(0x40008400), %l1 400085c4: a2 14 61 94 or %l1, 0x194, %l1 ! 40008594 <_Heap_Walk_print_nothing> if ( !_System_state_Is_up( _System_state_Get() ) ) { 400085c8: 03 10 00 80 sethi %hi(0x40020000), %g1 400085cc: c2 00 61 d0 ld [ %g1 + 0x1d0 ], %g1 ! 400201d0 <_System_state_Current> 400085d0: 80 a0 60 03 cmp %g1, 3 400085d4: 12 80 01 1e bne 40008a4c <_Heap_Walk+0x4b0> 400085d8: 90 10 00 19 mov %i1, %o0 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)( 400085dc: da 06 20 18 ld [ %i0 + 0x18 ], %o5 400085e0: c6 06 20 1c ld [ %i0 + 0x1c ], %g3 400085e4: c4 06 20 08 ld [ %i0 + 8 ], %g2 400085e8: c2 06 20 0c ld [ %i0 + 0xc ], %g1 400085ec: c6 23 a0 5c st %g3, [ %sp + 0x5c ] 400085f0: c4 23 a0 68 st %g2, [ %sp + 0x68 ] 400085f4: c2 23 a0 6c st %g1, [ %sp + 0x6c ] 400085f8: e0 23 a0 60 st %l0, [ %sp + 0x60 ] 400085fc: e8 23 a0 64 st %l4, [ %sp + 0x64 ] 40008600: 92 10 20 00 clr %o1 40008604: 15 10 00 74 sethi %hi(0x4001d000), %o2 40008608: 96 10 00 12 mov %l2, %o3 4000860c: 94 12 a1 c0 or %o2, 0x1c0, %o2 40008610: 9f c4 40 00 call %l1 40008614: 98 10 00 13 mov %l3, %o4 heap->area_begin, heap->area_end, first_block, last_block, first_free_block, last_free_block ); if ( page_size == 0 ) { 40008618: 80 a4 a0 00 cmp %l2, 0 4000861c: 12 80 00 07 bne 40008638 <_Heap_Walk+0x9c> 40008620: 80 8c a0 07 btst 7, %l2 (*printer)( source, true, "page size is zero\n" ); 40008624: 15 10 00 74 sethi %hi(0x4001d000), %o2 40008628: 90 10 00 19 mov %i1, %o0 4000862c: 92 10 20 01 mov 1, %o1 40008630: 10 80 00 27 b 400086cc <_Heap_Walk+0x130> 40008634: 94 12 a2 58 or %o2, 0x258, %o2 return false; } if ( !_Addresses_Is_aligned( (void *) page_size ) ) { 40008638: 22 80 00 08 be,a 40008658 <_Heap_Walk+0xbc> 4000863c: 90 10 00 13 mov %l3, %o0 (*printer)( 40008640: 15 10 00 74 sethi %hi(0x4001d000), %o2 40008644: 90 10 00 19 mov %i1, %o0 40008648: 96 10 00 12 mov %l2, %o3 4000864c: 92 10 20 01 mov 1, %o1 40008650: 10 80 01 05 b 40008a64 <_Heap_Walk+0x4c8> 40008654: 94 12 a2 70 or %o2, 0x270, %o2 ); return false; } if ( !_Heap_Is_aligned( min_block_size, page_size ) ) { 40008658: 7f ff e5 20 call 40001ad8 <.urem> 4000865c: 92 10 00 12 mov %l2, %o1 40008660: 80 a2 20 00 cmp %o0, 0 40008664: 22 80 00 08 be,a 40008684 <_Heap_Walk+0xe8> 40008668: 90 04 20 08 add %l0, 8, %o0 (*printer)( 4000866c: 15 10 00 74 sethi %hi(0x4001d000), %o2 40008670: 90 10 00 19 mov %i1, %o0 40008674: 96 10 00 13 mov %l3, %o3 40008678: 92 10 20 01 mov 1, %o1 4000867c: 10 80 00 fa b 40008a64 <_Heap_Walk+0x4c8> 40008680: 94 12 a2 90 or %o2, 0x290, %o2 ); return false; } if ( 40008684: 7f ff e5 15 call 40001ad8 <.urem> 40008688: 92 10 00 12 mov %l2, %o1 4000868c: 80 a2 20 00 cmp %o0, 0 40008690: 22 80 00 08 be,a 400086b0 <_Heap_Walk+0x114> 40008694: c2 04 20 04 ld [ %l0 + 4 ], %g1 !_Heap_Is_aligned( _Heap_Alloc_area_of_block( first_block ), page_size ) ) { (*printer)( 40008698: 15 10 00 74 sethi %hi(0x4001d000), %o2 4000869c: 90 10 00 19 mov %i1, %o0 400086a0: 96 10 00 10 mov %l0, %o3 400086a4: 92 10 20 01 mov 1, %o1 400086a8: 10 80 00 ef b 40008a64 <_Heap_Walk+0x4c8> 400086ac: 94 12 a2 b8 or %o2, 0x2b8, %o2 ); return false; } if ( !_Heap_Is_prev_used( first_block ) ) { 400086b0: 80 88 60 01 btst 1, %g1 400086b4: 32 80 00 09 bne,a 400086d8 <_Heap_Walk+0x13c> 400086b8: ea 04 00 00 ld [ %l0 ], %l5 (*printer)( 400086bc: 15 10 00 74 sethi %hi(0x4001d000), %o2 400086c0: 90 10 00 19 mov %i1, %o0 400086c4: 92 10 20 01 mov 1, %o1 400086c8: 94 12 a2 f0 or %o2, 0x2f0, %o2 400086cc: 9f c4 40 00 call %l1 400086d0: b0 10 20 00 clr %i0 400086d4: 30 80 00 e6 b,a 40008a6c <_Heap_Walk+0x4d0> ); return false; } if ( first_block->prev_size != page_size ) { 400086d8: 80 a5 40 12 cmp %l5, %l2 400086dc: 22 80 00 09 be,a 40008700 <_Heap_Walk+0x164> 400086e0: c2 05 20 04 ld [ %l4 + 4 ], %g1 (*printer)( 400086e4: 15 10 00 74 sethi %hi(0x4001d000), %o2 400086e8: 90 10 00 19 mov %i1, %o0 400086ec: 96 10 00 15 mov %l5, %o3 400086f0: 98 10 00 12 mov %l2, %o4 400086f4: 92 10 20 01 mov 1, %o1 400086f8: 10 80 00 88 b 40008918 <_Heap_Walk+0x37c> 400086fc: 94 12 a3 20 or %o2, 0x320, %o2 ); return false; } if ( _Heap_Is_free( last_block ) ) { 40008700: 82 08 7f fe and %g1, -2, %g1 40008704: 82 05 00 01 add %l4, %g1, %g1 40008708: c2 00 60 04 ld [ %g1 + 4 ], %g1 4000870c: 80 88 60 01 btst 1, %g1 40008710: 32 80 00 07 bne,a 4000872c <_Heap_Walk+0x190> 40008714: d6 06 20 08 ld [ %i0 + 8 ], %o3 (*printer)( 40008718: 15 10 00 74 sethi %hi(0x4001d000), %o2 4000871c: 90 10 00 19 mov %i1, %o0 40008720: 92 10 20 01 mov 1, %o1 40008724: 10 bf ff ea b 400086cc <_Heap_Walk+0x130> 40008728: 94 12 a3 50 or %o2, 0x350, %o2 int source, Heap_Walk_printer printer, Heap_Control *heap ) { uintptr_t const page_size = heap->page_size; 4000872c: ec 06 20 10 ld [ %i0 + 0x10 ], %l6 return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next; 40008730: a4 10 00 18 mov %i0, %l2 40008734: 10 80 00 32 b 400087fc <_Heap_Walk+0x260> 40008738: ae 10 00 0b mov %o3, %l7 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 4000873c: 80 a0 80 17 cmp %g2, %l7 40008740: 18 80 00 05 bgu 40008754 <_Heap_Walk+0x1b8> 40008744: 82 10 20 00 clr %g1 40008748: c2 06 20 24 ld [ %i0 + 0x24 ], %g1 4000874c: 80 a0 40 17 cmp %g1, %l7 40008750: 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 ) ) { 40008754: 80 a0 60 00 cmp %g1, 0 40008758: 32 80 00 08 bne,a 40008778 <_Heap_Walk+0x1dc> 4000875c: 90 05 e0 08 add %l7, 8, %o0 (*printer)( 40008760: 15 10 00 74 sethi %hi(0x4001d000), %o2 40008764: 96 10 00 17 mov %l7, %o3 40008768: 90 10 00 19 mov %i1, %o0 4000876c: 92 10 20 01 mov 1, %o1 40008770: 10 80 00 bd b 40008a64 <_Heap_Walk+0x4c8> 40008774: 94 12 a3 68 or %o2, 0x368, %o2 ); return false; } if ( 40008778: 7f ff e4 d8 call 40001ad8 <.urem> 4000877c: 92 10 00 16 mov %l6, %o1 40008780: 80 a2 20 00 cmp %o0, 0 40008784: 22 80 00 08 be,a 400087a4 <_Heap_Walk+0x208> 40008788: c2 05 e0 04 ld [ %l7 + 4 ], %g1 !_Heap_Is_aligned( _Heap_Alloc_area_of_block( free_block ), page_size ) ) { (*printer)( 4000878c: 15 10 00 74 sethi %hi(0x4001d000), %o2 40008790: 96 10 00 17 mov %l7, %o3 40008794: 90 10 00 19 mov %i1, %o0 40008798: 92 10 20 01 mov 1, %o1 4000879c: 10 80 00 b2 b 40008a64 <_Heap_Walk+0x4c8> 400087a0: 94 12 a3 88 or %o2, 0x388, %o2 ); return false; } if ( _Heap_Is_used( free_block ) ) { 400087a4: 82 08 7f fe and %g1, -2, %g1 400087a8: 82 05 c0 01 add %l7, %g1, %g1 400087ac: c2 00 60 04 ld [ %g1 + 4 ], %g1 400087b0: 80 88 60 01 btst 1, %g1 400087b4: 22 80 00 08 be,a 400087d4 <_Heap_Walk+0x238> 400087b8: d8 05 e0 0c ld [ %l7 + 0xc ], %o4 (*printer)( 400087bc: 15 10 00 74 sethi %hi(0x4001d000), %o2 400087c0: 96 10 00 17 mov %l7, %o3 400087c4: 90 10 00 19 mov %i1, %o0 400087c8: 92 10 20 01 mov 1, %o1 400087cc: 10 80 00 a6 b 40008a64 <_Heap_Walk+0x4c8> 400087d0: 94 12 a3 b8 or %o2, 0x3b8, %o2 ); return false; } if ( free_block->prev != prev_block ) { 400087d4: 80 a3 00 12 cmp %o4, %l2 400087d8: 02 80 00 08 be 400087f8 <_Heap_Walk+0x25c> 400087dc: a4 10 00 17 mov %l7, %l2 (*printer)( 400087e0: 15 10 00 74 sethi %hi(0x4001d000), %o2 400087e4: 96 10 00 17 mov %l7, %o3 400087e8: 90 10 00 19 mov %i1, %o0 400087ec: 92 10 20 01 mov 1, %o1 400087f0: 10 80 00 4a b 40008918 <_Heap_Walk+0x37c> 400087f4: 94 12 a3 d8 or %o2, 0x3d8, %o2 return false; } prev_block = free_block; free_block = free_block->next; 400087f8: ee 05 e0 08 ld [ %l7 + 8 ], %l7 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 ) { 400087fc: 80 a5 c0 18 cmp %l7, %i0 40008800: 32 bf ff cf bne,a 4000873c <_Heap_Walk+0x1a0> 40008804: c4 06 20 20 ld [ %i0 + 0x20 ], %g2 "block 0x%08x: size %u\n", block, block_size ); } else { (*printer)( 40008808: 10 80 00 89 b 40008a2c <_Heap_Walk+0x490> 4000880c: 37 10 00 75 sethi %hi(0x4001d400), %i3 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; if ( prev_used ) { 40008810: 80 8d a0 01 btst 1, %l6 - 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; 40008814: ac 0d bf fe and %l6, -2, %l6 40008818: 02 80 00 0a be 40008840 <_Heap_Walk+0x2a4> 4000881c: a4 04 00 16 add %l0, %l6, %l2 (*printer)( 40008820: 90 10 00 19 mov %i1, %o0 40008824: 92 10 20 00 clr %o1 40008828: 94 10 00 1a mov %i2, %o2 4000882c: 96 10 00 10 mov %l0, %o3 40008830: 9f c4 40 00 call %l1 40008834: 98 10 00 16 mov %l6, %o4 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 40008838: 10 80 00 0a b 40008860 <_Heap_Walk+0x2c4> 4000883c: c4 06 20 20 ld [ %i0 + 0x20 ], %g2 "block 0x%08x: size %u\n", block, block_size ); } else { (*printer)( 40008840: da 04 00 00 ld [ %l0 ], %o5 40008844: 90 10 00 19 mov %i1, %o0 40008848: 92 10 20 00 clr %o1 4000884c: 94 10 00 1b mov %i3, %o2 40008850: 96 10 00 10 mov %l0, %o3 40008854: 9f c4 40 00 call %l1 40008858: 98 10 00 16 mov %l6, %o4 4000885c: c4 06 20 20 ld [ %i0 + 0x20 ], %g2 40008860: 80 a0 80 12 cmp %g2, %l2 40008864: 18 80 00 05 bgu 40008878 <_Heap_Walk+0x2dc> <== NEVER TAKEN 40008868: 82 10 20 00 clr %g1 4000886c: c2 06 20 24 ld [ %i0 + 0x24 ], %g1 40008870: 80 a0 40 12 cmp %g1, %l2 40008874: 82 60 3f ff subx %g0, -1, %g1 block_size, block->prev_size ); } if ( !_Heap_Is_block_in_heap( heap, next_block ) ) { 40008878: 80 a0 60 00 cmp %g1, 0 4000887c: 32 80 00 09 bne,a 400088a0 <_Heap_Walk+0x304> 40008880: 90 10 00 16 mov %l6, %o0 (*printer)( 40008884: 15 10 00 75 sethi %hi(0x4001d400), %o2 40008888: 90 10 00 19 mov %i1, %o0 4000888c: 96 10 00 10 mov %l0, %o3 40008890: 98 10 00 12 mov %l2, %o4 40008894: 92 10 20 01 mov 1, %o1 40008898: 10 80 00 20 b 40008918 <_Heap_Walk+0x37c> 4000889c: 94 12 a0 50 or %o2, 0x50, %o2 ); return false; } if ( !_Heap_Is_aligned( block_size, page_size ) ) { 400088a0: 7f ff e4 8e call 40001ad8 <.urem> 400088a4: 92 10 00 15 mov %l5, %o1 400088a8: 80 a2 20 00 cmp %o0, 0 400088ac: 02 80 00 09 be 400088d0 <_Heap_Walk+0x334> 400088b0: 80 a5 80 13 cmp %l6, %l3 (*printer)( 400088b4: 15 10 00 75 sethi %hi(0x4001d400), %o2 400088b8: 90 10 00 19 mov %i1, %o0 400088bc: 96 10 00 10 mov %l0, %o3 400088c0: 98 10 00 16 mov %l6, %o4 400088c4: 92 10 20 01 mov 1, %o1 400088c8: 10 80 00 14 b 40008918 <_Heap_Walk+0x37c> 400088cc: 94 12 a0 80 or %o2, 0x80, %o2 ); return false; } if ( block_size < min_block_size ) { 400088d0: 1a 80 00 0a bcc 400088f8 <_Heap_Walk+0x35c> 400088d4: 80 a4 80 10 cmp %l2, %l0 (*printer)( 400088d8: 15 10 00 75 sethi %hi(0x4001d400), %o2 400088dc: 90 10 00 19 mov %i1, %o0 400088e0: 96 10 00 10 mov %l0, %o3 400088e4: 98 10 00 16 mov %l6, %o4 400088e8: 9a 10 00 13 mov %l3, %o5 400088ec: 92 10 20 01 mov 1, %o1 400088f0: 10 80 00 3b b 400089dc <_Heap_Walk+0x440> 400088f4: 94 12 a0 b0 or %o2, 0xb0, %o2 ); return false; } if ( next_block_begin <= block_begin ) { 400088f8: 38 80 00 0b bgu,a 40008924 <_Heap_Walk+0x388> 400088fc: c2 04 a0 04 ld [ %l2 + 4 ], %g1 (*printer)( 40008900: 15 10 00 75 sethi %hi(0x4001d400), %o2 40008904: 90 10 00 19 mov %i1, %o0 40008908: 96 10 00 10 mov %l0, %o3 4000890c: 98 10 00 12 mov %l2, %o4 40008910: 92 10 20 01 mov 1, %o1 40008914: 94 12 a0 e0 or %o2, 0xe0, %o2 40008918: 9f c4 40 00 call %l1 4000891c: b0 10 20 00 clr %i0 40008920: 30 80 00 53 b,a 40008a6c <_Heap_Walk+0x4d0> ); return false; } if ( !_Heap_Is_prev_used( next_block ) ) { 40008924: 80 88 60 01 btst 1, %g1 40008928: 32 80 00 46 bne,a 40008a40 <_Heap_Walk+0x4a4> 4000892c: a0 10 00 12 mov %l2, %l0 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; 40008930: fa 04 20 04 ld [ %l0 + 4 ], %i5 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)( 40008934: d8 04 20 0c ld [ %l0 + 0xc ], %o4 return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next; 40008938: c2 06 20 08 ld [ %i0 + 8 ], %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; 4000893c: ac 0f 7f fe and %i5, -2, %l6 return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next; 40008940: 1b 10 00 75 sethi %hi(0x4001d400), %o5 40008944: 80 a3 00 01 cmp %o4, %g1 } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_last( Heap_Control *heap ) { return _Heap_Free_list_tail(heap)->prev; 40008948: c6 06 20 0c ld [ %i0 + 0xc ], %g3 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 4000894c: ae 04 00 16 add %l0, %l6, %l7 return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next; 40008950: 02 80 00 07 be 4000896c <_Heap_Walk+0x3d0> 40008954: 9a 13 61 18 or %o5, 0x118, %o5 "block 0x%08x: prev 0x%08x%s, next 0x%08x%s\n", block, block->prev, block->prev == first_free_block ? " (= first)" : (block->prev == free_list_head ? " (= head)" : ""), 40008958: 1b 10 00 75 sethi %hi(0x4001d400), %o5 4000895c: 80 a3 00 18 cmp %o4, %i0 40008960: 02 80 00 03 be 4000896c <_Heap_Walk+0x3d0> 40008964: 9a 13 61 30 or %o5, 0x130, %o5 40008968: 9a 10 00 1c mov %i4, %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)( 4000896c: c4 04 20 08 ld [ %l0 + 8 ], %g2 40008970: 03 10 00 75 sethi %hi(0x4001d400), %g1 40008974: 80 a0 80 03 cmp %g2, %g3 40008978: 02 80 00 07 be 40008994 <_Heap_Walk+0x3f8> 4000897c: 82 10 61 40 or %g1, 0x140, %g1 " (= first)" : (block->prev == free_list_head ? " (= head)" : ""), block->next, block->next == last_free_block ? " (= last)" : (block->next == free_list_tail ? " (= tail)" : "") 40008980: 03 10 00 75 sethi %hi(0x4001d400), %g1 40008984: 80 a0 80 18 cmp %g2, %i0 40008988: 02 80 00 03 be 40008994 <_Heap_Walk+0x3f8> 4000898c: 82 10 61 50 or %g1, 0x150, %g1 40008990: 82 10 00 1c mov %i4, %g1 Heap_Block *const last_free_block = _Heap_Free_list_last( heap ); bool const prev_used = _Heap_Is_prev_used( block ); uintptr_t const block_size = _Heap_Block_size( block ); Heap_Block *const next_block = _Heap_Block_at( block, block_size ); (*printer)( 40008994: c4 23 a0 5c st %g2, [ %sp + 0x5c ] 40008998: c2 23 a0 60 st %g1, [ %sp + 0x60 ] 4000899c: 90 10 00 19 mov %i1, %o0 400089a0: 92 10 20 00 clr %o1 400089a4: 15 10 00 75 sethi %hi(0x4001d400), %o2 400089a8: 96 10 00 10 mov %l0, %o3 400089ac: 9f c4 40 00 call %l1 400089b0: 94 12 a1 60 or %o2, 0x160, %o2 block->next == last_free_block ? " (= last)" : (block->next == free_list_tail ? " (= tail)" : "") ); if ( block_size != next_block->prev_size ) { 400089b4: da 05 c0 00 ld [ %l7 ], %o5 400089b8: 80 a5 80 0d cmp %l6, %o5 400089bc: 02 80 00 0b be 400089e8 <_Heap_Walk+0x44c> 400089c0: 15 10 00 75 sethi %hi(0x4001d400), %o2 (*printer)( 400089c4: ee 23 a0 5c st %l7, [ %sp + 0x5c ] 400089c8: 90 10 00 19 mov %i1, %o0 400089cc: 96 10 00 10 mov %l0, %o3 400089d0: 98 10 00 16 mov %l6, %o4 400089d4: 92 10 20 01 mov 1, %o1 400089d8: 94 12 a1 90 or %o2, 0x190, %o2 400089dc: 9f c4 40 00 call %l1 400089e0: b0 10 20 00 clr %i0 400089e4: 30 80 00 22 b,a 40008a6c <_Heap_Walk+0x4d0> ); return false; } if ( !prev_used ) { 400089e8: 80 8f 60 01 btst 1, %i5 400089ec: 32 80 00 0b bne,a 40008a18 <_Heap_Walk+0x47c> 400089f0: c2 06 20 08 ld [ %i0 + 8 ], %g1 (*printer)( 400089f4: 15 10 00 75 sethi %hi(0x4001d400), %o2 400089f8: 90 10 00 19 mov %i1, %o0 400089fc: 96 10 00 10 mov %l0, %o3 40008a00: 92 10 20 01 mov 1, %o1 40008a04: 10 80 00 18 b 40008a64 <_Heap_Walk+0x4c8> 40008a08: 94 12 a1 d0 or %o2, 0x1d0, %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 ) { 40008a0c: 22 80 00 0d be,a 40008a40 <_Heap_Walk+0x4a4> 40008a10: a0 10 00 12 mov %l2, %l0 return true; } free_block = free_block->next; 40008a14: 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 ) { 40008a18: 80 a0 40 18 cmp %g1, %i0 40008a1c: 12 bf ff fc bne 40008a0c <_Heap_Walk+0x470> 40008a20: 80 a0 40 10 cmp %g1, %l0 return false; } if ( !_Heap_Walk_is_in_free_list( heap, block ) ) { (*printer)( 40008a24: 10 80 00 0c b 40008a54 <_Heap_Walk+0x4b8> 40008a28: 15 10 00 75 sethi %hi(0x4001d400), %o2 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; if ( prev_used ) { (*printer)( 40008a2c: 35 10 00 75 sethi %hi(0x4001d400), %i2 " (= first)" : (block->prev == free_list_head ? " (= head)" : ""), block->next, block->next == last_free_block ? " (= last)" : (block->next == free_list_tail ? " (= tail)" : "") 40008a30: 39 10 00 75 sethi %hi(0x4001d400), %i4 "block 0x%08x: size %u\n", block, block_size ); } else { (*printer)( 40008a34: b6 16 e0 28 or %i3, 0x28, %i3 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; if ( prev_used ) { (*printer)( 40008a38: b4 16 a0 10 or %i2, 0x10, %i2 " (= first)" : (block->prev == free_list_head ? " (= head)" : ""), block->next, block->next == last_free_block ? " (= last)" : (block->next == free_list_tail ? " (= tail)" : "") 40008a3c: b8 17 21 28 or %i4, 0x128, %i4 if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; } while ( block != last_block ) { 40008a40: 80 a4 00 14 cmp %l0, %l4 40008a44: 32 bf ff 73 bne,a 40008810 <_Heap_Walk+0x274> 40008a48: ec 04 20 04 ld [ %l0 + 4 ], %l6 block = next_block; } return true; } 40008a4c: 81 c7 e0 08 ret 40008a50: 91 e8 20 01 restore %g0, 1, %o0 return false; } if ( !_Heap_Walk_is_in_free_list( heap, block ) ) { (*printer)( 40008a54: 90 10 00 19 mov %i1, %o0 40008a58: 96 10 00 10 mov %l0, %o3 40008a5c: 92 10 20 01 mov 1, %o1 40008a60: 94 12 a2 00 or %o2, 0x200, %o2 40008a64: 9f c4 40 00 call %l1 40008a68: b0 10 20 00 clr %i0 40008a6c: 81 c7 e0 08 ret 40008a70: 81 e8 00 00 restore =============================================================================== 40007818 <_Objects_Allocate>: */ Objects_Control *_Objects_Allocate( Objects_Information *information ) { 40007818: 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 ) 4000781c: c2 06 20 18 ld [ %i0 + 0x18 ], %g1 */ Objects_Control *_Objects_Allocate( Objects_Information *information ) { 40007820: a0 10 00 18 mov %i0, %l0 * 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 ) 40007824: 80 a0 60 00 cmp %g1, 0 40007828: 02 80 00 20 be 400078a8 <_Objects_Allocate+0x90> <== NEVER TAKEN 4000782c: 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 ); 40007830: a2 04 20 20 add %l0, 0x20, %l1 40007834: 40 00 12 ff call 4000c430 <_Chain_Get> 40007838: 90 10 00 11 mov %l1, %o0 if ( information->auto_extend ) { 4000783c: c2 0c 20 12 ldub [ %l0 + 0x12 ], %g1 40007840: 80 a0 60 00 cmp %g1, 0 40007844: 02 80 00 19 be 400078a8 <_Objects_Allocate+0x90> 40007848: 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 ) { 4000784c: 80 a2 20 00 cmp %o0, 0 40007850: 32 80 00 0a bne,a 40007878 <_Objects_Allocate+0x60> 40007854: c2 14 20 0a lduh [ %l0 + 0xa ], %g1 _Objects_Extend_information( information ); 40007858: 40 00 00 1e call 400078d0 <_Objects_Extend_information> 4000785c: 90 10 00 10 mov %l0, %o0 the_object = (Objects_Control *) _Chain_Get( &information->Inactive ); 40007860: 40 00 12 f4 call 4000c430 <_Chain_Get> 40007864: 90 10 00 11 mov %l1, %o0 } if ( the_object ) { 40007868: b0 92 20 00 orcc %o0, 0, %i0 4000786c: 02 80 00 0f be 400078a8 <_Objects_Allocate+0x90> 40007870: 01 00 00 00 nop uint32_t block; block = (uint32_t) _Objects_Get_index( the_object->id ) - 40007874: c2 14 20 0a lduh [ %l0 + 0xa ], %g1 40007878: d0 16 20 0a lduh [ %i0 + 0xa ], %o0 _Objects_Get_index( information->minimum_id ); block /= information->allocation_size; information->inactive_per_block[ block ]--; 4000787c: d2 14 20 14 lduh [ %l0 + 0x14 ], %o1 40007880: 40 00 44 af call 40018b3c <.udiv> 40007884: 90 22 00 01 sub %o0, %g1, %o0 40007888: c2 04 20 30 ld [ %l0 + 0x30 ], %g1 4000788c: 91 2a 20 02 sll %o0, 2, %o0 information->inactive--; 40007890: c6 14 20 2c lduh [ %l0 + 0x2c ], %g3 block = (uint32_t) _Objects_Get_index( the_object->id ) - _Objects_Get_index( information->minimum_id ); block /= information->allocation_size; information->inactive_per_block[ block ]--; 40007894: c4 00 40 08 ld [ %g1 + %o0 ], %g2 information->inactive--; 40007898: 86 00 ff ff add %g3, -1, %g3 block = (uint32_t) _Objects_Get_index( the_object->id ) - _Objects_Get_index( information->minimum_id ); block /= information->allocation_size; information->inactive_per_block[ block ]--; 4000789c: 84 00 bf ff add %g2, -1, %g2 information->inactive--; 400078a0: c6 34 20 2c sth %g3, [ %l0 + 0x2c ] block = (uint32_t) _Objects_Get_index( the_object->id ) - _Objects_Get_index( information->minimum_id ); block /= information->allocation_size; information->inactive_per_block[ block ]--; 400078a4: c4 20 40 08 st %g2, [ %g1 + %o0 ] information->inactive--; } } return the_object; } 400078a8: 81 c7 e0 08 ret 400078ac: 81 e8 00 00 restore =============================================================================== 400078d0 <_Objects_Extend_information>: */ void _Objects_Extend_information( Objects_Information *information ) { 400078d0: 9d e3 bf 90 save %sp, -112, %sp minimum_index = _Objects_Get_index( information->minimum_id ); index_base = minimum_index; block = 0; /* if ( information->maximum < minimum_index ) */ if ( information->object_blocks == NULL ) 400078d4: e4 06 20 34 ld [ %i0 + 0x34 ], %l2 400078d8: 80 a4 a0 00 cmp %l2, 0 400078dc: 12 80 00 06 bne 400078f4 <_Objects_Extend_information+0x24> 400078e0: e6 16 20 0a lduh [ %i0 + 0xa ], %l3 400078e4: a0 10 00 13 mov %l3, %l0 400078e8: a2 10 20 00 clr %l1 400078ec: 10 80 00 15 b 40007940 <_Objects_Extend_information+0x70> 400078f0: a8 10 20 00 clr %l4 block_count = 0; else { block_count = information->maximum / information->allocation_size; 400078f4: e2 16 20 14 lduh [ %i0 + 0x14 ], %l1 400078f8: d0 16 20 10 lduh [ %i0 + 0x10 ], %o0 400078fc: 40 00 44 90 call 40018b3c <.udiv> 40007900: 92 10 00 11 mov %l1, %o1 for ( ; block < block_count; block++ ) { if ( information->object_blocks[ block ] == NULL ) 40007904: 82 10 00 11 mov %l1, %g1 /* if ( information->maximum < minimum_index ) */ if ( information->object_blocks == NULL ) block_count = 0; else { block_count = information->maximum / information->allocation_size; 40007908: 91 2a 20 10 sll %o0, 0x10, %o0 4000790c: a0 10 00 13 mov %l3, %l0 40007910: a9 32 20 10 srl %o0, 0x10, %l4 for ( ; block < block_count; block++ ) { 40007914: 10 80 00 08 b 40007934 <_Objects_Extend_information+0x64> 40007918: a2 10 20 00 clr %l1 if ( information->object_blocks[ block ] == NULL ) 4000791c: c4 04 80 02 ld [ %l2 + %g2 ], %g2 40007920: 80 a0 a0 00 cmp %g2, 0 40007924: 22 80 00 08 be,a 40007944 <_Objects_Extend_information+0x74> 40007928: d0 16 20 14 lduh [ %i0 + 0x14 ], %o0 4000792c: a0 04 00 01 add %l0, %g1, %l0 if ( information->object_blocks == NULL ) block_count = 0; else { block_count = information->maximum / information->allocation_size; for ( ; block < block_count; block++ ) { 40007930: a2 04 60 01 inc %l1 40007934: 80 a4 40 14 cmp %l1, %l4 40007938: 0a bf ff f9 bcs 4000791c <_Objects_Extend_information+0x4c> 4000793c: 85 2c 60 02 sll %l1, 2, %g2 else index_base += information->allocation_size; } } maximum = (uint32_t) information->maximum + information->allocation_size; 40007940: d0 16 20 14 lduh [ %i0 + 0x14 ], %o0 40007944: ec 16 20 10 lduh [ %i0 + 0x10 ], %l6 /* * We need to limit the number of objects to the maximum number * representable in the index portion of the object Id. In the * case of 16-bit Ids, this is only 256 object instances. */ if ( maximum > OBJECTS_ID_FINAL_INDEX ) { 40007948: 03 00 00 3f sethi %hi(0xfc00), %g1 else index_base += information->allocation_size; } } maximum = (uint32_t) information->maximum + information->allocation_size; 4000794c: ac 02 00 16 add %o0, %l6, %l6 /* * We need to limit the number of objects to the maximum number * representable in the index portion of the object Id. In the * case of 16-bit Ids, this is only 256 object instances. */ if ( maximum > OBJECTS_ID_FINAL_INDEX ) { 40007950: 82 10 63 ff or %g1, 0x3ff, %g1 40007954: 80 a5 80 01 cmp %l6, %g1 40007958: 18 80 00 88 bgu 40007b78 <_Objects_Extend_information+0x2a8><== NEVER TAKEN 4000795c: 01 00 00 00 nop /* * Allocate the name table, and the objects and if it fails either return or * generate a fatal error depending on auto-extending being active. */ block_size = information->allocation_size * information->size; 40007960: 40 00 44 3d call 40018a54 <.umul> 40007964: d2 06 20 18 ld [ %i0 + 0x18 ], %o1 if ( information->auto_extend ) { 40007968: c2 0e 20 12 ldub [ %i0 + 0x12 ], %g1 4000796c: 80 a0 60 00 cmp %g1, 0 40007970: 02 80 00 09 be 40007994 <_Objects_Extend_information+0xc4> 40007974: 01 00 00 00 nop new_object_block = _Workspace_Allocate( block_size ); 40007978: 40 00 08 4c call 40009aa8 <_Workspace_Allocate> 4000797c: 01 00 00 00 nop if ( !new_object_block ) 40007980: a4 92 20 00 orcc %o0, 0, %l2 40007984: 32 80 00 08 bne,a 400079a4 <_Objects_Extend_information+0xd4> 40007988: c2 16 20 10 lduh [ %i0 + 0x10 ], %g1 4000798c: 81 c7 e0 08 ret 40007990: 81 e8 00 00 restore return; } else { new_object_block = _Workspace_Allocate_or_fatal_error( block_size ); 40007994: 40 00 08 37 call 40009a70 <_Workspace_Allocate_or_fatal_error> 40007998: 01 00 00 00 nop 4000799c: a4 10 00 08 mov %o0, %l2 } /* * If the index_base is the maximum we need to grow the tables. */ if (index_base >= information->maximum ) { 400079a0: c2 16 20 10 lduh [ %i0 + 0x10 ], %g1 400079a4: 80 a4 00 01 cmp %l0, %g1 400079a8: 2a 80 00 53 bcs,a 40007af4 <_Objects_Extend_information+0x224> 400079ac: c2 06 20 34 ld [ %i0 + 0x34 ], %g1 * Allocate the tables and break it up. */ block_size = block_count * (sizeof(void *) + sizeof(uint32_t) + sizeof(Objects_Name *)) + ((maximum + minimum_index) * sizeof(Objects_Control *)); object_blocks = (void**) _Workspace_Allocate( block_size ); 400079b0: 82 05 80 13 add %l6, %l3, %g1 */ /* * Up the block count and maximum */ block_count++; 400079b4: ae 05 20 01 add %l4, 1, %l7 * Allocate the tables and break it up. */ block_size = block_count * (sizeof(void *) + sizeof(uint32_t) + sizeof(Objects_Name *)) + ((maximum + minimum_index) * sizeof(Objects_Control *)); object_blocks = (void**) _Workspace_Allocate( block_size ); 400079b8: 91 2d e0 01 sll %l7, 1, %o0 400079bc: 90 02 00 17 add %o0, %l7, %o0 400079c0: 90 00 40 08 add %g1, %o0, %o0 400079c4: 40 00 08 39 call 40009aa8 <_Workspace_Allocate> 400079c8: 91 2a 20 02 sll %o0, 2, %o0 if ( !object_blocks ) { 400079cc: aa 92 20 00 orcc %o0, 0, %l5 400079d0: 32 80 00 06 bne,a 400079e8 <_Objects_Extend_information+0x118> 400079d4: c2 16 20 10 lduh [ %i0 + 0x10 ], %g1 _Workspace_Free( new_object_block ); 400079d8: 40 00 08 3d call 40009acc <_Workspace_Free> 400079dc: 90 10 00 12 mov %l2, %o0 return; 400079e0: 81 c7 e0 08 ret 400079e4: 81 e8 00 00 restore } /* * Break the block into the various sections. */ inactive_per_block = (uint32_t *) _Addresses_Add_offset( 400079e8: af 2d e0 02 sll %l7, 2, %l7 * Take the block count down. Saves all the (block_count - 1) * in the copies. */ block_count--; if ( information->maximum > minimum_index ) { 400079ec: 80 a0 40 13 cmp %g1, %l3 RTEMS_INLINE_ROUTINE void *_Addresses_Add_offset ( const void *base, uintptr_t offset ) { return (void *)((uintptr_t)base + offset); 400079f0: ba 05 40 17 add %l5, %l7, %i5 400079f4: 82 10 20 00 clr %g1 400079f8: 08 80 00 14 bleu 40007a48 <_Objects_Extend_information+0x178> 400079fc: ae 07 40 17 add %i5, %l7, %l7 /* * Copy each section of the table over. This has to be performed as * separate parts as size of each block has changed. */ memcpy( object_blocks, 40007a00: d2 06 20 34 ld [ %i0 + 0x34 ], %o1 information->object_blocks, block_count * sizeof(void*) ); 40007a04: b9 2d 20 02 sll %l4, 2, %i4 /* * Copy each section of the table over. This has to be performed as * separate parts as size of each block has changed. */ memcpy( object_blocks, 40007a08: 40 00 20 f1 call 4000fdcc 40007a0c: 94 10 00 1c mov %i4, %o2 information->object_blocks, block_count * sizeof(void*) ); memcpy( inactive_per_block, 40007a10: d2 06 20 30 ld [ %i0 + 0x30 ], %o1 40007a14: 94 10 00 1c mov %i4, %o2 40007a18: 40 00 20 ed call 4000fdcc 40007a1c: 90 10 00 1d mov %i5, %o0 information->inactive_per_block, block_count * sizeof(uint32_t) ); memcpy( local_table, 40007a20: c2 16 20 10 lduh [ %i0 + 0x10 ], %g1 40007a24: d2 06 20 1c ld [ %i0 + 0x1c ], %o1 40007a28: a6 04 c0 01 add %l3, %g1, %l3 40007a2c: 90 10 00 17 mov %l7, %o0 40007a30: 40 00 20 e7 call 4000fdcc 40007a34: 95 2c e0 02 sll %l3, 2, %o2 */ object_blocks[block_count] = NULL; inactive_per_block[block_count] = 0; for ( index=index_base ; index < ( information->allocation_size + index_base ); 40007a38: 10 80 00 08 b 40007a58 <_Objects_Extend_information+0x188> 40007a3c: c6 16 20 14 lduh [ %i0 + 0x14 ], %g3 } else { /* * Deal with the special case of the 0 to minimum_index */ for ( index = 0; index < minimum_index; index++ ) { 40007a40: 82 00 60 01 inc %g1 local_table[ index ] = NULL; 40007a44: c0 20 80 17 clr [ %g2 + %l7 ] } else { /* * Deal with the special case of the 0 to minimum_index */ for ( index = 0; index < minimum_index; index++ ) { 40007a48: 80 a0 40 13 cmp %g1, %l3 40007a4c: 2a bf ff fd bcs,a 40007a40 <_Objects_Extend_information+0x170> 40007a50: 85 28 60 02 sll %g1, 2, %g2 */ object_blocks[block_count] = NULL; inactive_per_block[block_count] = 0; for ( index=index_base ; index < ( information->allocation_size + index_base ); 40007a54: c6 16 20 14 lduh [ %i0 + 0x14 ], %g3 } /* * Initialise the new entries in the table. */ object_blocks[block_count] = NULL; 40007a58: a9 2d 20 02 sll %l4, 2, %l4 inactive_per_block[block_count] = 0; for ( index=index_base ; index < ( information->allocation_size + index_base ); 40007a5c: 85 2c 20 02 sll %l0, 2, %g2 /* * Initialise the new entries in the table. */ object_blocks[block_count] = NULL; inactive_per_block[block_count] = 0; 40007a60: c0 27 40 14 clr [ %i5 + %l4 ] } /* * Initialise the new entries in the table. */ object_blocks[block_count] = NULL; 40007a64: c0 25 40 14 clr [ %l5 + %l4 ] inactive_per_block[block_count] = 0; for ( index=index_base ; index < ( information->allocation_size + index_base ); 40007a68: 86 04 00 03 add %l0, %g3, %g3 40007a6c: 84 05 c0 02 add %l7, %g2, %g2 * Initialise the new entries in the table. */ object_blocks[block_count] = NULL; inactive_per_block[block_count] = 0; for ( index=index_base ; 40007a70: 10 80 00 04 b 40007a80 <_Objects_Extend_information+0x1b0> 40007a74: 82 10 00 10 mov %l0, %g1 index < ( information->allocation_size + index_base ); index++ ) { 40007a78: 82 00 60 01 inc %g1 40007a7c: 84 00 a0 04 add %g2, 4, %g2 * Initialise the new entries in the table. */ object_blocks[block_count] = NULL; inactive_per_block[block_count] = 0; for ( index=index_base ; 40007a80: 80 a0 40 03 cmp %g1, %g3 40007a84: 2a bf ff fd bcs,a 40007a78 <_Objects_Extend_information+0x1a8> 40007a88: c0 20 80 00 clr [ %g2 ] index < ( information->allocation_size + index_base ); index++ ) { local_table[ index ] = NULL; } _ISR_Disable( level ); 40007a8c: 7f ff e8 b0 call 40001d4c 40007a90: 01 00 00 00 nop information->object_blocks = object_blocks; information->inactive_per_block = inactive_per_block; information->local_table = local_table; information->maximum = (Objects_Maximum) maximum; information->maximum_id = _Objects_Build_id( 40007a94: c8 06 00 00 ld [ %i0 ], %g4 40007a98: c4 16 20 04 lduh [ %i0 + 4 ], %g2 old_tables = information->object_blocks; information->object_blocks = object_blocks; information->inactive_per_block = inactive_per_block; information->local_table = local_table; information->maximum = (Objects_Maximum) maximum; 40007a9c: ec 36 20 10 sth %l6, [ %i0 + 0x10 ] information->maximum_id = _Objects_Build_id( 40007aa0: ad 2d a0 10 sll %l6, 0x10, %l6 local_table[ index ] = NULL; } _ISR_Disable( level ); old_tables = information->object_blocks; 40007aa4: e6 06 20 34 ld [ %i0 + 0x34 ], %l3 information->object_blocks = object_blocks; information->inactive_per_block = inactive_per_block; information->local_table = local_table; information->maximum = (Objects_Maximum) maximum; information->maximum_id = _Objects_Build_id( 40007aa8: 83 35 a0 10 srl %l6, 0x10, %g1 _ISR_Disable( level ); old_tables = information->object_blocks; information->object_blocks = object_blocks; information->inactive_per_block = inactive_per_block; 40007aac: fa 26 20 30 st %i5, [ %i0 + 0x30 ] information->local_table = local_table; 40007ab0: ee 26 20 1c st %l7, [ %i0 + 0x1c ] information->maximum = (Objects_Maximum) maximum; information->maximum_id = _Objects_Build_id( 40007ab4: 89 29 20 18 sll %g4, 0x18, %g4 40007ab8: 85 28 a0 1b sll %g2, 0x1b, %g2 _ISR_Disable( level ); old_tables = information->object_blocks; information->object_blocks = object_blocks; 40007abc: ea 26 20 34 st %l5, [ %i0 + 0x34 ] information->inactive_per_block = inactive_per_block; information->local_table = local_table; information->maximum = (Objects_Maximum) maximum; information->maximum_id = _Objects_Build_id( 40007ac0: 07 00 00 40 sethi %hi(0x10000), %g3 40007ac4: ac 11 00 03 or %g4, %g3, %l6 40007ac8: ac 15 80 02 or %l6, %g2, %l6 40007acc: ac 15 80 01 or %l6, %g1, %l6 40007ad0: ec 26 20 0c st %l6, [ %i0 + 0xc ] information->the_class, _Objects_Local_node, information->maximum ); _ISR_Enable( level ); 40007ad4: 7f ff e8 a2 call 40001d5c 40007ad8: 01 00 00 00 nop if ( old_tables ) 40007adc: 80 a4 e0 00 cmp %l3, 0 40007ae0: 22 80 00 05 be,a 40007af4 <_Objects_Extend_information+0x224> 40007ae4: c2 06 20 34 ld [ %i0 + 0x34 ], %g1 _Workspace_Free( old_tables ); 40007ae8: 40 00 07 f9 call 40009acc <_Workspace_Free> 40007aec: 90 10 00 13 mov %l3, %o0 } /* * Assign the new object block to the object block table. */ information->object_blocks[ block ] = new_object_block; 40007af0: c2 06 20 34 ld [ %i0 + 0x34 ], %g1 /* * Initialize objects .. add to a local chain first. */ _Chain_Initialize( 40007af4: d4 16 20 14 lduh [ %i0 + 0x14 ], %o2 40007af8: d6 06 20 18 ld [ %i0 + 0x18 ], %o3 40007afc: 92 10 00 12 mov %l2, %o1 40007b00: 90 07 bf f4 add %fp, -12, %o0 } /* * Assign the new object block to the object block table. */ information->object_blocks[ block ] = new_object_block; 40007b04: a3 2c 60 02 sll %l1, 2, %l1 information->the_class, _Objects_Local_node, index ); _Chain_Append( &information->Inactive, &the_object->Node ); 40007b08: a8 06 20 20 add %i0, 0x20, %l4 } /* * Assign the new object block to the object block table. */ information->object_blocks[ block ] = new_object_block; 40007b0c: e4 20 40 11 st %l2, [ %g1 + %l1 ] */ index = index_base; while ((the_object = (Objects_Control *) _Chain_Get( &Inactive )) != NULL ) { the_object->id = _Objects_Build_id( 40007b10: 27 00 00 40 sethi %hi(0x10000), %l3 information->object_blocks[ block ] = new_object_block; /* * Initialize objects .. add to a local chain first. */ _Chain_Initialize( 40007b14: 40 00 12 57 call 4000c470 <_Chain_Initialize> 40007b18: a4 10 00 08 mov %o0, %l2 /* * Move from the local chain, initialise, then append to the inactive chain */ index = index_base; while ((the_object = (Objects_Control *) _Chain_Get( &Inactive )) != NULL ) { 40007b1c: 30 80 00 0c b,a 40007b4c <_Objects_Extend_information+0x27c> the_object->id = _Objects_Build_id( 40007b20: c4 16 20 04 lduh [ %i0 + 4 ], %g2 40007b24: 83 28 60 18 sll %g1, 0x18, %g1 40007b28: 85 28 a0 1b sll %g2, 0x1b, %g2 40007b2c: 82 10 40 13 or %g1, %l3, %g1 40007b30: 82 10 40 02 or %g1, %g2, %g1 40007b34: 82 10 40 10 or %g1, %l0, %g1 information->the_class, _Objects_Local_node, index ); _Chain_Append( &information->Inactive, &the_object->Node ); 40007b38: 92 10 00 08 mov %o0, %o1 */ index = index_base; while ((the_object = (Objects_Control *) _Chain_Get( &Inactive )) != NULL ) { the_object->id = _Objects_Build_id( 40007b3c: c2 22 20 08 st %g1, [ %o0 + 8 ] index ); _Chain_Append( &information->Inactive, &the_object->Node ); index++; 40007b40: a0 04 20 01 inc %l0 information->the_class, _Objects_Local_node, index ); _Chain_Append( &information->Inactive, &the_object->Node ); 40007b44: 7f ff fc ee call 40006efc <_Chain_Append> 40007b48: 90 10 00 14 mov %l4, %o0 /* * Move from the local chain, initialise, then append to the inactive chain */ index = index_base; while ((the_object = (Objects_Control *) _Chain_Get( &Inactive )) != NULL ) { 40007b4c: 40 00 12 39 call 4000c430 <_Chain_Get> 40007b50: 90 10 00 12 mov %l2, %o0 40007b54: 80 a2 20 00 cmp %o0, 0 40007b58: 32 bf ff f2 bne,a 40007b20 <_Objects_Extend_information+0x250> 40007b5c: c2 06 00 00 ld [ %i0 ], %g1 index++; } information->inactive_per_block[ block ] = information->allocation_size; information->inactive = 40007b60: c2 16 20 2c lduh [ %i0 + 0x2c ], %g1 _Chain_Append( &information->Inactive, &the_object->Node ); index++; } information->inactive_per_block[ block ] = information->allocation_size; 40007b64: c8 16 20 14 lduh [ %i0 + 0x14 ], %g4 40007b68: c4 06 20 30 ld [ %i0 + 0x30 ], %g2 information->inactive = 40007b6c: 82 01 00 01 add %g4, %g1, %g1 _Chain_Append( &information->Inactive, &the_object->Node ); index++; } information->inactive_per_block[ block ] = information->allocation_size; 40007b70: c8 20 80 11 st %g4, [ %g2 + %l1 ] information->inactive = 40007b74: c2 36 20 2c sth %g1, [ %i0 + 0x2c ] 40007b78: 81 c7 e0 08 ret 40007b7c: 81 e8 00 00 restore =============================================================================== 40007c28 <_Objects_Get_information>: Objects_Information *_Objects_Get_information( Objects_APIs the_api, uint32_t the_class ) { 40007c28: 9d e3 bf a0 save %sp, -96, %sp Objects_Information *info; int the_class_api_maximum; if ( !the_class ) 40007c2c: 80 a6 60 00 cmp %i1, 0 40007c30: 22 80 00 1a be,a 40007c98 <_Objects_Get_information+0x70> 40007c34: b0 10 20 00 clr %i0 /* * 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 ); 40007c38: 40 00 13 94 call 4000ca88 <_Objects_API_maximum_class> 40007c3c: 90 10 00 18 mov %i0, %o0 if ( the_class_api_maximum == 0 ) 40007c40: 80 a2 20 00 cmp %o0, 0 40007c44: 22 80 00 15 be,a 40007c98 <_Objects_Get_information+0x70> 40007c48: b0 10 20 00 clr %i0 return NULL; if ( the_class > (uint32_t) the_class_api_maximum ) 40007c4c: 80 a6 40 08 cmp %i1, %o0 40007c50: 38 80 00 12 bgu,a 40007c98 <_Objects_Get_information+0x70> 40007c54: b0 10 20 00 clr %i0 return NULL; if ( !_Objects_Information_table[ the_api ] ) 40007c58: b1 2e 20 02 sll %i0, 2, %i0 40007c5c: 03 10 00 76 sethi %hi(0x4001d800), %g1 40007c60: 82 10 60 d0 or %g1, 0xd0, %g1 ! 4001d8d0 <_Objects_Information_table> 40007c64: c2 00 40 18 ld [ %g1 + %i0 ], %g1 40007c68: 80 a0 60 00 cmp %g1, 0 40007c6c: 02 80 00 0b be 40007c98 <_Objects_Get_information+0x70> <== NEVER TAKEN 40007c70: b0 10 20 00 clr %i0 return NULL; info = _Objects_Information_table[ the_api ][ the_class ]; 40007c74: b3 2e 60 02 sll %i1, 2, %i1 40007c78: f0 00 40 19 ld [ %g1 + %i1 ], %i0 if ( !info ) 40007c7c: 80 a6 20 00 cmp %i0, 0 40007c80: 02 80 00 06 be 40007c98 <_Objects_Get_information+0x70> <== NEVER TAKEN 40007c84: 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 ) 40007c88: c2 16 20 10 lduh [ %i0 + 0x10 ], %g1 40007c8c: 80 a0 60 00 cmp %g1, 0 40007c90: 22 80 00 02 be,a 40007c98 <_Objects_Get_information+0x70> 40007c94: b0 10 20 00 clr %i0 return NULL; #endif return info; } 40007c98: 81 c7 e0 08 ret 40007c9c: 81 e8 00 00 restore =============================================================================== 400185b8 <_Objects_Get_no_protection>: /* * You can't just extract the index portion or you can get tricked * by a value between 1 and maximum. */ index = id - information->minimum_id + 1; 400185b8: c4 02 20 08 ld [ %o0 + 8 ], %g2 if ( information->maximum >= index ) { 400185bc: c2 12 20 10 lduh [ %o0 + 0x10 ], %g1 /* * You can't just extract the index portion or you can get tricked * by a value between 1 and maximum. */ index = id - information->minimum_id + 1; 400185c0: 84 22 40 02 sub %o1, %g2, %g2 400185c4: 84 00 a0 01 inc %g2 if ( information->maximum >= index ) { 400185c8: 80 a0 40 02 cmp %g1, %g2 400185cc: 0a 80 00 09 bcs 400185f0 <_Objects_Get_no_protection+0x38> 400185d0: 85 28 a0 02 sll %g2, 2, %g2 if ( (the_object = information->local_table[ index ]) != NULL ) { 400185d4: c2 02 20 1c ld [ %o0 + 0x1c ], %g1 400185d8: d0 00 40 02 ld [ %g1 + %g2 ], %o0 400185dc: 80 a2 20 00 cmp %o0, 0 400185e0: 02 80 00 05 be 400185f4 <_Objects_Get_no_protection+0x3c> <== NEVER TAKEN 400185e4: 82 10 20 01 mov 1, %g1 *location = OBJECTS_LOCAL; return the_object; 400185e8: 81 c3 e0 08 retl 400185ec: c0 22 80 00 clr [ %o2 ] /* * This isn't supported or required yet for Global objects so * if it isn't local, we don't find it. */ *location = OBJECTS_ERROR; 400185f0: 82 10 20 01 mov 1, %g1 400185f4: 90 10 20 00 clr %o0 return NULL; } 400185f8: 81 c3 e0 08 retl 400185fc: c2 22 80 00 st %g1, [ %o2 ] =============================================================================== 4000939c <_Objects_Id_to_name>: */ Objects_Name_or_id_lookup_errors _Objects_Id_to_name ( Objects_Id id, Objects_Name *name ) { 4000939c: 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; 400093a0: 92 96 20 00 orcc %i0, 0, %o1 400093a4: 12 80 00 06 bne 400093bc <_Objects_Id_to_name+0x20> 400093a8: 83 32 60 18 srl %o1, 0x18, %g1 400093ac: 03 10 00 8c sethi %hi(0x40023000), %g1 400093b0: c2 00 62 bc ld [ %g1 + 0x2bc ], %g1 ! 400232bc <_Thread_Executing> 400093b4: d2 00 60 08 ld [ %g1 + 8 ], %o1 */ RTEMS_INLINE_ROUTINE Objects_APIs _Objects_Get_API( Objects_Id id ) { return (Objects_APIs) ((id >> OBJECTS_API_START_BIT) & OBJECTS_API_VALID_BITS); 400093b8: 83 32 60 18 srl %o1, 0x18, %g1 400093bc: 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 ) 400093c0: 84 00 7f ff add %g1, -1, %g2 400093c4: 80 a0 a0 03 cmp %g2, 3 400093c8: 18 80 00 18 bgu 40009428 <_Objects_Id_to_name+0x8c> 400093cc: 83 28 60 02 sll %g1, 2, %g1 the_api = _Objects_Get_API( tmpId ); if ( !_Objects_Is_api_valid( the_api ) ) return OBJECTS_INVALID_ID; if ( !_Objects_Information_table[ the_api ] ) 400093d0: 10 80 00 18 b 40009430 <_Objects_Id_to_name+0x94> 400093d4: 05 10 00 8c sethi %hi(0x40023000), %g2 return OBJECTS_INVALID_ID; the_class = _Objects_Get_class( tmpId ); information = _Objects_Information_table[ the_api ][ the_class ]; 400093d8: 85 28 a0 02 sll %g2, 2, %g2 400093dc: d0 00 40 02 ld [ %g1 + %g2 ], %o0 if ( !information ) 400093e0: 80 a2 20 00 cmp %o0, 0 400093e4: 02 80 00 11 be 40009428 <_Objects_Id_to_name+0x8c> <== NEVER TAKEN 400093e8: 01 00 00 00 nop return OBJECTS_INVALID_ID; #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES) if ( information->is_string ) 400093ec: c2 0a 20 38 ldub [ %o0 + 0x38 ], %g1 400093f0: 80 a0 60 00 cmp %g1, 0 400093f4: 12 80 00 0d bne 40009428 <_Objects_Id_to_name+0x8c> <== NEVER TAKEN 400093f8: 01 00 00 00 nop return OBJECTS_INVALID_ID; #endif the_object = _Objects_Get( information, tmpId, &ignored_location ); 400093fc: 7f ff ff cb call 40009328 <_Objects_Get> 40009400: 94 07 bf fc add %fp, -4, %o2 if ( !the_object ) 40009404: 80 a2 20 00 cmp %o0, 0 40009408: 02 80 00 08 be 40009428 <_Objects_Id_to_name+0x8c> 4000940c: 01 00 00 00 nop return OBJECTS_INVALID_ID; *name = the_object->name; 40009410: c2 02 20 0c ld [ %o0 + 0xc ], %g1 _Thread_Enable_dispatch(); 40009414: b0 10 20 00 clr %i0 40009418: 40 00 02 3d call 40009d0c <_Thread_Enable_dispatch> 4000941c: c2 26 40 00 st %g1, [ %i1 ] return OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL; 40009420: 81 c7 e0 08 ret 40009424: 81 e8 00 00 restore } 40009428: 81 c7 e0 08 ret 4000942c: 91 e8 20 03 restore %g0, 3, %o0 the_api = _Objects_Get_API( tmpId ); if ( !_Objects_Is_api_valid( the_api ) ) return OBJECTS_INVALID_ID; if ( !_Objects_Information_table[ the_api ] ) 40009430: 84 10 a1 60 or %g2, 0x160, %g2 40009434: c2 00 80 01 ld [ %g2 + %g1 ], %g1 40009438: 80 a0 60 00 cmp %g1, 0 4000943c: 12 bf ff e7 bne 400093d8 <_Objects_Id_to_name+0x3c> 40009440: 85 32 60 1b srl %o1, 0x1b, %g2 40009444: 30 bf ff f9 b,a 40009428 <_Objects_Id_to_name+0x8c> =============================================================================== 400085c4 <_Objects_Set_name>: bool _Objects_Set_name( Objects_Information *information, Objects_Control *the_object, const char *name ) { 400085c4: 9d e3 bf a0 save %sp, -96, %sp size_t length; const char *s; s = name; length = strnlen( name, information->name_length ); 400085c8: d2 16 20 3a lduh [ %i0 + 0x3a ], %o1 400085cc: 40 00 24 b0 call 4001188c 400085d0: 90 10 00 1a mov %i2, %o0 #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES) if ( information->is_string ) { 400085d4: c2 0e 20 38 ldub [ %i0 + 0x38 ], %g1 400085d8: 80 a0 60 00 cmp %g1, 0 400085dc: 02 80 00 17 be 40008638 <_Objects_Set_name+0x74> 400085e0: a0 10 00 08 mov %o0, %l0 char *d; d = _Workspace_Allocate( length + 1 ); 400085e4: 90 02 20 01 inc %o0 400085e8: 40 00 06 fb call 4000a1d4 <_Workspace_Allocate> 400085ec: b0 10 20 00 clr %i0 if ( !d ) 400085f0: a2 92 20 00 orcc %o0, 0, %l1 400085f4: 02 80 00 24 be 40008684 <_Objects_Set_name+0xc0> <== NEVER TAKEN 400085f8: 01 00 00 00 nop return false; if ( the_object->name.name_p ) { 400085fc: d0 06 60 0c ld [ %i1 + 0xc ], %o0 40008600: 80 a2 20 00 cmp %o0, 0 40008604: 02 80 00 06 be 4000861c <_Objects_Set_name+0x58> 40008608: 92 10 00 1a mov %i2, %o1 _Workspace_Free( (void *)the_object->name.name_p ); 4000860c: 40 00 06 fb call 4000a1f8 <_Workspace_Free> 40008610: 01 00 00 00 nop the_object->name.name_p = NULL; 40008614: c0 26 60 0c clr [ %i1 + 0xc ] } strncpy( d, name, length ); 40008618: 92 10 00 1a mov %i2, %o1 4000861c: 90 10 00 11 mov %l1, %o0 40008620: 40 00 24 60 call 400117a0 40008624: 94 10 00 10 mov %l0, %o2 d[length] = '\0'; 40008628: c0 2c 40 10 clrb [ %l1 + %l0 ] the_object->name.name_p = d; 4000862c: e2 26 60 0c st %l1, [ %i1 + 0xc ] 40008630: 81 c7 e0 08 ret 40008634: 91 e8 20 01 restore %g0, 1, %o0 } else #endif { the_object->name.name_u32 = _Objects_Build_name( 40008638: 80 a2 20 01 cmp %o0, 1 4000863c: 08 80 00 14 bleu 4000868c <_Objects_Set_name+0xc8> 40008640: c8 0e 80 00 ldub [ %i2 ], %g4 40008644: c6 4e a0 01 ldsb [ %i2 + 1 ], %g3 40008648: 80 a2 20 02 cmp %o0, 2 4000864c: 08 80 00 11 bleu 40008690 <_Objects_Set_name+0xcc> 40008650: 87 28 e0 10 sll %g3, 0x10, %g3 40008654: c4 4e a0 02 ldsb [ %i2 + 2 ], %g2 40008658: 80 a2 20 03 cmp %o0, 3 4000865c: 85 28 a0 08 sll %g2, 8, %g2 40008660: 08 80 00 03 bleu 4000866c <_Objects_Set_name+0xa8> 40008664: 82 10 20 20 mov 0x20, %g1 40008668: c2 4e a0 03 ldsb [ %i2 + 3 ], %g1 4000866c: 89 29 20 18 sll %g4, 0x18, %g4 40008670: b0 10 20 01 mov 1, %i0 40008674: 86 10 c0 04 or %g3, %g4, %g3 40008678: 84 10 c0 02 or %g3, %g2, %g2 4000867c: 82 10 80 01 or %g2, %g1, %g1 40008680: c2 26 60 0c st %g1, [ %i1 + 0xc ] ); } return true; } 40008684: 81 c7 e0 08 ret 40008688: 81 e8 00 00 restore d[length] = '\0'; the_object->name.name_p = d; } else #endif { the_object->name.name_u32 = _Objects_Build_name( 4000868c: 07 00 08 00 sethi %hi(0x200000), %g3 40008690: 05 00 00 08 sethi %hi(0x2000), %g2 40008694: 10 bf ff f6 b 4000866c <_Objects_Set_name+0xa8> 40008698: 82 10 20 20 mov 0x20, %g1 =============================================================================== 400074a0 <_POSIX_Condition_variables_Wait_support>: pthread_cond_t *cond, pthread_mutex_t *mutex, Watchdog_Interval timeout, bool already_timedout ) { 400074a0: 9d e3 bf 98 save %sp, -104, %sp register POSIX_Condition_variables_Control *the_cond; Objects_Locations location; int status; int mutex_status; if ( !_POSIX_Mutex_Get( mutex, &location ) ) { 400074a4: a0 07 bf fc add %fp, -4, %l0 400074a8: 90 10 00 19 mov %i1, %o0 400074ac: 40 00 00 7e call 400076a4 <_POSIX_Mutex_Get> 400074b0: 92 10 00 10 mov %l0, %o1 400074b4: 80 a2 20 00 cmp %o0, 0 400074b8: 22 80 00 18 be,a 40007518 <_POSIX_Condition_variables_Wait_support+0x78> 400074bc: b0 10 20 16 mov 0x16, %i0 */ RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void ) { RTEMS_COMPILER_MEMORY_BARRIER(); _Thread_Dispatch_disable_level -= 1; 400074c0: 03 10 00 81 sethi %hi(0x40020400), %g1 400074c4: c4 00 61 70 ld [ %g1 + 0x170 ], %g2 ! 40020570 <_Thread_Dispatch_disable_level> return EINVAL; } _Thread_Unnest_dispatch(); the_cond = _POSIX_Condition_variables_Get( cond, &location ); 400074c8: 92 10 00 10 mov %l0, %o1 400074cc: 84 00 bf ff add %g2, -1, %g2 400074d0: 90 10 00 18 mov %i0, %o0 400074d4: c4 20 61 70 st %g2, [ %g1 + 0x170 ] 400074d8: 7f ff ff 74 call 400072a8 <_POSIX_Condition_variables_Get> 400074dc: 01 00 00 00 nop switch ( location ) { 400074e0: c2 07 bf fc ld [ %fp + -4 ], %g1 400074e4: 80 a0 60 00 cmp %g1, 0 400074e8: 12 80 00 34 bne 400075b8 <_POSIX_Condition_variables_Wait_support+0x118> 400074ec: a0 10 00 08 mov %o0, %l0 case OBJECTS_LOCAL: if ( the_cond->Mutex && ( the_cond->Mutex != *mutex ) ) { 400074f0: c2 02 20 14 ld [ %o0 + 0x14 ], %g1 400074f4: 80 a0 60 00 cmp %g1, 0 400074f8: 02 80 00 0a be 40007520 <_POSIX_Condition_variables_Wait_support+0x80> 400074fc: 01 00 00 00 nop 40007500: c4 06 40 00 ld [ %i1 ], %g2 40007504: 80 a0 40 02 cmp %g1, %g2 40007508: 02 80 00 06 be 40007520 <_POSIX_Condition_variables_Wait_support+0x80> 4000750c: 01 00 00 00 nop _Thread_Enable_dispatch(); 40007510: 40 00 0c 9f call 4000a78c <_Thread_Enable_dispatch> 40007514: b0 10 20 16 mov 0x16, %i0 ! 16 return EINVAL; 40007518: 81 c7 e0 08 ret 4000751c: 81 e8 00 00 restore } (void) pthread_mutex_unlock( mutex ); 40007520: 40 00 00 f2 call 400078e8 40007524: 90 10 00 19 mov %i1, %o0 _Thread_Enable_dispatch(); return EINVAL; } */ if ( !already_timedout ) { 40007528: 80 8e e0 ff btst 0xff, %i3 4000752c: 12 80 00 1c bne 4000759c <_POSIX_Condition_variables_Wait_support+0xfc> 40007530: 23 10 00 81 sethi %hi(0x40020400), %l1 the_cond->Mutex = *mutex; 40007534: c4 06 40 00 ld [ %i1 ], %g2 _Thread_queue_Enter_critical_section( &the_cond->Wait_queue ); _Thread_Executing->Wait.return_code = 0; 40007538: c2 04 62 2c ld [ %l1 + 0x22c ], %g1 return EINVAL; } */ if ( !already_timedout ) { the_cond->Mutex = *mutex; 4000753c: c4 24 20 14 st %g2, [ %l0 + 0x14 ] _Thread_queue_Enter_critical_section( &the_cond->Wait_queue ); _Thread_Executing->Wait.return_code = 0; 40007540: c0 20 60 34 clr [ %g1 + 0x34 ] _Thread_Executing->Wait.queue = &the_cond->Wait_queue; _Thread_Executing->Wait.id = *cond; 40007544: c6 06 00 00 ld [ %i0 ], %g3 if ( !already_timedout ) { the_cond->Mutex = *mutex; _Thread_queue_Enter_critical_section( &the_cond->Wait_queue ); _Thread_Executing->Wait.return_code = 0; _Thread_Executing->Wait.queue = &the_cond->Wait_queue; 40007548: 84 04 20 18 add %l0, 0x18, %g2 _Thread_Executing->Wait.id = *cond; 4000754c: c6 20 60 20 st %g3, [ %g1 + 0x20 ] if ( !already_timedout ) { the_cond->Mutex = *mutex; _Thread_queue_Enter_critical_section( &the_cond->Wait_queue ); _Thread_Executing->Wait.return_code = 0; _Thread_Executing->Wait.queue = &the_cond->Wait_queue; 40007550: c4 20 60 44 st %g2, [ %g1 + 0x44 ] _Thread_Executing->Wait.id = *cond; _Thread_queue_Enqueue( &the_cond->Wait_queue, timeout ); 40007554: 92 10 00 1a mov %i2, %o1 RTEMS_INLINE_ROUTINE void _Thread_queue_Enter_critical_section ( Thread_queue_Control *the_thread_queue ) { the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; 40007558: 82 10 20 01 mov 1, %g1 4000755c: 90 10 00 02 mov %g2, %o0 40007560: 15 10 00 2c sethi %hi(0x4000b000), %o2 40007564: 94 12 a0 b0 or %o2, 0xb0, %o2 ! 4000b0b0 <_Thread_queue_Timeout> 40007568: 40 00 0d dc call 4000acd8 <_Thread_queue_Enqueue_with_handler> 4000756c: c2 24 20 48 st %g1, [ %l0 + 0x48 ] _Thread_Enable_dispatch(); 40007570: 40 00 0c 87 call 4000a78c <_Thread_Enable_dispatch> 40007574: 01 00 00 00 nop /* * Switch ourself out because we blocked as a result of the * _Thread_queue_Enqueue. */ status = _Thread_Executing->Wait.return_code; 40007578: c2 04 62 2c ld [ %l1 + 0x22c ], %g1 4000757c: f0 00 60 34 ld [ %g1 + 0x34 ], %i0 if ( status && status != ETIMEDOUT ) 40007580: 80 a6 20 74 cmp %i0, 0x74 40007584: 02 80 00 08 be 400075a4 <_POSIX_Condition_variables_Wait_support+0x104> 40007588: 80 a6 20 00 cmp %i0, 0 4000758c: 02 80 00 06 be 400075a4 <_POSIX_Condition_variables_Wait_support+0x104><== ALWAYS TAKEN 40007590: 01 00 00 00 nop 40007594: 81 c7 e0 08 ret <== NOT EXECUTED 40007598: 81 e8 00 00 restore <== NOT EXECUTED return status; } else { _Thread_Enable_dispatch(); 4000759c: 40 00 0c 7c call 4000a78c <_Thread_Enable_dispatch> 400075a0: b0 10 20 74 mov 0x74, %i0 /* * When we get here the dispatch disable level is 0. */ mutex_status = pthread_mutex_lock( mutex ); 400075a4: 40 00 00 b0 call 40007864 400075a8: 90 10 00 19 mov %i1, %o0 if ( mutex_status ) 400075ac: 80 a2 20 00 cmp %o0, 0 400075b0: 02 80 00 03 be 400075bc <_POSIX_Condition_variables_Wait_support+0x11c> 400075b4: 01 00 00 00 nop 400075b8: b0 10 20 16 mov 0x16, %i0 ! 16 case OBJECTS_ERROR: break; } return EINVAL; } 400075bc: 81 c7 e0 08 ret 400075c0: 81 e8 00 00 restore =============================================================================== 4000b2d4 <_POSIX_Message_queue_Receive_support>: size_t msg_len, unsigned int *msg_prio, bool wait, Watchdog_Interval timeout ) { 4000b2d4: 9d e3 bf 98 save %sp, -104, %sp RTEMS_INLINE_ROUTINE POSIX_Message_queue_Control_fd *_POSIX_Message_queue_Get_fd ( mqd_t id, Objects_Locations *location ) { return (POSIX_Message_queue_Control_fd *) _Objects_Get( 4000b2d8: 11 10 00 9e sethi %hi(0x40027800), %o0 4000b2dc: 94 07 bf fc add %fp, -4, %o2 4000b2e0: 90 12 22 7c or %o0, 0x27c, %o0 4000b2e4: 40 00 0c 61 call 4000e468 <_Objects_Get> 4000b2e8: 92 10 00 18 mov %i0, %o1 Objects_Locations location; size_t length_out; bool do_wait; the_mq_fd = _POSIX_Message_queue_Get_fd( mqdes, &location ); switch ( location ) { 4000b2ec: c2 07 bf fc ld [ %fp + -4 ], %g1 size_t msg_len, unsigned int *msg_prio, bool wait, Watchdog_Interval timeout ) { 4000b2f0: 94 10 00 19 mov %i1, %o2 Objects_Locations location; size_t length_out; bool do_wait; the_mq_fd = _POSIX_Message_queue_Get_fd( mqdes, &location ); switch ( location ) { 4000b2f4: 80 a0 60 00 cmp %g1, 0 4000b2f8: 12 80 00 3b bne 4000b3e4 <_POSIX_Message_queue_Receive_support+0x110> 4000b2fc: 9a 10 00 1d mov %i5, %o5 case OBJECTS_LOCAL: if ( (the_mq_fd->oflag & O_ACCMODE) == O_WRONLY ) { 4000b300: c2 02 20 14 ld [ %o0 + 0x14 ], %g1 4000b304: 84 08 60 03 and %g1, 3, %g2 4000b308: 80 a0 a0 01 cmp %g2, 1 4000b30c: 32 80 00 08 bne,a 4000b32c <_POSIX_Message_queue_Receive_support+0x58> 4000b310: d0 02 20 10 ld [ %o0 + 0x10 ], %o0 _Thread_Enable_dispatch(); 4000b314: 40 00 0e a1 call 4000ed98 <_Thread_Enable_dispatch> 4000b318: 01 00 00 00 nop rtems_set_errno_and_return_minus_one( EBADF ); 4000b31c: 40 00 2a de call 40015e94 <__errno> 4000b320: 01 00 00 00 nop 4000b324: 10 80 00 0b b 4000b350 <_POSIX_Message_queue_Receive_support+0x7c> 4000b328: 82 10 20 09 mov 9, %g1 ! 9 } the_mq = the_mq_fd->Queue; if ( msg_len < the_mq->Message_queue.maximum_message_size ) { 4000b32c: c4 02 20 68 ld [ %o0 + 0x68 ], %g2 4000b330: 80 a6 80 02 cmp %i2, %g2 4000b334: 1a 80 00 09 bcc 4000b358 <_POSIX_Message_queue_Receive_support+0x84> 4000b338: 80 8f 20 ff btst 0xff, %i4 _Thread_Enable_dispatch(); 4000b33c: 40 00 0e 97 call 4000ed98 <_Thread_Enable_dispatch> 4000b340: 01 00 00 00 nop rtems_set_errno_and_return_minus_one( EMSGSIZE ); 4000b344: 40 00 2a d4 call 40015e94 <__errno> 4000b348: 01 00 00 00 nop 4000b34c: 82 10 20 7a mov 0x7a, %g1 ! 7a 4000b350: 10 80 00 23 b 4000b3dc <_POSIX_Message_queue_Receive_support+0x108> 4000b354: c2 22 00 00 st %g1, [ %o0 ] length_out = -1; /* * A timed receive with a bad time will do a poll regardless. */ if ( wait ) 4000b358: 02 80 00 05 be 4000b36c <_POSIX_Message_queue_Receive_support+0x98><== NEVER TAKEN 4000b35c: 98 10 20 00 clr %o4 do_wait = (the_mq_fd->oflag & O_NONBLOCK) ? false : true; 4000b360: 99 30 60 0e srl %g1, 0xe, %o4 4000b364: 98 1b 20 01 xor %o4, 1, %o4 4000b368: 98 0b 20 01 and %o4, 1, %o4 /* * Now if something goes wrong, we return a "length" of -1 * to indicate an error. */ length_out = -1; 4000b36c: 82 10 3f ff mov -1, %g1 do_wait = wait; /* * Now perform the actual message receive */ _CORE_message_queue_Seize( 4000b370: 90 02 20 1c add %o0, 0x1c, %o0 4000b374: 92 10 00 18 mov %i0, %o1 4000b378: 98 0b 20 01 and %o4, 1, %o4 4000b37c: 96 07 bf f8 add %fp, -8, %o3 4000b380: 40 00 08 0e call 4000d3b8 <_CORE_message_queue_Seize> 4000b384: c2 27 bf f8 st %g1, [ %fp + -8 ] &length_out, do_wait, timeout ); _Thread_Enable_dispatch(); 4000b388: 40 00 0e 84 call 4000ed98 <_Thread_Enable_dispatch> 4000b38c: 35 10 00 9d sethi %hi(0x40027400), %i2 *msg_prio = _POSIX_Message_queue_Priority_from_core(_Thread_Executing->Wait.count); 4000b390: c2 06 a2 1c ld [ %i2 + 0x21c ], %g1 ! 4002761c <_Thread_Executing> do_wait, timeout ); _Thread_Enable_dispatch(); *msg_prio = 4000b394: c4 00 60 24 ld [ %g1 + 0x24 ], %g2 _POSIX_Message_queue_Priority_from_core(_Thread_Executing->Wait.count); if ( !_Thread_Executing->Wait.return_code ) 4000b398: c6 00 60 34 ld [ %g1 + 0x34 ], %g3 do_wait, timeout ); _Thread_Enable_dispatch(); *msg_prio = 4000b39c: 83 38 a0 1f sra %g2, 0x1f, %g1 4000b3a0: 84 18 40 02 xor %g1, %g2, %g2 4000b3a4: 82 20 80 01 sub %g2, %g1, %g1 _POSIX_Message_queue_Priority_from_core(_Thread_Executing->Wait.count); if ( !_Thread_Executing->Wait.return_code ) 4000b3a8: 80 a0 e0 00 cmp %g3, 0 4000b3ac: 12 80 00 05 bne 4000b3c0 <_POSIX_Message_queue_Receive_support+0xec> 4000b3b0: c2 26 c0 00 st %g1, [ %i3 ] return length_out; 4000b3b4: f0 07 bf f8 ld [ %fp + -8 ], %i0 4000b3b8: 81 c7 e0 08 ret 4000b3bc: 81 e8 00 00 restore rtems_set_errno_and_return_minus_one( 4000b3c0: 40 00 2a b5 call 40015e94 <__errno> 4000b3c4: 01 00 00 00 nop 4000b3c8: c2 06 a2 1c ld [ %i2 + 0x21c ], %g1 4000b3cc: b6 10 00 08 mov %o0, %i3 4000b3d0: 40 00 00 9b call 4000b63c <_POSIX_Message_queue_Translate_core_message_queue_return_code> 4000b3d4: d0 00 60 34 ld [ %g1 + 0x34 ], %o0 4000b3d8: d0 26 c0 00 st %o0, [ %i3 ] 4000b3dc: 81 c7 e0 08 ret 4000b3e0: 91 e8 3f ff restore %g0, -1, %o0 #endif case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( EBADF ); 4000b3e4: 40 00 2a ac call 40015e94 <__errno> 4000b3e8: b0 10 3f ff mov -1, %i0 4000b3ec: 82 10 20 09 mov 9, %g1 4000b3f0: c2 22 00 00 st %g1, [ %o0 ] } 4000b3f4: 81 c7 e0 08 ret 4000b3f8: 81 e8 00 00 restore =============================================================================== 4000bb88 <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch>: Thread_Control *the_thread ) { POSIX_API_Control *thread_support; thread_support = the_thread->API_Extensions[ THREAD_API_POSIX ]; 4000bb88: c2 02 21 60 ld [ %o0 + 0x160 ], %g1 if ( thread_support->cancelability_state == PTHREAD_CANCEL_ENABLE && 4000bb8c: c4 00 60 d4 ld [ %g1 + 0xd4 ], %g2 4000bb90: 80 a0 a0 00 cmp %g2, 0 4000bb94: 12 80 00 12 bne 4000bbdc <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch+0x54><== NEVER TAKEN 4000bb98: 01 00 00 00 nop thread_support->cancelability_type == PTHREAD_CANCEL_ASYNCHRONOUS && 4000bb9c: c4 00 60 d8 ld [ %g1 + 0xd8 ], %g2 4000bba0: 80 a0 a0 01 cmp %g2, 1 4000bba4: 12 80 00 0e bne 4000bbdc <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch+0x54> 4000bba8: 01 00 00 00 nop thread_support->cancelation_requested ) { 4000bbac: c2 00 60 dc ld [ %g1 + 0xdc ], %g1 4000bbb0: 80 a0 60 00 cmp %g1, 0 4000bbb4: 02 80 00 0a be 4000bbdc <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch+0x54> 4000bbb8: 01 00 00 00 nop */ RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void ) { RTEMS_COMPILER_MEMORY_BARRIER(); _Thread_Dispatch_disable_level -= 1; 4000bbbc: 03 10 00 7b sethi %hi(0x4001ec00), %g1 4000bbc0: c4 00 61 e0 ld [ %g1 + 0x1e0 ], %g2 ! 4001ede0 <_Thread_Dispatch_disable_level> _Thread_Unnest_dispatch(); _POSIX_Thread_Exit( the_thread, PTHREAD_CANCELED ); 4000bbc4: 92 10 3f ff mov -1, %o1 4000bbc8: 84 00 bf ff add %g2, -1, %g2 4000bbcc: c4 20 61 e0 st %g2, [ %g1 + 0x1e0 ] 4000bbd0: 82 13 c0 00 mov %o7, %g1 4000bbd4: 40 00 01 ab call 4000c280 <_POSIX_Thread_Exit> 4000bbd8: 9e 10 40 00 mov %g1, %o7 } else _Thread_Enable_dispatch(); 4000bbdc: 82 13 c0 00 mov %o7, %g1 4000bbe0: 7f ff f3 7a call 400089c8 <_Thread_Enable_dispatch> 4000bbe4: 9e 10 40 00 mov %g1, %o7 =============================================================================== 4000cefc <_POSIX_Thread_Translate_sched_param>: int policy, struct sched_param *param, Thread_CPU_budget_algorithms *budget_algorithm, Thread_CPU_budget_algorithm_callout *budget_callout ) { 4000cefc: 9d e3 bf a0 save %sp, -96, %sp if ( !_POSIX_Priority_Is_valid( param->sched_priority ) ) 4000cf00: 7f ff ff f4 call 4000ced0 <_POSIX_Priority_Is_valid> 4000cf04: d0 06 40 00 ld [ %i1 ], %o0 4000cf08: 80 8a 20 ff btst 0xff, %o0 4000cf0c: 02 80 00 37 be 4000cfe8 <_POSIX_Thread_Translate_sched_param+0xec><== NEVER TAKEN 4000cf10: 80 a6 20 00 cmp %i0, 0 return EINVAL; *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE; 4000cf14: c0 26 80 00 clr [ %i2 ] *budget_callout = NULL; if ( policy == SCHED_OTHER ) { 4000cf18: 12 80 00 06 bne 4000cf30 <_POSIX_Thread_Translate_sched_param+0x34> 4000cf1c: c0 26 c0 00 clr [ %i3 ] *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE; 4000cf20: 82 10 20 01 mov 1, %g1 4000cf24: c2 26 80 00 st %g1, [ %i2 ] return 0; 4000cf28: 81 c7 e0 08 ret 4000cf2c: 81 e8 00 00 restore } if ( policy == SCHED_FIFO ) { 4000cf30: 80 a6 20 01 cmp %i0, 1 4000cf34: 12 80 00 04 bne 4000cf44 <_POSIX_Thread_Translate_sched_param+0x48> 4000cf38: 80 a6 20 02 cmp %i0, 2 *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE; 4000cf3c: 10 80 00 29 b 4000cfe0 <_POSIX_Thread_Translate_sched_param+0xe4> 4000cf40: c0 26 80 00 clr [ %i2 ] return 0; } if ( policy == SCHED_RR ) { 4000cf44: 12 80 00 04 bne 4000cf54 <_POSIX_Thread_Translate_sched_param+0x58> 4000cf48: 80 a6 20 04 cmp %i0, 4 *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_EXHAUST_TIMESLICE; 4000cf4c: 10 80 00 25 b 4000cfe0 <_POSIX_Thread_Translate_sched_param+0xe4> 4000cf50: f0 26 80 00 st %i0, [ %i2 ] return 0; } if ( policy == SCHED_SPORADIC ) { 4000cf54: 12 80 00 25 bne 4000cfe8 <_POSIX_Thread_Translate_sched_param+0xec> 4000cf58: 01 00 00 00 nop if ( (param->sched_ss_repl_period.tv_sec == 0) && 4000cf5c: c2 06 60 08 ld [ %i1 + 8 ], %g1 4000cf60: 80 a0 60 00 cmp %g1, 0 4000cf64: 32 80 00 07 bne,a 4000cf80 <_POSIX_Thread_Translate_sched_param+0x84> 4000cf68: c2 06 60 10 ld [ %i1 + 0x10 ], %g1 (param->sched_ss_repl_period.tv_nsec == 0) ) 4000cf6c: c2 06 60 0c ld [ %i1 + 0xc ], %g1 4000cf70: 80 a0 60 00 cmp %g1, 0 4000cf74: 02 80 00 1d be 4000cfe8 <_POSIX_Thread_Translate_sched_param+0xec> 4000cf78: 01 00 00 00 nop return EINVAL; if ( (param->sched_ss_init_budget.tv_sec == 0) && 4000cf7c: c2 06 60 10 ld [ %i1 + 0x10 ], %g1 4000cf80: 80 a0 60 00 cmp %g1, 0 4000cf84: 12 80 00 06 bne 4000cf9c <_POSIX_Thread_Translate_sched_param+0xa0> 4000cf88: 01 00 00 00 nop (param->sched_ss_init_budget.tv_nsec == 0) ) 4000cf8c: c2 06 60 14 ld [ %i1 + 0x14 ], %g1 4000cf90: 80 a0 60 00 cmp %g1, 0 4000cf94: 02 80 00 15 be 4000cfe8 <_POSIX_Thread_Translate_sched_param+0xec> 4000cf98: 01 00 00 00 nop return EINVAL; if ( _Timespec_To_ticks( ¶m->sched_ss_repl_period ) < 4000cf9c: 7f ff f5 a9 call 4000a640 <_Timespec_To_ticks> 4000cfa0: 90 06 60 08 add %i1, 8, %o0 4000cfa4: b0 10 00 08 mov %o0, %i0 4000cfa8: 7f ff f5 a6 call 4000a640 <_Timespec_To_ticks> 4000cfac: 90 06 60 10 add %i1, 0x10, %o0 4000cfb0: 80 a6 00 08 cmp %i0, %o0 4000cfb4: 0a 80 00 0d bcs 4000cfe8 <_POSIX_Thread_Translate_sched_param+0xec> 4000cfb8: 01 00 00 00 nop _Timespec_To_ticks( ¶m->sched_ss_init_budget ) ) return EINVAL; if ( !_POSIX_Priority_Is_valid( param->sched_ss_low_priority ) ) 4000cfbc: 7f ff ff c5 call 4000ced0 <_POSIX_Priority_Is_valid> 4000cfc0: d0 06 60 04 ld [ %i1 + 4 ], %o0 4000cfc4: 80 8a 20 ff btst 0xff, %o0 4000cfc8: 02 80 00 08 be 4000cfe8 <_POSIX_Thread_Translate_sched_param+0xec> 4000cfcc: 82 10 20 03 mov 3, %g1 return EINVAL; *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_CALLOUT; 4000cfd0: c2 26 80 00 st %g1, [ %i2 ] *budget_callout = _POSIX_Threads_Sporadic_budget_callout; 4000cfd4: 03 10 00 1b sethi %hi(0x40006c00), %g1 4000cfd8: 82 10 60 50 or %g1, 0x50, %g1 ! 40006c50 <_POSIX_Threads_Sporadic_budget_callout> 4000cfdc: c2 26 c0 00 st %g1, [ %i3 ] return 0; 4000cfe0: 81 c7 e0 08 ret 4000cfe4: 91 e8 20 00 restore %g0, 0, %o0 } return EINVAL; } 4000cfe8: 81 c7 e0 08 ret 4000cfec: 91 e8 20 16 restore %g0, 0x16, %o0 =============================================================================== 400069b4 <_POSIX_Threads_Initialize_user_threads_body>: * * Output parameters: NONE */ void _POSIX_Threads_Initialize_user_threads_body(void) { 400069b4: 9d e3 bf 60 save %sp, -160, %sp uint32_t maximum; posix_initialization_threads_table *user_threads; pthread_t thread_id; pthread_attr_t attr; user_threads = Configuration_POSIX_API.User_initialization_threads_table; 400069b8: 03 10 00 78 sethi %hi(0x4001e000), %g1 400069bc: 82 10 61 fc or %g1, 0x1fc, %g1 ! 4001e1fc maximum = Configuration_POSIX_API.number_of_initialization_threads; 400069c0: e6 00 60 30 ld [ %g1 + 0x30 ], %l3 if ( !user_threads || maximum == 0 ) 400069c4: 80 a4 e0 00 cmp %l3, 0 400069c8: 02 80 00 1d be 40006a3c <_POSIX_Threads_Initialize_user_threads_body+0x88><== NEVER TAKEN 400069cc: e2 00 60 34 ld [ %g1 + 0x34 ], %l1 400069d0: 80 a4 60 00 cmp %l1, 0 400069d4: 02 80 00 1a be 40006a3c <_POSIX_Threads_Initialize_user_threads_body+0x88><== NEVER TAKEN 400069d8: a4 10 20 00 clr %l2 for ( index=0 ; index < maximum ; index++ ) { /* * There is no way for these calls to fail in this situation. */ (void) pthread_attr_init( &attr ); 400069dc: a0 07 bf c0 add %fp, -64, %l0 (void) pthread_attr_setinheritsched( &attr, PTHREAD_EXPLICIT_SCHED ); (void) pthread_attr_setstacksize(&attr, user_threads[ index ].stack_size); status = pthread_create( 400069e0: a8 07 bf fc add %fp, -4, %l4 for ( index=0 ; index < maximum ; index++ ) { /* * There is no way for these calls to fail in this situation. */ (void) pthread_attr_init( &attr ); 400069e4: 40 00 19 83 call 4000cff0 400069e8: 90 10 00 10 mov %l0, %o0 (void) pthread_attr_setinheritsched( &attr, PTHREAD_EXPLICIT_SCHED ); 400069ec: 92 10 20 02 mov 2, %o1 400069f0: 40 00 19 8b call 4000d01c 400069f4: 90 10 00 10 mov %l0, %o0 (void) pthread_attr_setstacksize(&attr, user_threads[ index ].stack_size); 400069f8: d2 04 60 04 ld [ %l1 + 4 ], %o1 400069fc: 40 00 19 98 call 4000d05c 40006a00: 90 10 00 10 mov %l0, %o0 status = pthread_create( 40006a04: d4 04 40 00 ld [ %l1 ], %o2 40006a08: 90 10 00 14 mov %l4, %o0 40006a0c: 92 10 00 10 mov %l0, %o1 40006a10: 7f ff ff 34 call 400066e0 40006a14: 96 10 20 00 clr %o3 &thread_id, &attr, user_threads[ index ].thread_entry, NULL ); if ( status ) 40006a18: 94 92 20 00 orcc %o0, 0, %o2 40006a1c: 22 80 00 05 be,a 40006a30 <_POSIX_Threads_Initialize_user_threads_body+0x7c> 40006a20: a4 04 a0 01 inc %l2 _Internal_error_Occurred( INTERNAL_ERROR_POSIX_API, true, status ); 40006a24: 90 10 20 02 mov 2, %o0 40006a28: 40 00 07 a6 call 400088c0 <_Internal_error_Occurred> 40006a2c: 92 10 20 01 mov 1, %o1 * * Setting the attributes explicitly is critical, since we don't want * to inherit the idle tasks attributes. */ for ( index=0 ; index < maximum ; index++ ) { 40006a30: 80 a4 80 13 cmp %l2, %l3 40006a34: 0a bf ff ec bcs 400069e4 <_POSIX_Threads_Initialize_user_threads_body+0x30><== NEVER TAKEN 40006a38: a2 04 60 08 add %l1, 8, %l1 40006a3c: 81 c7 e0 08 ret 40006a40: 81 e8 00 00 restore =============================================================================== 4000be04 <_POSIX_Threads_Sporadic_budget_TSR>: */ void _POSIX_Threads_Sporadic_budget_TSR( Objects_Id id __attribute__((unused)), void *argument ) { 4000be04: 9d e3 bf a0 save %sp, -96, %sp Thread_Control *the_thread; POSIX_API_Control *api; the_thread = argument; api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 4000be08: e0 06 61 60 ld [ %i1 + 0x160 ], %l0 /* ticks is guaranteed to be at least one */ ticks = _Timespec_To_ticks( &api->schedparam.sched_ss_init_budget ); 4000be0c: 40 00 04 60 call 4000cf8c <_Timespec_To_ticks> 4000be10: 90 04 20 94 add %l0, 0x94, %o0 4000be14: 03 10 00 73 sethi %hi(0x4001cc00), %g1 4000be18: c4 04 20 84 ld [ %l0 + 0x84 ], %g2 4000be1c: d2 08 62 b4 ldub [ %g1 + 0x2b4 ], %o1 */ #if 0 printk( "TSR %d %d %d\n", the_thread->resource_count, the_thread->current_priority, new_priority ); #endif if ( the_thread->resource_count == 0 ) { 4000be20: c2 06 60 1c ld [ %i1 + 0x1c ], %g1 4000be24: 92 22 40 02 sub %o1, %g2, %o1 api = the_thread->API_Extensions[ THREAD_API_POSIX ]; /* ticks is guaranteed to be at least one */ ticks = _Timespec_To_ticks( &api->schedparam.sched_ss_init_budget ); the_thread->cpu_time_budget = ticks; 4000be28: d0 26 60 78 st %o0, [ %i1 + 0x78 ] */ #if 0 printk( "TSR %d %d %d\n", the_thread->resource_count, the_thread->current_priority, new_priority ); #endif if ( the_thread->resource_count == 0 ) { 4000be2c: 80 a0 60 00 cmp %g1, 0 4000be30: 12 80 00 08 bne 4000be50 <_POSIX_Threads_Sporadic_budget_TSR+0x4c><== NEVER TAKEN 4000be34: d2 26 60 18 st %o1, [ %i1 + 0x18 ] /* * If this would make them less important, then do not change it. */ if ( the_thread->current_priority > new_priority ) { 4000be38: c2 06 60 14 ld [ %i1 + 0x14 ], %g1 4000be3c: 80 a0 40 09 cmp %g1, %o1 4000be40: 08 80 00 04 bleu 4000be50 <_POSIX_Threads_Sporadic_budget_TSR+0x4c> 4000be44: 90 10 00 19 mov %i1, %o0 _Thread_Change_priority( the_thread, new_priority, true ); 4000be48: 7f ff f0 91 call 4000808c <_Thread_Change_priority> 4000be4c: 94 10 20 01 mov 1, %o2 #endif } } /* ticks is guaranteed to be at least one */ ticks = _Timespec_To_ticks( &api->schedparam.sched_ss_repl_period ); 4000be50: 40 00 04 4f call 4000cf8c <_Timespec_To_ticks> 4000be54: 90 04 20 8c add %l0, 0x8c, %o0 ) { the_watchdog->initial = units; _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 4000be58: 31 10 00 76 sethi %hi(0x4001d800), %i0 Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 4000be5c: d0 24 20 b0 st %o0, [ %l0 + 0xb0 ] _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 4000be60: b2 04 20 a4 add %l0, 0xa4, %i1 4000be64: 7f ff f6 53 call 400097b0 <_Watchdog_Insert> 4000be68: 91 ee 22 4c restore %i0, 0x24c, %o0 =============================================================================== 4000bdb4 <_POSIX_Threads_Sporadic_budget_callout>: ) { POSIX_API_Control *api; uint32_t new_priority; api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 4000bdb4: c4 02 21 60 ld [ %o0 + 0x160 ], %g2 RTEMS_INLINE_ROUTINE Priority_Control _POSIX_Priority_To_core( int priority ) { return (Priority_Control) (POSIX_SCHEDULER_MAXIMUM_PRIORITY - priority + 1); 4000bdb8: c6 00 a0 88 ld [ %g2 + 0x88 ], %g3 4000bdbc: 05 10 00 73 sethi %hi(0x4001cc00), %g2 4000bdc0: d2 08 a2 b4 ldub [ %g2 + 0x2b4 ], %o1 ! 4001ceb4 */ #if 0 printk( "callout %d %d %d\n", the_thread->resource_count, the_thread->current_priority, new_priority ); #endif if ( the_thread->resource_count == 0 ) { 4000bdc4: c4 02 20 1c ld [ %o0 + 0x1c ], %g2 4000bdc8: 92 22 40 03 sub %o1, %g3, %o1 /* * This will prevent the thread from consuming its entire "budget" * while at low priority. */ the_thread->cpu_time_budget = 0xFFFFFFFF; /* XXX should be based on MAX_U32 */ 4000bdcc: 86 10 3f ff mov -1, %g3 new_priority = _POSIX_Priority_To_core(api->schedparam.sched_ss_low_priority); the_thread->real_priority = new_priority; 4000bdd0: d2 22 20 18 st %o1, [ %o0 + 0x18 ] */ #if 0 printk( "callout %d %d %d\n", the_thread->resource_count, the_thread->current_priority, new_priority ); #endif if ( the_thread->resource_count == 0 ) { 4000bdd4: 80 a0 a0 00 cmp %g2, 0 4000bdd8: 12 80 00 09 bne 4000bdfc <_POSIX_Threads_Sporadic_budget_callout+0x48><== NEVER TAKEN 4000bddc: c6 22 20 78 st %g3, [ %o0 + 0x78 ] /* * Make sure we are actually lowering it. If they have lowered it * to logically lower than sched_ss_low_priority, then we do not want to * change it. */ if ( the_thread->current_priority < new_priority ) { 4000bde0: c2 02 20 14 ld [ %o0 + 0x14 ], %g1 4000bde4: 80 a0 40 09 cmp %g1, %o1 4000bde8: 1a 80 00 05 bcc 4000bdfc <_POSIX_Threads_Sporadic_budget_callout+0x48><== NEVER TAKEN 4000bdec: 94 10 20 01 mov 1, %o2 _Thread_Change_priority( the_thread, new_priority, true ); 4000bdf0: 82 13 c0 00 mov %o7, %g1 4000bdf4: 7f ff f0 a6 call 4000808c <_Thread_Change_priority> 4000bdf8: 9e 10 40 00 mov %g1, %o7 4000bdfc: 81 c3 e0 08 retl <== NOT EXECUTED =============================================================================== 400066c0 <_POSIX_Timer_TSR>: * This is the operation that is run when a timer expires */ void _POSIX_Timer_TSR( Objects_Id timer __attribute__((unused)), void *data) { 400066c0: 9d e3 bf a0 save %sp, -96, %sp bool activated; ptimer = (POSIX_Timer_Control *)data; /* Increment the number of expirations. */ ptimer->overrun = ptimer->overrun + 1; 400066c4: c4 06 60 68 ld [ %i1 + 0x68 ], %g2 /* The timer must be reprogrammed */ if ( ( ptimer->timer_data.it_interval.tv_sec != 0 ) || 400066c8: c2 06 60 54 ld [ %i1 + 0x54 ], %g1 bool activated; ptimer = (POSIX_Timer_Control *)data; /* Increment the number of expirations. */ ptimer->overrun = ptimer->overrun + 1; 400066cc: 84 00 a0 01 inc %g2 /* The timer must be reprogrammed */ if ( ( ptimer->timer_data.it_interval.tv_sec != 0 ) || 400066d0: 80 a0 60 00 cmp %g1, 0 400066d4: 12 80 00 06 bne 400066ec <_POSIX_Timer_TSR+0x2c> 400066d8: c4 26 60 68 st %g2, [ %i1 + 0x68 ] ( ptimer->timer_data.it_interval.tv_nsec != 0 ) ) { 400066dc: c2 06 60 58 ld [ %i1 + 0x58 ], %g1 400066e0: 80 a0 60 00 cmp %g1, 0 400066e4: 02 80 00 0f be 40006720 <_POSIX_Timer_TSR+0x60> <== NEVER TAKEN 400066e8: 82 10 20 04 mov 4, %g1 activated = _POSIX_Timer_Insert_helper( 400066ec: d2 06 60 64 ld [ %i1 + 0x64 ], %o1 400066f0: d4 06 60 08 ld [ %i1 + 8 ], %o2 400066f4: 90 06 60 10 add %i1, 0x10, %o0 400066f8: 17 10 00 19 sethi %hi(0x40006400), %o3 400066fc: 98 10 00 19 mov %i1, %o4 40006700: 40 00 19 30 call 4000cbc0 <_POSIX_Timer_Insert_helper> 40006704: 96 12 e2 c0 or %o3, 0x2c0, %o3 ptimer->ticks, ptimer->Object.id, _POSIX_Timer_TSR, ptimer ); if ( !activated ) 40006708: 80 8a 20 ff btst 0xff, %o0 4000670c: 02 80 00 0a be 40006734 <_POSIX_Timer_TSR+0x74> <== NEVER TAKEN 40006710: 01 00 00 00 nop return; /* Store the time when the timer was started again */ _TOD_Get( &ptimer->time ); 40006714: 40 00 05 ac call 40007dc4 <_TOD_Get> 40006718: 90 06 60 6c add %i1, 0x6c, %o0 4000671c: 82 10 20 03 mov 3, %g1 /* * The sending of the signal to the process running the handling function * specified for that signal is simulated */ if ( pthread_kill ( ptimer->thread_id, ptimer->inf.sigev_signo ) ) { 40006720: d0 06 60 38 ld [ %i1 + 0x38 ], %o0 40006724: d2 06 60 44 ld [ %i1 + 0x44 ], %o1 40006728: 40 00 18 10 call 4000c768 4000672c: c2 2e 60 3c stb %g1, [ %i1 + 0x3c ] } /* After the signal handler returns, the count of expirations of the * timer must be set to 0. */ ptimer->overrun = 0; 40006730: c0 26 60 68 clr [ %i1 + 0x68 ] 40006734: 81 c7 e0 08 ret 40006738: 81 e8 00 00 restore =============================================================================== 4000dfc8 <_POSIX_signals_Check_signal>: bool _POSIX_signals_Check_signal( POSIX_API_Control *api, int signo, bool is_global ) { 4000dfc8: 9d e3 bf 90 save %sp, -112, %sp siginfo_t siginfo_struct; sigset_t saved_signals_blocked; if ( ! _POSIX_signals_Clear_signals( api, signo, &siginfo_struct, 4000dfcc: 98 10 20 01 mov 1, %o4 4000dfd0: 96 0e a0 ff and %i2, 0xff, %o3 4000dfd4: a0 07 bf f4 add %fp, -12, %l0 4000dfd8: 90 10 00 18 mov %i0, %o0 4000dfdc: 92 10 00 19 mov %i1, %o1 4000dfe0: 40 00 00 22 call 4000e068 <_POSIX_signals_Clear_signals> 4000dfe4: 94 10 00 10 mov %l0, %o2 4000dfe8: 80 8a 20 ff btst 0xff, %o0 4000dfec: 02 80 00 1d be 4000e060 <_POSIX_signals_Check_signal+0x98> 4000dff0: 83 2e 60 02 sll %i1, 2, %g1 #endif /* * Just to prevent sending a signal which is currently being ignored. */ if ( _POSIX_signals_Vectors[ signo ].sa_handler == SIG_IGN ) 4000dff4: 07 10 00 77 sethi %hi(0x4001dc00), %g3 4000dff8: 85 2e 60 04 sll %i1, 4, %g2 4000dffc: 86 10 e3 04 or %g3, 0x304, %g3 4000e000: 84 20 80 01 sub %g2, %g1, %g2 4000e004: 88 00 c0 02 add %g3, %g2, %g4 4000e008: c2 01 20 08 ld [ %g4 + 8 ], %g1 4000e00c: 80 a0 60 01 cmp %g1, 1 4000e010: 02 80 00 14 be 4000e060 <_POSIX_signals_Check_signal+0x98><== NEVER TAKEN 4000e014: 01 00 00 00 nop /* * Block the signals requested in sa_mask */ saved_signals_blocked = api->signals_blocked; api->signals_blocked |= _POSIX_signals_Vectors[ signo ].sa_mask; 4000e018: c8 01 20 04 ld [ %g4 + 4 ], %g4 return false; /* * Block the signals requested in sa_mask */ saved_signals_blocked = api->signals_blocked; 4000e01c: e2 06 20 cc ld [ %i0 + 0xcc ], %l1 api->signals_blocked |= _POSIX_signals_Vectors[ signo ].sa_mask; /* * Here, the signal handler function executes */ switch ( _POSIX_signals_Vectors[ signo ].sa_flags ) { 4000e020: c4 00 c0 02 ld [ %g3 + %g2 ], %g2 /* * Block the signals requested in sa_mask */ saved_signals_blocked = api->signals_blocked; api->signals_blocked |= _POSIX_signals_Vectors[ signo ].sa_mask; 4000e024: 86 11 00 11 or %g4, %l1, %g3 /* * Here, the signal handler function executes */ switch ( _POSIX_signals_Vectors[ signo ].sa_flags ) { 4000e028: 80 a0 a0 02 cmp %g2, 2 4000e02c: 12 80 00 08 bne 4000e04c <_POSIX_signals_Check_signal+0x84> 4000e030: c6 26 20 cc st %g3, [ %i0 + 0xcc ] case SA_SIGINFO: (*_POSIX_signals_Vectors[ signo ].sa_sigaction)( 4000e034: 90 10 00 19 mov %i1, %o0 4000e038: 92 10 00 10 mov %l0, %o1 4000e03c: 9f c0 40 00 call %g1 4000e040: 94 10 20 00 clr %o2 signo, &siginfo_struct, NULL /* context is undefined per 1003.1b-1993, p. 66 */ ); break; 4000e044: 10 80 00 05 b 4000e058 <_POSIX_signals_Check_signal+0x90> 4000e048: e2 26 20 cc st %l1, [ %i0 + 0xcc ] default: (*_POSIX_signals_Vectors[ signo ].sa_handler)( signo ); 4000e04c: 9f c0 40 00 call %g1 4000e050: 90 10 00 19 mov %i1, %o0 } /* * Restore the previous set of blocked signals */ api->signals_blocked = saved_signals_blocked; 4000e054: e2 26 20 cc st %l1, [ %i0 + 0xcc ] return true; 4000e058: 81 c7 e0 08 ret 4000e05c: 91 e8 20 01 restore %g0, 1, %o0 } 4000e060: 81 c7 e0 08 ret 4000e064: 91 e8 20 00 restore %g0, 0, %o0 =============================================================================== 4000f148 <_POSIX_signals_Clear_process_signals>: */ void _POSIX_signals_Clear_process_signals( int signo ) { 4000f148: 9d e3 bf a0 save %sp, -96, %sp clear_signal = true; mask = signo_to_mask( signo ); ISR_Level level; _ISR_Disable( level ); 4000f14c: 7f ff cb 00 call 40001d4c 4000f150: 01 00 00 00 nop if ( _POSIX_signals_Vectors[ signo ].sa_flags == SA_SIGINFO ) { 4000f154: 85 2e 20 04 sll %i0, 4, %g2 4000f158: 83 2e 20 02 sll %i0, 2, %g1 4000f15c: 82 20 80 01 sub %g2, %g1, %g1 4000f160: 05 10 00 77 sethi %hi(0x4001dc00), %g2 4000f164: 84 10 a3 04 or %g2, 0x304, %g2 ! 4001df04 <_POSIX_signals_Vectors> 4000f168: c4 00 80 01 ld [ %g2 + %g1 ], %g2 4000f16c: 80 a0 a0 02 cmp %g2, 2 4000f170: 12 80 00 0a bne 4000f198 <_POSIX_signals_Clear_process_signals+0x50> 4000f174: 05 10 00 78 sethi %hi(0x4001e000), %g2 if ( !_Chain_Is_empty( &_POSIX_signals_Siginfo[ signo ] ) ) 4000f178: 05 10 00 78 sethi %hi(0x4001e000), %g2 4000f17c: 84 10 a0 fc or %g2, 0xfc, %g2 ! 4001e0fc <_POSIX_signals_Siginfo> 4000f180: c6 00 40 02 ld [ %g1 + %g2 ], %g3 4000f184: 82 00 40 02 add %g1, %g2, %g1 4000f188: 82 00 60 04 add %g1, 4, %g1 4000f18c: 80 a0 c0 01 cmp %g3, %g1 4000f190: 12 80 00 0e bne 4000f1c8 <_POSIX_signals_Clear_process_signals+0x80><== NEVER TAKEN 4000f194: 05 10 00 78 sethi %hi(0x4001e000), %g2 clear_signal = false; } if ( clear_signal ) { _POSIX_signals_Pending &= ~mask; 4000f198: c6 00 a0 f8 ld [ %g2 + 0xf8 ], %g3 ! 4001e0f8 <_POSIX_signals_Pending> 4000f19c: b0 06 3f ff add %i0, -1, %i0 4000f1a0: 82 10 20 01 mov 1, %g1 4000f1a4: 83 28 40 18 sll %g1, %i0, %g1 4000f1a8: 82 28 c0 01 andn %g3, %g1, %g1 if ( !_POSIX_signals_Pending ) 4000f1ac: 80 a0 60 00 cmp %g1, 0 4000f1b0: 12 80 00 06 bne 4000f1c8 <_POSIX_signals_Clear_process_signals+0x80><== NEVER TAKEN 4000f1b4: c2 20 a0 f8 st %g1, [ %g2 + 0xf8 ] _Thread_Do_post_task_switch_extension--; 4000f1b8: 03 10 00 76 sethi %hi(0x4001d800), %g1 4000f1bc: c4 00 62 10 ld [ %g1 + 0x210 ], %g2 ! 4001da10 <_Thread_Do_post_task_switch_extension> 4000f1c0: 84 00 bf ff add %g2, -1, %g2 4000f1c4: c4 20 62 10 st %g2, [ %g1 + 0x210 ] } _ISR_Enable( level ); 4000f1c8: 7f ff ca e5 call 40001d5c 4000f1cc: 91 e8 00 08 restore %g0, %o0, %o0 =============================================================================== 4000715c <_POSIX_signals_Get_highest>: #include int _POSIX_signals_Get_highest( sigset_t set ) { 4000715c: 82 10 20 1b mov 0x1b, %g1 ! 1b int signo; for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) { if ( set & signo_to_mask( signo ) ) { 40007160: 84 10 20 01 mov 1, %g2 40007164: 86 00 7f ff add %g1, -1, %g3 40007168: 87 28 80 03 sll %g2, %g3, %g3 4000716c: 80 88 c0 08 btst %g3, %o0 40007170: 12 80 00 11 bne 400071b4 <_POSIX_signals_Get_highest+0x58><== NEVER TAKEN 40007174: 01 00 00 00 nop sigset_t set ) { int signo; for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) { 40007178: 82 00 60 01 inc %g1 4000717c: 80 a0 60 20 cmp %g1, 0x20 40007180: 12 bf ff fa bne 40007168 <_POSIX_signals_Get_highest+0xc> 40007184: 86 00 7f ff add %g1, -1, %g3 40007188: 82 10 20 01 mov 1, %g1 #if (SIGHUP != 1) #error "Assumption that SIGHUP==1 violated!!" #endif for ( signo = SIGHUP ; signo <= __SIGLASTNOTRT ; signo++ ) { if ( set & signo_to_mask( signo ) ) { 4000718c: 84 10 20 01 mov 1, %g2 40007190: 86 00 7f ff add %g1, -1, %g3 40007194: 87 28 80 03 sll %g2, %g3, %g3 40007198: 80 88 c0 08 btst %g3, %o0 4000719c: 12 80 00 06 bne 400071b4 <_POSIX_signals_Get_highest+0x58> 400071a0: 01 00 00 00 nop */ #if (SIGHUP != 1) #error "Assumption that SIGHUP==1 violated!!" #endif for ( signo = SIGHUP ; signo <= __SIGLASTNOTRT ; signo++ ) { 400071a4: 82 00 60 01 inc %g1 400071a8: 80 a0 60 1b cmp %g1, 0x1b 400071ac: 12 bf ff fa bne 40007194 <_POSIX_signals_Get_highest+0x38><== ALWAYS TAKEN 400071b0: 86 00 7f ff add %g1, -1, %g3 * a return 0. This routine will NOT be called unless a signal * is pending in the set passed in. */ found_it: return signo; } 400071b4: 81 c3 e0 08 retl 400071b8: 90 10 00 01 mov %g1, %o0 =============================================================================== 4000f218 <_POSIX_signals_Unblock_thread>: bool _POSIX_signals_Unblock_thread( Thread_Control *the_thread, int signo, siginfo_t *info ) { 4000f218: 9d e3 bf a0 save %sp, -96, %sp /* * Is the thread is specifically waiting for a signal? */ if ( _States_Is_interruptible_signal( the_thread->current_state ) ) { 4000f21c: c2 06 20 10 ld [ %i0 + 0x10 ], %g1 4000f220: 09 04 00 20 sethi %hi(0x10008000), %g4 4000f224: 86 06 7f ff add %i1, -1, %g3 4000f228: 9a 08 40 04 and %g1, %g4, %o5 4000f22c: 84 10 20 01 mov 1, %g2 4000f230: 80 a3 40 04 cmp %o5, %g4 bool _POSIX_signals_Unblock_thread( Thread_Control *the_thread, int signo, siginfo_t *info ) { 4000f234: 92 10 00 1a mov %i2, %o1 4000f238: 87 28 80 03 sll %g2, %g3, %g3 /* * Is the thread is specifically waiting for a signal? */ if ( _States_Is_interruptible_signal( the_thread->current_state ) ) { 4000f23c: 12 80 00 1a bne 4000f2a4 <_POSIX_signals_Unblock_thread+0x8c> 4000f240: c8 06 21 60 ld [ %i0 + 0x160 ], %g4 if ( (the_thread->Wait.option & mask) || (~api->signals_blocked & mask) ) { 4000f244: c2 06 20 30 ld [ %i0 + 0x30 ], %g1 4000f248: 80 88 c0 01 btst %g3, %g1 4000f24c: 12 80 00 06 bne 4000f264 <_POSIX_signals_Unblock_thread+0x4c> 4000f250: 82 10 20 04 mov 4, %g1 4000f254: c2 01 20 cc ld [ %g4 + 0xcc ], %g1 4000f258: 80 a8 c0 01 andncc %g3, %g1, %g0 4000f25c: 02 80 00 38 be 4000f33c <_POSIX_signals_Unblock_thread+0x124> 4000f260: 82 10 20 04 mov 4, %g1 the_thread->Wait.return_code = EINTR; 4000f264: c2 26 20 34 st %g1, [ %i0 + 0x34 ] the_info = (siginfo_t *) the_thread->Wait.return_argument; if ( !info ) { 4000f268: 80 a2 60 00 cmp %o1, 0 4000f26c: 12 80 00 07 bne 4000f288 <_POSIX_signals_Unblock_thread+0x70> 4000f270: d0 06 20 28 ld [ %i0 + 0x28 ], %o0 the_info->si_signo = signo; the_info->si_code = SI_USER; 4000f274: 82 10 20 01 mov 1, %g1 the_thread->Wait.return_code = EINTR; the_info = (siginfo_t *) the_thread->Wait.return_argument; if ( !info ) { the_info->si_signo = signo; 4000f278: f2 22 00 00 st %i1, [ %o0 ] the_info->si_code = SI_USER; the_info->si_value.sival_int = 0; 4000f27c: c0 22 20 08 clr [ %o0 + 8 ] the_info = (siginfo_t *) the_thread->Wait.return_argument; if ( !info ) { the_info->si_signo = signo; the_info->si_code = SI_USER; 4000f280: 10 80 00 04 b 4000f290 <_POSIX_signals_Unblock_thread+0x78> 4000f284: c2 22 20 04 st %g1, [ %o0 + 4 ] the_info->si_value.sival_int = 0; } else { *the_info = *info; 4000f288: 40 00 02 d1 call 4000fdcc 4000f28c: 94 10 20 0c mov 0xc, %o2 } _Thread_queue_Extract_with_proxy( the_thread ); 4000f290: 90 10 00 18 mov %i0, %o0 4000f294: 7f ff e6 d1 call 40008dd8 <_Thread_queue_Extract_with_proxy> 4000f298: b0 10 20 01 mov 1, %i0 return true; 4000f29c: 81 c7 e0 08 ret 4000f2a0: 81 e8 00 00 restore } /* * Thread is not waiting due to a sigwait. */ if ( ~api->signals_blocked & mask ) { 4000f2a4: c8 01 20 cc ld [ %g4 + 0xcc ], %g4 4000f2a8: 80 a8 c0 04 andncc %g3, %g4, %g0 4000f2ac: 02 80 00 24 be 4000f33c <_POSIX_signals_Unblock_thread+0x124> 4000f2b0: 07 04 00 00 sethi %hi(0x10000000), %g3 * + Any other combination, do nothing. */ the_thread->do_post_task_switch_extension = true; if ( the_thread->current_state & STATES_INTERRUPTIBLE_BY_SIGNAL ) { 4000f2b4: 80 88 40 03 btst %g1, %g3 4000f2b8: 02 80 00 12 be 4000f300 <_POSIX_signals_Unblock_thread+0xe8> 4000f2bc: c4 2e 20 74 stb %g2, [ %i0 + 0x74 ] the_thread->Wait.return_code = EINTR; 4000f2c0: 84 10 20 04 mov 4, %g2 #if 0 if ( _States_Is_waiting_on_thread_queue(the_thread->current_state) ) _Thread_queue_Extract_with_proxy( the_thread ); else #endif if ( _States_Is_delaying(the_thread->current_state) ){ 4000f2c4: 80 88 60 08 btst 8, %g1 4000f2c8: 02 80 00 1d be 4000f33c <_POSIX_signals_Unblock_thread+0x124><== NEVER TAKEN 4000f2cc: c4 26 20 34 st %g2, [ %i0 + 0x34 ] if ( _Watchdog_Is_active( &the_thread->Timer ) ) 4000f2d0: c2 06 20 50 ld [ %i0 + 0x50 ], %g1 4000f2d4: 80 a0 60 02 cmp %g1, 2 4000f2d8: 12 80 00 05 bne 4000f2ec <_POSIX_signals_Unblock_thread+0xd4><== NEVER TAKEN 4000f2dc: 90 10 00 18 mov %i0, %o0 (void) _Watchdog_Remove( &the_thread->Timer ); 4000f2e0: 7f ff e9 91 call 40009924 <_Watchdog_Remove> 4000f2e4: 90 06 20 48 add %i0, 0x48, %o0 RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 4000f2e8: 90 10 00 18 mov %i0, %o0 4000f2ec: 13 04 00 ff sethi %hi(0x1003fc00), %o1 4000f2f0: 7f ff e3 e0 call 40008270 <_Thread_Clear_state> 4000f2f4: 92 12 63 f8 or %o1, 0x3f8, %o1 ! 1003fff8 _Thread_Unblock( the_thread ); } } else if ( the_thread->current_state == STATES_READY ) { if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) _ISR_Signals_to_thread_executing = true; 4000f2f8: 81 c7 e0 08 ret 4000f2fc: 91 e8 20 00 restore %g0, 0, %o0 if ( _States_Is_delaying(the_thread->current_state) ){ if ( _Watchdog_Is_active( &the_thread->Timer ) ) (void) _Watchdog_Remove( &the_thread->Timer ); _Thread_Unblock( the_thread ); } } else if ( the_thread->current_state == STATES_READY ) { 4000f300: 80 a0 60 00 cmp %g1, 0 4000f304: 12 80 00 0e bne 4000f33c <_POSIX_signals_Unblock_thread+0x124><== NEVER TAKEN 4000f308: 03 10 00 76 sethi %hi(0x4001d800), %g1 if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) 4000f30c: c2 00 62 08 ld [ %g1 + 0x208 ], %g1 ! 4001da08 <_ISR_Nest_level> 4000f310: 80 a0 60 00 cmp %g1, 0 4000f314: 02 80 00 0a be 4000f33c <_POSIX_signals_Unblock_thread+0x124> 4000f318: 03 10 00 76 sethi %hi(0x4001d800), %g1 4000f31c: c2 00 62 2c ld [ %g1 + 0x22c ], %g1 ! 4001da2c <_Thread_Executing> 4000f320: 80 a6 00 01 cmp %i0, %g1 4000f324: 12 bf ff de bne 4000f29c <_POSIX_signals_Unblock_thread+0x84><== NEVER TAKEN 4000f328: b0 10 20 00 clr %i0 _ISR_Signals_to_thread_executing = true; 4000f32c: 03 10 00 76 sethi %hi(0x4001d800), %g1 4000f330: c4 28 62 c8 stb %g2, [ %g1 + 0x2c8 ] ! 4001dac8 <_ISR_Signals_to_thread_executing> 4000f334: 81 c7 e0 08 ret 4000f338: 81 e8 00 00 restore 4000f33c: b0 10 20 00 clr %i0 } } return false; } 4000f340: 81 c7 e0 08 ret 4000f344: 81 e8 00 00 restore =============================================================================== 4000c1c8 <_RTEMS_tasks_Post_switch_extension>: */ void _RTEMS_tasks_Post_switch_extension( Thread_Control *executing ) { 4000c1c8: 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 ]; 4000c1cc: e0 06 21 5c ld [ %i0 + 0x15c ], %l0 if ( !api ) 4000c1d0: 80 a4 20 00 cmp %l0, 0 4000c1d4: 02 80 00 1d be 4000c248 <_RTEMS_tasks_Post_switch_extension+0x80><== NEVER TAKEN 4000c1d8: 01 00 00 00 nop * Signal Processing */ asr = &api->Signal; _ISR_Disable( level ); 4000c1dc: 7f ff d6 dc call 40001d4c 4000c1e0: 01 00 00 00 nop signal_set = asr->signals_posted; 4000c1e4: e6 04 20 14 ld [ %l0 + 0x14 ], %l3 asr->signals_posted = 0; 4000c1e8: c0 24 20 14 clr [ %l0 + 0x14 ] _ISR_Enable( level ); 4000c1ec: 7f ff d6 dc call 40001d5c 4000c1f0: 01 00 00 00 nop if ( !signal_set ) /* similar to _ASR_Are_signals_pending( asr ) */ 4000c1f4: 80 a4 e0 00 cmp %l3, 0 4000c1f8: 02 80 00 14 be 4000c248 <_RTEMS_tasks_Post_switch_extension+0x80> 4000c1fc: a2 07 bf fc add %fp, -4, %l1 return; asr->nest_level += 1; 4000c200: c2 04 20 1c ld [ %l0 + 0x1c ], %g1 rtems_task_mode( asr->mode_set, RTEMS_ALL_MODE_MASKS, &prev_mode ); 4000c204: d0 04 20 10 ld [ %l0 + 0x10 ], %o0 if ( !signal_set ) /* similar to _ASR_Are_signals_pending( asr ) */ return; asr->nest_level += 1; 4000c208: 82 00 60 01 inc %g1 4000c20c: c2 24 20 1c st %g1, [ %l0 + 0x1c ] rtems_task_mode( asr->mode_set, RTEMS_ALL_MODE_MASKS, &prev_mode ); 4000c210: 94 10 00 11 mov %l1, %o2 4000c214: 25 00 00 3f sethi %hi(0xfc00), %l2 4000c218: 40 00 08 74 call 4000e3e8 4000c21c: 92 14 a3 ff or %l2, 0x3ff, %o1 ! ffff (*asr->handler)( signal_set ); 4000c220: c2 04 20 0c ld [ %l0 + 0xc ], %g1 4000c224: 9f c0 40 00 call %g1 4000c228: 90 10 00 13 mov %l3, %o0 asr->nest_level -= 1; 4000c22c: c2 04 20 1c ld [ %l0 + 0x1c ], %g1 rtems_task_mode( prev_mode, RTEMS_ALL_MODE_MASKS, &prev_mode ); 4000c230: 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; 4000c234: 82 00 7f ff add %g1, -1, %g1 rtems_task_mode( prev_mode, RTEMS_ALL_MODE_MASKS, &prev_mode ); 4000c238: 92 14 a3 ff or %l2, 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; 4000c23c: c2 24 20 1c st %g1, [ %l0 + 0x1c ] rtems_task_mode( prev_mode, RTEMS_ALL_MODE_MASKS, &prev_mode ); 4000c240: 40 00 08 6a call 4000e3e8 4000c244: 94 10 00 11 mov %l1, %o2 4000c248: 81 c7 e0 08 ret 4000c24c: 81 e8 00 00 restore =============================================================================== 40007b5c <_Rate_monotonic_Timeout>: void _Rate_monotonic_Timeout( Objects_Id id, void *ignored ) { 40007b5c: 9d e3 bf 98 save %sp, -104, %sp 40007b60: 11 10 00 8d sethi %hi(0x40023400), %o0 40007b64: 92 10 00 18 mov %i0, %o1 40007b68: 90 12 22 70 or %o0, 0x270, %o0 40007b6c: 40 00 07 a6 call 40009a04 <_Objects_Get> 40007b70: 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 ) { 40007b74: c2 07 bf fc ld [ %fp + -4 ], %g1 40007b78: 80 a0 60 00 cmp %g1, 0 40007b7c: 12 80 00 26 bne 40007c14 <_Rate_monotonic_Timeout+0xb8> <== NEVER TAKEN 40007b80: a0 10 00 08 mov %o0, %l0 case OBJECTS_LOCAL: the_thread = the_period->owner; 40007b84: d0 02 20 40 ld [ %o0 + 0x40 ], %o0 if ( _States_Is_waiting_for_period( the_thread->current_state ) && 40007b88: 03 00 00 10 sethi %hi(0x4000), %g1 40007b8c: c4 02 20 10 ld [ %o0 + 0x10 ], %g2 40007b90: 80 88 80 01 btst %g2, %g1 40007b94: 22 80 00 0c be,a 40007bc4 <_Rate_monotonic_Timeout+0x68> 40007b98: c2 04 20 38 ld [ %l0 + 0x38 ], %g1 the_thread->Wait.id == the_period->Object.id ) { 40007b9c: c4 02 20 20 ld [ %o0 + 0x20 ], %g2 40007ba0: c2 04 20 08 ld [ %l0 + 8 ], %g1 40007ba4: 80 a0 80 01 cmp %g2, %g1 40007ba8: 32 80 00 07 bne,a 40007bc4 <_Rate_monotonic_Timeout+0x68> 40007bac: c2 04 20 38 ld [ %l0 + 0x38 ], %g1 RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 40007bb0: 13 04 00 ff sethi %hi(0x1003fc00), %o1 40007bb4: 40 00 08 eb call 40009f60 <_Thread_Clear_state> 40007bb8: 92 12 63 f8 or %o1, 0x3f8, %o1 ! 1003fff8 _Thread_Unblock( the_thread ); _Rate_monotonic_Initiate_statistics( the_period ); 40007bbc: 10 80 00 08 b 40007bdc <_Rate_monotonic_Timeout+0x80> 40007bc0: 90 10 00 10 mov %l0, %o0 _Watchdog_Insert_ticks( &the_period->Timer, the_period->next_length ); } else if ( the_period->state == RATE_MONOTONIC_OWNER_IS_BLOCKING ) { 40007bc4: 80 a0 60 01 cmp %g1, 1 40007bc8: 12 80 00 0e bne 40007c00 <_Rate_monotonic_Timeout+0xa4> 40007bcc: 82 10 20 04 mov 4, %g1 the_period->state = RATE_MONOTONIC_EXPIRED_WHILE_BLOCKING; 40007bd0: 82 10 20 03 mov 3, %g1 _Rate_monotonic_Initiate_statistics( the_period ); 40007bd4: 90 10 00 10 mov %l0, %o0 _Rate_monotonic_Initiate_statistics( the_period ); _Watchdog_Insert_ticks( &the_period->Timer, the_period->next_length ); } else if ( the_period->state == RATE_MONOTONIC_OWNER_IS_BLOCKING ) { the_period->state = RATE_MONOTONIC_EXPIRED_WHILE_BLOCKING; 40007bd8: c2 24 20 38 st %g1, [ %l0 + 0x38 ] _Rate_monotonic_Initiate_statistics( the_period ); 40007bdc: 7f ff fe 3e call 400074d4 <_Rate_monotonic_Initiate_statistics> 40007be0: 01 00 00 00 nop Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 40007be4: c2 04 20 3c ld [ %l0 + 0x3c ], %g1 _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 40007be8: 92 04 20 10 add %l0, 0x10, %o1 Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 40007bec: c2 24 20 1c st %g1, [ %l0 + 0x1c ] _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 40007bf0: 11 10 00 8e sethi %hi(0x40023800), %o0 40007bf4: 40 00 0f 0a call 4000b81c <_Watchdog_Insert> 40007bf8: 90 12 20 bc or %o0, 0xbc, %o0 ! 400238bc <_Watchdog_Ticks_chain> 40007bfc: 30 80 00 02 b,a 40007c04 <_Rate_monotonic_Timeout+0xa8> _Watchdog_Insert_ticks( &the_period->Timer, the_period->next_length ); } else the_period->state = RATE_MONOTONIC_EXPIRED; 40007c00: c2 24 20 38 st %g1, [ %l0 + 0x38 ] */ RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void ) { RTEMS_COMPILER_MEMORY_BARRIER(); _Thread_Dispatch_disable_level -= 1; 40007c04: 03 10 00 8d sethi %hi(0x40023400), %g1 40007c08: c4 00 63 e0 ld [ %g1 + 0x3e0 ], %g2 ! 400237e0 <_Thread_Dispatch_disable_level> 40007c0c: 84 00 bf ff add %g2, -1, %g2 40007c10: c4 20 63 e0 st %g2, [ %g1 + 0x3e0 ] 40007c14: 81 c7 e0 08 ret 40007c18: 81 e8 00 00 restore =============================================================================== 4000756c <_TOD_Validate>: */ bool _TOD_Validate( const rtems_time_of_day *the_tod ) { 4000756c: 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(); 40007570: 03 10 00 8d sethi %hi(0x40023400), %g1 if ((!the_tod) || 40007574: 80 a6 20 00 cmp %i0, 0 40007578: 02 80 00 2d be 4000762c <_TOD_Validate+0xc0> <== NEVER TAKEN 4000757c: d2 00 62 44 ld [ %g1 + 0x244 ], %o1 (the_tod->ticks >= ticks_per_second) || 40007580: 11 00 03 d0 sethi %hi(0xf4000), %o0 40007584: 40 00 5a 8a call 4001dfac <.udiv> 40007588: 90 12 22 40 or %o0, 0x240, %o0 ! f4240 4000758c: c2 06 20 18 ld [ %i0 + 0x18 ], %g1 40007590: 80 a0 40 08 cmp %g1, %o0 40007594: 1a 80 00 26 bcc 4000762c <_TOD_Validate+0xc0> 40007598: 01 00 00 00 nop (the_tod->second >= TOD_SECONDS_PER_MINUTE) || 4000759c: c2 06 20 14 ld [ %i0 + 0x14 ], %g1 400075a0: 80 a0 60 3b cmp %g1, 0x3b 400075a4: 18 80 00 22 bgu 4000762c <_TOD_Validate+0xc0> 400075a8: 01 00 00 00 nop (the_tod->minute >= TOD_MINUTES_PER_HOUR) || 400075ac: c2 06 20 10 ld [ %i0 + 0x10 ], %g1 400075b0: 80 a0 60 3b cmp %g1, 0x3b 400075b4: 18 80 00 1e bgu 4000762c <_TOD_Validate+0xc0> 400075b8: 01 00 00 00 nop (the_tod->hour >= TOD_HOURS_PER_DAY) || 400075bc: c2 06 20 0c ld [ %i0 + 0xc ], %g1 400075c0: 80 a0 60 17 cmp %g1, 0x17 400075c4: 18 80 00 1a bgu 4000762c <_TOD_Validate+0xc0> 400075c8: 01 00 00 00 nop (the_tod->month == 0) || 400075cc: c2 06 20 04 ld [ %i0 + 4 ], %g1 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) || 400075d0: 80 a0 60 00 cmp %g1, 0 400075d4: 02 80 00 16 be 4000762c <_TOD_Validate+0xc0> <== NEVER TAKEN 400075d8: 80 a0 60 0c cmp %g1, 0xc 400075dc: 18 80 00 14 bgu 4000762c <_TOD_Validate+0xc0> 400075e0: 01 00 00 00 nop (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) || 400075e4: c6 06 00 00 ld [ %i0 ], %g3 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) || 400075e8: 80 a0 e7 c3 cmp %g3, 0x7c3 400075ec: 08 80 00 10 bleu 4000762c <_TOD_Validate+0xc0> 400075f0: 01 00 00 00 nop (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) || (the_tod->day == 0) ) 400075f4: c4 06 20 08 ld [ %i0 + 8 ], %g2 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) || 400075f8: 80 a0 a0 00 cmp %g2, 0 400075fc: 02 80 00 0c be 4000762c <_TOD_Validate+0xc0> <== NEVER TAKEN 40007600: 80 88 e0 03 btst 3, %g3 40007604: 07 10 00 87 sethi %hi(0x40021c00), %g3 (the_tod->month > TOD_MONTHS_PER_YEAR) || (the_tod->year < TOD_BASE_YEAR) || (the_tod->day == 0) ) return false; if ( (the_tod->year % 4) == 0 ) 40007608: 12 80 00 03 bne 40007614 <_TOD_Validate+0xa8> 4000760c: 86 10 e1 9c or %g3, 0x19c, %g3 ! 40021d9c <_TOD_Days_per_month> days_in_month = _TOD_Days_per_month[ 1 ][ the_tod->month ]; 40007610: 82 00 60 0d add %g1, 0xd, %g1 else days_in_month = _TOD_Days_per_month[ 0 ][ the_tod->month ]; 40007614: 83 28 60 02 sll %g1, 2, %g1 40007618: 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( 4000761c: 80 a0 40 02 cmp %g1, %g2 40007620: b0 60 3f ff subx %g0, -1, %i0 40007624: 81 c7 e0 08 ret 40007628: 81 e8 00 00 restore if ( the_tod->day > days_in_month ) return false; return true; } 4000762c: 81 c7 e0 08 ret 40007630: 91 e8 20 00 restore %g0, 0, %o0 =============================================================================== 4000808c <_Thread_Change_priority>: void _Thread_Change_priority( Thread_Control *the_thread, Priority_Control new_priority, bool prepend_it ) { 4000808c: 9d e3 bf a0 save %sp, -96, %sp */ /* * Save original state */ original_state = the_thread->current_state; 40008090: e2 06 20 10 ld [ %i0 + 0x10 ], %l1 /* * 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 ); 40008094: 40 00 04 26 call 4000912c <_Thread_Set_transient> 40008098: 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 ) 4000809c: c2 06 20 14 ld [ %i0 + 0x14 ], %g1 void _Thread_Change_priority( Thread_Control *the_thread, Priority_Control new_priority, bool prepend_it ) { 400080a0: a0 10 00 18 mov %i0, %l0 /* * Do not bother recomputing all the priority related information if * we are not REALLY changing priority. */ if ( the_thread->current_priority != new_priority ) 400080a4: 80 a0 40 19 cmp %g1, %i1 400080a8: 02 80 00 04 be 400080b8 <_Thread_Change_priority+0x2c> 400080ac: 92 10 00 19 mov %i1, %o1 _Thread_Set_priority( the_thread, new_priority ); 400080b0: 40 00 03 a2 call 40008f38 <_Thread_Set_priority> 400080b4: 90 10 00 18 mov %i0, %o0 _ISR_Disable( level ); 400080b8: 7f ff e7 25 call 40001d4c 400080bc: 01 00 00 00 nop 400080c0: b0 10 00 08 mov %o0, %i0 /* * 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; 400080c4: e4 04 20 10 ld [ %l0 + 0x10 ], %l2 if ( state != STATES_TRANSIENT ) { 400080c8: 80 a4 a0 04 cmp %l2, 4 400080cc: 02 80 00 10 be 4000810c <_Thread_Change_priority+0x80> 400080d0: a2 0c 60 04 and %l1, 4, %l1 /* Only clear the transient state if it wasn't set already */ if ( ! _States_Is_transient( original_state ) ) 400080d4: 80 a4 60 00 cmp %l1, 0 400080d8: 12 80 00 03 bne 400080e4 <_Thread_Change_priority+0x58> <== NEVER TAKEN 400080dc: 82 0c bf fb and %l2, -5, %g1 the_thread->current_state = _States_Clear( STATES_TRANSIENT, state ); 400080e0: c2 24 20 10 st %g1, [ %l0 + 0x10 ] _ISR_Enable( level ); 400080e4: 7f ff e7 1e call 40001d5c 400080e8: 90 10 00 18 mov %i0, %o0 if ( _States_Is_waiting_on_thread_queue( state ) ) { 400080ec: 03 00 00 ef sethi %hi(0x3bc00), %g1 400080f0: 82 10 62 e0 or %g1, 0x2e0, %g1 ! 3bee0 400080f4: 80 8c 80 01 btst %l2, %g1 400080f8: 02 80 00 5c be 40008268 <_Thread_Change_priority+0x1dc> 400080fc: 01 00 00 00 nop _Thread_queue_Requeue( the_thread->Wait.queue, the_thread ); 40008100: f0 04 20 44 ld [ %l0 + 0x44 ], %i0 40008104: 40 00 03 60 call 40008e84 <_Thread_queue_Requeue> 40008108: 93 e8 00 10 restore %g0, %l0, %o1 } return; } /* Only clear the transient state if it wasn't set already */ if ( ! _States_Is_transient( original_state ) ) { 4000810c: 80 a4 60 00 cmp %l1, 0 40008110: 12 80 00 1c bne 40008180 <_Thread_Change_priority+0xf4> <== NEVER TAKEN 40008114: 01 00 00 00 nop RTEMS_INLINE_ROUTINE void _Priority_Add_to_bit_map ( Priority_Information *the_priority_map ) { *the_priority_map->minor |= the_priority_map->ready_minor; 40008118: c4 04 20 90 ld [ %l0 + 0x90 ], %g2 4000811c: c6 14 20 96 lduh [ %l0 + 0x96 ], %g3 40008120: c8 10 80 00 lduh [ %g2 ], %g4 _Priority_Major_bit_map |= the_priority_map->ready_major; 40008124: 03 10 00 76 sethi %hi(0x4001d800), %g1 RTEMS_INLINE_ROUTINE void _Priority_Add_to_bit_map ( Priority_Information *the_priority_map ) { *the_priority_map->minor |= the_priority_map->ready_minor; 40008128: 86 11 00 03 or %g4, %g3, %g3 4000812c: c6 30 80 00 sth %g3, [ %g2 ] _Priority_Major_bit_map |= the_priority_map->ready_major; 40008130: c4 10 62 20 lduh [ %g1 + 0x220 ], %g2 40008134: c6 14 20 94 lduh [ %l0 + 0x94 ], %g3 * 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 ); 40008138: c0 24 20 10 clr [ %l0 + 0x10 ] 4000813c: 84 10 c0 02 or %g3, %g2, %g2 40008140: c4 30 62 20 sth %g2, [ %g1 + 0x220 ] _Priority_Add_to_bit_map( &the_thread->Priority_map ); if ( prepend_it ) 40008144: 80 8e a0 ff btst 0xff, %i2 40008148: 02 80 00 08 be 40008168 <_Thread_Change_priority+0xdc> 4000814c: c2 04 20 8c ld [ %l0 + 0x8c ], %g1 ) { Chain_Node *before_node; the_node->previous = after_node; before_node = after_node->next; 40008150: c4 00 40 00 ld [ %g1 ], %g2 Chain_Node *the_node ) { Chain_Node *before_node; the_node->previous = after_node; 40008154: c2 24 20 04 st %g1, [ %l0 + 4 ] before_node = after_node->next; after_node->next = the_node; 40008158: e0 20 40 00 st %l0, [ %g1 ] the_node->next = before_node; before_node->previous = the_node; 4000815c: e0 20 a0 04 st %l0, [ %g2 + 4 ] Chain_Node *before_node; the_node->previous = after_node; before_node = after_node->next; after_node->next = the_node; the_node->next = before_node; 40008160: 10 80 00 08 b 40008180 <_Thread_Change_priority+0xf4> 40008164: c4 24 00 00 st %g2, [ %l0 ] Chain_Node *the_node ) { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); 40008168: 84 00 60 04 add %g1, 4, %g2 4000816c: c4 24 00 00 st %g2, [ %l0 ] old_last_node = the_chain->last; 40008170: c4 00 60 08 ld [ %g1 + 8 ], %g2 the_chain->last = the_node; 40008174: e0 20 60 08 st %l0, [ %g1 + 8 ] old_last_node->next = the_node; the_node->previous = old_last_node; 40008178: c4 24 20 04 st %g2, [ %l0 + 4 ] Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); old_last_node = the_chain->last; the_chain->last = the_node; old_last_node->next = the_node; 4000817c: e0 20 80 00 st %l0, [ %g2 ] _Chain_Prepend_unprotected( the_thread->ready, &the_thread->Object.Node ); else _Chain_Append_unprotected( the_thread->ready, &the_thread->Object.Node ); } _ISR_Flash( level ); 40008180: 7f ff e6 f7 call 40001d5c 40008184: 90 10 00 18 mov %i0, %o0 40008188: 7f ff e6 f1 call 40001d4c 4000818c: 01 00 00 00 nop RTEMS_INLINE_ROUTINE Priority_Control _Priority_Get_highest( void ) { Priority_Bit_map_control minor; Priority_Bit_map_control major; _Bitfield_Find_first_bit( _Priority_Major_bit_map, major ); 40008190: 03 10 00 76 sethi %hi(0x4001d800), %g1 40008194: c4 10 62 20 lduh [ %g1 + 0x220 ], %g2 ! 4001da20 <_Priority_Major_bit_map> */ RTEMS_INLINE_ROUTINE void _Thread_Calculate_heir( void ) { _Thread_Heir = (Thread_Control *) _Thread_Ready_chain[ _Priority_Get_highest() ].first; 40008198: 03 10 00 76 sethi %hi(0x4001d800), %g1 4000819c: 85 28 a0 10 sll %g2, 0x10, %g2 400081a0: da 00 60 c4 ld [ %g1 + 0xc4 ], %o5 400081a4: 87 30 a0 10 srl %g2, 0x10, %g3 400081a8: 03 10 00 6f sethi %hi(0x4001bc00), %g1 400081ac: 80 a0 e0 ff cmp %g3, 0xff 400081b0: 18 80 00 05 bgu 400081c4 <_Thread_Change_priority+0x138> 400081b4: 82 10 62 90 or %g1, 0x290, %g1 400081b8: c4 08 40 03 ldub [ %g1 + %g3 ], %g2 400081bc: 10 80 00 04 b 400081cc <_Thread_Change_priority+0x140> 400081c0: 84 00 a0 08 add %g2, 8, %g2 400081c4: 85 30 a0 18 srl %g2, 0x18, %g2 400081c8: c4 08 40 02 ldub [ %g1 + %g2 ], %g2 _Bitfield_Find_first_bit( _Priority_Bit_map[major], minor ); 400081cc: 83 28 a0 10 sll %g2, 0x10, %g1 400081d0: 07 10 00 76 sethi %hi(0x4001d800), %g3 400081d4: 83 30 60 0f srl %g1, 0xf, %g1 400081d8: 86 10 e2 a0 or %g3, 0x2a0, %g3 400081dc: c6 10 c0 01 lduh [ %g3 + %g1 ], %g3 400081e0: 03 10 00 6f sethi %hi(0x4001bc00), %g1 400081e4: 87 28 e0 10 sll %g3, 0x10, %g3 400081e8: 89 30 e0 10 srl %g3, 0x10, %g4 400081ec: 80 a1 20 ff cmp %g4, 0xff 400081f0: 18 80 00 05 bgu 40008204 <_Thread_Change_priority+0x178> 400081f4: 82 10 62 90 or %g1, 0x290, %g1 400081f8: c2 08 40 04 ldub [ %g1 + %g4 ], %g1 400081fc: 10 80 00 04 b 4000820c <_Thread_Change_priority+0x180> 40008200: 82 00 60 08 add %g1, 8, %g1 40008204: 87 30 e0 18 srl %g3, 0x18, %g3 40008208: c2 08 40 03 ldub [ %g1 + %g3 ], %g1 * ready thread. */ RTEMS_INLINE_ROUTINE void _Thread_Calculate_heir( void ) { _Thread_Heir = (Thread_Control *) 4000820c: 83 28 60 10 sll %g1, 0x10, %g1 40008210: 83 30 60 10 srl %g1, 0x10, %g1 40008214: 85 28 a0 10 sll %g2, 0x10, %g2 40008218: 85 30 a0 0c srl %g2, 0xc, %g2 4000821c: 84 00 40 02 add %g1, %g2, %g2 40008220: 83 28 a0 04 sll %g2, 4, %g1 40008224: 85 28 a0 02 sll %g2, 2, %g2 40008228: 84 20 40 02 sub %g1, %g2, %g2 4000822c: c4 03 40 02 ld [ %o5 + %g2 ], %g2 * is also the heir thread, and false otherwise. */ RTEMS_INLINE_ROUTINE bool _Thread_Is_executing_also_the_heir( void ) { return ( _Thread_Executing == _Thread_Heir ); 40008230: 03 10 00 76 sethi %hi(0x4001d800), %g1 40008234: c2 00 62 2c ld [ %g1 + 0x22c ], %g1 ! 4001da2c <_Thread_Executing> * ready thread. */ RTEMS_INLINE_ROUTINE void _Thread_Calculate_heir( void ) { _Thread_Heir = (Thread_Control *) 40008238: 07 10 00 76 sethi %hi(0x4001d800), %g3 * We altered the set of thread priorities. So let's figure out * who is the heir and if we need to switch to them. */ _Thread_Calculate_heir(); if ( !_Thread_Is_executing_also_the_heir() && 4000823c: 80 a0 40 02 cmp %g1, %g2 40008240: 02 80 00 08 be 40008260 <_Thread_Change_priority+0x1d4> 40008244: c4 20 e1 fc st %g2, [ %g3 + 0x1fc ] _Thread_Executing->is_preemptible ) 40008248: c2 08 60 75 ldub [ %g1 + 0x75 ], %g1 4000824c: 80 a0 60 00 cmp %g1, 0 40008250: 02 80 00 04 be 40008260 <_Thread_Change_priority+0x1d4> 40008254: 84 10 20 01 mov 1, %g2 _Context_Switch_necessary = true; 40008258: 03 10 00 76 sethi %hi(0x4001d800), %g1 4000825c: c4 28 62 3c stb %g2, [ %g1 + 0x23c ] ! 4001da3c <_Context_Switch_necessary> _ISR_Enable( level ); 40008260: 7f ff e6 bf call 40001d5c 40008264: 81 e8 00 00 restore 40008268: 81 c7 e0 08 ret 4000826c: 81 e8 00 00 restore =============================================================================== 40008270 <_Thread_Clear_state>: void _Thread_Clear_state( Thread_Control *the_thread, States_Control state ) { 40008270: 9d e3 bf a0 save %sp, -96, %sp ISR_Level level; States_Control current_state; _ISR_Disable( level ); 40008274: 7f ff e6 b6 call 40001d4c 40008278: a0 10 00 18 mov %i0, %l0 4000827c: b0 10 00 08 mov %o0, %i0 current_state = the_thread->current_state; 40008280: c2 04 20 10 ld [ %l0 + 0x10 ], %g1 if ( current_state & state ) { 40008284: 80 8e 40 01 btst %i1, %g1 40008288: 02 80 00 2d be 4000833c <_Thread_Clear_state+0xcc> 4000828c: 01 00 00 00 nop RTEMS_INLINE_ROUTINE States_Control _States_Clear ( States_Control states_to_clear, States_Control current_state ) { return (current_state & ~states_to_clear); 40008290: b2 28 40 19 andn %g1, %i1, %i1 current_state = the_thread->current_state = _States_Clear( state, current_state ); if ( _States_Is_ready( current_state ) ) { 40008294: 80 a6 60 00 cmp %i1, 0 40008298: 12 80 00 29 bne 4000833c <_Thread_Clear_state+0xcc> 4000829c: f2 24 20 10 st %i1, [ %l0 + 0x10 ] RTEMS_INLINE_ROUTINE void _Priority_Add_to_bit_map ( Priority_Information *the_priority_map ) { *the_priority_map->minor |= the_priority_map->ready_minor; 400082a0: c4 04 20 90 ld [ %l0 + 0x90 ], %g2 _Priority_Add_to_bit_map( &the_thread->Priority_map ); _Chain_Append_unprotected(the_thread->ready, &the_thread->Object.Node); 400082a4: c2 04 20 8c ld [ %l0 + 0x8c ], %g1 400082a8: c8 10 80 00 lduh [ %g2 ], %g4 400082ac: c6 14 20 96 lduh [ %l0 + 0x96 ], %g3 400082b0: 86 11 00 03 or %g4, %g3, %g3 400082b4: c6 30 80 00 sth %g3, [ %g2 ] Chain_Node *the_node ) { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); 400082b8: 84 00 60 04 add %g1, 4, %g2 _Priority_Major_bit_map |= the_priority_map->ready_major; 400082bc: da 14 20 94 lduh [ %l0 + 0x94 ], %o5 400082c0: c4 24 00 00 st %g2, [ %l0 ] 400082c4: 07 10 00 76 sethi %hi(0x4001d800), %g3 old_last_node = the_chain->last; 400082c8: c4 00 60 08 ld [ %g1 + 8 ], %g2 400082cc: c8 10 e2 20 lduh [ %g3 + 0x220 ], %g4 the_chain->last = the_node; 400082d0: e0 20 60 08 st %l0, [ %g1 + 8 ] old_last_node->next = the_node; the_node->previous = old_last_node; 400082d4: c4 24 20 04 st %g2, [ %l0 + 4 ] 400082d8: 82 13 40 04 or %o5, %g4, %g1 Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); old_last_node = the_chain->last; the_chain->last = the_node; old_last_node->next = the_node; 400082dc: e0 20 80 00 st %l0, [ %g2 ] 400082e0: c2 30 e2 20 sth %g1, [ %g3 + 0x220 ] _ISR_Flash( level ); 400082e4: 7f ff e6 9e call 40001d5c 400082e8: 01 00 00 00 nop 400082ec: 7f ff e6 98 call 40001d4c 400082f0: 01 00 00 00 nop * a context switch. * Pseudo-ISR case: * Even if the thread isn't preemptible, if the new heir is * a pseudo-ISR system task, we need to do a context switch. */ if ( the_thread->current_priority < _Thread_Heir->current_priority ) { 400082f4: 05 10 00 76 sethi %hi(0x4001d800), %g2 400082f8: c6 00 a1 fc ld [ %g2 + 0x1fc ], %g3 ! 4001d9fc <_Thread_Heir> 400082fc: c2 04 20 14 ld [ %l0 + 0x14 ], %g1 40008300: c6 00 e0 14 ld [ %g3 + 0x14 ], %g3 40008304: 80 a0 40 03 cmp %g1, %g3 40008308: 1a 80 00 0d bcc 4000833c <_Thread_Clear_state+0xcc> 4000830c: 07 10 00 76 sethi %hi(0x4001d800), %g3 _Thread_Heir = the_thread; if ( _Thread_Executing->is_preemptible || 40008310: c6 00 e2 2c ld [ %g3 + 0x22c ], %g3 ! 4001da2c <_Thread_Executing> * Pseudo-ISR case: * Even if the thread isn't preemptible, if the new heir is * a pseudo-ISR system task, we need to do a context switch. */ if ( the_thread->current_priority < _Thread_Heir->current_priority ) { _Thread_Heir = the_thread; 40008314: e0 20 a1 fc st %l0, [ %g2 + 0x1fc ] if ( _Thread_Executing->is_preemptible || 40008318: c4 08 e0 75 ldub [ %g3 + 0x75 ], %g2 4000831c: 80 a0 a0 00 cmp %g2, 0 40008320: 12 80 00 05 bne 40008334 <_Thread_Clear_state+0xc4> 40008324: 84 10 20 01 mov 1, %g2 40008328: 80 a0 60 00 cmp %g1, 0 4000832c: 12 80 00 04 bne 4000833c <_Thread_Clear_state+0xcc> <== ALWAYS TAKEN 40008330: 01 00 00 00 nop the_thread->current_priority == 0 ) _Context_Switch_necessary = true; 40008334: 03 10 00 76 sethi %hi(0x4001d800), %g1 40008338: c4 28 62 3c stb %g2, [ %g1 + 0x23c ] ! 4001da3c <_Context_Switch_necessary> } } } _ISR_Enable( level ); 4000833c: 7f ff e6 88 call 40001d5c 40008340: 81 e8 00 00 restore =============================================================================== 400084c8 <_Thread_Delay_ended>: void _Thread_Delay_ended( Objects_Id id, void *ignored __attribute__((unused)) ) { 400084c8: 9d e3 bf 98 save %sp, -104, %sp Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); 400084cc: 90 10 00 18 mov %i0, %o0 400084d0: 40 00 00 6c call 40008680 <_Thread_Get> 400084d4: 92 07 bf fc add %fp, -4, %o1 switch ( location ) { 400084d8: c2 07 bf fc ld [ %fp + -4 ], %g1 400084dc: 80 a0 60 00 cmp %g1, 0 400084e0: 12 80 00 08 bne 40008500 <_Thread_Delay_ended+0x38> <== NEVER TAKEN 400084e4: 13 04 00 00 sethi %hi(0x10000000), %o1 #if defined(RTEMS_MULTIPROCESSING) case OBJECTS_REMOTE: /* impossible */ #endif break; case OBJECTS_LOCAL: _Thread_Clear_state( 400084e8: 7f ff ff 62 call 40008270 <_Thread_Clear_state> 400084ec: 92 12 60 18 or %o1, 0x18, %o1 ! 10000018 400084f0: 03 10 00 76 sethi %hi(0x4001d800), %g1 400084f4: c4 00 61 70 ld [ %g1 + 0x170 ], %g2 ! 4001d970 <_Thread_Dispatch_disable_level> 400084f8: 84 00 bf ff add %g2, -1, %g2 400084fc: c4 20 61 70 st %g2, [ %g1 + 0x170 ] 40008500: 81 c7 e0 08 ret 40008504: 81 e8 00 00 restore =============================================================================== 40008508 <_Thread_Dispatch>: * dispatch thread * no dispatch thread */ void _Thread_Dispatch( void ) { 40008508: 9d e3 bf 90 save %sp, -112, %sp Thread_Control *executing; Thread_Control *heir; ISR_Level level; executing = _Thread_Executing; 4000850c: 2d 10 00 76 sethi %hi(0x4001d800), %l6 _ISR_Disable( level ); 40008510: 7f ff e6 0f call 40001d4c 40008514: e0 05 a2 2c ld [ %l6 + 0x22c ], %l0 ! 4001da2c <_Thread_Executing> while ( _Context_Switch_necessary == true ) { 40008518: 2b 10 00 76 sethi %hi(0x4001d800), %l5 4000851c: 35 10 00 76 sethi %hi(0x4001d800), %i2 heir = _Thread_Heir; 40008520: 37 10 00 76 sethi %hi(0x4001d800), %i3 #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; 40008524: 39 10 00 76 sethi %hi(0x4001d800), %i4 #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ { Timestamp_Control uptime, ran; _TOD_Get_uptime( &uptime ); _Timestamp_Subtract( 40008528: 25 10 00 76 sethi %hi(0x4001d800), %l2 #endif /* * Switch libc's task specific data. */ if ( _Thread_libc_reent ) { 4000852c: 3b 10 00 76 sethi %hi(0x4001d800), %i5 _ISR_Disable( level ); while ( _Context_Switch_necessary == true ) { heir = _Thread_Heir; _Thread_Dispatch_disable_level = 1; _Context_Switch_necessary = false; _Thread_Executing = heir; 40008530: ac 15 a2 2c or %l6, 0x22c, %l6 Thread_Control *heir; ISR_Level level; executing = _Thread_Executing; _ISR_Disable( level ); while ( _Context_Switch_necessary == true ) { 40008534: aa 15 62 3c or %l5, 0x23c, %l5 heir = _Thread_Heir; _Thread_Dispatch_disable_level = 1; 40008538: b4 16 a1 70 or %i2, 0x170, %i2 ISR_Level level; executing = _Thread_Executing; _ISR_Disable( level ); while ( _Context_Switch_necessary == true ) { heir = _Thread_Heir; 4000853c: b6 16 e1 fc or %i3, 0x1fc, %i3 #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; 40008540: b8 17 20 c8 or %i4, 0xc8, %i4 #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ { Timestamp_Control uptime, ran; _TOD_Get_uptime( &uptime ); _Timestamp_Subtract( 40008544: a4 14 a2 34 or %l2, 0x234, %l2 #endif /* * Switch libc's task specific data. */ if ( _Thread_libc_reent ) { 40008548: ba 17 61 f8 or %i5, 0x1f8, %i5 executing = _Thread_Executing; _ISR_Disable( level ); while ( _Context_Switch_necessary == true ) { heir = _Thread_Heir; _Thread_Dispatch_disable_level = 1; 4000854c: ae 10 20 01 mov 1, %l7 _ISR_Enable( level ); #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ { Timestamp_Control uptime, ran; _TOD_Get_uptime( &uptime ); 40008550: a8 07 bf f8 add %fp, -8, %l4 Thread_Control *heir; ISR_Level level; executing = _Thread_Executing; _ISR_Disable( level ); while ( _Context_Switch_necessary == true ) { 40008554: 10 80 00 29 b 400085f8 <_Thread_Dispatch+0xf0> 40008558: a6 07 bf f0 add %fp, -16, %l3 heir = _Thread_Heir; _Thread_Dispatch_disable_level = 1; 4000855c: ee 26 80 00 st %l7, [ %i2 ] _Thread_Executing = heir; #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 ) 40008560: c2 04 60 7c ld [ %l1 + 0x7c ], %g1 executing = _Thread_Executing; _ISR_Disable( level ); while ( _Context_Switch_necessary == true ) { heir = _Thread_Heir; _Thread_Dispatch_disable_level = 1; _Context_Switch_necessary = false; 40008564: c0 2d 40 00 clrb [ %l5 ] _Thread_Executing = heir; #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 ) 40008568: 80 a0 60 01 cmp %g1, 1 4000856c: 12 80 00 04 bne 4000857c <_Thread_Dispatch+0x74> 40008570: e2 25 80 00 st %l1, [ %l6 ] heir->cpu_time_budget = _Thread_Ticks_per_timeslice; 40008574: c2 07 00 00 ld [ %i4 ], %g1 40008578: c2 24 60 78 st %g1, [ %l1 + 0x78 ] _ISR_Enable( level ); 4000857c: 7f ff e5 f8 call 40001d5c 40008580: 01 00 00 00 nop #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ { Timestamp_Control uptime, ran; _TOD_Get_uptime( &uptime ); 40008584: 40 00 10 35 call 4000c658 <_TOD_Get_uptime> 40008588: 90 10 00 14 mov %l4, %o0 _Timestamp_Subtract( 4000858c: 90 10 00 12 mov %l2, %o0 40008590: 92 10 00 14 mov %l4, %o1 40008594: 40 00 03 c2 call 4000949c <_Timespec_Subtract> 40008598: 94 10 00 13 mov %l3, %o2 &_Thread_Time_of_last_context_switch, &uptime, &ran ); _Timestamp_Add_to( &executing->cpu_time_used, &ran ); 4000859c: 92 10 00 13 mov %l3, %o1 400085a0: 40 00 03 a5 call 40009434 <_Timespec_Add_to> 400085a4: 90 04 20 84 add %l0, 0x84, %o0 _Thread_Time_of_last_context_switch = uptime; 400085a8: c4 07 bf f8 ld [ %fp + -8 ], %g2 #endif /* * Switch libc's task specific data. */ if ( _Thread_libc_reent ) { 400085ac: c2 07 40 00 ld [ %i5 ], %g1 &_Thread_Time_of_last_context_switch, &uptime, &ran ); _Timestamp_Add_to( &executing->cpu_time_used, &ran ); _Thread_Time_of_last_context_switch = uptime; 400085b0: c4 24 80 00 st %g2, [ %l2 ] 400085b4: c4 07 bf fc ld [ %fp + -4 ], %g2 if ( _Thread_libc_reent ) { executing->libc_reent = *_Thread_libc_reent; *_Thread_libc_reent = heir->libc_reent; } _User_extensions_Thread_switch( executing, heir ); 400085b8: 90 10 00 10 mov %l0, %o0 &_Thread_Time_of_last_context_switch, &uptime, &ran ); _Timestamp_Add_to( &executing->cpu_time_used, &ran ); _Thread_Time_of_last_context_switch = uptime; 400085bc: c4 24 a0 04 st %g2, [ %l2 + 4 ] #endif /* * Switch libc's task specific data. */ if ( _Thread_libc_reent ) { 400085c0: 80 a0 60 00 cmp %g1, 0 400085c4: 02 80 00 06 be 400085dc <_Thread_Dispatch+0xd4> <== NEVER TAKEN 400085c8: 92 10 00 11 mov %l1, %o1 executing->libc_reent = *_Thread_libc_reent; 400085cc: c4 00 40 00 ld [ %g1 ], %g2 400085d0: c4 24 21 58 st %g2, [ %l0 + 0x158 ] *_Thread_libc_reent = heir->libc_reent; 400085d4: c4 04 61 58 ld [ %l1 + 0x158 ], %g2 400085d8: c4 20 40 00 st %g2, [ %g1 ] } _User_extensions_Thread_switch( executing, heir ); 400085dc: 40 00 04 65 call 40009770 <_User_extensions_Thread_switch> 400085e0: 01 00 00 00 nop if ( executing->fp_context != NULL ) _Context_Save_fp( &executing->fp_context ); #endif #endif _Context_Switch( &executing->Registers, &heir->Registers ); 400085e4: 90 04 20 d0 add %l0, 0xd0, %o0 400085e8: 40 00 05 59 call 40009b4c <_CPU_Context_switch> 400085ec: 92 04 60 d0 add %l1, 0xd0, %o1 #endif #endif executing = _Thread_Executing; _ISR_Disable( level ); 400085f0: 7f ff e5 d7 call 40001d4c 400085f4: e0 05 80 00 ld [ %l6 ], %l0 Thread_Control *heir; ISR_Level level; executing = _Thread_Executing; _ISR_Disable( level ); while ( _Context_Switch_necessary == true ) { 400085f8: c2 0d 40 00 ldub [ %l5 ], %g1 400085fc: 80 a0 60 00 cmp %g1, 0 40008600: 32 bf ff d7 bne,a 4000855c <_Thread_Dispatch+0x54> 40008604: e2 06 c0 00 ld [ %i3 ], %l1 executing = _Thread_Executing; _ISR_Disable( level ); } _Thread_Dispatch_disable_level = 0; 40008608: 03 10 00 76 sethi %hi(0x4001d800), %g1 4000860c: c0 20 61 70 clr [ %g1 + 0x170 ] ! 4001d970 <_Thread_Dispatch_disable_level> _ISR_Enable( level ); 40008610: 7f ff e5 d3 call 40001d5c 40008614: 01 00 00 00 nop if ( _Thread_Do_post_task_switch_extension || 40008618: 03 10 00 76 sethi %hi(0x4001d800), %g1 4000861c: c2 00 62 10 ld [ %g1 + 0x210 ], %g1 ! 4001da10 <_Thread_Do_post_task_switch_extension> 40008620: 80 a0 60 00 cmp %g1, 0 40008624: 12 80 00 06 bne 4000863c <_Thread_Dispatch+0x134> 40008628: 01 00 00 00 nop executing->do_post_task_switch_extension ) { 4000862c: c2 0c 20 74 ldub [ %l0 + 0x74 ], %g1 40008630: 80 a0 60 00 cmp %g1, 0 40008634: 02 80 00 04 be 40008644 <_Thread_Dispatch+0x13c> 40008638: 01 00 00 00 nop executing->do_post_task_switch_extension = false; _API_extensions_Run_postswitch(); 4000863c: 7f ff f9 de call 40006db4 <_API_extensions_Run_postswitch> 40008640: c0 2c 20 74 clrb [ %l0 + 0x74 ] 40008644: 81 c7 e0 08 ret 40008648: 81 e8 00 00 restore =============================================================================== 4000e808 <_Thread_Evaluate_mode>: bool _Thread_Evaluate_mode( void ) { Thread_Control *executing; executing = _Thread_Executing; 4000e808: 03 10 00 76 sethi %hi(0x4001d800), %g1 4000e80c: c2 00 62 2c ld [ %g1 + 0x22c ], %g1 ! 4001da2c <_Thread_Executing> if ( !_States_Is_ready( executing->current_state ) || 4000e810: c4 00 60 10 ld [ %g1 + 0x10 ], %g2 4000e814: 80 a0 a0 00 cmp %g2, 0 4000e818: 12 80 00 0b bne 4000e844 <_Thread_Evaluate_mode+0x3c> <== NEVER TAKEN 4000e81c: 84 10 20 01 mov 1, %g2 4000e820: 05 10 00 76 sethi %hi(0x4001d800), %g2 4000e824: c4 00 a1 fc ld [ %g2 + 0x1fc ], %g2 ! 4001d9fc <_Thread_Heir> 4000e828: 80 a0 40 02 cmp %g1, %g2 4000e82c: 02 80 00 0b be 4000e858 <_Thread_Evaluate_mode+0x50> 4000e830: 01 00 00 00 nop ( !_Thread_Is_heir( executing ) && executing->is_preemptible ) ) { 4000e834: c2 08 60 75 ldub [ %g1 + 0x75 ], %g1 4000e838: 80 a0 60 00 cmp %g1, 0 4000e83c: 02 80 00 07 be 4000e858 <_Thread_Evaluate_mode+0x50> <== NEVER TAKEN 4000e840: 84 10 20 01 mov 1, %g2 _Context_Switch_necessary = true; 4000e844: 03 10 00 76 sethi %hi(0x4001d800), %g1 4000e848: 90 10 20 01 mov 1, %o0 4000e84c: c4 28 62 3c stb %g2, [ %g1 + 0x23c ] return true; 4000e850: 81 c3 e0 08 retl 4000e854: 01 00 00 00 nop } return false; } 4000e858: 81 c3 e0 08 retl 4000e85c: 90 10 20 00 clr %o0 ! 0 =============================================================================== 4000e860 <_Thread_Handler>: * * Output parameters: NONE */ void _Thread_Handler( void ) { 4000e860: 9d e3 bf a0 save %sp, -96, %sp #if defined(EXECUTE_GLOBAL_CONSTRUCTORS) static char doneConstructors; char doneCons; #endif executing = _Thread_Executing; 4000e864: 03 10 00 76 sethi %hi(0x4001d800), %g1 4000e868: e0 00 62 2c ld [ %g1 + 0x22c ], %l0 ! 4001da2c <_Thread_Executing> /* * 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(); 4000e86c: 3f 10 00 3a sethi %hi(0x4000e800), %i7 4000e870: be 17 e0 60 or %i7, 0x60, %i7 ! 4000e860 <_Thread_Handler> /* * have to put level into a register for those cpu's that use * inline asm here */ level = executing->Start.isr_level; 4000e874: d0 04 20 b8 ld [ %l0 + 0xb8 ], %o0 _ISR_Set_level(level); 4000e878: 7f ff cd 39 call 40001d5c 4000e87c: 91 2a 20 08 sll %o0, 8, %o0 #if defined(EXECUTE_GLOBAL_CONSTRUCTORS) doneCons = doneConstructors; 4000e880: 03 10 00 75 sethi %hi(0x4001d400), %g1 doneConstructors = 1; 4000e884: 84 10 20 01 mov 1, %g2 level = executing->Start.isr_level; _ISR_Set_level(level); #if defined(EXECUTE_GLOBAL_CONSTRUCTORS) doneCons = doneConstructors; 4000e888: e2 08 61 e8 ldub [ %g1 + 0x1e8 ], %l1 /* * 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 ); 4000e88c: 90 10 00 10 mov %l0, %o0 4000e890: 7f ff eb 45 call 400095a4 <_User_extensions_Thread_begin> 4000e894: c4 28 61 e8 stb %g2, [ %g1 + 0x1e8 ] /* * At this point, the dispatch disable level BETTER be 1. */ _Thread_Enable_dispatch(); 4000e898: 7f ff e7 6d call 4000864c <_Thread_Enable_dispatch> 4000e89c: a3 2c 60 18 sll %l1, 0x18, %l1 /* * _init could be a weak symbol and we SHOULD test it but it isn't * in any configuration I know of and it generates a warning on every * RTEMS target configuration. --joel (12 May 2007) */ if (!doneCons) /* && (volatile void *)_init) */ { 4000e8a0: 80 a4 60 00 cmp %l1, 0 4000e8a4: 32 80 00 05 bne,a 4000e8b8 <_Thread_Handler+0x58> 4000e8a8: c2 04 20 a0 ld [ %l0 + 0xa0 ], %g1 INIT_NAME (); 4000e8ac: 40 00 39 43 call 4001cdb8 <_init> 4000e8b0: 01 00 00 00 nop } #endif if ( executing->Start.prototype == THREAD_START_NUMERIC ) { 4000e8b4: c2 04 20 a0 ld [ %l0 + 0xa0 ], %g1 4000e8b8: 80 a0 60 00 cmp %g1, 0 4000e8bc: 12 80 00 05 bne 4000e8d0 <_Thread_Handler+0x70> 4000e8c0: 80 a0 60 01 cmp %g1, 1 executing->Wait.return_argument = (*(Thread_Entry_numeric) executing->Start.entry_point)( 4000e8c4: c2 04 20 9c ld [ %l0 + 0x9c ], %g1 4000e8c8: 10 80 00 06 b 4000e8e0 <_Thread_Handler+0x80> 4000e8cc: d0 04 20 a8 ld [ %l0 + 0xa8 ], %o0 executing->Start.numeric_argument ); } #if defined(RTEMS_POSIX_API) else if ( executing->Start.prototype == THREAD_START_POINTER ) { 4000e8d0: 12 80 00 07 bne 4000e8ec <_Thread_Handler+0x8c> <== NEVER TAKEN 4000e8d4: 01 00 00 00 nop executing->Wait.return_argument = (*(Thread_Entry_pointer) executing->Start.entry_point)( 4000e8d8: c2 04 20 9c ld [ %l0 + 0x9c ], %g1 4000e8dc: d0 04 20 a4 ld [ %l0 + 0xa4 ], %o0 4000e8e0: 9f c0 40 00 call %g1 4000e8e4: 01 00 00 00 nop executing->Start.numeric_argument ); } #if defined(RTEMS_POSIX_API) else if ( executing->Start.prototype == THREAD_START_POINTER ) { executing->Wait.return_argument = 4000e8e8: d0 24 20 28 st %o0, [ %l0 + 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 ); 4000e8ec: 7f ff eb 3f call 400095e8 <_User_extensions_Thread_exitted> 4000e8f0: 90 10 00 10 mov %l0, %o0 _Internal_error_Occurred( 4000e8f4: 90 10 20 00 clr %o0 4000e8f8: 92 10 20 01 mov 1, %o1 4000e8fc: 7f ff e3 99 call 40007760 <_Internal_error_Occurred> 4000e900: 94 10 20 06 mov 6, %o2 =============================================================================== 4000872c <_Thread_Initialize>: Thread_CPU_budget_algorithms budget_algorithm, Thread_CPU_budget_algorithm_callout budget_callout, uint32_t isr_level, Objects_Name name ) { 4000872c: 9d e3 bf a0 save %sp, -96, %sp 40008730: c2 07 a0 6c ld [ %fp + 0x6c ], %g1 /* * Zero out all the allocated memory fields */ for ( i=0 ; i <= THREAD_API_LAST ; i++ ) the_thread->API_Extensions[i] = NULL; 40008734: c0 26 61 5c clr [ %i1 + 0x15c ] 40008738: c0 26 61 60 clr [ %i1 + 0x160 ] 4000873c: c0 26 61 64 clr [ %i1 + 0x164 ] extensions_area = NULL; the_thread->libc_reent = NULL; 40008740: c0 26 61 58 clr [ %i1 + 0x158 ] Thread_CPU_budget_algorithms budget_algorithm, Thread_CPU_budget_algorithm_callout budget_callout, uint32_t isr_level, Objects_Name name ) { 40008744: e2 00 40 00 ld [ %g1 ], %l1 if ( !actual_stack_size || actual_stack_size < stack_size ) return false; /* stack allocation failed */ stack = the_thread->Start.stack; #else if ( !stack_area ) { 40008748: 80 a6 a0 00 cmp %i2, 0 Thread_CPU_budget_algorithms budget_algorithm, Thread_CPU_budget_algorithm_callout budget_callout, uint32_t isr_level, Objects_Name name ) { 4000874c: e0 07 a0 60 ld [ %fp + 0x60 ], %l0 if ( !actual_stack_size || actual_stack_size < stack_size ) return false; /* stack allocation failed */ stack = the_thread->Start.stack; #else if ( !stack_area ) { 40008750: 12 80 00 0f bne 4000878c <_Thread_Initialize+0x60> 40008754: e4 0f a0 5f ldub [ %fp + 0x5f ], %l2 actual_stack_size = _Thread_Stack_Allocate( the_thread, stack_size ); 40008758: 90 10 00 19 mov %i1, %o0 4000875c: 40 00 02 99 call 400091c0 <_Thread_Stack_Allocate> 40008760: 92 10 00 1b mov %i3, %o1 if ( !actual_stack_size || actual_stack_size < stack_size ) 40008764: 80 a2 00 1b cmp %o0, %i3 40008768: 0a 80 00 04 bcs 40008778 <_Thread_Initialize+0x4c> 4000876c: 80 a2 20 00 cmp %o0, 0 40008770: 12 80 00 04 bne 40008780 <_Thread_Initialize+0x54> <== ALWAYS TAKEN 40008774: 82 10 20 01 mov 1, %g1 40008778: 81 c7 e0 08 ret 4000877c: 91 e8 20 00 restore %g0, 0, %o0 return false; /* stack allocation failed */ stack = the_thread->Start.stack; 40008780: f4 06 60 cc ld [ %i1 + 0xcc ], %i2 the_thread->Start.core_allocated_stack = true; 40008784: 10 80 00 04 b 40008794 <_Thread_Initialize+0x68> 40008788: c2 2e 60 c0 stb %g1, [ %i1 + 0xc0 ] } else { stack = stack_area; actual_stack_size = stack_size; the_thread->Start.core_allocated_stack = false; 4000878c: c0 2e 60 c0 clrb [ %i1 + 0xc0 ] 40008790: 90 10 00 1b mov %i3, %o0 #endif /* * Allocate the extensions area for this thread */ if ( _Thread_Maximum_extensions ) { 40008794: 03 10 00 76 sethi %hi(0x4001d800), %g1 40008798: c2 00 62 0c ld [ %g1 + 0x20c ], %g1 ! 4001da0c <_Thread_Maximum_extensions> Stack_Control *the_stack, void *starting_address, size_t size ) { the_stack->area = starting_address; 4000879c: f4 26 60 c8 st %i2, [ %i1 + 0xc8 ] the_stack->size = size; 400087a0: d0 26 60 c4 st %o0, [ %i1 + 0xc4 ] Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 400087a4: c0 26 60 50 clr [ %i1 + 0x50 ] the_watchdog->routine = routine; 400087a8: c0 26 60 64 clr [ %i1 + 0x64 ] the_watchdog->id = id; 400087ac: c0 26 60 68 clr [ %i1 + 0x68 ] the_watchdog->user_data = user_data; 400087b0: c0 26 60 6c clr [ %i1 + 0x6c ] 400087b4: 80 a0 60 00 cmp %g1, 0 400087b8: 02 80 00 08 be 400087d8 <_Thread_Initialize+0xac> 400087bc: b6 10 20 00 clr %i3 extensions_area = _Workspace_Allocate( 400087c0: 82 00 60 01 inc %g1 400087c4: 40 00 04 b9 call 40009aa8 <_Workspace_Allocate> 400087c8: 91 28 60 02 sll %g1, 2, %o0 (_Thread_Maximum_extensions + 1) * sizeof( void * ) ); if ( !extensions_area ) 400087cc: b6 92 20 00 orcc %o0, 0, %i3 400087d0: 22 80 00 31 be,a 40008894 <_Thread_Initialize+0x168> 400087d4: d0 06 61 58 ld [ %i1 + 0x158 ], %o0 * 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 ) { 400087d8: 80 a6 e0 00 cmp %i3, 0 400087dc: 02 80 00 0c be 4000880c <_Thread_Initialize+0xe0> 400087e0: f6 26 61 68 st %i3, [ %i1 + 0x168 ] for ( i = 0; i <= _Thread_Maximum_extensions ; i++ ) 400087e4: 03 10 00 76 sethi %hi(0x4001d800), %g1 400087e8: c4 00 62 0c ld [ %g1 + 0x20c ], %g2 ! 4001da0c <_Thread_Maximum_extensions> 400087ec: 10 80 00 05 b 40008800 <_Thread_Initialize+0xd4> 400087f0: 82 10 20 00 clr %g1 the_thread->extensions[i] = NULL; 400087f4: 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++ ) 400087f8: 82 00 60 01 inc %g1 the_thread->extensions[i] = NULL; 400087fc: 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++ ) 40008800: 80 a0 40 02 cmp %g1, %g2 40008804: 28 bf ff fc bleu,a 400087f4 <_Thread_Initialize+0xc8> 40008808: c8 06 61 68 ld [ %i1 + 0x168 ], %g4 * General initialization */ the_thread->Start.is_preemptible = is_preemptible; the_thread->Start.budget_algorithm = budget_algorithm; the_thread->Start.budget_callout = budget_callout; 4000880c: c2 07 a0 64 ld [ %fp + 0x64 ], %g1 /* * General initialization */ the_thread->Start.is_preemptible = is_preemptible; 40008810: e4 2e 60 ac stb %l2, [ %i1 + 0xac ] the_thread->Start.budget_algorithm = budget_algorithm; the_thread->Start.budget_callout = budget_callout; 40008814: c2 26 60 b4 st %g1, [ %i1 + 0xb4 ] switch ( budget_algorithm ) { 40008818: 80 a4 20 02 cmp %l0, 2 4000881c: 12 80 00 05 bne 40008830 <_Thread_Initialize+0x104> 40008820: e0 26 60 b0 st %l0, [ %i1 + 0xb0 ] case THREAD_CPU_BUDGET_ALGORITHM_NONE: case THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE: break; #if defined(RTEMS_SCORE_THREAD_ENABLE_EXHAUST_TIMESLICE) case THREAD_CPU_BUDGET_ALGORITHM_EXHAUST_TIMESLICE: the_thread->cpu_time_budget = _Thread_Ticks_per_timeslice; 40008824: 03 10 00 76 sethi %hi(0x4001d800), %g1 40008828: c2 00 60 c8 ld [ %g1 + 0xc8 ], %g1 ! 4001d8c8 <_Thread_Ticks_per_timeslice> 4000882c: c2 26 60 78 st %g1, [ %i1 + 0x78 ] case THREAD_CPU_BUDGET_ALGORITHM_CALLOUT: break; #endif } the_thread->Start.isr_level = isr_level; 40008830: c2 07 a0 68 ld [ %fp + 0x68 ], %g1 #if defined(RTEMS_ITRON_API) the_thread->suspend_count = 0; #endif the_thread->real_priority = priority; the_thread->Start.initial_priority = priority; _Thread_Set_priority( the_thread, priority ); 40008834: 92 10 00 1d mov %i5, %o1 case THREAD_CPU_BUDGET_ALGORITHM_CALLOUT: break; #endif } the_thread->Start.isr_level = isr_level; 40008838: c2 26 60 b8 st %g1, [ %i1 + 0xb8 ] the_thread->current_state = STATES_DORMANT; 4000883c: 82 10 20 01 mov 1, %g1 #if defined(RTEMS_ITRON_API) the_thread->suspend_count = 0; #endif the_thread->real_priority = priority; the_thread->Start.initial_priority = priority; _Thread_Set_priority( the_thread, priority ); 40008840: 90 10 00 19 mov %i1, %o0 #endif } the_thread->Start.isr_level = isr_level; the_thread->current_state = STATES_DORMANT; 40008844: c2 26 60 10 st %g1, [ %i1 + 0x10 ] the_thread->Wait.queue = NULL; 40008848: c0 26 60 44 clr [ %i1 + 0x44 ] the_thread->resource_count = 0; 4000884c: c0 26 60 1c clr [ %i1 + 0x1c ] #if defined(RTEMS_ITRON_API) the_thread->suspend_count = 0; #endif the_thread->real_priority = priority; 40008850: fa 26 60 18 st %i5, [ %i1 + 0x18 ] the_thread->Start.initial_priority = priority; _Thread_Set_priority( the_thread, priority ); 40008854: 40 00 01 b9 call 40008f38 <_Thread_Set_priority> 40008858: fa 26 60 bc st %i5, [ %i1 + 0xbc ] #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 4000885c: c2 16 60 0a lduh [ %i1 + 0xa ], %g1 40008860: c4 06 20 1c ld [ %i0 + 0x1c ], %g2 40008864: 83 28 60 02 sll %g1, 2, %g1 information, _Objects_Get_index( the_object->id ), the_object ); the_object->name = name; 40008868: e2 26 60 0c st %l1, [ %i1 + 0xc ] #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 4000886c: f2 20 80 01 st %i1, [ %g2 + %g1 ] /* * Initialize the CPU usage statistics */ #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ _Timestamp_Set_to_zero( &the_thread->cpu_time_used ); 40008870: c0 26 60 84 clr [ %i1 + 0x84 ] 40008874: c0 26 60 88 clr [ %i1 + 0x88 ] * 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 ); 40008878: 90 10 00 19 mov %i1, %o0 4000887c: 40 00 03 7f call 40009678 <_User_extensions_Thread_create> 40008880: b0 10 20 01 mov 1, %i0 if ( extension_status ) 40008884: 80 8a 20 ff btst 0xff, %o0 40008888: 12 80 00 22 bne 40008910 <_Thread_Initialize+0x1e4> 4000888c: 01 00 00 00 nop return true; failed: if ( the_thread->libc_reent ) 40008890: d0 06 61 58 ld [ %i1 + 0x158 ], %o0 40008894: 80 a2 20 00 cmp %o0, 0 40008898: 22 80 00 05 be,a 400088ac <_Thread_Initialize+0x180> 4000889c: d0 06 61 5c ld [ %i1 + 0x15c ], %o0 _Workspace_Free( the_thread->libc_reent ); 400088a0: 40 00 04 8b call 40009acc <_Workspace_Free> 400088a4: 01 00 00 00 nop for ( i=0 ; i <= THREAD_API_LAST ; i++ ) if ( the_thread->API_Extensions[i] ) 400088a8: d0 06 61 5c ld [ %i1 + 0x15c ], %o0 400088ac: 80 a2 20 00 cmp %o0, 0 400088b0: 22 80 00 05 be,a 400088c4 <_Thread_Initialize+0x198> 400088b4: d0 06 61 60 ld [ %i1 + 0x160 ], %o0 _Workspace_Free( the_thread->API_Extensions[i] ); 400088b8: 40 00 04 85 call 40009acc <_Workspace_Free> 400088bc: 01 00 00 00 nop failed: if ( the_thread->libc_reent ) _Workspace_Free( the_thread->libc_reent ); for ( i=0 ; i <= THREAD_API_LAST ; i++ ) if ( the_thread->API_Extensions[i] ) 400088c0: d0 06 61 60 ld [ %i1 + 0x160 ], %o0 400088c4: 80 a2 20 00 cmp %o0, 0 400088c8: 22 80 00 05 be,a 400088dc <_Thread_Initialize+0x1b0> 400088cc: d0 06 61 64 ld [ %i1 + 0x164 ], %o0 _Workspace_Free( the_thread->API_Extensions[i] ); 400088d0: 40 00 04 7f call 40009acc <_Workspace_Free> 400088d4: 01 00 00 00 nop failed: if ( the_thread->libc_reent ) _Workspace_Free( the_thread->libc_reent ); for ( i=0 ; i <= THREAD_API_LAST ; i++ ) if ( the_thread->API_Extensions[i] ) 400088d8: d0 06 61 64 ld [ %i1 + 0x164 ], %o0 400088dc: 80 a2 20 00 cmp %o0, 0 400088e0: 02 80 00 05 be 400088f4 <_Thread_Initialize+0x1c8> <== ALWAYS TAKEN 400088e4: 80 a6 e0 00 cmp %i3, 0 _Workspace_Free( the_thread->API_Extensions[i] ); 400088e8: 40 00 04 79 call 40009acc <_Workspace_Free> <== NOT EXECUTED 400088ec: 01 00 00 00 nop <== NOT EXECUTED if ( extensions_area ) 400088f0: 80 a6 e0 00 cmp %i3, 0 <== NOT EXECUTED 400088f4: 02 80 00 05 be 40008908 <_Thread_Initialize+0x1dc> 400088f8: 90 10 00 19 mov %i1, %o0 (void) _Workspace_Free( extensions_area ); 400088fc: 40 00 04 74 call 40009acc <_Workspace_Free> 40008900: 90 10 00 1b mov %i3, %o0 #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) if ( fp_area ) (void) _Workspace_Free( fp_area ); #endif _Thread_Stack_Free( the_thread ); 40008904: 90 10 00 19 mov %i1, %o0 40008908: 40 00 02 45 call 4000921c <_Thread_Stack_Free> 4000890c: b0 10 20 00 clr %i0 return false; } 40008910: 81 c7 e0 08 ret 40008914: 81 e8 00 00 restore =============================================================================== 4000d344 <_Thread_Resume>: void _Thread_Resume( Thread_Control *the_thread, bool force ) { 4000d344: 9d e3 bf a0 save %sp, -96, %sp ISR_Level level; States_Control current_state; _ISR_Disable( level ); 4000d348: 7f ff d2 d5 call 40001e9c 4000d34c: a0 10 00 18 mov %i0, %l0 4000d350: b0 10 00 08 mov %o0, %i0 _ISR_Enable( level ); return; } #endif current_state = the_thread->current_state; 4000d354: c2 04 20 10 ld [ %l0 + 0x10 ], %g1 if ( current_state & STATES_SUSPENDED ) { 4000d358: 80 88 60 02 btst 2, %g1 4000d35c: 02 80 00 2c be 4000d40c <_Thread_Resume+0xc8> <== NEVER TAKEN 4000d360: 82 08 7f fd and %g1, -3, %g1 current_state = the_thread->current_state = _States_Clear(STATES_SUSPENDED, current_state); if ( _States_Is_ready( current_state ) ) { 4000d364: 80 a0 60 00 cmp %g1, 0 4000d368: 12 80 00 29 bne 4000d40c <_Thread_Resume+0xc8> 4000d36c: c2 24 20 10 st %g1, [ %l0 + 0x10 ] RTEMS_INLINE_ROUTINE void _Priority_Add_to_bit_map ( Priority_Information *the_priority_map ) { *the_priority_map->minor |= the_priority_map->ready_minor; 4000d370: c4 04 20 90 ld [ %l0 + 0x90 ], %g2 _Priority_Add_to_bit_map( &the_thread->Priority_map ); _Chain_Append_unprotected(the_thread->ready, &the_thread->Object.Node); 4000d374: c2 04 20 8c ld [ %l0 + 0x8c ], %g1 4000d378: c8 10 80 00 lduh [ %g2 ], %g4 4000d37c: c6 14 20 96 lduh [ %l0 + 0x96 ], %g3 4000d380: 86 11 00 03 or %g4, %g3, %g3 4000d384: c6 30 80 00 sth %g3, [ %g2 ] Chain_Node *the_node ) { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); 4000d388: 84 00 60 04 add %g1, 4, %g2 _Priority_Major_bit_map |= the_priority_map->ready_major; 4000d38c: da 14 20 94 lduh [ %l0 + 0x94 ], %o5 4000d390: c4 24 00 00 st %g2, [ %l0 ] 4000d394: 07 10 00 8f sethi %hi(0x40023c00), %g3 old_last_node = the_chain->last; 4000d398: c4 00 60 08 ld [ %g1 + 8 ], %g2 4000d39c: c8 10 e0 10 lduh [ %g3 + 0x10 ], %g4 the_chain->last = the_node; 4000d3a0: e0 20 60 08 st %l0, [ %g1 + 8 ] old_last_node->next = the_node; the_node->previous = old_last_node; 4000d3a4: c4 24 20 04 st %g2, [ %l0 + 4 ] 4000d3a8: 82 13 40 04 or %o5, %g4, %g1 Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); old_last_node = the_chain->last; the_chain->last = the_node; old_last_node->next = the_node; 4000d3ac: e0 20 80 00 st %l0, [ %g2 ] 4000d3b0: c2 30 e0 10 sth %g1, [ %g3 + 0x10 ] _ISR_Flash( level ); 4000d3b4: 7f ff d2 be call 40001eac 4000d3b8: 01 00 00 00 nop 4000d3bc: 7f ff d2 b8 call 40001e9c 4000d3c0: 01 00 00 00 nop if ( the_thread->current_priority < _Thread_Heir->current_priority ) { 4000d3c4: 05 10 00 8e sethi %hi(0x40023800), %g2 4000d3c8: c6 00 a3 ec ld [ %g2 + 0x3ec ], %g3 ! 40023bec <_Thread_Heir> 4000d3cc: c2 04 20 14 ld [ %l0 + 0x14 ], %g1 4000d3d0: c6 00 e0 14 ld [ %g3 + 0x14 ], %g3 4000d3d4: 80 a0 40 03 cmp %g1, %g3 4000d3d8: 1a 80 00 0d bcc 4000d40c <_Thread_Resume+0xc8> 4000d3dc: 07 10 00 8f sethi %hi(0x40023c00), %g3 _Thread_Heir = the_thread; if ( _Thread_Executing->is_preemptible || 4000d3e0: c6 00 e0 1c ld [ %g3 + 0x1c ], %g3 ! 40023c1c <_Thread_Executing> _Chain_Append_unprotected(the_thread->ready, &the_thread->Object.Node); _ISR_Flash( level ); if ( the_thread->current_priority < _Thread_Heir->current_priority ) { _Thread_Heir = the_thread; 4000d3e4: e0 20 a3 ec st %l0, [ %g2 + 0x3ec ] if ( _Thread_Executing->is_preemptible || 4000d3e8: c4 08 e0 75 ldub [ %g3 + 0x75 ], %g2 4000d3ec: 80 a0 a0 00 cmp %g2, 0 4000d3f0: 12 80 00 05 bne 4000d404 <_Thread_Resume+0xc0> 4000d3f4: 84 10 20 01 mov 1, %g2 4000d3f8: 80 a0 60 00 cmp %g1, 0 4000d3fc: 12 80 00 04 bne 4000d40c <_Thread_Resume+0xc8> <== ALWAYS TAKEN 4000d400: 01 00 00 00 nop the_thread->current_priority == 0 ) _Context_Switch_necessary = true; 4000d404: 03 10 00 8f sethi %hi(0x40023c00), %g1 4000d408: c4 28 60 2c stb %g2, [ %g1 + 0x2c ] ! 40023c2c <_Context_Switch_necessary> } } } _ISR_Enable( level ); 4000d40c: 7f ff d2 a8 call 40001eac 4000d410: 81 e8 00 00 restore =============================================================================== 400092e8 <_Thread_Tickle_timeslice>: * * Output parameters: NONE */ void _Thread_Tickle_timeslice( void ) { 400092e8: 9d e3 bf a0 save %sp, -96, %sp Thread_Control *executing; executing = _Thread_Executing; 400092ec: 03 10 00 76 sethi %hi(0x4001d800), %g1 400092f0: e0 00 62 2c ld [ %g1 + 0x22c ], %l0 ! 4001da2c <_Thread_Executing> /* * If the thread is not preemptible or is not ready, then * just return. */ if ( !executing->is_preemptible ) 400092f4: c2 0c 20 75 ldub [ %l0 + 0x75 ], %g1 400092f8: 80 a0 60 00 cmp %g1, 0 400092fc: 02 80 00 23 be 40009388 <_Thread_Tickle_timeslice+0xa0> 40009300: 01 00 00 00 nop return; if ( !_States_Is_ready( executing->current_state ) ) 40009304: c2 04 20 10 ld [ %l0 + 0x10 ], %g1 40009308: 80 a0 60 00 cmp %g1, 0 4000930c: 12 80 00 1f bne 40009388 <_Thread_Tickle_timeslice+0xa0> 40009310: 01 00 00 00 nop /* * The cpu budget algorithm determines what happens next. */ switch ( executing->budget_algorithm ) { 40009314: c2 04 20 7c ld [ %l0 + 0x7c ], %g1 40009318: 80 a0 60 01 cmp %g1, 1 4000931c: 0a 80 00 12 bcs 40009364 <_Thread_Tickle_timeslice+0x7c> 40009320: 80 a0 60 02 cmp %g1, 2 40009324: 28 80 00 07 bleu,a 40009340 <_Thread_Tickle_timeslice+0x58> 40009328: c2 04 20 78 ld [ %l0 + 0x78 ], %g1 4000932c: 80 a0 60 03 cmp %g1, 3 40009330: 12 80 00 16 bne 40009388 <_Thread_Tickle_timeslice+0xa0> <== NEVER TAKEN 40009334: 01 00 00 00 nop } break; #if defined(RTEMS_SCORE_THREAD_ENABLE_SCHEDULER_CALLOUT) case THREAD_CPU_BUDGET_ALGORITHM_CALLOUT: if ( --executing->cpu_time_budget == 0 ) 40009338: 10 80 00 0d b 4000936c <_Thread_Tickle_timeslice+0x84> 4000933c: c2 04 20 78 ld [ %l0 + 0x78 ], %g1 case THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE: #if defined(RTEMS_SCORE_THREAD_ENABLE_EXHAUST_TIMESLICE) case THREAD_CPU_BUDGET_ALGORITHM_EXHAUST_TIMESLICE: #endif if ( (int)(--executing->cpu_time_budget) <= 0 ) { 40009340: 82 00 7f ff add %g1, -1, %g1 40009344: 80 a0 60 00 cmp %g1, 0 40009348: 14 80 00 07 bg 40009364 <_Thread_Tickle_timeslice+0x7c> 4000934c: c2 24 20 78 st %g1, [ %l0 + 0x78 ] _Thread_Reset_timeslice(); 40009350: 40 00 0e e9 call 4000cef4 <_Thread_Reset_timeslice> 40009354: 01 00 00 00 nop executing->cpu_time_budget = _Thread_Ticks_per_timeslice; 40009358: 03 10 00 76 sethi %hi(0x4001d800), %g1 4000935c: c2 00 60 c8 ld [ %g1 + 0xc8 ], %g1 ! 4001d8c8 <_Thread_Ticks_per_timeslice> 40009360: c2 24 20 78 st %g1, [ %l0 + 0x78 ] 40009364: 81 c7 e0 08 ret 40009368: 81 e8 00 00 restore } break; #if defined(RTEMS_SCORE_THREAD_ENABLE_SCHEDULER_CALLOUT) case THREAD_CPU_BUDGET_ALGORITHM_CALLOUT: if ( --executing->cpu_time_budget == 0 ) 4000936c: 82 00 7f ff add %g1, -1, %g1 40009370: 80 a0 60 00 cmp %g1, 0 40009374: 12 bf ff fc bne 40009364 <_Thread_Tickle_timeslice+0x7c> 40009378: c2 24 20 78 st %g1, [ %l0 + 0x78 ] (*executing->budget_callout)( executing ); 4000937c: c2 04 20 80 ld [ %l0 + 0x80 ], %g1 40009380: 9f c0 40 00 call %g1 40009384: 90 10 00 10 mov %l0, %o0 40009388: 81 c7 e0 08 ret 4000938c: 81 e8 00 00 restore =============================================================================== 40009390 <_Thread_Yield_processor>: * ready chain * select heir */ void _Thread_Yield_processor( void ) { 40009390: 9d e3 bf a0 save %sp, -96, %sp ISR_Level level; Thread_Control *executing; Chain_Control *ready; executing = _Thread_Executing; 40009394: 03 10 00 76 sethi %hi(0x4001d800), %g1 40009398: e0 00 62 2c ld [ %g1 + 0x22c ], %l0 ! 4001da2c <_Thread_Executing> ready = executing->ready; _ISR_Disable( level ); 4000939c: 7f ff e2 6c call 40001d4c 400093a0: e2 04 20 8c ld [ %l0 + 0x8c ], %l1 400093a4: b0 10 00 08 mov %o0, %i0 if ( !_Chain_Has_only_one_node( ready ) ) { 400093a8: c4 04 40 00 ld [ %l1 ], %g2 400093ac: c2 04 60 08 ld [ %l1 + 8 ], %g1 400093b0: 80 a0 80 01 cmp %g2, %g1 400093b4: 02 80 00 17 be 40009410 <_Thread_Yield_processor+0x80> 400093b8: 25 10 00 76 sethi %hi(0x4001d800), %l2 ) { Chain_Node *next; Chain_Node *previous; next = the_node->next; 400093bc: c2 04 00 00 ld [ %l0 ], %g1 previous = the_node->previous; 400093c0: c4 04 20 04 ld [ %l0 + 4 ], %g2 Chain_Node *the_node ) { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); 400093c4: 86 04 60 04 add %l1, 4, %g3 Chain_Node *previous; next = the_node->next; previous = the_node->previous; next->previous = previous; previous->next = next; 400093c8: c2 20 80 00 st %g1, [ %g2 ] Chain_Node *the_node ) { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); 400093cc: c6 24 00 00 st %g3, [ %l0 ] Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; next->previous = previous; 400093d0: c4 20 60 04 st %g2, [ %g1 + 4 ] ) { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); old_last_node = the_chain->last; 400093d4: c2 04 60 08 ld [ %l1 + 8 ], %g1 the_chain->last = the_node; 400093d8: e0 24 60 08 st %l0, [ %l1 + 8 ] old_last_node->next = the_node; the_node->previous = old_last_node; 400093dc: c2 24 20 04 st %g1, [ %l0 + 4 ] Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); old_last_node = the_chain->last; the_chain->last = the_node; old_last_node->next = the_node; 400093e0: e0 20 40 00 st %l0, [ %g1 ] _Chain_Extract_unprotected( &executing->Object.Node ); _Chain_Append_unprotected( ready, &executing->Object.Node ); _ISR_Flash( level ); 400093e4: 7f ff e2 5e call 40001d5c 400093e8: 01 00 00 00 nop 400093ec: 7f ff e2 58 call 40001d4c 400093f0: 01 00 00 00 nop if ( _Thread_Is_heir( executing ) ) 400093f4: c2 04 a1 fc ld [ %l2 + 0x1fc ], %g1 400093f8: 80 a4 00 01 cmp %l0, %g1 400093fc: 12 80 00 09 bne 40009420 <_Thread_Yield_processor+0x90> <== NEVER TAKEN 40009400: 84 10 20 01 mov 1, %g2 _Thread_Heir = (Thread_Control *) ready->first; 40009404: c2 04 40 00 ld [ %l1 ], %g1 40009408: 10 80 00 06 b 40009420 <_Thread_Yield_processor+0x90> 4000940c: c2 24 a1 fc st %g1, [ %l2 + 0x1fc ] _Context_Switch_necessary = true; } else if ( !_Thread_Is_heir( executing ) ) 40009410: c2 04 a1 fc ld [ %l2 + 0x1fc ], %g1 40009414: 80 a4 00 01 cmp %l0, %g1 40009418: 02 80 00 04 be 40009428 <_Thread_Yield_processor+0x98> <== ALWAYS TAKEN 4000941c: 84 10 20 01 mov 1, %g2 _Context_Switch_necessary = true; 40009420: 03 10 00 76 sethi %hi(0x4001d800), %g1 40009424: c4 28 62 3c stb %g2, [ %g1 + 0x23c ] ! 4001da3c <_Context_Switch_necessary> _ISR_Enable( level ); 40009428: 7f ff e2 4d call 40001d5c 4000942c: 81 e8 00 00 restore =============================================================================== 40008c2c <_Thread_queue_Enqueue_priority>: Thread_blocking_operation_States _Thread_queue_Enqueue_priority ( Thread_queue_Control *the_thread_queue, Thread_Control *the_thread, ISR_Level *level_p ) { 40008c2c: 9d e3 bf a0 save %sp, -96, %sp Priority_Control priority; States_Control block_state; _Chain_Initialize_empty( &the_thread->Wait.Block2n ); priority = the_thread->current_priority; 40008c30: e0 06 60 14 ld [ %i1 + 0x14 ], %l0 */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 40008c34: 82 06 60 3c add %i1, 0x3c, %g1 the_chain->permanent_null = NULL; 40008c38: c0 26 60 3c clr [ %i1 + 0x3c ] */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 40008c3c: c2 26 60 38 st %g1, [ %i1 + 0x38 ] the_chain->permanent_null = NULL; the_chain->last = _Chain_Head(the_chain); 40008c40: 82 06 60 38 add %i1, 0x38, %g1 40008c44: c2 26 60 40 st %g1, [ %i1 + 0x40 ] the_thread->Wait.queue = the_thread_queue; _ISR_Enable( level ); return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; restart_reverse_search: search_priority = PRIORITY_MAXIMUM + 1; 40008c48: 2d 10 00 73 sethi %hi(0x4001cc00), %l6 _Chain_Initialize_empty( &the_thread->Wait.Block2n ); priority = the_thread->current_priority; header_index = _Thread_queue_Header_number( priority ); header = &the_thread_queue->Queues.Priority[ header_index ]; 40008c4c: 83 34 20 06 srl %l0, 6, %g1 block_state = the_thread_queue->state; if ( _Thread_queue_Is_reverse_search( priority ) ) 40008c50: 80 8c 20 20 btst 0x20, %l0 _Chain_Initialize_empty( &the_thread->Wait.Block2n ); priority = the_thread->current_priority; header_index = _Thread_queue_Header_number( priority ); header = &the_thread_queue->Queues.Priority[ header_index ]; 40008c54: a7 28 60 04 sll %g1, 4, %l3 the_thread->Wait.queue = the_thread_queue; _ISR_Enable( level ); return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; restart_reverse_search: search_priority = PRIORITY_MAXIMUM + 1; 40008c58: ac 15 a2 b4 or %l6, 0x2b4, %l6 _Chain_Initialize_empty( &the_thread->Wait.Block2n ); priority = the_thread->current_priority; header_index = _Thread_queue_Header_number( priority ); header = &the_thread_queue->Queues.Priority[ header_index ]; 40008c5c: 83 28 60 02 sll %g1, 2, %g1 block_state = the_thread_queue->state; 40008c60: ea 06 20 38 ld [ %i0 + 0x38 ], %l5 _Chain_Initialize_empty( &the_thread->Wait.Block2n ); priority = the_thread->current_priority; header_index = _Thread_queue_Header_number( priority ); header = &the_thread_queue->Queues.Priority[ header_index ]; 40008c64: a6 24 c0 01 sub %l3, %g1, %l3 block_state = the_thread_queue->state; if ( _Thread_queue_Is_reverse_search( priority ) ) 40008c68: 12 80 00 28 bne 40008d08 <_Thread_queue_Enqueue_priority+0xdc> 40008c6c: a6 06 00 13 add %i0, %l3, %l3 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 40008c70: ac 04 e0 04 add %l3, 4, %l6 goto restart_reverse_search; restart_forward_search: search_priority = PRIORITY_MINIMUM - 1; _ISR_Disable( level ); 40008c74: 7f ff e4 36 call 40001d4c 40008c78: 01 00 00 00 nop 40008c7c: a4 10 00 08 mov %o0, %l2 search_thread = (Thread_Control *) header->first; 40008c80: a8 10 3f ff mov -1, %l4 while ( !_Chain_Is_tail( header, (Chain_Node *)search_thread ) ) { 40008c84: 10 80 00 10 b 40008cc4 <_Thread_queue_Enqueue_priority+0x98> 40008c88: e2 04 c0 00 ld [ %l3 ], %l1 search_priority = search_thread->current_priority; if ( priority <= search_priority ) 40008c8c: 80 a4 00 14 cmp %l0, %l4 40008c90: 28 80 00 11 bleu,a 40008cd4 <_Thread_queue_Enqueue_priority+0xa8> 40008c94: c2 06 20 30 ld [ %i0 + 0x30 ], %g1 break; search_priority = search_thread->current_priority; if ( priority <= search_priority ) break; #endif _ISR_Flash( level ); 40008c98: 7f ff e4 31 call 40001d5c 40008c9c: 90 10 00 12 mov %l2, %o0 40008ca0: 7f ff e4 2b call 40001d4c 40008ca4: 01 00 00 00 nop if ( !_States_Are_set( search_thread->current_state, block_state) ) { 40008ca8: c2 04 60 10 ld [ %l1 + 0x10 ], %g1 40008cac: 80 8d 40 01 btst %l5, %g1 40008cb0: 32 80 00 05 bne,a 40008cc4 <_Thread_queue_Enqueue_priority+0x98><== ALWAYS TAKEN 40008cb4: e2 04 40 00 ld [ %l1 ], %l1 _ISR_Enable( level ); 40008cb8: 7f ff e4 29 call 40001d5c <== NOT EXECUTED 40008cbc: 90 10 00 12 mov %l2, %o0 <== NOT EXECUTED goto restart_forward_search; 40008cc0: 30 bf ff ed b,a 40008c74 <_Thread_queue_Enqueue_priority+0x48><== NOT EXECUTED restart_forward_search: search_priority = PRIORITY_MINIMUM - 1; _ISR_Disable( level ); search_thread = (Thread_Control *) header->first; while ( !_Chain_Is_tail( header, (Chain_Node *)search_thread ) ) { 40008cc4: 80 a4 40 16 cmp %l1, %l6 40008cc8: 32 bf ff f1 bne,a 40008c8c <_Thread_queue_Enqueue_priority+0x60> 40008ccc: e8 04 60 14 ld [ %l1 + 0x14 ], %l4 } search_thread = (Thread_Control *)search_thread->Object.Node.next; } if ( the_thread_queue->sync_state != 40008cd0: c2 06 20 30 ld [ %i0 + 0x30 ], %g1 40008cd4: 80 a0 60 01 cmp %g1, 1 40008cd8: 12 80 00 3c bne 40008dc8 <_Thread_queue_Enqueue_priority+0x19c> 40008cdc: 90 10 00 12 mov %l2, %o0 THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) goto synchronize; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; if ( priority == search_priority ) 40008ce0: 80 a4 00 14 cmp %l0, %l4 40008ce4: 02 80 00 2e be 40008d9c <_Thread_queue_Enqueue_priority+0x170> 40008ce8: c0 26 20 30 clr [ %i0 + 0x30 ] goto equal_priority; search_node = (Chain_Node *) search_thread; previous_node = search_node->previous; 40008cec: c2 04 60 04 ld [ %l1 + 4 ], %g1 the_node = (Chain_Node *) the_thread; the_node->next = search_node; 40008cf0: e2 26 40 00 st %l1, [ %i1 ] the_node->previous = previous_node; 40008cf4: c2 26 60 04 st %g1, [ %i1 + 4 ] previous_node->next = the_node; search_node->previous = the_node; the_thread->Wait.queue = the_thread_queue; 40008cf8: f0 26 60 44 st %i0, [ %i1 + 0x44 ] previous_node = search_node->previous; the_node = (Chain_Node *) the_thread; the_node->next = search_node; the_node->previous = previous_node; previous_node->next = the_node; 40008cfc: f2 20 40 00 st %i1, [ %g1 ] search_node->previous = the_node; 40008d00: f2 24 60 04 st %i1, [ %l1 + 4 ] the_thread->Wait.queue = the_thread_queue; _ISR_Enable( level ); 40008d04: 30 80 00 2d b,a 40008db8 <_Thread_queue_Enqueue_priority+0x18c> return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; restart_reverse_search: search_priority = PRIORITY_MAXIMUM + 1; _ISR_Disable( level ); 40008d08: 7f ff e4 11 call 40001d4c 40008d0c: e8 0d 80 00 ldub [ %l6 ], %l4 the_thread->Wait.queue = the_thread_queue; _ISR_Enable( level ); return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; restart_reverse_search: search_priority = PRIORITY_MAXIMUM + 1; 40008d10: a8 05 20 01 inc %l4 _ISR_Disable( level ); 40008d14: a4 10 00 08 mov %o0, %l2 search_thread = (Thread_Control *) header->last; while ( !_Chain_Is_head( header, (Chain_Node *)search_thread ) ) { 40008d18: 10 80 00 10 b 40008d58 <_Thread_queue_Enqueue_priority+0x12c> 40008d1c: e2 04 e0 08 ld [ %l3 + 8 ], %l1 search_priority = search_thread->current_priority; if ( priority >= search_priority ) 40008d20: 80 a4 00 14 cmp %l0, %l4 40008d24: 3a 80 00 11 bcc,a 40008d68 <_Thread_queue_Enqueue_priority+0x13c> 40008d28: c2 06 20 30 ld [ %i0 + 0x30 ], %g1 break; search_priority = search_thread->current_priority; if ( priority >= search_priority ) break; #endif _ISR_Flash( level ); 40008d2c: 7f ff e4 0c call 40001d5c 40008d30: 90 10 00 12 mov %l2, %o0 40008d34: 7f ff e4 06 call 40001d4c 40008d38: 01 00 00 00 nop if ( !_States_Are_set( search_thread->current_state, block_state) ) { 40008d3c: c2 04 60 10 ld [ %l1 + 0x10 ], %g1 40008d40: 80 8d 40 01 btst %l5, %g1 40008d44: 32 80 00 05 bne,a 40008d58 <_Thread_queue_Enqueue_priority+0x12c> 40008d48: e2 04 60 04 ld [ %l1 + 4 ], %l1 _ISR_Enable( level ); 40008d4c: 7f ff e4 04 call 40001d5c 40008d50: 90 10 00 12 mov %l2, %o0 goto restart_reverse_search; 40008d54: 30 bf ff ed b,a 40008d08 <_Thread_queue_Enqueue_priority+0xdc> restart_reverse_search: search_priority = PRIORITY_MAXIMUM + 1; _ISR_Disable( level ); search_thread = (Thread_Control *) header->last; while ( !_Chain_Is_head( header, (Chain_Node *)search_thread ) ) { 40008d58: 80 a4 40 13 cmp %l1, %l3 40008d5c: 32 bf ff f1 bne,a 40008d20 <_Thread_queue_Enqueue_priority+0xf4> 40008d60: e8 04 60 14 ld [ %l1 + 0x14 ], %l4 } search_thread = (Thread_Control *) search_thread->Object.Node.previous; } if ( the_thread_queue->sync_state != 40008d64: c2 06 20 30 ld [ %i0 + 0x30 ], %g1 40008d68: 80 a0 60 01 cmp %g1, 1 40008d6c: 12 80 00 17 bne 40008dc8 <_Thread_queue_Enqueue_priority+0x19c> 40008d70: 90 10 00 12 mov %l2, %o0 THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) goto synchronize; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; if ( priority == search_priority ) 40008d74: 80 a4 00 14 cmp %l0, %l4 40008d78: 02 80 00 09 be 40008d9c <_Thread_queue_Enqueue_priority+0x170> 40008d7c: c0 26 20 30 clr [ %i0 + 0x30 ] goto equal_priority; search_node = (Chain_Node *) search_thread; next_node = search_node->next; 40008d80: c2 04 40 00 ld [ %l1 ], %g1 the_node = (Chain_Node *) the_thread; the_node->next = next_node; the_node->previous = search_node; 40008d84: e2 26 60 04 st %l1, [ %i1 + 4 ] search_node = (Chain_Node *) search_thread; next_node = search_node->next; the_node = (Chain_Node *) the_thread; the_node->next = next_node; 40008d88: c2 26 40 00 st %g1, [ %i1 ] the_node->previous = search_node; search_node->next = the_node; next_node->previous = the_node; the_thread->Wait.queue = the_thread_queue; 40008d8c: f0 26 60 44 st %i0, [ %i1 + 0x44 ] next_node = search_node->next; the_node = (Chain_Node *) the_thread; the_node->next = next_node; the_node->previous = search_node; search_node->next = the_node; 40008d90: f2 24 40 00 st %i1, [ %l1 ] next_node->previous = the_node; 40008d94: f2 20 60 04 st %i1, [ %g1 + 4 ] the_thread->Wait.queue = the_thread_queue; _ISR_Enable( level ); 40008d98: 30 80 00 08 b,a 40008db8 <_Thread_queue_Enqueue_priority+0x18c> 40008d9c: a2 04 60 3c add %l1, 0x3c, %l1 return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; equal_priority: /* add at end of priority group */ search_node = _Chain_Tail( &search_thread->Wait.Block2n ); previous_node = search_node->previous; 40008da0: c2 04 60 04 ld [ %l1 + 4 ], %g1 the_node = (Chain_Node *) the_thread; the_node->next = search_node; 40008da4: e2 26 40 00 st %l1, [ %i1 ] the_node->previous = previous_node; 40008da8: c2 26 60 04 st %g1, [ %i1 + 4 ] previous_node->next = the_node; search_node->previous = the_node; the_thread->Wait.queue = the_thread_queue; 40008dac: f0 26 60 44 st %i0, [ %i1 + 0x44 ] previous_node = search_node->previous; the_node = (Chain_Node *) the_thread; the_node->next = search_node; the_node->previous = previous_node; previous_node->next = the_node; 40008db0: f2 20 40 00 st %i1, [ %g1 ] search_node->previous = the_node; 40008db4: f2 24 60 04 st %i1, [ %l1 + 4 ] the_thread->Wait.queue = the_thread_queue; _ISR_Enable( level ); 40008db8: 7f ff e3 e9 call 40001d5c 40008dbc: b0 10 20 01 mov 1, %i0 return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; 40008dc0: 81 c7 e0 08 ret 40008dc4: 81 e8 00 00 restore * the mutex by an ISR or timed out. * * WARNING! Returning with interrupts disabled! */ *level_p = level; return the_thread_queue->sync_state; 40008dc8: f0 06 20 30 ld [ %i0 + 0x30 ], %i0 * For example, the blocking thread could have been given * the mutex by an ISR or timed out. * * WARNING! Returning with interrupts disabled! */ *level_p = level; 40008dcc: d0 26 80 00 st %o0, [ %i2 ] return the_thread_queue->sync_state; } 40008dd0: 81 c7 e0 08 ret 40008dd4: 81 e8 00 00 restore =============================================================================== 40008e84 <_Thread_queue_Requeue>: void _Thread_queue_Requeue( Thread_queue_Control *the_thread_queue, Thread_Control *the_thread ) { 40008e84: 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 ) 40008e88: 80 a6 20 00 cmp %i0, 0 40008e8c: 02 80 00 19 be 40008ef0 <_Thread_queue_Requeue+0x6c> <== NEVER TAKEN 40008e90: 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 ) { 40008e94: e2 06 20 34 ld [ %i0 + 0x34 ], %l1 40008e98: 80 a4 60 01 cmp %l1, 1 40008e9c: 12 80 00 15 bne 40008ef0 <_Thread_queue_Requeue+0x6c> <== NEVER TAKEN 40008ea0: 01 00 00 00 nop Thread_queue_Control *tq = the_thread_queue; ISR_Level level; ISR_Level level_ignored; _ISR_Disable( level ); 40008ea4: 7f ff e3 aa call 40001d4c 40008ea8: 01 00 00 00 nop 40008eac: a0 10 00 08 mov %o0, %l0 if ( _States_Is_waiting_on_thread_queue( the_thread->current_state ) ) { 40008eb0: c4 06 60 10 ld [ %i1 + 0x10 ], %g2 40008eb4: 03 00 00 ef sethi %hi(0x3bc00), %g1 40008eb8: 82 10 62 e0 or %g1, 0x2e0, %g1 ! 3bee0 40008ebc: 80 88 80 01 btst %g2, %g1 40008ec0: 02 80 00 0a be 40008ee8 <_Thread_queue_Requeue+0x64> <== NEVER TAKEN 40008ec4: 94 10 20 01 mov 1, %o2 _Thread_queue_Enter_critical_section( tq ); _Thread_queue_Extract_priority_helper( tq, the_thread, true ); 40008ec8: 90 10 00 18 mov %i0, %o0 40008ecc: 92 10 00 19 mov %i1, %o1 40008ed0: 40 00 0f 67 call 4000cc6c <_Thread_queue_Extract_priority_helper> 40008ed4: e2 26 20 30 st %l1, [ %i0 + 0x30 ] (void) _Thread_queue_Enqueue_priority( tq, the_thread, &level_ignored ); 40008ed8: 90 10 00 18 mov %i0, %o0 40008edc: 92 10 00 19 mov %i1, %o1 40008ee0: 7f ff ff 53 call 40008c2c <_Thread_queue_Enqueue_priority> 40008ee4: 94 07 bf fc add %fp, -4, %o2 } _ISR_Enable( level ); 40008ee8: 7f ff e3 9d call 40001d5c 40008eec: 90 10 00 10 mov %l0, %o0 40008ef0: 81 c7 e0 08 ret 40008ef4: 81 e8 00 00 restore =============================================================================== 40008ef8 <_Thread_queue_Timeout>: void _Thread_queue_Timeout( Objects_Id id, void *ignored __attribute__((unused)) ) { 40008ef8: 9d e3 bf 98 save %sp, -104, %sp Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); 40008efc: 90 10 00 18 mov %i0, %o0 40008f00: 7f ff fd e0 call 40008680 <_Thread_Get> 40008f04: 92 07 bf fc add %fp, -4, %o1 switch ( location ) { 40008f08: c2 07 bf fc ld [ %fp + -4 ], %g1 40008f0c: 80 a0 60 00 cmp %g1, 0 40008f10: 12 80 00 08 bne 40008f30 <_Thread_queue_Timeout+0x38> <== NEVER TAKEN 40008f14: 01 00 00 00 nop #if defined(RTEMS_MULTIPROCESSING) case OBJECTS_REMOTE: /* impossible */ #endif break; case OBJECTS_LOCAL: _Thread_queue_Process_timeout( the_thread ); 40008f18: 40 00 0f 8d call 4000cd4c <_Thread_queue_Process_timeout> 40008f1c: 01 00 00 00 nop */ RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void ) { RTEMS_COMPILER_MEMORY_BARRIER(); _Thread_Dispatch_disable_level -= 1; 40008f20: 03 10 00 76 sethi %hi(0x4001d800), %g1 40008f24: c4 00 61 70 ld [ %g1 + 0x170 ], %g2 ! 4001d970 <_Thread_Dispatch_disable_level> 40008f28: 84 00 bf ff add %g2, -1, %g2 40008f2c: c4 20 61 70 st %g2, [ %g1 + 0x170 ] 40008f30: 81 c7 e0 08 ret 40008f34: 81 e8 00 00 restore =============================================================================== 40015fcc <_Timer_server_Body>: * @a arg points to the corresponding timer server control block. */ static rtems_task _Timer_server_Body( rtems_task_argument arg ) { 40015fcc: 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; 40015fd0: 35 10 00 f9 sethi %hi(0x4003e400), %i2 40015fd4: b2 07 bf f4 add %fp, -12, %i1 40015fd8: ac 07 bf f8 add %fp, -8, %l6 40015fdc: a2 07 bf e8 add %fp, -24, %l1 40015fe0: a6 07 bf ec add %fp, -20, %l3 static void _Timer_server_Process_tod_watchdogs( Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); 40015fe4: 37 10 00 f9 sethi %hi(0x4003e400), %i3 40015fe8: 2b 10 00 f9 sethi %hi(0x4003e400), %l5 RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); the_chain->permanent_null = NULL; 40015fec: c0 27 bf f8 clr [ %fp + -8 ] 40015ff0: c0 27 bf ec clr [ %fp + -20 ] the_chain->last = _Chain_Head(the_chain); 40015ff4: f2 27 bf fc st %i1, [ %fp + -4 ] */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 40015ff8: ec 27 bf f4 st %l6, [ %fp + -12 ] the_chain->permanent_null = NULL; the_chain->last = _Chain_Head(the_chain); 40015ffc: e2 27 bf f0 st %l1, [ %fp + -16 ] */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 40016000: e6 27 bf e8 st %l3, [ %fp + -24 ] static void _Timer_server_Process_interval_watchdogs( Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = _Watchdog_Ticks_since_boot; 40016004: b4 16 a2 94 or %i2, 0x294, %i2 static void _Timer_server_Process_tod_watchdogs( Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); 40016008: b6 16 e1 d0 or %i3, 0x1d0, %i3 4001600c: aa 15 61 40 or %l5, 0x140, %l5 */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; watchdogs->last_snapshot = snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 40016010: a8 06 20 30 add %i0, 0x30, %l4 /* * 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 ); 40016014: a4 06 20 68 add %i0, 0x68, %l2 static void _Timer_server_Stop_interval_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog ); 40016018: b8 06 20 08 add %i0, 8, %i4 static void _Timer_server_Stop_tod_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->TOD_watchdogs.System_watchdog ); 4001601c: ba 06 20 40 add %i0, 0x40, %i5 _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; 40016020: ae 10 20 01 mov 1, %l7 { /* * 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; 40016024: f2 26 20 78 st %i1, [ %i0 + 0x78 ] static void _Timer_server_Process_interval_watchdogs( Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = _Watchdog_Ticks_since_boot; 40016028: c2 06 80 00 ld [ %i2 ], %g1 /* * We assume adequate unsigned arithmetic here. */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; 4001602c: d2 06 20 3c ld [ %i0 + 0x3c ], %o1 watchdogs->last_snapshot = snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 40016030: 94 10 00 11 mov %l1, %o2 /* * We assume adequate unsigned arithmetic here. */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; watchdogs->last_snapshot = snapshot; 40016034: c2 26 20 3c st %g1, [ %i0 + 0x3c ] _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 40016038: 92 20 40 09 sub %g1, %o1, %o1 4001603c: 40 00 11 69 call 4001a5e0 <_Watchdog_Adjust_to_chain> 40016040: 90 10 00 14 mov %l4, %o0 Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); Watchdog_Interval last_snapshot = watchdogs->last_snapshot; 40016044: d4 06 20 74 ld [ %i0 + 0x74 ], %o2 static void _Timer_server_Process_tod_watchdogs( Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); 40016048: e0 06 c0 00 ld [ %i3 ], %l0 /* * 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 ) { 4001604c: 80 a4 00 0a cmp %l0, %o2 40016050: 08 80 00 06 bleu 40016068 <_Timer_server_Body+0x9c> 40016054: 92 24 00 0a sub %l0, %o2, %o1 /* * 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 ); 40016058: 90 10 00 12 mov %l2, %o0 4001605c: 40 00 11 61 call 4001a5e0 <_Watchdog_Adjust_to_chain> 40016060: 94 10 00 11 mov %l1, %o2 40016064: 30 80 00 06 b,a 4001607c <_Timer_server_Body+0xb0> } else if ( snapshot < last_snapshot ) { 40016068: 1a 80 00 05 bcc 4001607c <_Timer_server_Body+0xb0> 4001606c: 94 22 80 10 sub %o2, %l0, %o2 /* * 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 ); 40016070: 90 10 00 12 mov %l2, %o0 40016074: 40 00 11 34 call 4001a544 <_Watchdog_Adjust> 40016078: 92 10 20 01 mov 1, %o1 } watchdogs->last_snapshot = snapshot; 4001607c: e0 26 20 74 st %l0, [ %i0 + 0x74 ] } static void _Timer_server_Process_insertions( Timer_server_Control *ts ) { while ( true ) { Timer_Control *timer = (Timer_Control *) _Chain_Get( ts->insert_chain ); 40016080: d0 06 20 78 ld [ %i0 + 0x78 ], %o0 40016084: 40 00 02 7e call 40016a7c <_Chain_Get> 40016088: 01 00 00 00 nop if ( timer == NULL ) { 4001608c: 80 a2 20 00 cmp %o0, 0 40016090: 02 80 00 0f be 400160cc <_Timer_server_Body+0x100> 40016094: 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 ) { 40016098: c2 02 20 38 ld [ %o0 + 0x38 ], %g1 4001609c: 80 a0 60 01 cmp %g1, 1 400160a0: 12 80 00 05 bne 400160b4 <_Timer_server_Body+0xe8> 400160a4: 80 a0 60 03 cmp %g1, 3 _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); 400160a8: 92 02 20 10 add %o0, 0x10, %o1 400160ac: 10 80 00 05 b 400160c0 <_Timer_server_Body+0xf4> 400160b0: 90 10 00 14 mov %l4, %o0 } else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) { 400160b4: 12 bf ff f3 bne 40016080 <_Timer_server_Body+0xb4> <== NEVER TAKEN 400160b8: 92 02 20 10 add %o0, 0x10, %o1 _Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker ); 400160bc: 90 10 00 12 mov %l2, %o0 400160c0: 40 00 11 7d call 4001a6b4 <_Watchdog_Insert> 400160c4: 01 00 00 00 nop 400160c8: 30 bf ff ee b,a 40016080 <_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 ); 400160cc: 7f ff e1 4f call 4000e608 400160d0: 01 00 00 00 nop if ( _Chain_Is_empty( insert_chain ) ) { 400160d4: c2 07 bf f4 ld [ %fp + -12 ], %g1 400160d8: 80 a0 40 16 cmp %g1, %l6 400160dc: 12 80 00 0a bne 40016104 <_Timer_server_Body+0x138> <== NEVER TAKEN 400160e0: 01 00 00 00 nop ts->insert_chain = NULL; 400160e4: c0 26 20 78 clr [ %i0 + 0x78 ] _ISR_Enable( level ); 400160e8: 7f ff e1 4c call 4000e618 400160ec: 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 ) ) { 400160f0: c2 07 bf e8 ld [ %fp + -24 ], %g1 400160f4: 80 a0 40 13 cmp %g1, %l3 400160f8: 12 80 00 06 bne 40016110 <_Timer_server_Body+0x144> 400160fc: 01 00 00 00 nop 40016100: 30 80 00 1a b,a 40016168 <_Timer_server_Body+0x19c> ts->insert_chain = NULL; _ISR_Enable( level ); break; } else { _ISR_Enable( level ); 40016104: 7f ff e1 45 call 4000e618 <== NOT EXECUTED 40016108: 01 00 00 00 nop <== NOT EXECUTED 4001610c: 30 bf ff c7 b,a 40016028 <_Timer_server_Body+0x5c> <== 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 ); 40016110: 7f ff e1 3e call 4000e608 40016114: 01 00 00 00 nop 40016118: 84 10 00 08 mov %o0, %g2 */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 4001611c: e0 07 bf e8 ld [ %fp + -24 ], %l0 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected( Chain_Control *the_chain ) { if ( !_Chain_Is_empty(the_chain)) 40016120: 80 a4 00 13 cmp %l0, %l3 40016124: 02 80 00 0e be 4001615c <_Timer_server_Body+0x190> 40016128: 80 a4 20 00 cmp %l0, 0 { Chain_Node *return_node; Chain_Node *new_first; return_node = the_chain->first; new_first = return_node->next; 4001612c: c2 04 00 00 ld [ %l0 ], %g1 the_chain->first = new_first; 40016130: c2 27 bf e8 st %g1, [ %fp + -24 ] watchdog = (Watchdog_Control *) _Chain_Get_unprotected( &fire_chain ); if ( watchdog != NULL ) { 40016134: 02 80 00 0a be 4001615c <_Timer_server_Body+0x190> <== NEVER TAKEN 40016138: e2 20 60 04 st %l1, [ %g1 + 4 ] watchdog->state = WATCHDOG_INACTIVE; 4001613c: c0 24 20 08 clr [ %l0 + 8 ] _ISR_Enable( level ); 40016140: 7f ff e1 36 call 4000e618 40016144: 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 ); 40016148: d2 04 20 24 ld [ %l0 + 0x24 ], %o1 4001614c: c2 04 20 1c ld [ %l0 + 0x1c ], %g1 40016150: 9f c0 40 00 call %g1 40016154: d0 04 20 20 ld [ %l0 + 0x20 ], %o0 } 40016158: 30 bf ff ee b,a 40016110 <_Timer_server_Body+0x144> watchdog = (Watchdog_Control *) _Chain_Get_unprotected( &fire_chain ); if ( watchdog != NULL ) { watchdog->state = WATCHDOG_INACTIVE; _ISR_Enable( level ); } else { _ISR_Enable( level ); 4001615c: 7f ff e1 2f call 4000e618 40016160: 90 10 00 02 mov %g2, %o0 40016164: 30 bf ff b0 b,a 40016024 <_Timer_server_Body+0x58> * the active flag of the timer server is true. */ (*watchdog->routine)( watchdog->id, watchdog->user_data ); } } else { ts->active = false; 40016168: c0 2e 20 7c clrb [ %i0 + 0x7c ] 4001616c: c2 05 40 00 ld [ %l5 ], %g1 40016170: 82 00 60 01 inc %g1 40016174: c2 25 40 00 st %g1, [ %l5 ] /* * Block until there is something to do. */ _Thread_Disable_dispatch(); _Thread_Set_state( ts->thread, STATES_DELAYING ); 40016178: d0 06 00 00 ld [ %i0 ], %o0 4001617c: 40 00 0e 55 call 40019ad0 <_Thread_Set_state> 40016180: 92 10 20 08 mov 8, %o1 _Timer_server_Reset_interval_system_watchdog( ts ); 40016184: 7f ff ff 68 call 40015f24 <_Timer_server_Reset_interval_system_watchdog> 40016188: 90 10 00 18 mov %i0, %o0 _Timer_server_Reset_tod_system_watchdog( ts ); 4001618c: 7f ff ff 7b call 40015f78 <_Timer_server_Reset_tod_system_watchdog> 40016190: 90 10 00 18 mov %i0, %o0 _Thread_Enable_dispatch(); 40016194: 40 00 0b 94 call 40018fe4 <_Thread_Enable_dispatch> 40016198: 01 00 00 00 nop static void _Timer_server_Stop_interval_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog ); 4001619c: 90 10 00 1c mov %i4, %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; 400161a0: ee 2e 20 7c stb %l7, [ %i0 + 0x7c ] static void _Timer_server_Stop_interval_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog ); 400161a4: 40 00 11 a1 call 4001a828 <_Watchdog_Remove> 400161a8: 01 00 00 00 nop static void _Timer_server_Stop_tod_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->TOD_watchdogs.System_watchdog ); 400161ac: 40 00 11 9f call 4001a828 <_Watchdog_Remove> 400161b0: 90 10 00 1d mov %i5, %o0 400161b4: 30 bf ff 9c b,a 40016024 <_Timer_server_Body+0x58> =============================================================================== 4000b9b0 <_Watchdog_Adjust>: void _Watchdog_Adjust( Chain_Control *header, Watchdog_Adjust_directions direction, Watchdog_Interval units ) { 4000b9b0: 9d e3 bf a0 save %sp, -96, %sp ISR_Level level; _ISR_Disable( level ); 4000b9b4: 7f ff dc d0 call 40002cf4 4000b9b8: a0 10 00 18 mov %i0, %l0 */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 4000b9bc: c2 06 00 00 ld [ %i0 ], %g1 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 4000b9c0: a2 06 20 04 add %i0, 4, %l1 * hence the compiler must not assume *header to remain * unmodified across that call. * * Till Straumann, 7/2003 */ if ( !_Chain_Is_empty( header ) ) { 4000b9c4: 80 a0 40 11 cmp %g1, %l1 4000b9c8: 02 80 00 1e be 4000ba40 <_Watchdog_Adjust+0x90> 4000b9cc: 80 a6 60 00 cmp %i1, 0 switch ( direction ) { 4000b9d0: 02 80 00 19 be 4000ba34 <_Watchdog_Adjust+0x84> 4000b9d4: a4 10 20 01 mov 1, %l2 4000b9d8: 80 a6 60 01 cmp %i1, 1 4000b9dc: 12 80 00 19 bne 4000ba40 <_Watchdog_Adjust+0x90> <== NEVER TAKEN 4000b9e0: 01 00 00 00 nop case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; 4000b9e4: c4 00 60 10 ld [ %g1 + 0x10 ], %g2 4000b9e8: 10 80 00 07 b 4000ba04 <_Watchdog_Adjust+0x54> 4000b9ec: b4 00 80 1a add %g2, %i2, %i2 break; case WATCHDOG_FORWARD: while ( units ) { if ( units < _Watchdog_First( header )->delta_interval ) { 4000b9f0: f2 00 60 10 ld [ %g1 + 0x10 ], %i1 4000b9f4: 80 a6 80 19 cmp %i2, %i1 4000b9f8: 3a 80 00 05 bcc,a 4000ba0c <_Watchdog_Adjust+0x5c> 4000b9fc: e4 20 60 10 st %l2, [ %g1 + 0x10 ] _Watchdog_First( header )->delta_interval -= units; 4000ba00: b4 26 40 1a sub %i1, %i2, %i2 break; 4000ba04: 10 80 00 0f b 4000ba40 <_Watchdog_Adjust+0x90> 4000ba08: f4 20 60 10 st %i2, [ %g1 + 0x10 ] } else { units -= _Watchdog_First( header )->delta_interval; _Watchdog_First( header )->delta_interval = 1; _ISR_Enable( level ); 4000ba0c: 7f ff dc be call 40002d04 4000ba10: 01 00 00 00 nop _Watchdog_Tickle( header ); 4000ba14: 40 00 00 95 call 4000bc68 <_Watchdog_Tickle> 4000ba18: 90 10 00 10 mov %l0, %o0 _ISR_Disable( level ); 4000ba1c: 7f ff dc b6 call 40002cf4 4000ba20: 01 00 00 00 nop if ( _Chain_Is_empty( header ) ) 4000ba24: c2 04 00 00 ld [ %l0 ], %g1 4000ba28: 80 a0 40 11 cmp %g1, %l1 4000ba2c: 02 80 00 05 be 4000ba40 <_Watchdog_Adjust+0x90> 4000ba30: b4 26 80 19 sub %i2, %i1, %i2 switch ( direction ) { case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; break; case WATCHDOG_FORWARD: while ( units ) { 4000ba34: 80 a6 a0 00 cmp %i2, 0 4000ba38: 32 bf ff ee bne,a 4000b9f0 <_Watchdog_Adjust+0x40> <== ALWAYS TAKEN 4000ba3c: c2 04 00 00 ld [ %l0 ], %g1 } break; } } _ISR_Enable( level ); 4000ba40: 7f ff dc b1 call 40002d04 4000ba44: 91 e8 00 08 restore %g0, %o0, %o0 =============================================================================== 40009924 <_Watchdog_Remove>: */ Watchdog_States _Watchdog_Remove( Watchdog_Control *the_watchdog ) { 40009924: 9d e3 bf a0 save %sp, -96, %sp ISR_Level level; Watchdog_States previous_state; Watchdog_Control *next_watchdog; _ISR_Disable( level ); 40009928: 7f ff e1 09 call 40001d4c 4000992c: a0 10 00 18 mov %i0, %l0 previous_state = the_watchdog->state; 40009930: f0 06 20 08 ld [ %i0 + 8 ], %i0 switch ( previous_state ) { 40009934: 80 a6 20 01 cmp %i0, 1 40009938: 22 80 00 1e be,a 400099b0 <_Watchdog_Remove+0x8c> 4000993c: c0 24 20 08 clr [ %l0 + 8 ] 40009940: 0a 80 00 1d bcs 400099b4 <_Watchdog_Remove+0x90> 40009944: 03 10 00 76 sethi %hi(0x4001d800), %g1 40009948: 80 a6 20 03 cmp %i0, 3 4000994c: 18 80 00 1a bgu 400099b4 <_Watchdog_Remove+0x90> <== NEVER TAKEN 40009950: 01 00 00 00 nop 40009954: c2 04 00 00 ld [ %l0 ], %g1 break; case WATCHDOG_ACTIVE: case WATCHDOG_REMOVE_IT: the_watchdog->state = WATCHDOG_INACTIVE; 40009958: c0 24 20 08 clr [ %l0 + 8 ] next_watchdog = _Watchdog_Next( the_watchdog ); if ( _Watchdog_Next(next_watchdog) ) 4000995c: c4 00 40 00 ld [ %g1 ], %g2 40009960: 80 a0 a0 00 cmp %g2, 0 40009964: 22 80 00 07 be,a 40009980 <_Watchdog_Remove+0x5c> 40009968: 03 10 00 76 sethi %hi(0x4001d800), %g1 next_watchdog->delta_interval += the_watchdog->delta_interval; 4000996c: c6 00 60 10 ld [ %g1 + 0x10 ], %g3 ! 4001d810 40009970: c4 04 20 10 ld [ %l0 + 0x10 ], %g2 40009974: 84 00 c0 02 add %g3, %g2, %g2 40009978: c4 20 60 10 st %g2, [ %g1 + 0x10 ] if ( _Watchdog_Sync_count ) 4000997c: 03 10 00 76 sethi %hi(0x4001d800), %g1 40009980: c2 00 62 c0 ld [ %g1 + 0x2c0 ], %g1 ! 4001dac0 <_Watchdog_Sync_count> 40009984: 80 a0 60 00 cmp %g1, 0 40009988: 22 80 00 07 be,a 400099a4 <_Watchdog_Remove+0x80> 4000998c: c2 04 00 00 ld [ %l0 ], %g1 _Watchdog_Sync_level = _ISR_Nest_level; 40009990: 03 10 00 76 sethi %hi(0x4001d800), %g1 40009994: c4 00 62 08 ld [ %g1 + 0x208 ], %g2 ! 4001da08 <_ISR_Nest_level> 40009998: 03 10 00 76 sethi %hi(0x4001d800), %g1 4000999c: c4 20 62 28 st %g2, [ %g1 + 0x228 ] ! 4001da28 <_Watchdog_Sync_level> ) { Chain_Node *next; Chain_Node *previous; next = the_node->next; 400099a0: c2 04 00 00 ld [ %l0 ], %g1 previous = the_node->previous; 400099a4: c4 04 20 04 ld [ %l0 + 4 ], %g2 next->previous = previous; previous->next = next; 400099a8: c2 20 80 00 st %g1, [ %g2 ] Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; next->previous = previous; 400099ac: c4 20 60 04 st %g2, [ %g1 + 4 ] _Chain_Extract_unprotected( &the_watchdog->Node ); break; } the_watchdog->stop_time = _Watchdog_Ticks_since_boot; 400099b0: 03 10 00 76 sethi %hi(0x4001d800), %g1 400099b4: c2 00 62 c4 ld [ %g1 + 0x2c4 ], %g1 ! 4001dac4 <_Watchdog_Ticks_since_boot> 400099b8: c2 24 20 18 st %g1, [ %l0 + 0x18 ] _ISR_Enable( level ); 400099bc: 7f ff e0 e8 call 40001d5c 400099c0: 01 00 00 00 nop return( previous_state ); } 400099c4: 81 c7 e0 08 ret 400099c8: 81 e8 00 00 restore =============================================================================== 4000b15c <_Watchdog_Report_chain>: void _Watchdog_Report_chain( const char *name, Chain_Control *header ) { 4000b15c: 9d e3 bf a0 save %sp, -96, %sp ISR_Level level; Chain_Node *node; _ISR_Disable( level ); 4000b160: 7f ff dd b3 call 4000282c 4000b164: a0 10 00 18 mov %i0, %l0 4000b168: b0 10 00 08 mov %o0, %i0 printk( "Watchdog Chain: %s %p\n", name, header ); 4000b16c: 11 10 00 85 sethi %hi(0x40021400), %o0 4000b170: 94 10 00 19 mov %i1, %o2 4000b174: 90 12 22 58 or %o0, 0x258, %o0 4000b178: 7f ff e6 34 call 40004a48 4000b17c: 92 10 00 10 mov %l0, %o1 */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 4000b180: e2 06 40 00 ld [ %i1 ], %l1 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 4000b184: b2 06 60 04 add %i1, 4, %i1 if ( !_Chain_Is_empty( header ) ) { 4000b188: 80 a4 40 19 cmp %l1, %i1 4000b18c: 02 80 00 0e be 4000b1c4 <_Watchdog_Report_chain+0x68> 4000b190: 11 10 00 85 sethi %hi(0x40021400), %o0 node != _Chain_Tail(header) ; node = node->next ) { Watchdog_Control *watch = (Watchdog_Control *) node; _Watchdog_Report( NULL, watch ); 4000b194: 92 10 00 11 mov %l1, %o1 4000b198: 40 00 00 10 call 4000b1d8 <_Watchdog_Report> 4000b19c: 90 10 20 00 clr %o0 _ISR_Disable( level ); printk( "Watchdog Chain: %s %p\n", name, header ); if ( !_Chain_Is_empty( header ) ) { for ( node = header->first ; node != _Chain_Tail(header) ; node = node->next ) 4000b1a0: e2 04 40 00 ld [ %l1 ], %l1 Chain_Node *node; _ISR_Disable( level ); printk( "Watchdog Chain: %s %p\n", name, header ); if ( !_Chain_Is_empty( header ) ) { for ( node = header->first ; 4000b1a4: 80 a4 40 19 cmp %l1, %i1 4000b1a8: 12 bf ff fc bne 4000b198 <_Watchdog_Report_chain+0x3c> <== NEVER TAKEN 4000b1ac: 92 10 00 11 mov %l1, %o1 { Watchdog_Control *watch = (Watchdog_Control *) node; _Watchdog_Report( NULL, watch ); } printk( "== end of %s \n", name ); 4000b1b0: 92 10 00 10 mov %l0, %o1 4000b1b4: 11 10 00 85 sethi %hi(0x40021400), %o0 4000b1b8: 7f ff e6 24 call 40004a48 4000b1bc: 90 12 22 70 or %o0, 0x270, %o0 ! 40021670 4000b1c0: 30 80 00 03 b,a 4000b1cc <_Watchdog_Report_chain+0x70> } else { printk( "Chain is empty\n" ); 4000b1c4: 7f ff e6 21 call 40004a48 4000b1c8: 90 12 22 80 or %o0, 0x280, %o0 } _ISR_Enable( level ); 4000b1cc: 7f ff dd 9c call 4000283c 4000b1d0: 81 e8 00 00 restore =============================================================================== 400064ec : int adjtime( struct timeval *delta, struct timeval *olddelta ) { 400064ec: 9d e3 bf 98 save %sp, -104, %sp long adjustment; /* * Simple validations */ if ( !delta ) 400064f0: a0 96 20 00 orcc %i0, 0, %l0 400064f4: 02 80 00 07 be 40006510 400064f8: 03 00 03 d0 sethi %hi(0xf4000), %g1 rtems_set_errno_and_return_minus_one( EINVAL ); if ( delta->tv_usec >= TOD_MICROSECONDS_PER_SECOND ) 400064fc: c4 04 20 04 ld [ %l0 + 4 ], %g2 40006500: 82 10 62 3f or %g1, 0x23f, %g1 40006504: 80 a0 80 01 cmp %g2, %g1 40006508: 08 80 00 08 bleu 40006528 4000650c: 80 a6 60 00 cmp %i1, 0 rtems_set_errno_and_return_minus_one( EINVAL ); 40006510: 40 00 26 d3 call 4001005c <__errno> 40006514: b0 10 3f ff mov -1, %i0 40006518: 82 10 20 16 mov 0x16, %g1 4000651c: c2 22 00 00 st %g1, [ %o0 ] 40006520: 81 c7 e0 08 ret 40006524: 81 e8 00 00 restore if ( olddelta ) { 40006528: 22 80 00 05 be,a 4000653c 4000652c: c2 04 00 00 ld [ %l0 ], %g1 olddelta->tv_sec = 0; 40006530: c0 26 40 00 clr [ %i1 ] olddelta->tv_usec = 0; 40006534: c0 26 60 04 clr [ %i1 + 4 ] } /* convert delta to microseconds */ adjustment = (delta->tv_sec * TOD_MICROSECONDS_PER_SECOND); 40006538: c2 04 00 00 ld [ %l0 ], %g1 adjustment += delta->tv_usec; /* too small to account for */ if ( adjustment < rtems_configuration_get_microseconds_per_tick() ) 4000653c: 05 10 00 79 sethi %hi(0x4001e400), %g2 olddelta->tv_usec = 0; } /* convert delta to microseconds */ adjustment = (delta->tv_sec * TOD_MICROSECONDS_PER_SECOND); adjustment += delta->tv_usec; 40006540: c8 04 20 04 ld [ %l0 + 4 ], %g4 /* too small to account for */ if ( adjustment < rtems_configuration_get_microseconds_per_tick() ) 40006544: c6 00 a1 54 ld [ %g2 + 0x154 ], %g3 olddelta->tv_sec = 0; olddelta->tv_usec = 0; } /* convert delta to microseconds */ adjustment = (delta->tv_sec * TOD_MICROSECONDS_PER_SECOND); 40006548: 9b 28 60 08 sll %g1, 8, %o5 4000654c: 85 28 60 03 sll %g1, 3, %g2 40006550: 84 23 40 02 sub %o5, %g2, %g2 40006554: 9b 28 a0 06 sll %g2, 6, %o5 40006558: 84 23 40 02 sub %o5, %g2, %g2 4000655c: 82 00 80 01 add %g2, %g1, %g1 40006560: 83 28 60 06 sll %g1, 6, %g1 adjustment += delta->tv_usec; 40006564: 82 00 40 04 add %g1, %g4, %g1 /* too small to account for */ if ( adjustment < rtems_configuration_get_microseconds_per_tick() ) 40006568: 80 a0 40 03 cmp %g1, %g3 4000656c: 0a 80 00 35 bcs 40006640 40006570: 03 10 00 7c sethi %hi(0x4001f000), %g1 rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 40006574: c4 00 61 30 ld [ %g1 + 0x130 ], %g2 ! 4001f130 <_Thread_Dispatch_disable_level> 40006578: 84 00 a0 01 inc %g2 4000657c: c4 20 61 30 st %g2, [ %g1 + 0x130 ] * This prevents context switches while we are adjusting the TOD */ _Thread_Disable_dispatch(); _TOD_Get( &ts ); 40006580: 40 00 06 24 call 40007e10 <_TOD_Get> 40006584: 90 07 bf f8 add %fp, -8, %o0 ts.tv_sec += delta->tv_sec; ts.tv_nsec += delta->tv_usec * TOD_NANOSECONDS_PER_MICROSECOND; 40006588: c4 04 20 04 ld [ %l0 + 4 ], %g2 _Thread_Disable_dispatch(); _TOD_Get( &ts ); ts.tv_sec += delta->tv_sec; 4000658c: c2 04 00 00 ld [ %l0 ], %g1 ts.tv_nsec += delta->tv_usec * TOD_NANOSECONDS_PER_MICROSECOND; 40006590: c8 07 bf f8 ld [ %fp + -8 ], %g4 40006594: 87 28 a0 07 sll %g2, 7, %g3 40006598: 88 01 00 01 add %g4, %g1, %g4 4000659c: 83 28 a0 02 sll %g2, 2, %g1 400065a0: 82 20 c0 01 sub %g3, %g1, %g1 400065a4: c6 07 bf fc ld [ %fp + -4 ], %g3 400065a8: 82 00 40 02 add %g1, %g2, %g1 /* if adjustment is too much positive */ while ( ts.tv_nsec >= TOD_NANOSECONDS_PER_SECOND ) { 400065ac: 1b 0e e6 b2 sethi %hi(0x3b9ac800), %o5 _Thread_Disable_dispatch(); _TOD_Get( &ts ); ts.tv_sec += delta->tv_sec; ts.tv_nsec += delta->tv_usec * TOD_NANOSECONDS_PER_MICROSECOND; 400065b0: 83 28 60 03 sll %g1, 3, %g1 /* if adjustment is too much positive */ while ( ts.tv_nsec >= TOD_NANOSECONDS_PER_SECOND ) { 400065b4: 05 31 19 4d sethi %hi(0xc4653400), %g2 _Thread_Disable_dispatch(); _TOD_Get( &ts ); ts.tv_sec += delta->tv_sec; ts.tv_nsec += delta->tv_usec * TOD_NANOSECONDS_PER_MICROSECOND; 400065b8: 82 00 40 03 add %g1, %g3, %g1 /* if adjustment is too much positive */ while ( ts.tv_nsec >= TOD_NANOSECONDS_PER_SECOND ) { 400065bc: 9a 13 61 ff or %o5, 0x1ff, %o5 400065c0: 10 80 00 03 b 400065cc 400065c4: 84 10 a2 00 or %g2, 0x200, %g2 400065c8: 82 00 40 02 add %g1, %g2, %g1 400065cc: 86 10 00 04 mov %g4, %g3 400065d0: 80 a0 40 0d cmp %g1, %o5 400065d4: 18 bf ff fd bgu 400065c8 400065d8: 88 01 20 01 inc %g4 ts.tv_nsec -= TOD_NANOSECONDS_PER_SECOND; ts.tv_sec++; } /* if adjustment is too much negative */ while ( ts.tv_nsec <= (-1 * TOD_NANOSECONDS_PER_SECOND) ) { 400065dc: 1b 31 19 4d sethi %hi(0xc4653400), %o5 ts.tv_sec += delta->tv_sec; ts.tv_nsec += delta->tv_usec * TOD_NANOSECONDS_PER_MICROSECOND; /* if adjustment is too much positive */ while ( ts.tv_nsec >= TOD_NANOSECONDS_PER_SECOND ) { 400065e0: 09 0e e6 b2 sethi %hi(0x3b9ac800), %g4 ts.tv_nsec -= TOD_NANOSECONDS_PER_SECOND; ts.tv_sec++; } /* if adjustment is too much negative */ while ( ts.tv_nsec <= (-1 * TOD_NANOSECONDS_PER_SECOND) ) { 400065e4: 9a 13 62 00 or %o5, 0x200, %o5 ts.tv_sec += delta->tv_sec; ts.tv_nsec += delta->tv_usec * TOD_NANOSECONDS_PER_MICROSECOND; /* if adjustment is too much positive */ while ( ts.tv_nsec >= TOD_NANOSECONDS_PER_SECOND ) { 400065e8: 10 80 00 03 b 400065f4 400065ec: 88 11 22 00 or %g4, 0x200, %g4 400065f0: 82 00 40 04 add %g1, %g4, %g1 400065f4: 84 10 00 03 mov %g3, %g2 ts.tv_nsec -= TOD_NANOSECONDS_PER_SECOND; ts.tv_sec++; } /* if adjustment is too much negative */ while ( ts.tv_nsec <= (-1 * TOD_NANOSECONDS_PER_SECOND) ) { 400065f8: 80 a0 40 0d cmp %g1, %o5 400065fc: 08 bf ff fd bleu 400065f0 40006600: 86 00 ff ff add %g3, -1, %g3 ts.tv_nsec += TOD_NANOSECONDS_PER_SECOND; ts.tv_sec--; } _TOD_Set( &ts ); 40006604: 90 07 bf f8 add %fp, -8, %o0 ts.tv_nsec -= TOD_NANOSECONDS_PER_SECOND; ts.tv_sec++; } /* if adjustment is too much negative */ while ( ts.tv_nsec <= (-1 * TOD_NANOSECONDS_PER_SECOND) ) { 40006608: c2 27 bf fc st %g1, [ %fp + -4 ] ts.tv_nsec += TOD_NANOSECONDS_PER_SECOND; ts.tv_sec--; } _TOD_Set( &ts ); 4000660c: 40 00 06 2d call 40007ec0 <_TOD_Set> 40006610: c4 27 bf f8 st %g2, [ %fp + -8 ] _Thread_Enable_dispatch(); 40006614: 40 00 0a df call 40009190 <_Thread_Enable_dispatch> 40006618: 01 00 00 00 nop /* set the user's output */ if ( olddelta ) 4000661c: 80 a6 60 00 cmp %i1, 0 40006620: 02 80 00 08 be 40006640 <== NEVER TAKEN 40006624: 01 00 00 00 nop *olddelta = *delta; 40006628: c2 04 00 00 ld [ %l0 ], %g1 4000662c: c2 26 40 00 st %g1, [ %i1 ] 40006630: c2 04 20 04 ld [ %l0 + 4 ], %g1 40006634: c2 26 60 04 st %g1, [ %i1 + 4 ] 40006638: 81 c7 e0 08 ret 4000663c: 91 e8 20 00 restore %g0, 0, %o0 return 0; } 40006640: 81 c7 e0 08 ret 40006644: 91 e8 20 00 restore %g0, 0, %o0 =============================================================================== 4000642c : int clock_gettime( clockid_t clock_id, struct timespec *tp ) { 4000642c: 9d e3 bf a0 save %sp, -96, %sp if ( !tp ) 40006430: 90 96 60 00 orcc %i1, 0, %o0 40006434: 12 80 00 06 bne 4000644c 40006438: 80 a6 20 01 cmp %i0, 1 rtems_set_errno_and_return_minus_one( EINVAL ); 4000643c: 40 00 28 3d call 40010530 <__errno> 40006440: 01 00 00 00 nop 40006444: 10 80 00 14 b 40006494 40006448: 82 10 20 16 mov 0x16, %g1 ! 16 if ( clock_id == CLOCK_REALTIME ) { 4000644c: 12 80 00 05 bne 40006460 40006450: 80 a6 20 04 cmp %i0, 4 _TOD_Get(tp); 40006454: 40 00 07 c7 call 40008370 <_TOD_Get> 40006458: b0 10 20 00 clr %i0 4000645c: 30 80 00 15 b,a 400064b0 return 0; } #ifdef CLOCK_MONOTONIC if ( clock_id == CLOCK_MONOTONIC ) { 40006460: 02 80 00 04 be 40006470 <== NEVER TAKEN 40006464: 80 a6 20 02 cmp %i0, 2 return 0; } #endif #ifdef _POSIX_CPUTIME if ( clock_id == CLOCK_PROCESS_CPUTIME ) { 40006468: 12 80 00 06 bne 40006480 4000646c: 80 a6 20 03 cmp %i0, 3 _TOD_Get_uptime_as_timespec( tp ); 40006470: 40 00 07 df call 400083ec <_TOD_Get_uptime_as_timespec> 40006474: b0 10 20 00 clr %i0 return 0; 40006478: 81 c7 e0 08 ret 4000647c: 81 e8 00 00 restore } #endif #ifdef _POSIX_THREAD_CPUTIME if ( clock_id == CLOCK_THREAD_CPUTIME ) 40006480: 12 80 00 08 bne 400064a0 40006484: 01 00 00 00 nop rtems_set_errno_and_return_minus_one( ENOSYS ); 40006488: 40 00 28 2a call 40010530 <__errno> 4000648c: 01 00 00 00 nop 40006490: 82 10 20 58 mov 0x58, %g1 ! 58 40006494: c2 22 00 00 st %g1, [ %o0 ] 40006498: 81 c7 e0 08 ret 4000649c: 91 e8 3f ff restore %g0, -1, %o0 #endif rtems_set_errno_and_return_minus_one( EINVAL ); 400064a0: 40 00 28 24 call 40010530 <__errno> 400064a4: b0 10 3f ff mov -1, %i0 400064a8: 82 10 20 16 mov 0x16, %g1 400064ac: c2 22 00 00 st %g1, [ %o0 ] return 0; } 400064b0: 81 c7 e0 08 ret 400064b4: 81 e8 00 00 restore =============================================================================== 400064b8 : int clock_settime( clockid_t clock_id, const struct timespec *tp ) { 400064b8: 9d e3 bf a0 save %sp, -96, %sp if ( !tp ) 400064bc: 90 96 60 00 orcc %i1, 0, %o0 400064c0: 02 80 00 0a be 400064e8 <== NEVER TAKEN 400064c4: 80 a6 20 01 cmp %i0, 1 rtems_set_errno_and_return_minus_one( EINVAL ); if ( clock_id == CLOCK_REALTIME ) { 400064c8: 12 80 00 15 bne 4000651c 400064cc: 80 a6 20 02 cmp %i0, 2 if ( tp->tv_sec < TOD_SECONDS_1970_THROUGH_1988 ) 400064d0: c4 02 00 00 ld [ %o0 ], %g2 400064d4: 03 08 76 b9 sethi %hi(0x21dae400), %g1 400064d8: 82 10 60 ff or %g1, 0xff, %g1 ! 21dae4ff 400064dc: 80 a0 80 01 cmp %g2, %g1 400064e0: 38 80 00 06 bgu,a 400064f8 400064e4: 03 10 00 7f sethi %hi(0x4001fc00), %g1 rtems_set_errno_and_return_minus_one( EINVAL ); 400064e8: 40 00 28 12 call 40010530 <__errno> 400064ec: 01 00 00 00 nop 400064f0: 10 80 00 12 b 40006538 400064f4: 82 10 20 16 mov 0x16, %g1 ! 16 rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 400064f8: c4 00 60 10 ld [ %g1 + 0x10 ], %g2 400064fc: 84 00 a0 01 inc %g2 40006500: c4 20 60 10 st %g2, [ %g1 + 0x10 ] _Thread_Disable_dispatch(); _TOD_Set( tp ); 40006504: 40 00 07 d0 call 40008444 <_TOD_Set> 40006508: b0 10 20 00 clr %i0 _Thread_Enable_dispatch(); 4000650c: 40 00 0c 82 call 40009714 <_Thread_Enable_dispatch> 40006510: 01 00 00 00 nop rtems_set_errno_and_return_minus_one( ENOSYS ); #endif else rtems_set_errno_and_return_minus_one( EINVAL ); return 0; 40006514: 81 c7 e0 08 ret 40006518: 81 e8 00 00 restore _Thread_Disable_dispatch(); _TOD_Set( tp ); _Thread_Enable_dispatch(); } #ifdef _POSIX_CPUTIME else if ( clock_id == CLOCK_PROCESS_CPUTIME ) 4000651c: 02 80 00 04 be 4000652c 40006520: 80 a6 20 03 cmp %i0, 3 rtems_set_errno_and_return_minus_one( ENOSYS ); #endif #ifdef _POSIX_THREAD_CPUTIME else if ( clock_id == CLOCK_THREAD_CPUTIME ) 40006524: 12 80 00 08 bne 40006544 40006528: 01 00 00 00 nop rtems_set_errno_and_return_minus_one( ENOSYS ); 4000652c: 40 00 28 01 call 40010530 <__errno> 40006530: 01 00 00 00 nop 40006534: 82 10 20 58 mov 0x58, %g1 ! 58 40006538: c2 22 00 00 st %g1, [ %o0 ] 4000653c: 81 c7 e0 08 ret 40006540: 91 e8 3f ff restore %g0, -1, %o0 #endif else rtems_set_errno_and_return_minus_one( EINVAL ); 40006544: 40 00 27 fb call 40010530 <__errno> 40006548: b0 10 3f ff mov -1, %i0 4000654c: 82 10 20 16 mov 0x16, %g1 40006550: c2 22 00 00 st %g1, [ %o0 ] return 0; } 40006554: 81 c7 e0 08 ret 40006558: 81 e8 00 00 restore =============================================================================== 4000ee68 : int killinfo( pid_t pid, int sig, const union sigval *value ) { 4000ee68: 9d e3 bf 90 save %sp, -112, %sp POSIX_signals_Siginfo_node *psiginfo; /* * Only supported for the "calling process" (i.e. this node). */ if ( pid != getpid() ) 4000ee6c: 7f ff fc 04 call 4000de7c 4000ee70: 01 00 00 00 nop 4000ee74: 80 a6 00 08 cmp %i0, %o0 4000ee78: 02 80 00 06 be 4000ee90 4000ee7c: 80 a6 60 00 cmp %i1, 0 rtems_set_errno_and_return_minus_one( ESRCH ); 4000ee80: 40 00 01 97 call 4000f4dc <__errno> 4000ee84: 01 00 00 00 nop 4000ee88: 10 80 00 07 b 4000eea4 4000ee8c: 82 10 20 03 mov 3, %g1 ! 3 /* * Validate the signal passed. */ if ( !sig ) 4000ee90: 12 80 00 08 bne 4000eeb0 4000ee94: 82 06 7f ff add %i1, -1, %g1 rtems_set_errno_and_return_minus_one( EINVAL ); 4000ee98: 40 00 01 91 call 4000f4dc <__errno> 4000ee9c: 01 00 00 00 nop 4000eea0: 82 10 20 16 mov 0x16, %g1 ! 16 4000eea4: c2 22 00 00 st %g1, [ %o0 ] 4000eea8: 10 80 00 a5 b 4000f13c 4000eeac: 90 10 3f ff mov -1, %o0 if ( !is_valid_signo(sig) ) 4000eeb0: 80 a0 60 1f cmp %g1, 0x1f 4000eeb4: 18 bf ff f9 bgu 4000ee98 4000eeb8: 85 2e 60 02 sll %i1, 2, %g2 rtems_set_errno_and_return_minus_one( EINVAL ); /* * If the signal is being ignored, then we are out of here. */ if ( _POSIX_signals_Vectors[ sig ].sa_handler == SIG_IGN ) 4000eebc: 87 2e 60 04 sll %i1, 4, %g3 4000eec0: 86 20 c0 02 sub %g3, %g2, %g3 4000eec4: 05 10 00 77 sethi %hi(0x4001dc00), %g2 4000eec8: 84 10 a3 04 or %g2, 0x304, %g2 ! 4001df04 <_POSIX_signals_Vectors> 4000eecc: 84 00 80 03 add %g2, %g3, %g2 4000eed0: c4 00 a0 08 ld [ %g2 + 8 ], %g2 4000eed4: 80 a0 a0 01 cmp %g2, 1 4000eed8: 02 80 00 99 be 4000f13c 4000eedc: 90 10 20 00 clr %o0 /* * P1003.1c/Draft 10, p. 33 says that certain signals should always * be directed to the executing thread such as those caused by hardware * faults. */ if ( (sig == SIGFPE) || (sig == SIGILL) || (sig == SIGSEGV ) ) 4000eee0: 80 a6 60 04 cmp %i1, 4 4000eee4: 02 80 00 06 be 4000eefc 4000eee8: 80 a6 60 08 cmp %i1, 8 4000eeec: 02 80 00 04 be 4000eefc 4000eef0: 80 a6 60 0b cmp %i1, 0xb 4000eef4: 12 80 00 08 bne 4000ef14 4000eef8: a0 10 20 01 mov 1, %l0 return pthread_kill( pthread_self(), sig ); 4000eefc: 40 00 01 4f call 4000f438 4000ef00: 01 00 00 00 nop 4000ef04: 40 00 01 11 call 4000f348 4000ef08: 92 10 00 19 mov %i1, %o1 4000ef0c: 81 c7 e0 08 ret 4000ef10: 91 e8 00 08 restore %g0, %o0, %o0 /* * Build up a siginfo structure */ siginfo = &siginfo_struct; siginfo->si_signo = sig; 4000ef14: f2 27 bf f4 st %i1, [ %fp + -12 ] siginfo->si_code = SI_USER; 4000ef18: e0 27 bf f8 st %l0, [ %fp + -8 ] if ( !value ) { 4000ef1c: 80 a6 a0 00 cmp %i2, 0 4000ef20: 12 80 00 04 bne 4000ef30 4000ef24: a1 2c 00 01 sll %l0, %g1, %l0 siginfo->si_value.sival_int = 0; 4000ef28: 10 80 00 04 b 4000ef38 4000ef2c: c0 27 bf fc clr [ %fp + -4 ] } else { siginfo->si_value = *value; 4000ef30: c2 06 80 00 ld [ %i2 ], %g1 4000ef34: c2 27 bf fc st %g1, [ %fp + -4 ] 4000ef38: 03 10 00 76 sethi %hi(0x4001d800), %g1 4000ef3c: c4 00 61 70 ld [ %g1 + 0x170 ], %g2 ! 4001d970 <_Thread_Dispatch_disable_level> 4000ef40: 84 00 a0 01 inc %g2 4000ef44: c4 20 61 70 st %g2, [ %g1 + 0x170 ] /* * Is the currently executing thread interested? If so then it will * get it an execute it as soon as the dispatcher executes. */ the_thread = _Thread_Executing; 4000ef48: 03 10 00 76 sethi %hi(0x4001d800), %g1 4000ef4c: c2 00 62 2c ld [ %g1 + 0x22c ], %g1 ! 4001da2c <_Thread_Executing> api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 4000ef50: c4 00 61 60 ld [ %g1 + 0x160 ], %g2 4000ef54: c4 00 a0 cc ld [ %g2 + 0xcc ], %g2 4000ef58: 80 ac 00 02 andncc %l0, %g2, %g0 4000ef5c: 12 80 00 4e bne 4000f094 4000ef60: 07 10 00 78 sethi %hi(0x4001e000), %g3 /* XXX violation of visibility -- need to define thread queue support */ the_chain = &_POSIX_signals_Wait_queue.Queues.Fifo; for ( the_node = the_chain->first ; 4000ef64: 03 10 00 78 sethi %hi(0x4001e000), %g1 4000ef68: c4 00 60 90 ld [ %g1 + 0x90 ], %g2 ! 4001e090 <_POSIX_signals_Wait_queue> 4000ef6c: 10 80 00 0b b 4000ef98 4000ef70: 86 10 e0 94 or %g3, 0x94, %g3 !_Chain_Is_tail( the_chain, the_node ) ; the_node = the_node->next ) { the_thread = (Thread_Control *)the_node; api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 4000ef74: c8 00 a1 60 ld [ %g2 + 0x160 ], %g4 #endif /* * Is this thread is actually blocked waiting for the signal? */ if (the_thread->Wait.option & mask) 4000ef78: 80 8c 00 01 btst %l0, %g1 4000ef7c: 12 80 00 46 bne 4000f094 4000ef80: 82 10 00 02 mov %g2, %g1 /* * Is this thread is blocked waiting for another signal but has * not blocked this one? */ if (~api->signals_blocked & mask) 4000ef84: c8 01 20 cc ld [ %g4 + 0xcc ], %g4 4000ef88: 80 ac 00 04 andncc %l0, %g4, %g0 4000ef8c: 32 80 00 43 bne,a 4000f098 4000ef90: 84 10 20 01 mov 1, %g2 the_chain = &_POSIX_signals_Wait_queue.Queues.Fifo; for ( the_node = the_chain->first ; !_Chain_Is_tail( the_chain, the_node ) ; the_node = the_node->next ) { 4000ef94: c4 00 80 00 ld [ %g2 ], %g2 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 4000ef98: 80 a0 80 03 cmp %g2, %g3 4000ef9c: 32 bf ff f6 bne,a 4000ef74 4000efa0: c2 00 a0 30 ld [ %g2 + 0x30 ], %g1 * NOTES: * * + rtems internal threads do not receive signals. */ interested = NULL; interested_priority = PRIORITY_MAXIMUM + 1; 4000efa4: 03 10 00 73 sethi %hi(0x4001cc00), %g1 4000efa8: c8 08 62 b4 ldub [ %g1 + 0x2b4 ], %g4 ! 4001ceb4 4000efac: 05 10 00 76 sethi %hi(0x4001d800), %g2 4000efb0: 88 01 20 01 inc %g4 4000efb4: 84 10 a0 d8 or %g2, 0xd8, %g2 */ #define _POSIX_signals_Is_interested( _api, _mask ) \ ( ~(_api)->signals_blocked & (_mask) ) int killinfo( 4000efb8: 82 10 20 00 clr %g1 4000efbc: 90 00 a0 0c add %g2, 0xc, %o0 continue; } DEBUG_STEP("6"); /* prefer blocked/interruptible over blocked/not interruptible */ if ( !_States_Is_interruptible_by_signal(interested->current_state) ) { 4000efc0: 17 04 00 00 sethi %hi(0x10000000), %o3 for (the_api = OBJECTS_CLASSIC_API; the_api <= OBJECTS_APIS_LAST; the_api++) { /* * This can occur when no one is interested and ITRON is not configured. */ if ( !_Objects_Information_table[ the_api ] ) 4000efc4: c6 00 80 00 ld [ %g2 ], %g3 4000efc8: 80 a0 e0 00 cmp %g3, 0 4000efcc: 22 80 00 2c be,a 4000f07c 4000efd0: 84 00 a0 04 add %g2, 4, %g2 continue; the_info = _Objects_Information_table[ the_api ][ 1 ]; 4000efd4: c6 00 e0 04 ld [ %g3 + 4 ], %g3 if ( !the_info ) continue; #endif maximum = the_info->maximum; object_table = the_info->local_table; 4000efd8: 9a 10 20 01 mov 1, %o5 4000efdc: f4 00 e0 1c ld [ %g3 + 0x1c ], %i2 for ( index = 1 ; index <= maximum ; index++ ) { 4000efe0: 10 80 00 23 b 4000f06c 4000efe4: de 10 e0 10 lduh [ %g3 + 0x10 ], %o7 the_thread = (Thread_Control *) object_table[ index ]; 4000efe8: c6 06 80 03 ld [ %i2 + %g3 ], %g3 if ( !the_thread ) 4000efec: 80 a0 e0 00 cmp %g3, 0 4000eff0: 02 80 00 1d be 4000f064 4000eff4: 98 10 00 04 mov %g4, %o4 /* * If this thread is of lower priority than the interested thread, * go on to the next thread. */ if ( the_thread->current_priority > interested_priority ) 4000eff8: d8 00 e0 14 ld [ %g3 + 0x14 ], %o4 4000effc: 80 a3 00 04 cmp %o4, %g4 4000f000: 38 80 00 19 bgu,a 4000f064 4000f004: 98 10 00 04 mov %g4, %o4 DEBUG_STEP("2"); /* * If this thread is not interested, then go on to the next thread. */ api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 4000f008: d4 00 e1 60 ld [ %g3 + 0x160 ], %o2 4000f00c: d4 02 a0 cc ld [ %o2 + 0xcc ], %o2 4000f010: 80 ac 00 0a andncc %l0, %o2, %g0 4000f014: 22 80 00 14 be,a 4000f064 4000f018: 98 10 00 04 mov %g4, %o4 * * NOTE: We initialized interested_priority to PRIORITY_MAXIMUM + 1 * so we never have to worry about deferencing a NULL * interested thread. */ if ( the_thread->current_priority < interested_priority ) { 4000f01c: 80 a3 00 04 cmp %o4, %g4 4000f020: 2a 80 00 11 bcs,a 4000f064 4000f024: 82 10 00 03 mov %g3, %g1 * and blocking interruptibutable by signal. * * If the interested thread is ready, don't think about changing. */ if ( !_States_Is_ready( interested->current_state ) ) { 4000f028: d2 00 60 10 ld [ %g1 + 0x10 ], %o1 4000f02c: 80 a2 60 00 cmp %o1, 0 4000f030: 22 80 00 0d be,a 4000f064 <== NEVER TAKEN 4000f034: 98 10 00 04 mov %g4, %o4 <== NOT EXECUTED /* preferred ready over blocked */ DEBUG_STEP("5"); if ( _States_Is_ready( the_thread->current_state ) ) { 4000f038: d4 00 e0 10 ld [ %g3 + 0x10 ], %o2 4000f03c: 80 a2 a0 00 cmp %o2, 0 4000f040: 22 80 00 09 be,a 4000f064 4000f044: 82 10 00 03 mov %g3, %g1 continue; } DEBUG_STEP("6"); /* prefer blocked/interruptible over blocked/not interruptible */ if ( !_States_Is_interruptible_by_signal(interested->current_state) ) { 4000f048: 80 8a 40 0b btst %o1, %o3 4000f04c: 32 80 00 06 bne,a 4000f064 4000f050: 98 10 00 04 mov %g4, %o4 DEBUG_STEP("7"); if ( _States_Is_interruptible_by_signal(the_thread->current_state) ) { 4000f054: 80 8a 80 0b btst %o2, %o3 4000f058: 32 80 00 03 bne,a 4000f064 4000f05c: 82 10 00 03 mov %g3, %g1 4000f060: 98 10 00 04 mov %g4, %o4 #endif maximum = the_info->maximum; object_table = the_info->local_table; for ( index = 1 ; index <= maximum ; index++ ) { 4000f064: 9a 03 60 01 inc %o5 4000f068: 88 10 00 0c mov %o4, %g4 4000f06c: 80 a3 40 0f cmp %o5, %o7 4000f070: 28 bf ff de bleu,a 4000efe8 4000f074: 87 2b 60 02 sll %o5, 2, %g3 4000f078: 84 00 a0 04 add %g2, 4, %g2 * + rtems internal threads do not receive signals. */ interested = NULL; interested_priority = PRIORITY_MAXIMUM + 1; for (the_api = OBJECTS_CLASSIC_API; the_api <= OBJECTS_APIS_LAST; the_api++) { 4000f07c: 80 a0 80 08 cmp %g2, %o0 4000f080: 32 bf ff d2 bne,a 4000efc8 4000f084: c6 00 80 00 ld [ %g2 ], %g3 } } } } if ( interested ) { 4000f088: 80 a0 60 00 cmp %g1, 0 4000f08c: 02 80 00 0b be 4000f0b8 4000f090: 01 00 00 00 nop * thread needs to do the post context switch extension so it can * evaluate the signals pending. */ process_it: the_thread->do_post_task_switch_extension = true; 4000f094: 84 10 20 01 mov 1, %g2 ! 1 /* * Returns true if the signal was synchronously given to a thread * blocked waiting for the signal. */ if ( _POSIX_signals_Unblock_thread( the_thread, sig, siginfo ) ) { 4000f098: 90 10 00 01 mov %g1, %o0 * thread needs to do the post context switch extension so it can * evaluate the signals pending. */ process_it: the_thread->do_post_task_switch_extension = true; 4000f09c: c4 28 60 74 stb %g2, [ %g1 + 0x74 ] /* * Returns true if the signal was synchronously given to a thread * blocked waiting for the signal. */ if ( _POSIX_signals_Unblock_thread( the_thread, sig, siginfo ) ) { 4000f0a0: 92 10 00 19 mov %i1, %o1 4000f0a4: 40 00 00 5d call 4000f218 <_POSIX_signals_Unblock_thread> 4000f0a8: 94 07 bf f4 add %fp, -12, %o2 4000f0ac: 80 8a 20 ff btst 0xff, %o0 4000f0b0: 12 80 00 20 bne 4000f130 4000f0b4: 01 00 00 00 nop /* * We may have woken up a thread but we definitely need to post the * signal to the process wide information set. */ _POSIX_signals_Set_process_signals( mask ); 4000f0b8: 40 00 00 47 call 4000f1d4 <_POSIX_signals_Set_process_signals> 4000f0bc: 90 10 00 10 mov %l0, %o0 if ( _POSIX_signals_Vectors[ sig ].sa_flags == SA_SIGINFO ) { 4000f0c0: 83 2e 60 04 sll %i1, 4, %g1 4000f0c4: b3 2e 60 02 sll %i1, 2, %i1 4000f0c8: b2 20 40 19 sub %g1, %i1, %i1 4000f0cc: 03 10 00 77 sethi %hi(0x4001dc00), %g1 4000f0d0: 82 10 63 04 or %g1, 0x304, %g1 ! 4001df04 <_POSIX_signals_Vectors> 4000f0d4: c2 00 40 19 ld [ %g1 + %i1 ], %g1 4000f0d8: 80 a0 60 02 cmp %g1, 2 4000f0dc: 12 80 00 15 bne 4000f130 4000f0e0: 11 10 00 78 sethi %hi(0x4001e000), %o0 psiginfo = (POSIX_signals_Siginfo_node *) 4000f0e4: 7f ff f4 d3 call 4000c430 <_Chain_Get> 4000f0e8: 90 12 20 84 or %o0, 0x84, %o0 ! 4001e084 <_POSIX_signals_Inactive_siginfo> _Chain_Get( &_POSIX_signals_Inactive_siginfo ); if ( !psiginfo ) { 4000f0ec: a0 92 20 00 orcc %o0, 0, %l0 4000f0f0: 12 80 00 08 bne 4000f110 4000f0f4: 92 07 bf f4 add %fp, -12, %o1 _Thread_Enable_dispatch(); 4000f0f8: 7f ff e5 55 call 4000864c <_Thread_Enable_dispatch> 4000f0fc: 01 00 00 00 nop rtems_set_errno_and_return_minus_one( EAGAIN ); 4000f100: 40 00 00 f7 call 4000f4dc <__errno> 4000f104: 01 00 00 00 nop 4000f108: 10 bf ff 67 b 4000eea4 4000f10c: 82 10 20 0b mov 0xb, %g1 ! b } psiginfo->Info = *siginfo; 4000f110: 90 04 20 08 add %l0, 8, %o0 4000f114: 40 00 03 2e call 4000fdcc 4000f118: 94 10 20 0c mov 0xc, %o2 _Chain_Append( &_POSIX_signals_Siginfo[ sig ], &psiginfo->Node ); 4000f11c: 11 10 00 78 sethi %hi(0x4001e000), %o0 4000f120: 92 10 00 10 mov %l0, %o1 4000f124: 90 12 20 fc or %o0, 0xfc, %o0 4000f128: 7f ff df 75 call 40006efc <_Chain_Append> 4000f12c: 90 02 00 19 add %o0, %i1, %o0 } DEBUG_STEP("\n"); _Thread_Enable_dispatch(); 4000f130: 7f ff e5 47 call 4000864c <_Thread_Enable_dispatch> 4000f134: 01 00 00 00 nop 4000f138: 90 10 20 00 clr %o0 ! 0 return 0; } 4000f13c: b0 10 00 08 mov %o0, %i0 4000f140: 81 c7 e0 08 ret 4000f144: 81 e8 00 00 restore =============================================================================== 4001be50 : int nanosleep( const struct timespec *rqtp, struct timespec *rmtp ) { 4001be50: 9d e3 bf a0 save %sp, -96, %sp Watchdog_Interval ticks; if ( !_Timespec_Is_valid( rqtp ) ) 4001be54: 40 00 00 72 call 4001c01c <_Timespec_Is_valid> 4001be58: 90 10 00 18 mov %i0, %o0 4001be5c: 80 8a 20 ff btst 0xff, %o0 4001be60: 02 80 00 0a be 4001be88 4001be64: 01 00 00 00 nop * Return EINVAL if the delay interval is negative. * * NOTE: This behavior is beyond the POSIX specification. * FSU and GNU/Linux pthreads shares this behavior. */ if ( rqtp->tv_sec < 0 || rqtp->tv_nsec < 0 ) 4001be68: c2 06 00 00 ld [ %i0 ], %g1 4001be6c: 80 a0 60 00 cmp %g1, 0 4001be70: 06 80 00 06 bl 4001be88 <== NEVER TAKEN 4001be74: 01 00 00 00 nop 4001be78: c2 06 20 04 ld [ %i0 + 4 ], %g1 4001be7c: 80 a0 60 00 cmp %g1, 0 4001be80: 16 80 00 06 bge 4001be98 <== ALWAYS TAKEN 4001be84: 01 00 00 00 nop rtems_set_errno_and_return_minus_one( EINVAL ); 4001be88: 7f ff ce be call 4000f980 <__errno> 4001be8c: 01 00 00 00 nop 4001be90: 10 80 00 3c b 4001bf80 4001be94: 82 10 20 16 mov 0x16, %g1 ! 16 ticks = _Timespec_To_ticks( rqtp ); 4001be98: 7f ff c5 5e call 4000d410 <_Timespec_To_ticks> 4001be9c: 90 10 00 18 mov %i0, %o0 * A nanosleep for zero time is implemented as a yield. * This behavior is also beyond the POSIX specification but is * consistent with the RTEMS API and yields desirable behavior. */ if ( !ticks ) { 4001bea0: b0 92 20 00 orcc %o0, 0, %i0 4001bea4: 12 80 00 10 bne 4001bee4 4001bea8: 03 10 00 7a sethi %hi(0x4001e800), %g1 rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 4001beac: c4 00 61 f0 ld [ %g1 + 0x1f0 ], %g2 ! 4001e9f0 <_Thread_Dispatch_disable_level> 4001beb0: 84 00 a0 01 inc %g2 4001beb4: c4 20 61 f0 st %g2, [ %g1 + 0x1f0 ] _Thread_Disable_dispatch(); _Thread_Yield_processor(); 4001beb8: 7f ff b6 4f call 400097f4 <_Thread_Yield_processor> 4001bebc: 01 00 00 00 nop _Thread_Enable_dispatch(); 4001bec0: 7f ff b2 fc call 40008ab0 <_Thread_Enable_dispatch> 4001bec4: 01 00 00 00 nop if ( rmtp ) { 4001bec8: 80 a6 60 00 cmp %i1, 0 4001becc: 02 80 00 30 be 4001bf8c 4001bed0: 01 00 00 00 nop rmtp->tv_sec = 0; rmtp->tv_nsec = 0; 4001bed4: c0 26 60 04 clr [ %i1 + 4 ] if ( !ticks ) { _Thread_Disable_dispatch(); _Thread_Yield_processor(); _Thread_Enable_dispatch(); if ( rmtp ) { rmtp->tv_sec = 0; 4001bed8: c0 26 40 00 clr [ %i1 ] 4001bedc: 81 c7 e0 08 ret 4001bee0: 81 e8 00 00 restore 4001bee4: c4 00 61 f0 ld [ %g1 + 0x1f0 ], %g2 4001bee8: 84 00 a0 01 inc %g2 4001beec: c4 20 61 f0 st %g2, [ %g1 + 0x1f0 ] /* * Block for the desired amount of time */ _Thread_Disable_dispatch(); _Thread_Set_state( 4001bef0: 21 10 00 7a sethi %hi(0x4001e800), %l0 4001bef4: d0 04 22 ac ld [ %l0 + 0x2ac ], %o0 ! 4001eaac <_Thread_Executing> 4001bef8: 13 04 00 00 sethi %hi(0x10000000), %o1 4001befc: 7f ff b5 42 call 40009404 <_Thread_Set_state> 4001bf00: 92 12 60 08 or %o1, 8, %o1 ! 10000008 _Thread_Executing, STATES_DELAYING | STATES_INTERRUPTIBLE_BY_SIGNAL ); _Watchdog_Initialize( &_Thread_Executing->Timer, 4001bf04: c2 04 22 ac ld [ %l0 + 0x2ac ], %g1 4001bf08: 11 10 00 7a sethi %hi(0x4001e800), %o0 _Thread_Disable_dispatch(); _Thread_Set_state( _Thread_Executing, STATES_DELAYING | STATES_INTERRUPTIBLE_BY_SIGNAL ); _Watchdog_Initialize( 4001bf0c: c4 00 60 08 ld [ %g1 + 8 ], %g2 4001bf10: 90 12 22 cc or %o0, 0x2cc, %o0 void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; the_watchdog->id = id; 4001bf14: c4 20 60 68 st %g2, [ %g1 + 0x68 ] ) { the_watchdog->initial = units; _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 4001bf18: 92 00 60 48 add %g1, 0x48, %o1 Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 4001bf1c: 05 10 00 22 sethi %hi(0x40008800), %g2 4001bf20: 84 10 a1 2c or %g2, 0x12c, %g2 ! 4000892c <_Thread_Delay_ended> Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 4001bf24: c0 20 60 50 clr [ %g1 + 0x50 ] the_watchdog->routine = routine; the_watchdog->id = id; the_watchdog->user_data = user_data; 4001bf28: c0 20 60 6c clr [ %g1 + 0x6c ] Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 4001bf2c: f0 20 60 54 st %i0, [ %g1 + 0x54 ] _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 4001bf30: 7f ff b7 60 call 40009cb0 <_Watchdog_Insert> 4001bf34: c4 20 60 64 st %g2, [ %g1 + 0x64 ] _Thread_Delay_ended, _Thread_Executing->Object.id, NULL ); _Watchdog_Insert_ticks( &_Thread_Executing->Timer, ticks ); _Thread_Enable_dispatch(); 4001bf38: 7f ff b2 de call 40008ab0 <_Thread_Enable_dispatch> 4001bf3c: 01 00 00 00 nop /* calculate time remaining */ if ( rmtp ) { 4001bf40: 80 a6 60 00 cmp %i1, 0 4001bf44: 02 80 00 12 be 4001bf8c 4001bf48: c2 04 22 ac ld [ %l0 + 0x2ac ], %g1 ticks -= _Thread_Executing->Timer.stop_time - _Thread_Executing->Timer.start_time; _Timespec_From_ticks( ticks, rmtp ); 4001bf4c: 92 10 00 19 mov %i1, %o1 _Thread_Enable_dispatch(); /* calculate time remaining */ if ( rmtp ) { ticks -= 4001bf50: c4 00 60 60 ld [ %g1 + 0x60 ], %g2 4001bf54: c2 00 60 5c ld [ %g1 + 0x5c ], %g1 4001bf58: 82 20 40 02 sub %g1, %g2, %g1 4001bf5c: b0 00 40 18 add %g1, %i0, %i0 _Thread_Executing->Timer.stop_time - _Thread_Executing->Timer.start_time; _Timespec_From_ticks( ticks, rmtp ); 4001bf60: 40 00 00 1a call 4001bfc8 <_Timespec_From_ticks> 4001bf64: 90 10 00 18 mov %i0, %o0 */ #if defined(RTEMS_POSIX_API) /* * If there is time remaining, then we were interrupted by a signal. */ if ( ticks ) 4001bf68: 80 a6 20 00 cmp %i0, 0 4001bf6c: 02 80 00 08 be 4001bf8c 4001bf70: 01 00 00 00 nop rtems_set_errno_and_return_minus_one( EINTR ); 4001bf74: 7f ff ce 83 call 4000f980 <__errno> 4001bf78: 01 00 00 00 nop 4001bf7c: 82 10 20 04 mov 4, %g1 ! 4 4001bf80: c2 22 00 00 st %g1, [ %o0 ] 4001bf84: 81 c7 e0 08 ret 4001bf88: 91 e8 3f ff restore %g0, -1, %o0 #endif } return 0; } 4001bf8c: 81 c7 e0 08 ret 4001bf90: 91 e8 20 00 restore %g0, 0, %o0 =============================================================================== 4000af78 : int pthread_attr_setschedpolicy( pthread_attr_t *attr, int policy ) { if ( !attr || !attr->is_initialized ) 4000af78: 80 a2 20 00 cmp %o0, 0 4000af7c: 02 80 00 10 be 4000afbc 4000af80: 01 00 00 00 nop 4000af84: c2 02 00 00 ld [ %o0 ], %g1 4000af88: 80 a0 60 00 cmp %g1, 0 4000af8c: 02 80 00 0c be 4000afbc 4000af90: 80 a2 60 04 cmp %o1, 4 return EINVAL; switch ( policy ) { 4000af94: 18 80 00 06 bgu 4000afac 4000af98: 82 10 20 01 mov 1, %g1 4000af9c: 83 28 40 09 sll %g1, %o1, %g1 4000afa0: 80 88 60 17 btst 0x17, %g1 4000afa4: 32 80 00 04 bne,a 4000afb4 <== ALWAYS TAKEN 4000afa8: d2 22 20 14 st %o1, [ %o0 + 0x14 ] 4000afac: 81 c3 e0 08 retl 4000afb0: 90 10 20 86 mov 0x86, %o0 case SCHED_OTHER: case SCHED_FIFO: case SCHED_RR: case SCHED_SPORADIC: attr->schedpolicy = policy; return 0; 4000afb4: 81 c3 e0 08 retl 4000afb8: 90 10 20 00 clr %o0 default: return ENOTSUP; } } 4000afbc: 81 c3 e0 08 retl 4000afc0: 90 10 20 16 mov 0x16, %o0 =============================================================================== 40006a44 : int pthread_barrier_init( pthread_barrier_t *barrier, const pthread_barrierattr_t *attr, unsigned int count ) { 40006a44: 9d e3 bf 90 save %sp, -112, %sp const pthread_barrierattr_t *the_attr; /* * Error check parameters */ if ( !barrier ) 40006a48: 80 a6 20 00 cmp %i0, 0 40006a4c: 02 80 00 2e be 40006b04 40006a50: 80 a6 a0 00 cmp %i2, 0 return EINVAL; if ( count == 0 ) 40006a54: 02 80 00 2c be 40006b04 40006a58: 80 a6 60 00 cmp %i1, 0 return EINVAL; /* * If the user passed in NULL, use the default attributes */ if ( attr ) { 40006a5c: 32 80 00 06 bne,a 40006a74 40006a60: c2 06 40 00 ld [ %i1 ], %g1 the_attr = attr; } else { (void) pthread_barrierattr_init( &my_attr ); 40006a64: b2 07 bf f0 add %fp, -16, %i1 40006a68: 7f ff ff c0 call 40006968 40006a6c: 90 10 00 19 mov %i1, %o0 } /* * Now start error checking the attributes that we are going to use */ if ( !the_attr->is_initialized ) 40006a70: c2 06 40 00 ld [ %i1 ], %g1 40006a74: 80 a0 60 00 cmp %g1, 0 40006a78: 02 80 00 23 be 40006b04 40006a7c: 01 00 00 00 nop return EINVAL; switch ( the_attr->process_shared ) { 40006a80: c2 06 60 04 ld [ %i1 + 4 ], %g1 40006a84: 80 a0 60 00 cmp %g1, 0 40006a88: 12 80 00 1f bne 40006b04 <== NEVER TAKEN 40006a8c: 03 10 00 7c sethi %hi(0x4001f000), %g1 rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 40006a90: c4 00 62 50 ld [ %g1 + 0x250 ], %g2 ! 4001f250 <_Thread_Dispatch_disable_level> /* * Convert from POSIX attributes to Core Barrier attributes */ the_attributes.discipline = CORE_BARRIER_AUTOMATIC_RELEASE; the_attributes.maximum_count = count; 40006a94: f4 27 bf fc st %i2, [ %fp + -4 ] 40006a98: 84 00 a0 01 inc %g2 } /* * Convert from POSIX attributes to Core Barrier attributes */ the_attributes.discipline = CORE_BARRIER_AUTOMATIC_RELEASE; 40006a9c: c0 27 bf f8 clr [ %fp + -8 ] 40006aa0: c4 20 62 50 st %g2, [ %g1 + 0x250 ] * This function allocates a barrier control block from * the inactive chain of free barrier control blocks. */ RTEMS_INLINE_ROUTINE POSIX_Barrier_Control *_POSIX_Barrier_Allocate( void ) { return (POSIX_Barrier_Control *) 40006aa4: 23 10 00 7d sethi %hi(0x4001f400), %l1 40006aa8: 40 00 08 28 call 40008b48 <_Objects_Allocate> 40006aac: 90 14 62 60 or %l1, 0x260, %o0 ! 4001f660 <_POSIX_Barrier_Information> */ _Thread_Disable_dispatch(); /* prevents deletion */ the_barrier = _POSIX_Barrier_Allocate(); if ( !the_barrier ) { 40006ab0: a0 92 20 00 orcc %o0, 0, %l0 40006ab4: 12 80 00 06 bne 40006acc 40006ab8: 90 04 20 10 add %l0, 0x10, %o0 _Thread_Enable_dispatch(); 40006abc: 40 00 0b 82 call 400098c4 <_Thread_Enable_dispatch> 40006ac0: b0 10 20 0b mov 0xb, %i0 return EAGAIN; 40006ac4: 81 c7 e0 08 ret 40006ac8: 81 e8 00 00 restore } _CORE_barrier_Initialize( &the_barrier->Barrier, &the_attributes ); 40006acc: 40 00 05 b4 call 4000819c <_CORE_barrier_Initialize> 40006ad0: 92 07 bf f8 add %fp, -8, %o1 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 40006ad4: c4 14 20 0a lduh [ %l0 + 0xa ], %g2 40006ad8: a2 14 62 60 or %l1, 0x260, %l1 40006adc: c6 04 60 1c ld [ %l1 + 0x1c ], %g3 40006ae0: c2 04 20 08 ld [ %l0 + 8 ], %g1 40006ae4: 85 28 a0 02 sll %g2, 2, %g2 40006ae8: e0 20 c0 02 st %l0, [ %g3 + %g2 ] _Objects_Get_index( the_object->id ), the_object ); /* ASSERT: information->is_string == false */ the_object->name.name_u32 = name; 40006aec: c0 24 20 0c clr [ %l0 + 0xc ] ); /* * Exit the critical section and return the user an operational barrier */ *barrier = the_barrier->Object.id; 40006af0: c2 26 00 00 st %g1, [ %i0 ] _Thread_Enable_dispatch(); 40006af4: 40 00 0b 74 call 400098c4 <_Thread_Enable_dispatch> 40006af8: b0 10 20 00 clr %i0 return 0; 40006afc: 81 c7 e0 08 ret 40006b00: 81 e8 00 00 restore } 40006b04: 81 c7 e0 08 ret 40006b08: 91 e8 20 16 restore %g0, 0x16, %o0 =============================================================================== 40006200 : void pthread_cleanup_push( void (*routine)( void * ), void *arg ) { 40006200: 9d e3 bf a0 save %sp, -96, %sp /* * The POSIX standard does not address what to do when the routine * is NULL. It also does not address what happens when we cannot * allocate memory or anything else bad happens. */ if ( !routine ) 40006204: 80 a6 20 00 cmp %i0, 0 40006208: 02 80 00 12 be 40006250 4000620c: 03 10 00 7d sethi %hi(0x4001f400), %g1 rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 40006210: c4 00 62 f0 ld [ %g1 + 0x2f0 ], %g2 ! 4001f6f0 <_Thread_Dispatch_disable_level> 40006214: 84 00 a0 01 inc %g2 40006218: c4 20 62 f0 st %g2, [ %g1 + 0x2f0 ] return; _Thread_Disable_dispatch(); handler = _Workspace_Allocate( sizeof( POSIX_Cancel_Handler_control ) ); 4000621c: 40 00 10 f7 call 4000a5f8 <_Workspace_Allocate> 40006220: 90 10 20 10 mov 0x10, %o0 if ( handler ) { 40006224: 92 92 20 00 orcc %o0, 0, %o1 40006228: 02 80 00 08 be 40006248 <== NEVER TAKEN 4000622c: 03 10 00 7d sethi %hi(0x4001f400), %g1 thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; handler_stack = &thread_support->Cancellation_Handlers; 40006230: c2 00 63 ac ld [ %g1 + 0x3ac ], %g1 ! 4001f7ac <_Thread_Executing> handler->routine = routine; 40006234: f0 22 60 08 st %i0, [ %o1 + 8 ] handler = _Workspace_Allocate( sizeof( POSIX_Cancel_Handler_control ) ); if ( handler ) { thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; handler_stack = &thread_support->Cancellation_Handlers; 40006238: d0 00 61 60 ld [ %g1 + 0x160 ], %o0 handler->routine = routine; handler->arg = arg; 4000623c: f2 22 60 0c st %i1, [ %o1 + 0xc ] _Chain_Append( handler_stack, &handler->Node ); 40006240: 40 00 06 06 call 40007a58 <_Chain_Append> 40006244: 90 02 20 e0 add %o0, 0xe0, %o0 } _Thread_Enable_dispatch(); 40006248: 40 00 0b aa call 400090f0 <_Thread_Enable_dispatch> 4000624c: 81 e8 00 00 restore 40006250: 81 c7 e0 08 ret 40006254: 81 e8 00 00 restore =============================================================================== 40007300 : int pthread_cond_init( pthread_cond_t *cond, const pthread_condattr_t *attr ) { 40007300: 9d e3 bf a0 save %sp, -96, %sp POSIX_Condition_variables_Control *the_cond; const pthread_condattr_t *the_attr; if ( attr ) the_attr = attr; 40007304: 25 10 00 7a sethi %hi(0x4001e800), %l2 40007308: 80 a6 60 00 cmp %i1, 0 4000730c: 02 80 00 03 be 40007318 40007310: a4 14 a2 50 or %l2, 0x250, %l2 40007314: a4 10 00 19 mov %i1, %l2 /* * Be careful about attributes when global!!! */ if ( the_attr->process_shared == PTHREAD_PROCESS_SHARED ) 40007318: c2 04 a0 04 ld [ %l2 + 4 ], %g1 4000731c: 80 a0 60 01 cmp %g1, 1 40007320: 02 80 00 26 be 400073b8 <== NEVER TAKEN 40007324: 01 00 00 00 nop return EINVAL; if ( !the_attr->is_initialized ) 40007328: c2 04 80 00 ld [ %l2 ], %g1 4000732c: 80 a0 60 00 cmp %g1, 0 40007330: 02 80 00 22 be 400073b8 40007334: 03 10 00 81 sethi %hi(0x40020400), %g1 rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 40007338: c4 00 61 70 ld [ %g1 + 0x170 ], %g2 ! 40020570 <_Thread_Dispatch_disable_level> 4000733c: 84 00 a0 01 inc %g2 40007340: c4 20 61 70 st %g2, [ %g1 + 0x170 ] */ RTEMS_INLINE_ROUTINE POSIX_Condition_variables_Control *_POSIX_Condition_variables_Allocate( void ) { return (POSIX_Condition_variables_Control *) 40007344: 23 10 00 82 sethi %hi(0x40020800), %l1 40007348: 40 00 09 b2 call 40009a10 <_Objects_Allocate> 4000734c: 90 14 62 18 or %l1, 0x218, %o0 ! 40020a18 <_POSIX_Condition_variables_Information> _Thread_Disable_dispatch(); the_cond = _POSIX_Condition_variables_Allocate(); if ( !the_cond ) { 40007350: a0 92 20 00 orcc %o0, 0, %l0 40007354: 32 80 00 06 bne,a 4000736c 40007358: c2 04 a0 04 ld [ %l2 + 4 ], %g1 _Thread_Enable_dispatch(); 4000735c: 40 00 0d 0c call 4000a78c <_Thread_Enable_dispatch> 40007360: b0 10 20 0c mov 0xc, %i0 return ENOMEM; 40007364: 81 c7 e0 08 ret 40007368: 81 e8 00 00 restore the_cond->process_shared = the_attr->process_shared; the_cond->Mutex = POSIX_CONDITION_VARIABLES_NO_MUTEX; /* XXX some more initialization might need to go here */ _Thread_queue_Initialize( 4000736c: 90 04 20 18 add %l0, 0x18, %o0 if ( !the_cond ) { _Thread_Enable_dispatch(); return ENOMEM; } the_cond->process_shared = the_attr->process_shared; 40007370: c2 24 20 10 st %g1, [ %l0 + 0x10 ] the_cond->Mutex = POSIX_CONDITION_VARIABLES_NO_MUTEX; /* XXX some more initialization might need to go here */ _Thread_queue_Initialize( 40007374: 92 10 20 00 clr %o1 40007378: 94 10 28 00 mov 0x800, %o2 4000737c: 96 10 20 74 mov 0x74, %o3 40007380: 40 00 0f 19 call 4000afe4 <_Thread_queue_Initialize> 40007384: c0 24 20 14 clr [ %l0 + 0x14 ] #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 40007388: c4 14 20 0a lduh [ %l0 + 0xa ], %g2 4000738c: a2 14 62 18 or %l1, 0x218, %l1 40007390: c6 04 60 1c ld [ %l1 + 0x1c ], %g3 40007394: c2 04 20 08 ld [ %l0 + 8 ], %g1 40007398: 85 28 a0 02 sll %g2, 2, %g2 4000739c: e0 20 c0 02 st %l0, [ %g3 + %g2 ] _Objects_Get_index( the_object->id ), the_object ); /* ASSERT: information->is_string == false */ the_object->name.name_u32 = name; 400073a0: c0 24 20 0c clr [ %l0 + 0xc ] &_POSIX_Condition_variables_Information, &the_cond->Object, 0 ); *cond = the_cond->Object.id; 400073a4: c2 26 00 00 st %g1, [ %i0 ] _Thread_Enable_dispatch(); 400073a8: 40 00 0c f9 call 4000a78c <_Thread_Enable_dispatch> 400073ac: b0 10 20 00 clr %i0 return 0; 400073b0: 81 c7 e0 08 ret 400073b4: 81 e8 00 00 restore } 400073b8: 81 c7 e0 08 ret 400073bc: 91 e8 20 16 restore %g0, 0x16, %o0 =============================================================================== 40007178 : int pthread_condattr_destroy( pthread_condattr_t *attr ) { if ( !attr || attr->is_initialized == false ) 40007178: 80 a2 20 00 cmp %o0, 0 4000717c: 02 80 00 09 be 400071a0 40007180: 01 00 00 00 nop 40007184: c2 02 00 00 ld [ %o0 ], %g1 40007188: 80 a0 60 00 cmp %g1, 0 4000718c: 02 80 00 05 be 400071a0 <== NEVER TAKEN 40007190: 01 00 00 00 nop return EINVAL; attr->is_initialized = false; 40007194: c0 22 00 00 clr [ %o0 ] return 0; 40007198: 81 c3 e0 08 retl 4000719c: 90 10 20 00 clr %o0 } 400071a0: 81 c3 e0 08 retl 400071a4: 90 10 20 16 mov 0x16, %o0 =============================================================================== 400066e0 : pthread_t *thread, const pthread_attr_t *attr, void *(*start_routine)( void * ), void *arg ) { 400066e0: 9d e3 bf 58 save %sp, -168, %sp 400066e4: a0 10 00 18 mov %i0, %l0 int schedpolicy = SCHED_RR; struct sched_param schedparam; Objects_Name name; int rc; if ( !start_routine ) 400066e8: 80 a6 a0 00 cmp %i2, 0 400066ec: 02 80 00 8b be 40006918 400066f0: b0 10 20 0e mov 0xe, %i0 return EFAULT; the_attr = (attr) ? attr : &_POSIX_Threads_Default_attributes; 400066f4: 23 10 00 74 sethi %hi(0x4001d000), %l1 400066f8: 80 a6 60 00 cmp %i1, 0 400066fc: 02 80 00 03 be 40006708 40006700: a2 14 61 c8 or %l1, 0x1c8, %l1 40006704: a2 10 00 19 mov %i1, %l1 if ( !the_attr->is_initialized ) 40006708: c2 04 40 00 ld [ %l1 ], %g1 4000670c: 80 a0 60 00 cmp %g1, 0 40006710: 22 80 00 82 be,a 40006918 40006714: b0 10 20 16 mov 0x16, %i0 * stack space if it is allowed to allocate it itself. * * NOTE: If the user provides the stack we will let it drop below * twice the minimum. */ if ( the_attr->stackaddr && !_Stack_Is_enough(the_attr->stacksize) ) 40006718: c2 04 60 04 ld [ %l1 + 4 ], %g1 4000671c: 80 a0 60 00 cmp %g1, 0 40006720: 02 80 00 07 be 4000673c 40006724: 03 10 00 78 sethi %hi(0x4001e000), %g1 40006728: c4 04 60 08 ld [ %l1 + 8 ], %g2 4000672c: c2 00 62 34 ld [ %g1 + 0x234 ], %g1 40006730: 80 a0 80 01 cmp %g2, %g1 40006734: 2a 80 00 79 bcs,a 40006918 40006738: b0 10 20 16 mov 0x16, %i0 * If inheritsched is set to PTHREAD_INHERIT_SCHED, then this thread * inherits scheduling attributes from the creating thread. If it is * PTHREAD_EXPLICIT_SCHED, then scheduling parameters come from the * attributes structure. */ switch ( the_attr->inheritsched ) { 4000673c: c2 04 60 10 ld [ %l1 + 0x10 ], %g1 40006740: 80 a0 60 01 cmp %g1, 1 40006744: 02 80 00 06 be 4000675c 40006748: 80 a0 60 02 cmp %g1, 2 4000674c: 12 80 00 73 bne 40006918 40006750: b0 10 20 16 mov 0x16, %i0 schedpolicy = api->schedpolicy; schedparam = api->schedparam; break; case PTHREAD_EXPLICIT_SCHED: schedpolicy = the_attr->schedpolicy; 40006754: 10 80 00 0a b 4000677c 40006758: e6 04 60 14 ld [ %l1 + 0x14 ], %l3 * PTHREAD_EXPLICIT_SCHED, then scheduling parameters come from the * attributes structure. */ switch ( the_attr->inheritsched ) { case PTHREAD_INHERIT_SCHED: api = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; 4000675c: 03 10 00 7b sethi %hi(0x4001ec00), %g1 40006760: c2 00 61 7c ld [ %g1 + 0x17c ], %g1 ! 4001ed7c <_Thread_Executing> schedpolicy = api->schedpolicy; schedparam = api->schedparam; 40006764: 90 07 bf dc add %fp, -36, %o0 * PTHREAD_EXPLICIT_SCHED, then scheduling parameters come from the * attributes structure. */ switch ( the_attr->inheritsched ) { case PTHREAD_INHERIT_SCHED: api = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; 40006768: c2 00 61 60 ld [ %g1 + 0x160 ], %g1 schedpolicy = api->schedpolicy; schedparam = api->schedparam; 4000676c: 94 10 20 1c mov 0x1c, %o2 40006770: 92 00 60 84 add %g1, 0x84, %o1 * attributes structure. */ switch ( the_attr->inheritsched ) { case PTHREAD_INHERIT_SCHED: api = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; schedpolicy = api->schedpolicy; 40006774: 10 80 00 05 b 40006788 40006778: e6 00 60 80 ld [ %g1 + 0x80 ], %l3 schedparam = api->schedparam; break; case PTHREAD_EXPLICIT_SCHED: schedpolicy = the_attr->schedpolicy; schedparam = the_attr->schedparam; 4000677c: 90 07 bf dc add %fp, -36, %o0 40006780: 92 04 60 18 add %l1, 0x18, %o1 40006784: 94 10 20 1c mov 0x1c, %o2 40006788: 40 00 29 13 call 40010bd4 4000678c: b0 10 20 86 mov 0x86, %i0 /* * Check the contentionscope since rtems only supports PROCESS wide * contention (i.e. no system wide contention). */ if ( the_attr->contentionscope != PTHREAD_SCOPE_PROCESS ) 40006790: c2 04 60 0c ld [ %l1 + 0xc ], %g1 40006794: 80 a0 60 00 cmp %g1, 0 40006798: 12 80 00 62 bne 40006920 4000679c: 01 00 00 00 nop return ENOTSUP; /* * Interpret the scheduling parameters. */ if ( !_POSIX_Priority_Is_valid( schedparam.sched_priority ) ) 400067a0: 40 00 19 cc call 4000ced0 <_POSIX_Priority_Is_valid> 400067a4: d0 07 bf dc ld [ %fp + -36 ], %o0 400067a8: 80 8a 20 ff btst 0xff, %o0 400067ac: 02 80 00 5b be 40006918 <== NEVER TAKEN 400067b0: b0 10 20 16 mov 0x16, %i0 RTEMS_INLINE_ROUTINE Priority_Control _POSIX_Priority_To_core( int priority ) { return (Priority_Control) (POSIX_SCHEDULER_MAXIMUM_PRIORITY - priority + 1); 400067b4: 03 10 00 78 sethi %hi(0x4001e000), %g1 return EINVAL; core_priority = _POSIX_Priority_To_core( schedparam.sched_priority ); 400067b8: e8 07 bf dc ld [ %fp + -36 ], %l4 400067bc: ea 08 62 38 ldub [ %g1 + 0x238 ], %l5 /* * Set the core scheduling policy information. */ rc = _POSIX_Thread_Translate_sched_param( 400067c0: 90 10 00 13 mov %l3, %o0 400067c4: 92 07 bf dc add %fp, -36, %o1 400067c8: 94 07 bf fc add %fp, -4, %o2 400067cc: 40 00 19 cc call 4000cefc <_POSIX_Thread_Translate_sched_param> 400067d0: 96 07 bf f8 add %fp, -8, %o3 schedpolicy, &schedparam, &budget_algorithm, &budget_callout ); if ( rc ) 400067d4: b0 92 20 00 orcc %o0, 0, %i0 400067d8: 12 80 00 50 bne 40006918 400067dc: 2d 10 00 7b sethi %hi(0x4001ec00), %l6 #endif /* * Lock the allocator mutex for protection */ _RTEMS_Lock_allocator(); 400067e0: 40 00 05 fd call 40007fd4 <_API_Mutex_Lock> 400067e4: d0 05 a1 74 ld [ %l6 + 0x174 ], %o0 ! 4001ed74 <_RTEMS_Allocator_Mutex> * _POSIX_Threads_Allocate */ RTEMS_INLINE_ROUTINE Thread_Control *_POSIX_Threads_Allocate( void ) { return (Thread_Control *) _Objects_Allocate( &_POSIX_Threads_Information ); 400067e8: 11 10 00 7b sethi %hi(0x4001ec00), %o0 400067ec: 40 00 08 63 call 40008978 <_Objects_Allocate> 400067f0: 90 12 23 50 or %o0, 0x350, %o0 ! 4001ef50 <_POSIX_Threads_Information> * Allocate the thread control block. * * NOTE: Global threads are not currently supported. */ the_thread = _POSIX_Threads_Allocate(); if ( !the_thread ) { 400067f4: a4 92 20 00 orcc %o0, 0, %l2 400067f8: 32 80 00 04 bne,a 40006808 400067fc: c2 04 60 08 ld [ %l1 + 8 ], %g1 _RTEMS_Unlock_allocator(); 40006800: 10 80 00 21 b 40006884 40006804: d0 05 a1 74 ld [ %l6 + 0x174 ], %o0 /* * Initialize the core thread for this task. */ name.name_p = NULL; /* posix threads don't have a name by default */ status = _Thread_Initialize( 40006808: 05 10 00 78 sethi %hi(0x4001e000), %g2 4000680c: d6 00 a2 34 ld [ %g2 + 0x234 ], %o3 ! 4001e234 40006810: c0 27 bf d4 clr [ %fp + -44 ] 40006814: 97 2a e0 01 sll %o3, 1, %o3 40006818: 80 a2 c0 01 cmp %o3, %g1 4000681c: 1a 80 00 03 bcc 40006828 40006820: d4 04 60 04 ld [ %l1 + 4 ], %o2 40006824: 96 10 00 01 mov %g1, %o3 40006828: c2 07 bf fc ld [ %fp + -4 ], %g1 4000682c: 9a 0d 60 ff and %l5, 0xff, %o5 40006830: c2 23 a0 60 st %g1, [ %sp + 0x60 ] 40006834: c2 07 bf f8 ld [ %fp + -8 ], %g1 40006838: 9a 23 40 14 sub %o5, %l4, %o5 4000683c: c2 23 a0 64 st %g1, [ %sp + 0x64 ] 40006840: 82 07 bf d4 add %fp, -44, %g1 40006844: c0 23 a0 68 clr [ %sp + 0x68 ] 40006848: a8 10 20 01 mov 1, %l4 4000684c: c2 23 a0 6c st %g1, [ %sp + 0x6c ] 40006850: e8 23 a0 5c st %l4, [ %sp + 0x5c ] 40006854: 2b 10 00 7b sethi %hi(0x4001ec00), %l5 40006858: 92 10 00 12 mov %l2, %o1 4000685c: 90 15 63 50 or %l5, 0x350, %o0 40006860: 40 00 0b f3 call 4000982c <_Thread_Initialize> 40006864: 98 10 20 00 clr %o4 budget_callout, 0, /* isr level */ name /* posix threads don't have a name */ ); if ( !status ) { 40006868: 80 8a 20 ff btst 0xff, %o0 4000686c: 12 80 00 08 bne 4000688c 40006870: 90 15 63 50 or %l5, 0x350, %o0 RTEMS_INLINE_ROUTINE void _POSIX_Threads_Free ( Thread_Control *the_pthread ) { _Objects_Free( &_POSIX_Threads_Information, &the_pthread->Object ); 40006874: 40 00 09 1b call 40008ce0 <_Objects_Free> 40006878: 92 10 00 12 mov %l2, %o1 _POSIX_Threads_Free( the_thread ); _RTEMS_Unlock_allocator(); 4000687c: 03 10 00 7b sethi %hi(0x4001ec00), %g1 40006880: d0 00 61 74 ld [ %g1 + 0x174 ], %o0 ! 4001ed74 <_RTEMS_Allocator_Mutex> 40006884: 10 80 00 23 b 40006910 40006888: b0 10 20 0b mov 0xb, %i0 } /* * finish initializing the per API structure */ api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 4000688c: ea 04 a1 60 ld [ %l2 + 0x160 ], %l5 api->Attributes = *the_attr; 40006890: 92 10 00 11 mov %l1, %o1 40006894: 94 10 20 3c mov 0x3c, %o2 40006898: 40 00 28 cf call 40010bd4 4000689c: 90 10 00 15 mov %l5, %o0 api->detachstate = the_attr->detachstate; 400068a0: c2 04 60 38 ld [ %l1 + 0x38 ], %g1 api->schedpolicy = schedpolicy; api->schedparam = schedparam; 400068a4: 92 07 bf dc add %fp, -36, %o1 * finish initializing the per API structure */ api = the_thread->API_Extensions[ THREAD_API_POSIX ]; api->Attributes = *the_attr; api->detachstate = the_attr->detachstate; 400068a8: c2 25 60 3c st %g1, [ %l5 + 0x3c ] api->schedpolicy = schedpolicy; api->schedparam = schedparam; 400068ac: 94 10 20 1c mov 0x1c, %o2 */ api = the_thread->API_Extensions[ THREAD_API_POSIX ]; api->Attributes = *the_attr; api->detachstate = the_attr->detachstate; api->schedpolicy = schedpolicy; 400068b0: e6 25 60 80 st %l3, [ %l5 + 0x80 ] api->schedparam = schedparam; 400068b4: 40 00 28 c8 call 40010bd4 400068b8: 90 05 60 84 add %l5, 0x84, %o0 the_thread->do_post_task_switch_extension = true; /* * POSIX threads are allocated and started in one operation. */ status = _Thread_Start( 400068bc: 94 10 00 1a mov %i2, %o2 * This insures we evaluate the process-wide signals pending when we * first run. * * NOTE: Since the thread starts with all unblocked, this is necessary. */ the_thread->do_post_task_switch_extension = true; 400068c0: e8 2c a0 74 stb %l4, [ %l2 + 0x74 ] /* * POSIX threads are allocated and started in one operation. */ status = _Thread_Start( 400068c4: 96 10 00 1b mov %i3, %o3 400068c8: 90 10 00 12 mov %l2, %o0 400068cc: 92 10 20 01 mov 1, %o1 400068d0: 40 00 0e b3 call 4000a39c <_Thread_Start> 400068d4: 98 10 20 00 clr %o4 _RTEMS_Unlock_allocator(); return EINVAL; } #endif if ( schedpolicy == SCHED_SPORADIC ) { 400068d8: 80 a4 e0 04 cmp %l3, 4 400068dc: 32 80 00 0a bne,a 40006904 400068e0: c2 04 a0 08 ld [ %l2 + 8 ], %g1 _Watchdog_Insert_ticks( 400068e4: 40 00 0f 57 call 4000a640 <_Timespec_To_ticks> 400068e8: 90 05 60 8c add %l5, 0x8c, %o0 ) { the_watchdog->initial = units; _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 400068ec: 92 05 60 a4 add %l5, 0xa4, %o1 Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 400068f0: d0 25 60 b0 st %o0, [ %l5 + 0xb0 ] _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 400068f4: 11 10 00 7b sethi %hi(0x4001ec00), %o0 400068f8: 40 00 10 2e call 4000a9b0 <_Watchdog_Insert> 400068fc: 90 12 21 9c or %o0, 0x19c, %o0 ! 4001ed9c <_Watchdog_Ticks_chain> } /* * Return the id and indicate we successfully created the thread */ *thread = the_thread->Object.id; 40006900: c2 04 a0 08 ld [ %l2 + 8 ], %g1 _RTEMS_Unlock_allocator(); 40006904: 05 10 00 7b sethi %hi(0x4001ec00), %g2 40006908: d0 00 a1 74 ld [ %g2 + 0x174 ], %o0 ! 4001ed74 <_RTEMS_Allocator_Mutex> } /* * Return the id and indicate we successfully created the thread */ *thread = the_thread->Object.id; 4000690c: c2 24 00 00 st %g1, [ %l0 ] _RTEMS_Unlock_allocator(); 40006910: 40 00 05 c7 call 4000802c <_API_Mutex_Unlock> 40006914: 01 00 00 00 nop return 0; 40006918: 81 c7 e0 08 ret 4000691c: 81 e8 00 00 restore } 40006920: 81 c7 e0 08 ret 40006924: 81 e8 00 00 restore =============================================================================== 400060fc : int pthread_mutexattr_gettype( const pthread_mutexattr_t *attr, int *type ) { if ( !attr ) 400060fc: 80 a2 20 00 cmp %o0, 0 40006100: 02 80 00 0c be 40006130 40006104: 01 00 00 00 nop return EINVAL; if ( !attr->is_initialized ) 40006108: c2 02 00 00 ld [ %o0 ], %g1 4000610c: 80 a0 60 00 cmp %g1, 0 40006110: 02 80 00 08 be 40006130 40006114: 80 a2 60 00 cmp %o1, 0 return EINVAL; if ( !type ) 40006118: 02 80 00 06 be 40006130 <== NEVER TAKEN 4000611c: 01 00 00 00 nop return EINVAL; *type = attr->type; 40006120: c2 02 20 10 ld [ %o0 + 0x10 ], %g1 40006124: 90 10 20 00 clr %o0 return 0; 40006128: 81 c3 e0 08 retl 4000612c: c2 22 40 00 st %g1, [ %o1 ] } 40006130: 81 c3 e0 08 retl 40006134: 90 10 20 16 mov 0x16, %o0 =============================================================================== 40008564 : int pthread_mutexattr_setpshared( pthread_mutexattr_t *attr, int pshared ) { if ( !attr || !attr->is_initialized ) 40008564: 80 a2 20 00 cmp %o0, 0 40008568: 02 80 00 0b be 40008594 4000856c: 01 00 00 00 nop 40008570: c2 02 00 00 ld [ %o0 ], %g1 40008574: 80 a0 60 00 cmp %g1, 0 40008578: 02 80 00 07 be 40008594 4000857c: 80 a2 60 01 cmp %o1, 1 return EINVAL; switch ( pshared ) { 40008580: 18 80 00 05 bgu 40008594 <== NEVER TAKEN 40008584: 01 00 00 00 nop case PTHREAD_PROCESS_SHARED: case PTHREAD_PROCESS_PRIVATE: attr->process_shared = pshared; 40008588: d2 22 20 04 st %o1, [ %o0 + 4 ] return 0; 4000858c: 81 c3 e0 08 retl 40008590: 90 10 20 00 clr %o0 default: return EINVAL; } } 40008594: 81 c3 e0 08 retl 40008598: 90 10 20 16 mov 0x16, %o0 =============================================================================== 40006164 : int pthread_mutexattr_settype( pthread_mutexattr_t *attr, int type ) { if ( !attr || !attr->is_initialized ) 40006164: 80 a2 20 00 cmp %o0, 0 40006168: 02 80 00 0b be 40006194 4000616c: 01 00 00 00 nop 40006170: c2 02 00 00 ld [ %o0 ], %g1 40006174: 80 a0 60 00 cmp %g1, 0 40006178: 02 80 00 07 be 40006194 <== NEVER TAKEN 4000617c: 80 a2 60 03 cmp %o1, 3 return EINVAL; switch ( type ) { 40006180: 18 80 00 05 bgu 40006194 40006184: 01 00 00 00 nop case PTHREAD_MUTEX_NORMAL: case PTHREAD_MUTEX_RECURSIVE: case PTHREAD_MUTEX_ERRORCHECK: case PTHREAD_MUTEX_DEFAULT: attr->type = type; 40006188: d2 22 20 10 st %o1, [ %o0 + 0x10 ] return 0; 4000618c: 81 c3 e0 08 retl 40006190: 90 10 20 00 clr %o0 default: return EINVAL; } } 40006194: 81 c3 e0 08 retl 40006198: 90 10 20 16 mov 0x16, %o0 =============================================================================== 40006d0c : int pthread_once( pthread_once_t *once_control, void (*init_routine)(void) ) { 40006d0c: 9d e3 bf 98 save %sp, -104, %sp if ( !once_control || !init_routine ) 40006d10: 80 a6 60 00 cmp %i1, 0 40006d14: 02 80 00 05 be 40006d28 40006d18: a0 10 00 18 mov %i0, %l0 40006d1c: 80 a6 20 00 cmp %i0, 0 40006d20: 32 80 00 04 bne,a 40006d30 40006d24: c2 06 20 04 ld [ %i0 + 4 ], %g1 40006d28: 81 c7 e0 08 ret 40006d2c: 91 e8 20 16 restore %g0, 0x16, %o0 return EINVAL; if ( !once_control->init_executed ) { 40006d30: 80 a0 60 00 cmp %g1, 0 40006d34: 12 80 00 13 bne 40006d80 40006d38: b0 10 20 00 clr %i0 rtems_mode saveMode; rtems_task_mode(RTEMS_NO_PREEMPT, RTEMS_PREEMPT_MASK, &saveMode); 40006d3c: 90 10 21 00 mov 0x100, %o0 40006d40: 92 10 21 00 mov 0x100, %o1 40006d44: 40 00 03 03 call 40007950 40006d48: 94 07 bf fc add %fp, -4, %o2 if ( !once_control->init_executed ) { 40006d4c: c2 04 20 04 ld [ %l0 + 4 ], %g1 40006d50: 80 a0 60 00 cmp %g1, 0 40006d54: 12 80 00 07 bne 40006d70 <== NEVER TAKEN 40006d58: d0 07 bf fc ld [ %fp + -4 ], %o0 once_control->is_initialized = true; 40006d5c: 82 10 20 01 mov 1, %g1 once_control->init_executed = true; 40006d60: c2 24 20 04 st %g1, [ %l0 + 4 ] (*init_routine)(); 40006d64: 9f c6 40 00 call %i1 40006d68: c2 24 00 00 st %g1, [ %l0 ] } rtems_task_mode(saveMode, RTEMS_PREEMPT_MASK, &saveMode); 40006d6c: d0 07 bf fc ld [ %fp + -4 ], %o0 40006d70: 92 10 21 00 mov 0x100, %o1 40006d74: 94 07 bf fc add %fp, -4, %o2 40006d78: 40 00 02 f6 call 40007950 40006d7c: b0 10 20 00 clr %i0 } return 0; } 40006d80: 81 c7 e0 08 ret 40006d84: 81 e8 00 00 restore =============================================================================== 40007534 : int pthread_rwlock_init( pthread_rwlock_t *rwlock, const pthread_rwlockattr_t *attr ) { 40007534: 9d e3 bf 90 save %sp, -112, %sp const pthread_rwlockattr_t *the_attr; /* * Error check parameters */ if ( !rwlock ) 40007538: 80 a6 20 00 cmp %i0, 0 4000753c: 02 80 00 2a be 400075e4 40007540: 80 a6 60 00 cmp %i1, 0 return EINVAL; /* * If the user passed in NULL, use the default attributes */ if ( attr ) { 40007544: 32 80 00 06 bne,a 4000755c 40007548: c2 06 40 00 ld [ %i1 ], %g1 the_attr = attr; } else { (void) pthread_rwlockattr_init( &default_attr ); 4000754c: b2 07 bf f4 add %fp, -12, %i1 40007550: 40 00 02 7f call 40007f4c 40007554: 90 10 00 19 mov %i1, %o0 } /* * Now start error checking the attributes that we are going to use */ if ( !the_attr->is_initialized ) 40007558: c2 06 40 00 ld [ %i1 ], %g1 4000755c: 80 a0 60 00 cmp %g1, 0 40007560: 02 80 00 21 be 400075e4 <== NEVER TAKEN 40007564: 01 00 00 00 nop return EINVAL; switch ( the_attr->process_shared ) { 40007568: c2 06 60 04 ld [ %i1 + 4 ], %g1 4000756c: 80 a0 60 00 cmp %g1, 0 40007570: 12 80 00 1d bne 400075e4 <== NEVER TAKEN 40007574: 03 10 00 82 sethi %hi(0x40020800), %g1 rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 40007578: c4 00 62 a0 ld [ %g1 + 0x2a0 ], %g2 ! 40020aa0 <_Thread_Dispatch_disable_level> 4000757c: 84 00 a0 01 inc %g2 40007580: c4 20 62 a0 st %g2, [ %g1 + 0x2a0 ] * This function allocates a RWLock control block from * the inactive chain of free RWLock control blocks. */ RTEMS_INLINE_ROUTINE POSIX_RWLock_Control *_POSIX_RWLock_Allocate( void ) { return (POSIX_RWLock_Control *) 40007584: 23 10 00 83 sethi %hi(0x40020c00), %l1 40007588: 40 00 09 dc call 40009cf8 <_Objects_Allocate> 4000758c: 90 14 60 f0 or %l1, 0xf0, %o0 ! 40020cf0 <_POSIX_RWLock_Information> */ _Thread_Disable_dispatch(); /* prevents deletion */ the_rwlock = _POSIX_RWLock_Allocate(); if ( !the_rwlock ) { 40007590: a0 92 20 00 orcc %o0, 0, %l0 40007594: 12 80 00 06 bne 400075ac 40007598: 90 04 20 10 add %l0, 0x10, %o0 _Thread_Enable_dispatch(); 4000759c: 40 00 0d 36 call 4000aa74 <_Thread_Enable_dispatch> 400075a0: b0 10 20 0b mov 0xb, %i0 return EAGAIN; 400075a4: 81 c7 e0 08 ret 400075a8: 81 e8 00 00 restore } _CORE_RWLock_Initialize( &the_rwlock->RWLock, &the_attributes ); 400075ac: 40 00 07 91 call 400093f0 <_CORE_RWLock_Initialize> 400075b0: 92 07 bf fc add %fp, -4, %o1 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 400075b4: c4 14 20 0a lduh [ %l0 + 0xa ], %g2 400075b8: a2 14 60 f0 or %l1, 0xf0, %l1 400075bc: c6 04 60 1c ld [ %l1 + 0x1c ], %g3 400075c0: c2 04 20 08 ld [ %l0 + 8 ], %g1 400075c4: 85 28 a0 02 sll %g2, 2, %g2 400075c8: e0 20 c0 02 st %l0, [ %g3 + %g2 ] _Objects_Get_index( the_object->id ), the_object ); /* ASSERT: information->is_string == false */ the_object->name.name_u32 = name; 400075cc: c0 24 20 0c clr [ %l0 + 0xc ] &_POSIX_RWLock_Information, &the_rwlock->Object, 0 ); *rwlock = the_rwlock->Object.id; 400075d0: c2 26 00 00 st %g1, [ %i0 ] _Thread_Enable_dispatch(); 400075d4: 40 00 0d 28 call 4000aa74 <_Thread_Enable_dispatch> 400075d8: b0 10 20 00 clr %i0 return 0; 400075dc: 81 c7 e0 08 ret 400075e0: 81 e8 00 00 restore } 400075e4: 81 c7 e0 08 ret 400075e8: 91 e8 20 16 restore %g0, 0x16, %o0 =============================================================================== 40007664 : int pthread_rwlock_timedrdlock( pthread_rwlock_t *rwlock, const struct timespec *abstime ) { 40007664: 9d e3 bf 98 save %sp, -104, %sp Objects_Locations location; Watchdog_Interval ticks; bool do_wait = true; POSIX_Absolute_timeout_conversion_results_t status; if ( !rwlock ) 40007668: 80 a6 20 00 cmp %i0, 0 4000766c: 02 80 00 2d be 40007720 40007670: 90 10 00 19 mov %i1, %o0 * * If the status is POSIX_ABSOLUTE_TIMEOUT_INVALID, * POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST, or POSIX_ABSOLUTE_TIMEOUT_IS_NOW, * then we should not wait. */ status = _POSIX_Absolute_timeout_to_ticks( abstime, &ticks ); 40007674: 40 00 1a bd call 4000e168 <_POSIX_Absolute_timeout_to_ticks> 40007678: 92 07 bf f8 add %fp, -8, %o1 4000767c: d2 06 00 00 ld [ %i0 ], %o1 40007680: a0 10 00 08 mov %o0, %l0 40007684: 94 07 bf fc add %fp, -4, %o2 40007688: 11 10 00 83 sethi %hi(0x40020c00), %o0 4000768c: 40 00 0a da call 4000a1f4 <_Objects_Get> 40007690: 90 12 20 f0 or %o0, 0xf0, %o0 ! 40020cf0 <_POSIX_RWLock_Information> if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE ) do_wait = false; the_rwlock = _POSIX_RWLock_Get( rwlock, &location ); switch ( location ) { 40007694: c2 07 bf fc ld [ %fp + -4 ], %g1 40007698: 80 a0 60 00 cmp %g1, 0 4000769c: 32 80 00 22 bne,a 40007724 400076a0: 90 10 20 16 mov 0x16, %o0 case OBJECTS_LOCAL: _CORE_RWLock_Obtain_for_reading( 400076a4: d2 06 00 00 ld [ %i0 ], %o1 400076a8: d6 07 bf f8 ld [ %fp + -8 ], %o3 int _EXFUN(pthread_rwlock_init, (pthread_rwlock_t *__rwlock, _CONST pthread_rwlockattr_t *__attr)); int _EXFUN(pthread_rwlock_destroy, (pthread_rwlock_t *__rwlock)); int _EXFUN(pthread_rwlock_rdlock,(pthread_rwlock_t *__rwlock)); int _EXFUN(pthread_rwlock_tryrdlock,(pthread_rwlock_t *__rwlock)); int _EXFUN(pthread_rwlock_timedrdlock, 400076ac: 82 1c 20 03 xor %l0, 3, %g1 400076b0: 90 02 20 10 add %o0, 0x10, %o0 400076b4: 80 a0 00 01 cmp %g0, %g1 400076b8: 98 10 20 00 clr %o4 400076bc: a2 60 3f ff subx %g0, -1, %l1 400076c0: 40 00 07 57 call 4000941c <_CORE_RWLock_Obtain_for_reading> 400076c4: 94 10 00 11 mov %l1, %o2 do_wait, ticks, NULL ); _Thread_Enable_dispatch(); 400076c8: 40 00 0c eb call 4000aa74 <_Thread_Enable_dispatch> 400076cc: 01 00 00 00 nop if ( !do_wait ) { 400076d0: 80 a4 60 00 cmp %l1, 0 400076d4: 12 80 00 0d bne 40007708 400076d8: 03 10 00 82 sethi %hi(0x40020800), %g1 if ( _Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE ) { 400076dc: c2 00 63 5c ld [ %g1 + 0x35c ], %g1 ! 40020b5c <_Thread_Executing> 400076e0: c2 00 60 34 ld [ %g1 + 0x34 ], %g1 400076e4: 80 a0 60 02 cmp %g1, 2 400076e8: 32 80 00 09 bne,a 4000770c 400076ec: 03 10 00 82 sethi %hi(0x40020800), %g1 switch (status) { 400076f0: 80 a4 20 00 cmp %l0, 0 400076f4: 02 80 00 0c be 40007724 <== NEVER TAKEN 400076f8: 90 10 20 16 mov 0x16, %o0 400076fc: 80 a4 20 02 cmp %l0, 2 40007700: 08 80 00 09 bleu 40007724 <== ALWAYS TAKEN 40007704: 90 10 20 74 mov 0x74, %o0 break; } } } return _POSIX_RWLock_Translate_core_RWLock_return_code( 40007708: 03 10 00 82 sethi %hi(0x40020800), %g1 4000770c: c2 00 63 5c ld [ %g1 + 0x35c ], %g1 ! 40020b5c <_Thread_Executing> 40007710: 40 00 00 3b call 400077fc <_POSIX_RWLock_Translate_core_RWLock_return_code> 40007714: d0 00 60 34 ld [ %g1 + 0x34 ], %o0 40007718: 81 c7 e0 08 ret 4000771c: 91 e8 00 08 restore %g0, %o0, %o0 40007720: 90 10 20 16 mov 0x16, %o0 case OBJECTS_ERROR: break; } return EINVAL; } 40007724: b0 10 00 08 mov %o0, %i0 40007728: 81 c7 e0 08 ret 4000772c: 81 e8 00 00 restore =============================================================================== 40007730 : int pthread_rwlock_timedwrlock( pthread_rwlock_t *rwlock, const struct timespec *abstime ) { 40007730: 9d e3 bf 98 save %sp, -104, %sp Objects_Locations location; Watchdog_Interval ticks; bool do_wait = true; POSIX_Absolute_timeout_conversion_results_t status; if ( !rwlock ) 40007734: 80 a6 20 00 cmp %i0, 0 40007738: 02 80 00 2d be 400077ec 4000773c: 90 10 00 19 mov %i1, %o0 * * If the status is POSIX_ABSOLUTE_TIMEOUT_INVALID, * POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST, or POSIX_ABSOLUTE_TIMEOUT_IS_NOW, * then we should not wait. */ status = _POSIX_Absolute_timeout_to_ticks( abstime, &ticks ); 40007740: 40 00 1a 8a call 4000e168 <_POSIX_Absolute_timeout_to_ticks> 40007744: 92 07 bf f8 add %fp, -8, %o1 40007748: d2 06 00 00 ld [ %i0 ], %o1 4000774c: a0 10 00 08 mov %o0, %l0 40007750: 94 07 bf fc add %fp, -4, %o2 40007754: 11 10 00 83 sethi %hi(0x40020c00), %o0 40007758: 40 00 0a a7 call 4000a1f4 <_Objects_Get> 4000775c: 90 12 20 f0 or %o0, 0xf0, %o0 ! 40020cf0 <_POSIX_RWLock_Information> if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE ) do_wait = false; the_rwlock = _POSIX_RWLock_Get( rwlock, &location ); switch ( location ) { 40007760: c2 07 bf fc ld [ %fp + -4 ], %g1 40007764: 80 a0 60 00 cmp %g1, 0 40007768: 32 80 00 22 bne,a 400077f0 4000776c: 90 10 20 16 mov 0x16, %o0 case OBJECTS_LOCAL: _CORE_RWLock_Obtain_for_writing( 40007770: d2 06 00 00 ld [ %i0 ], %o1 40007774: d6 07 bf f8 ld [ %fp + -8 ], %o3 (pthread_rwlock_t *__rwlock, _CONST struct timespec *__abstime)); int _EXFUN(pthread_rwlock_unlock,(pthread_rwlock_t *__rwlock)); int _EXFUN(pthread_rwlock_wrlock,(pthread_rwlock_t *__rwlock)); int _EXFUN(pthread_rwlock_trywrlock,(pthread_rwlock_t *__rwlock)); int _EXFUN(pthread_rwlock_timedwrlock, 40007778: 82 1c 20 03 xor %l0, 3, %g1 4000777c: 90 02 20 10 add %o0, 0x10, %o0 40007780: 80 a0 00 01 cmp %g0, %g1 40007784: 98 10 20 00 clr %o4 40007788: a2 60 3f ff subx %g0, -1, %l1 4000778c: 40 00 07 58 call 400094ec <_CORE_RWLock_Obtain_for_writing> 40007790: 94 10 00 11 mov %l1, %o2 do_wait, ticks, NULL ); _Thread_Enable_dispatch(); 40007794: 40 00 0c b8 call 4000aa74 <_Thread_Enable_dispatch> 40007798: 01 00 00 00 nop if ( !do_wait && 4000779c: 80 a4 60 00 cmp %l1, 0 400077a0: 12 80 00 0d bne 400077d4 400077a4: 03 10 00 82 sethi %hi(0x40020800), %g1 (_Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE) ) { 400077a8: c2 00 63 5c ld [ %g1 + 0x35c ], %g1 ! 40020b5c <_Thread_Executing> 400077ac: c2 00 60 34 ld [ %g1 + 0x34 ], %g1 400077b0: 80 a0 60 02 cmp %g1, 2 400077b4: 32 80 00 09 bne,a 400077d8 400077b8: 03 10 00 82 sethi %hi(0x40020800), %g1 switch (status) { 400077bc: 80 a4 20 00 cmp %l0, 0 400077c0: 02 80 00 0c be 400077f0 <== NEVER TAKEN 400077c4: 90 10 20 16 mov 0x16, %o0 400077c8: 80 a4 20 02 cmp %l0, 2 400077cc: 08 80 00 09 bleu 400077f0 <== ALWAYS TAKEN 400077d0: 90 10 20 74 mov 0x74, %o0 case POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE: break; } } return _POSIX_RWLock_Translate_core_RWLock_return_code( 400077d4: 03 10 00 82 sethi %hi(0x40020800), %g1 400077d8: c2 00 63 5c ld [ %g1 + 0x35c ], %g1 ! 40020b5c <_Thread_Executing> 400077dc: 40 00 00 08 call 400077fc <_POSIX_RWLock_Translate_core_RWLock_return_code> 400077e0: d0 00 60 34 ld [ %g1 + 0x34 ], %o0 400077e4: 81 c7 e0 08 ret 400077e8: 91 e8 00 08 restore %g0, %o0, %o0 400077ec: 90 10 20 16 mov 0x16, %o0 case OBJECTS_ERROR: break; } return EINVAL; } 400077f0: b0 10 00 08 mov %o0, %i0 400077f4: 81 c7 e0 08 ret 400077f8: 81 e8 00 00 restore =============================================================================== 40007f70 : int pthread_rwlockattr_setpshared( pthread_rwlockattr_t *attr, int pshared ) { if ( !attr ) 40007f70: 80 a2 20 00 cmp %o0, 0 40007f74: 02 80 00 0b be 40007fa0 40007f78: 01 00 00 00 nop return EINVAL; if ( !attr->is_initialized ) 40007f7c: c2 02 00 00 ld [ %o0 ], %g1 40007f80: 80 a0 60 00 cmp %g1, 0 40007f84: 02 80 00 07 be 40007fa0 40007f88: 80 a2 60 01 cmp %o1, 1 return EINVAL; switch ( pshared ) { 40007f8c: 18 80 00 05 bgu 40007fa0 <== NEVER TAKEN 40007f90: 01 00 00 00 nop case PTHREAD_PROCESS_SHARED: case PTHREAD_PROCESS_PRIVATE: attr->process_shared = pshared; 40007f94: d2 22 20 04 st %o1, [ %o0 + 4 ] return 0; 40007f98: 81 c3 e0 08 retl 40007f9c: 90 10 20 00 clr %o0 default: return EINVAL; } } 40007fa0: 81 c3 e0 08 retl 40007fa4: 90 10 20 16 mov 0x16, %o0 =============================================================================== 40009184 : int pthread_setschedparam( pthread_t thread, int policy, struct sched_param *param ) { 40009184: 9d e3 bf 90 save %sp, -112, %sp 40009188: a0 10 00 18 mov %i0, %l0 int rc; /* * Check all the parameters */ if ( !param ) 4000918c: 80 a6 a0 00 cmp %i2, 0 40009190: 02 80 00 42 be 40009298 40009194: b0 10 20 16 mov 0x16, %i0 return EINVAL; rc = _POSIX_Thread_Translate_sched_param( 40009198: 90 10 00 19 mov %i1, %o0 4000919c: 92 10 00 1a mov %i2, %o1 400091a0: 94 07 bf fc add %fp, -4, %o2 400091a4: 40 00 18 3b call 4000f290 <_POSIX_Thread_Translate_sched_param> 400091a8: 96 07 bf f8 add %fp, -8, %o3 policy, param, &budget_algorithm, &budget_callout ); if ( rc ) 400091ac: b0 92 20 00 orcc %o0, 0, %i0 400091b0: 12 80 00 3a bne 40009298 400091b4: 92 10 00 10 mov %l0, %o1 400091b8: 11 10 00 8d sethi %hi(0x40023400), %o0 400091bc: 94 07 bf f4 add %fp, -12, %o2 400091c0: 40 00 08 22 call 4000b248 <_Objects_Get> 400091c4: 90 12 20 30 or %o0, 0x30, %o0 /* * Actually change the scheduling policy and parameters */ the_thread = _POSIX_Threads_Get( thread, &location ); switch ( location ) { 400091c8: c2 07 bf f4 ld [ %fp + -12 ], %g1 400091cc: 80 a0 60 00 cmp %g1, 0 400091d0: 02 80 00 04 be 400091e0 400091d4: a2 10 00 08 mov %o0, %l1 400091d8: 81 c7 e0 08 ret 400091dc: 91 e8 20 03 restore %g0, 3, %o0 case OBJECTS_LOCAL: api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 400091e0: e0 02 21 60 ld [ %o0 + 0x160 ], %l0 if ( api->schedpolicy == SCHED_SPORADIC ) 400091e4: c2 04 20 80 ld [ %l0 + 0x80 ], %g1 400091e8: 80 a0 60 04 cmp %g1, 4 400091ec: 32 80 00 05 bne,a 40009200 400091f0: f2 24 20 80 st %i1, [ %l0 + 0x80 ] (void) _Watchdog_Remove( &api->Sporadic_timer ); 400091f4: 40 00 0f 5f call 4000cf70 <_Watchdog_Remove> 400091f8: 90 04 20 a4 add %l0, 0xa4, %o0 api->schedpolicy = policy; 400091fc: f2 24 20 80 st %i1, [ %l0 + 0x80 ] api->schedparam = *param; 40009200: 92 10 00 1a mov %i2, %o1 40009204: 90 04 20 84 add %l0, 0x84, %o0 40009208: 40 00 27 ab call 400130b4 4000920c: 94 10 20 1c mov 0x1c, %o2 the_thread->budget_algorithm = budget_algorithm; 40009210: c4 07 bf fc ld [ %fp + -4 ], %g2 the_thread->budget_callout = budget_callout; switch ( api->schedpolicy ) { 40009214: c2 04 20 80 ld [ %l0 + 0x80 ], %g1 if ( api->schedpolicy == SCHED_SPORADIC ) (void) _Watchdog_Remove( &api->Sporadic_timer ); api->schedpolicy = policy; api->schedparam = *param; the_thread->budget_algorithm = budget_algorithm; 40009218: c4 24 60 7c st %g2, [ %l1 + 0x7c ] the_thread->budget_callout = budget_callout; 4000921c: c4 07 bf f8 ld [ %fp + -8 ], %g2 switch ( api->schedpolicy ) { 40009220: 80 a0 60 00 cmp %g1, 0 40009224: 06 80 00 1b bl 40009290 <== NEVER TAKEN 40009228: c4 24 60 80 st %g2, [ %l1 + 0x80 ] 4000922c: 80 a0 60 02 cmp %g1, 2 40009230: 24 80 00 07 ble,a 4000924c 40009234: c2 04 20 84 ld [ %l0 + 0x84 ], %g1 40009238: 80 a0 60 04 cmp %g1, 4 4000923c: 12 80 00 15 bne 40009290 <== NEVER TAKEN 40009240: 01 00 00 00 nop true ); break; case SCHED_SPORADIC: api->ss_high_priority = api->schedparam.sched_priority; 40009244: 10 80 00 0d b 40009278 40009248: c2 04 20 84 ld [ %l0 + 0x84 ], %g1 4000924c: 07 10 00 89 sethi %hi(0x40022400), %g3 switch ( api->schedpolicy ) { case SCHED_OTHER: case SCHED_FIFO: case SCHED_RR: the_thread->cpu_time_budget = _Thread_Ticks_per_timeslice; 40009250: 05 10 00 8c sethi %hi(0x40023000), %g2 40009254: d2 08 e2 a8 ldub [ %g3 + 0x2a8 ], %o1 40009258: c4 00 a0 f8 ld [ %g2 + 0xf8 ], %g2 4000925c: 92 22 40 01 sub %o1, %g1, %o1 40009260: c4 24 60 78 st %g2, [ %l1 + 0x78 ] the_thread->real_priority = _POSIX_Priority_To_core( api->schedparam.sched_priority ); _Thread_Change_priority( 40009264: 90 10 00 11 mov %l1, %o0 case SCHED_OTHER: case SCHED_FIFO: case SCHED_RR: the_thread->cpu_time_budget = _Thread_Ticks_per_timeslice; the_thread->real_priority = 40009268: d2 24 60 18 st %o1, [ %l1 + 0x18 ] _POSIX_Priority_To_core( api->schedparam.sched_priority ); _Thread_Change_priority( 4000926c: 40 00 08 a7 call 4000b508 <_Thread_Change_priority> 40009270: 94 10 20 01 mov 1, %o2 the_thread, the_thread->real_priority, true ); break; 40009274: 30 80 00 07 b,a 40009290 case SCHED_SPORADIC: api->ss_high_priority = api->schedparam.sched_priority; _Watchdog_Remove( &api->Sporadic_timer ); 40009278: 90 04 20 a4 add %l0, 0xa4, %o0 4000927c: 40 00 0f 3d call 4000cf70 <_Watchdog_Remove> 40009280: c2 24 20 a0 st %g1, [ %l0 + 0xa0 ] _POSIX_Threads_Sporadic_budget_TSR( 0, the_thread ); 40009284: 92 10 00 11 mov %l1, %o1 40009288: 7f ff ff a0 call 40009108 <_POSIX_Threads_Sporadic_budget_TSR> 4000928c: 90 10 20 00 clr %o0 break; } _Thread_Enable_dispatch(); 40009290: 40 00 0a 0e call 4000bac8 <_Thread_Enable_dispatch> 40009294: 01 00 00 00 nop case OBJECTS_ERROR: break; } return ESRCH; } 40009298: 81 c7 e0 08 ret 4000929c: 81 e8 00 00 restore =============================================================================== 40006994 : * * 18.2.2 Setting Cancelability State, P1003.1c/Draft 10, p. 183 */ void pthread_testcancel( void ) { 40006994: 9d e3 bf a0 save %sp, -96, %sp * Don't even think about deleting a resource from an ISR. * Besides this request is supposed to be for _Thread_Executing * and the ISR context is not a thread. */ if ( _ISR_Is_in_progress() ) 40006998: 03 10 00 7d sethi %hi(0x4001f400), %g1 4000699c: c2 00 63 88 ld [ %g1 + 0x388 ], %g1 ! 4001f788 <_ISR_Nest_level> 400069a0: 80 a0 60 00 cmp %g1, 0 400069a4: 12 80 00 17 bne 40006a00 <== NEVER TAKEN 400069a8: 05 10 00 7d sethi %hi(0x4001f400), %g2 return; thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; 400069ac: 03 10 00 7d sethi %hi(0x4001f400), %g1 400069b0: c6 00 a2 f0 ld [ %g2 + 0x2f0 ], %g3 400069b4: c2 00 63 ac ld [ %g1 + 0x3ac ], %g1 400069b8: 86 00 e0 01 inc %g3 400069bc: c2 00 61 60 ld [ %g1 + 0x160 ], %g1 400069c0: c6 20 a2 f0 st %g3, [ %g2 + 0x2f0 ] _Thread_Disable_dispatch(); if ( thread_support->cancelability_state == PTHREAD_CANCEL_ENABLE && 400069c4: c4 00 60 d4 ld [ %g1 + 0xd4 ], %g2 400069c8: 80 a0 a0 00 cmp %g2, 0 400069cc: 12 80 00 05 bne 400069e0 <== NEVER TAKEN 400069d0: a0 10 20 00 clr %l0 /* Setting Cancelability State, P1003.1c/Draft 10, p. 183 */ int _EXFUN(pthread_setcancelstate, (int __state, int *__oldstate)); int _EXFUN(pthread_setcanceltype, (int __type, int *__oldtype)); void _EXFUN(pthread_testcancel, (void)); 400069d4: c2 00 60 dc ld [ %g1 + 0xdc ], %g1 400069d8: 80 a0 00 01 cmp %g0, %g1 400069dc: a0 40 20 00 addx %g0, 0, %l0 thread_support->cancelation_requested ) cancel = true; _Thread_Enable_dispatch(); 400069e0: 40 00 09 c4 call 400090f0 <_Thread_Enable_dispatch> 400069e4: 01 00 00 00 nop if ( cancel ) 400069e8: 80 8c 20 ff btst 0xff, %l0 400069ec: 02 80 00 05 be 40006a00 400069f0: 03 10 00 7d sethi %hi(0x4001f400), %g1 _POSIX_Thread_Exit( _Thread_Executing, PTHREAD_CANCELED ); 400069f4: f0 00 63 ac ld [ %g1 + 0x3ac ], %i0 ! 4001f7ac <_Thread_Executing> 400069f8: 40 00 18 17 call 4000ca54 <_POSIX_Thread_Exit> 400069fc: 93 e8 3f ff restore %g0, -1, %o1 40006a00: 81 c7 e0 08 ret 40006a04: 81 e8 00 00 restore =============================================================================== 400093ec : #include #include void rtems_iterate_over_all_threads(rtems_per_thread_routine routine) { 400093ec: 9d e3 bf a0 save %sp, -96, %sp uint32_t i; uint32_t api_index; Thread_Control *the_thread; Objects_Information *information; if ( !routine ) 400093f0: 80 a6 20 00 cmp %i0, 0 400093f4: 02 80 00 1d be 40009468 <== NEVER TAKEN 400093f8: 21 10 00 af sethi %hi(0x4002bc00), %l0 400093fc: a0 14 22 44 or %l0, 0x244, %l0 ! 4002be44 <_Objects_Information_table+0x4> #endif #include #include void rtems_iterate_over_all_threads(rtems_per_thread_routine routine) 40009400: a6 04 20 10 add %l0, 0x10, %l3 if ( !routine ) return; for ( api_index = 1 ; api_index <= OBJECTS_APIS_LAST ; api_index++ ) { if ( !_Objects_Information_table[ api_index ] ) 40009404: c2 04 00 00 ld [ %l0 ], %g1 40009408: 80 a0 60 00 cmp %g1, 0 4000940c: 22 80 00 14 be,a 4000945c 40009410: a0 04 20 04 add %l0, 4, %l0 continue; information = _Objects_Information_table[ api_index ][ 1 ]; 40009414: e4 00 60 04 ld [ %g1 + 4 ], %l2 if ( !information ) 40009418: 80 a4 a0 00 cmp %l2, 0 4000941c: 12 80 00 0b bne 40009448 40009420: a2 10 20 01 mov 1, %l1 continue; for ( i=1 ; i <= information->maximum ; i++ ) { 40009424: 10 80 00 0e b 4000945c 40009428: a0 04 20 04 add %l0, 4, %l0 the_thread = (Thread_Control *)information->local_table[ i ]; 4000942c: c2 04 a0 1c ld [ %l2 + 0x1c ], %g1 40009430: d0 00 40 02 ld [ %g1 + %g2 ], %o0 if ( !the_thread ) 40009434: 80 a2 20 00 cmp %o0, 0 40009438: 02 80 00 04 be 40009448 <== NEVER TAKEN 4000943c: a2 04 60 01 inc %l1 continue; (*routine)(the_thread); 40009440: 9f c6 00 00 call %i0 40009444: 01 00 00 00 nop information = _Objects_Information_table[ api_index ][ 1 ]; if ( !information ) continue; for ( i=1 ; i <= information->maximum ; i++ ) { 40009448: c2 14 a0 10 lduh [ %l2 + 0x10 ], %g1 4000944c: 80 a4 40 01 cmp %l1, %g1 40009450: 08 bf ff f7 bleu 4000942c 40009454: 85 2c 60 02 sll %l1, 2, %g2 40009458: a0 04 20 04 add %l0, 4, %l0 Objects_Information *information; if ( !routine ) return; for ( api_index = 1 ; api_index <= OBJECTS_APIS_LAST ; api_index++ ) { 4000945c: 80 a4 00 13 cmp %l0, %l3 40009460: 32 bf ff ea bne,a 40009408 40009464: c2 04 00 00 ld [ %l0 ], %g1 40009468: 81 c7 e0 08 ret 4000946c: 81 e8 00 00 restore =============================================================================== 40013844 : uint32_t length, uint32_t buffer_size, rtems_attribute attribute_set, rtems_id *id ) { 40013844: 9d e3 bf a0 save %sp, -96, %sp register Partition_Control *the_partition; if ( !rtems_is_name_valid( name ) ) 40013848: a0 96 20 00 orcc %i0, 0, %l0 4001384c: 02 80 00 1c be 400138bc 40013850: b0 10 20 03 mov 3, %i0 return RTEMS_INVALID_NAME; if ( !starting_address ) 40013854: 80 a6 60 00 cmp %i1, 0 40013858: 02 80 00 34 be 40013928 4001385c: 80 a7 60 00 cmp %i5, 0 return RTEMS_INVALID_ADDRESS; if ( !id ) 40013860: 02 80 00 32 be 40013928 <== NEVER TAKEN 40013864: 80 a6 e0 00 cmp %i3, 0 return RTEMS_INVALID_ADDRESS; if ( length == 0 || buffer_size == 0 || length < buffer_size || 40013868: 02 80 00 32 be 40013930 4001386c: 80 a6 a0 00 cmp %i2, 0 40013870: 02 80 00 30 be 40013930 40013874: 80 a6 80 1b cmp %i2, %i3 40013878: 0a 80 00 2e bcs 40013930 4001387c: 80 8e e0 07 btst 7, %i3 40013880: 12 80 00 2c bne 40013930 40013884: 80 8e 60 07 btst 7, %i1 !_Partition_Is_buffer_size_aligned( buffer_size ) ) return RTEMS_INVALID_SIZE; if ( !_Addresses_Is_aligned( starting_address ) ) 40013888: 12 80 00 28 bne 40013928 4001388c: 03 10 00 f9 sethi %hi(0x4003e400), %g1 40013890: c4 00 61 40 ld [ %g1 + 0x140 ], %g2 ! 4003e540 <_Thread_Dispatch_disable_level> 40013894: 84 00 a0 01 inc %g2 40013898: c4 20 61 40 st %g2, [ %g1 + 0x140 ] * 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 ); 4001389c: 25 10 00 f8 sethi %hi(0x4003e000), %l2 400138a0: 40 00 12 07 call 400180bc <_Objects_Allocate> 400138a4: 90 14 a3 48 or %l2, 0x348, %o0 ! 4003e348 <_Partition_Information> _Thread_Disable_dispatch(); /* prevents deletion */ the_partition = _Partition_Allocate(); if ( !the_partition ) { 400138a8: a2 92 20 00 orcc %o0, 0, %l1 400138ac: 32 80 00 06 bne,a 400138c4 400138b0: f4 24 60 14 st %i2, [ %l1 + 0x14 ] _Thread_Enable_dispatch(); 400138b4: 40 00 15 cc call 40018fe4 <_Thread_Enable_dispatch> 400138b8: b0 10 20 05 mov 5, %i0 return RTEMS_TOO_MANY; 400138bc: 81 c7 e0 08 ret 400138c0: 81 e8 00 00 restore 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, 400138c4: 90 10 00 1a mov %i2, %o0 400138c8: 92 10 00 1b mov %i3, %o1 #endif the_partition->starting_address = starting_address; the_partition->length = length; the_partition->buffer_size = buffer_size; the_partition->attribute_set = attribute_set; 400138cc: f8 24 60 1c st %i4, [ %l1 + 0x1c ] _Thread_Enable_dispatch(); return RTEMS_TOO_MANY; } #endif the_partition->starting_address = starting_address; 400138d0: f2 24 60 10 st %i1, [ %l1 + 0x10 ] the_partition->length = length; the_partition->buffer_size = buffer_size; 400138d4: f6 24 60 18 st %i3, [ %l1 + 0x18 ] the_partition->attribute_set = attribute_set; the_partition->number_of_used_blocks = 0; _Chain_Initialize( &the_partition->Memory, starting_address, 400138d8: 40 00 64 21 call 4002c95c <.udiv> 400138dc: c0 24 60 20 clr [ %l1 + 0x20 ] 400138e0: 92 10 00 19 mov %i1, %o1 400138e4: 94 10 00 08 mov %o0, %o2 400138e8: 96 10 00 1b mov %i3, %o3 400138ec: b4 04 60 24 add %l1, 0x24, %i2 400138f0: 40 00 0c 73 call 40016abc <_Chain_Initialize> 400138f4: 90 10 00 1a mov %i2, %o0 400138f8: c2 14 60 0a lduh [ %l1 + 0xa ], %g1 400138fc: c6 04 60 08 ld [ %l1 + 8 ], %g3 40013900: a4 14 a3 48 or %l2, 0x348, %l2 40013904: c4 04 a0 1c ld [ %l2 + 0x1c ], %g2 information, _Objects_Get_index( the_object->id ), the_object ); the_object->name = name; 40013908: e0 24 60 0c st %l0, [ %l1 + 0xc ] #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 4001390c: 83 28 60 02 sll %g1, 2, %g1 &_Partition_Information, &the_partition->Object, (Objects_Name) name ); *id = the_partition->Object.id; 40013910: c6 27 40 00 st %g3, [ %i5 ] 40013914: e2 20 80 01 st %l1, [ %g2 + %g1 ] name, 0 /* Not used */ ); #endif _Thread_Enable_dispatch(); 40013918: 40 00 15 b3 call 40018fe4 <_Thread_Enable_dispatch> 4001391c: b0 10 20 00 clr %i0 return RTEMS_SUCCESSFUL; 40013920: 81 c7 e0 08 ret 40013924: 81 e8 00 00 restore 40013928: 81 c7 e0 08 ret 4001392c: 91 e8 20 09 restore %g0, 9, %o0 40013930: b0 10 20 08 mov 8, %i0 } 40013934: 81 c7 e0 08 ret 40013938: 81 e8 00 00 restore =============================================================================== 400076e4 : rtems_status_code rtems_rate_monotonic_period( rtems_id id, rtems_interval length ) { 400076e4: 9d e3 bf 98 save %sp, -104, %sp RTEMS_INLINE_ROUTINE Rate_monotonic_Control *_Rate_monotonic_Get ( Objects_Id id, Objects_Locations *location ) { return (Rate_monotonic_Control *) 400076e8: 11 10 00 8d sethi %hi(0x40023400), %o0 400076ec: 92 10 00 18 mov %i0, %o1 400076f0: 90 12 22 70 or %o0, 0x270, %o0 400076f4: 40 00 08 c4 call 40009a04 <_Objects_Get> 400076f8: 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 ) { 400076fc: c2 07 bf fc ld [ %fp + -4 ], %g1 40007700: 80 a0 60 00 cmp %g1, 0 40007704: 12 80 00 63 bne 40007890 40007708: a0 10 00 08 mov %o0, %l0 case OBJECTS_LOCAL: if ( !_Thread_Is_executing( the_period->owner ) ) { 4000770c: 25 10 00 8e sethi %hi(0x40023800), %l2 40007710: c4 02 20 40 ld [ %o0 + 0x40 ], %g2 40007714: c2 04 a0 9c ld [ %l2 + 0x9c ], %g1 40007718: 80 a0 80 01 cmp %g2, %g1 4000771c: 02 80 00 06 be 40007734 40007720: 80 a6 60 00 cmp %i1, 0 _Thread_Enable_dispatch(); 40007724: 40 00 0b 06 call 4000a33c <_Thread_Enable_dispatch> 40007728: b0 10 20 17 mov 0x17, %i0 return RTEMS_NOT_OWNER_OF_RESOURCE; 4000772c: 81 c7 e0 08 ret 40007730: 81 e8 00 00 restore } if ( length == RTEMS_PERIOD_STATUS ) { 40007734: 12 80 00 0b bne 40007760 40007738: 01 00 00 00 nop switch ( the_period->state ) { 4000773c: c2 02 20 38 ld [ %o0 + 0x38 ], %g1 40007740: 80 a0 60 04 cmp %g1, 4 40007744: 18 80 00 4f bgu 40007880 <== NEVER TAKEN 40007748: b0 10 20 00 clr %i0 4000774c: 83 28 60 02 sll %g1, 2, %g1 40007750: 05 10 00 84 sethi %hi(0x40021000), %g2 40007754: 84 10 a2 d8 or %g2, 0x2d8, %g2 ! 400212d8 40007758: 10 80 00 4a b 40007880 4000775c: f0 00 80 01 ld [ %g2 + %g1 ], %i0 } _Thread_Enable_dispatch(); return( return_value ); } _ISR_Disable( level ); 40007760: 7f ff ed 25 call 40002bf4 40007764: 01 00 00 00 nop 40007768: a6 10 00 08 mov %o0, %l3 switch ( the_period->state ) { 4000776c: e2 04 20 38 ld [ %l0 + 0x38 ], %l1 40007770: 80 a4 60 02 cmp %l1, 2 40007774: 02 80 00 1a be 400077dc 40007778: 80 a4 60 04 cmp %l1, 4 4000777c: 02 80 00 34 be 4000784c 40007780: 80 a4 60 00 cmp %l1, 0 40007784: 12 80 00 43 bne 40007890 <== NEVER TAKEN 40007788: 01 00 00 00 nop case RATE_MONOTONIC_INACTIVE: { _ISR_Enable( level ); 4000778c: 7f ff ed 1e call 40002c04 40007790: 01 00 00 00 nop /* * Baseline statistics information for the beginning of a period. */ _Rate_monotonic_Initiate_statistics( the_period ); 40007794: 7f ff ff 50 call 400074d4 <_Rate_monotonic_Initiate_statistics> 40007798: 90 10 00 10 mov %l0, %o0 the_period->state = RATE_MONOTONIC_ACTIVE; 4000779c: 82 10 20 02 mov 2, %g1 400077a0: c2 24 20 38 st %g1, [ %l0 + 0x38 ] Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 400077a4: 03 10 00 1e sethi %hi(0x40007800), %g1 400077a8: 82 10 63 5c or %g1, 0x35c, %g1 ! 40007b5c <_Rate_monotonic_Timeout> the_watchdog->id = id; 400077ac: f0 24 20 30 st %i0, [ %l0 + 0x30 ] ) { the_watchdog->initial = units; _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 400077b0: 92 04 20 10 add %l0, 0x10, %o1 400077b4: 11 10 00 8e sethi %hi(0x40023800), %o0 Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 400077b8: f2 24 20 1c st %i1, [ %l0 + 0x1c ] _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 400077bc: 90 12 20 bc or %o0, 0xbc, %o0 Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 400077c0: c0 24 20 18 clr [ %l0 + 0x18 ] the_watchdog->routine = routine; the_watchdog->id = id; the_watchdog->user_data = user_data; 400077c4: c0 24 20 34 clr [ %l0 + 0x34 ] _Rate_monotonic_Timeout, id, NULL ); the_period->next_length = length; 400077c8: f2 24 20 3c st %i1, [ %l0 + 0x3c ] Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 400077cc: c2 24 20 2c st %g1, [ %l0 + 0x2c ] ) { the_watchdog->initial = units; _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 400077d0: 40 00 10 13 call 4000b81c <_Watchdog_Insert> 400077d4: b0 10 20 00 clr %i0 400077d8: 30 80 00 2a b,a 40007880 case RATE_MONOTONIC_ACTIVE: /* * Update statistics from the concluding period. */ _Rate_monotonic_Update_statistics( the_period ); 400077dc: 7f ff ff 84 call 400075ec <_Rate_monotonic_Update_statistics> 400077e0: 90 10 00 10 mov %l0, %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; 400077e4: 82 10 20 01 mov 1, %g1 the_period->next_length = length; 400077e8: f2 24 20 3c st %i1, [ %l0 + 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; 400077ec: c2 24 20 38 st %g1, [ %l0 + 0x38 ] the_period->next_length = length; _ISR_Enable( level ); 400077f0: 7f ff ed 05 call 40002c04 400077f4: 90 10 00 13 mov %l3, %o0 _Thread_Executing->Wait.id = the_period->Object.id; 400077f8: c2 04 a0 9c ld [ %l2 + 0x9c ], %g1 400077fc: c4 04 20 08 ld [ %l0 + 8 ], %g2 _Thread_Set_state( _Thread_Executing, STATES_WAITING_FOR_PERIOD ); 40007800: 90 10 00 01 mov %g1, %o0 the_period->state = RATE_MONOTONIC_OWNER_IS_BLOCKING; the_period->next_length = length; _ISR_Enable( level ); _Thread_Executing->Wait.id = the_period->Object.id; 40007804: c4 20 60 20 st %g2, [ %g1 + 0x20 ] _Thread_Set_state( _Thread_Executing, STATES_WAITING_FOR_PERIOD ); 40007808: 40 00 0d 38 call 4000ace8 <_Thread_Set_state> 4000780c: 13 00 00 10 sethi %hi(0x4000), %o1 /* * Did the watchdog timer expire while we were actually blocking * on it? */ _ISR_Disable( level ); 40007810: 7f ff ec f9 call 40002bf4 40007814: 01 00 00 00 nop local_state = the_period->state; 40007818: e6 04 20 38 ld [ %l0 + 0x38 ], %l3 the_period->state = RATE_MONOTONIC_ACTIVE; 4000781c: e2 24 20 38 st %l1, [ %l0 + 0x38 ] _ISR_Enable( level ); 40007820: 7f ff ec f9 call 40002c04 40007824: 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 ) 40007828: 80 a4 e0 03 cmp %l3, 3 4000782c: 12 80 00 04 bne 4000783c 40007830: d0 04 a0 9c ld [ %l2 + 0x9c ], %o0 _Thread_Clear_state( _Thread_Executing, STATES_WAITING_FOR_PERIOD ); 40007834: 40 00 09 cb call 40009f60 <_Thread_Clear_state> 40007838: 13 00 00 10 sethi %hi(0x4000), %o1 _Thread_Enable_dispatch(); 4000783c: 40 00 0a c0 call 4000a33c <_Thread_Enable_dispatch> 40007840: b0 10 20 00 clr %i0 return RTEMS_SUCCESSFUL; 40007844: 81 c7 e0 08 ret 40007848: 81 e8 00 00 restore case RATE_MONOTONIC_EXPIRED: /* * Update statistics from the concluding period */ _Rate_monotonic_Update_statistics( the_period ); 4000784c: 7f ff ff 68 call 400075ec <_Rate_monotonic_Update_statistics> 40007850: 90 10 00 10 mov %l0, %o0 _ISR_Enable( level ); 40007854: 7f ff ec ec call 40002c04 40007858: 90 10 00 13 mov %l3, %o0 the_period->state = RATE_MONOTONIC_ACTIVE; 4000785c: 82 10 20 02 mov 2, %g1 40007860: 92 04 20 10 add %l0, 0x10, %o1 40007864: 11 10 00 8e sethi %hi(0x40023800), %o0 Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 40007868: f2 24 20 1c st %i1, [ %l0 + 0x1c ] _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 4000786c: 90 12 20 bc or %o0, 0xbc, %o0 the_period->next_length = length; 40007870: f2 24 20 3c st %i1, [ %l0 + 0x3c ] */ _Rate_monotonic_Update_statistics( the_period ); _ISR_Enable( level ); the_period->state = RATE_MONOTONIC_ACTIVE; 40007874: c2 24 20 38 st %g1, [ %l0 + 0x38 ] 40007878: 40 00 0f e9 call 4000b81c <_Watchdog_Insert> 4000787c: b0 10 20 06 mov 6, %i0 the_period->next_length = length; _Watchdog_Insert_ticks( &the_period->Timer, length ); _Thread_Enable_dispatch(); 40007880: 40 00 0a af call 4000a33c <_Thread_Enable_dispatch> 40007884: 01 00 00 00 nop return RTEMS_TIMEOUT; 40007888: 81 c7 e0 08 ret 4000788c: 81 e8 00 00 restore case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 40007890: 81 c7 e0 08 ret 40007894: 91 e8 20 04 restore %g0, 4, %o0 =============================================================================== 40007898 : */ void rtems_rate_monotonic_report_statistics_with_plugin( void *context, rtems_printk_plugin_t print ) { 40007898: 9d e3 bf 30 save %sp, -208, %sp rtems_id id; rtems_rate_monotonic_period_statistics the_stats; rtems_rate_monotonic_period_status the_status; char name[5]; if ( !print ) 4000789c: 80 a6 60 00 cmp %i1, 0 400078a0: 02 80 00 7a be 40007a88 <== NEVER TAKEN 400078a4: 90 10 00 18 mov %i0, %o0 return; (*print)( context, "Period information by period\n" ); 400078a8: 13 10 00 84 sethi %hi(0x40021000), %o1 400078ac: 9f c6 40 00 call %i1 400078b0: 92 12 62 f0 or %o1, 0x2f0, %o1 ! 400212f0 #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ (*print)( context, "--- CPU times are in seconds ---\n" ); 400078b4: 90 10 00 18 mov %i0, %o0 400078b8: 13 10 00 84 sethi %hi(0x40021000), %o1 400078bc: 9f c6 40 00 call %i1 400078c0: 92 12 63 10 or %o1, 0x310, %o1 ! 40021310 (*print)( context, "--- Wall times are in seconds ---\n" ); 400078c4: 90 10 00 18 mov %i0, %o0 400078c8: 13 10 00 84 sethi %hi(0x40021000), %o1 400078cc: 9f c6 40 00 call %i1 400078d0: 92 12 63 38 or %o1, 0x338, %o1 ! 40021338 Be sure to test the various cases. (*print)( context,"\ 1234567890123456789012345678901234567890123456789012345678901234567890123456789\ \n"); */ (*print)( context, " ID OWNER COUNT MISSED " 400078d4: 90 10 00 18 mov %i0, %o0 400078d8: 13 10 00 84 sethi %hi(0x40021000), %o1 400078dc: 9f c6 40 00 call %i1 400078e0: 92 12 63 60 or %o1, 0x360, %o1 ! 40021360 #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ " " #endif " WALL TIME\n" ); (*print)( context, " " 400078e4: 90 10 00 18 mov %i0, %o0 400078e8: 13 10 00 84 sethi %hi(0x40021000), %o1 400078ec: 9f c6 40 00 call %i1 400078f0: 92 12 63 b0 or %o1, 0x3b0, %o1 ! 400213b0 /* * 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 ; 400078f4: 03 10 00 8d sethi %hi(0x40023400), %g1 rtems_object_get_name( the_status.owner, sizeof(name), name ); /* * Print part of report line that is not dependent on granularity */ (*print)( context, 400078f8: 2d 10 00 85 sethi %hi(0x40021400), %l6 /* * 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 ; 400078fc: 82 10 62 70 or %g1, 0x270, %g1 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, 40007900: 2b 10 00 85 sethi %hi(0x40021400), %l5 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, 40007904: 29 10 00 85 sethi %hi(0x40021400), %l4 /* * If the count is zero, don't print statistics */ if (the_stats.count == 0) { (*print)( context, "\n" ); 40007908: 27 10 00 85 sethi %hi(0x40021400), %l3 * 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++ ) { status = rtems_rate_monotonic_get_statistics( id, &the_stats ); 4000790c: ba 07 bf a0 add %fp, -96, %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 ; 40007910: ae 10 00 01 mov %g1, %l7 rtems_object_get_name( the_status.owner, sizeof(name), name ); /* * Print part of report line that is not dependent on granularity */ (*print)( context, 40007914: ac 15 a0 00 mov %l6, %l6 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, 40007918: aa 15 60 20 or %l5, 0x20, %l5 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, 4000791c: a8 15 20 40 or %l4, 0x40, %l4 /* * If the count is zero, don't print statistics */ if (the_stats.count == 0) { (*print)( context, "\n" ); 40007920: a6 14 e0 18 or %l3, 0x18, %l3 /* * 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 ; 40007924: e0 00 60 08 ld [ %g1 + 8 ], %l0 status = rtems_rate_monotonic_get_statistics( id, &the_stats ); if ( status != RTEMS_SUCCESSFUL ) continue; /* If the above passed, so should this but check it anyway */ status = rtems_rate_monotonic_get_status( id, &the_status ); 40007928: b8 07 bf d8 add %fp, -40, %i4 #if defined(RTEMS_DEBUG) if ( status != RTEMS_SUCCESSFUL ) continue; #endif rtems_object_get_name( the_status.owner, sizeof(name), name ); 4000792c: a4 07 bf f8 add %fp, -8, %l2 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 ); 40007930: b4 07 bf b8 add %fp, -72, %i2 /* * 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 ; 40007934: 10 80 00 51 b 40007a78 40007938: a2 07 bf f0 add %fp, -16, %l1 id <= _Rate_monotonic_Information.maximum_id ; id++ ) { status = rtems_rate_monotonic_get_statistics( id, &the_stats ); 4000793c: 40 00 19 fd call 4000e130 40007940: 92 10 00 1d mov %i5, %o1 if ( status != RTEMS_SUCCESSFUL ) 40007944: 80 a2 20 00 cmp %o0, 0 40007948: 32 80 00 4c bne,a 40007a78 4000794c: a0 04 20 01 inc %l0 continue; /* If the above passed, so should this but check it anyway */ status = rtems_rate_monotonic_get_status( id, &the_status ); 40007950: 92 10 00 1c mov %i4, %o1 40007954: 40 00 1a 24 call 4000e1e4 40007958: 90 10 00 10 mov %l0, %o0 #if defined(RTEMS_DEBUG) if ( status != RTEMS_SUCCESSFUL ) continue; #endif rtems_object_get_name( the_status.owner, sizeof(name), name ); 4000795c: d0 07 bf d8 ld [ %fp + -40 ], %o0 40007960: 94 10 00 12 mov %l2, %o2 40007964: 40 00 00 ae call 40007c1c 40007968: 92 10 20 05 mov 5, %o1 /* * Print part of report line that is not dependent on granularity */ (*print)( context, 4000796c: d8 1f bf a0 ldd [ %fp + -96 ], %o4 40007970: 92 10 00 16 mov %l6, %o1 40007974: 94 10 00 10 mov %l0, %o2 40007978: 90 10 00 18 mov %i0, %o0 4000797c: 9f c6 40 00 call %i1 40007980: 96 10 00 12 mov %l2, %o3 ); /* * If the count is zero, don't print statistics */ if (the_stats.count == 0) { 40007984: c2 07 bf a0 ld [ %fp + -96 ], %g1 struct timespec cpu_average; struct timespec *min_cpu = &the_stats.min_cpu_time; struct timespec *max_cpu = &the_stats.max_cpu_time; struct timespec *total_cpu = &the_stats.total_cpu_time; _Timespec_Divide_by_integer( total_cpu, the_stats.count, &cpu_average ); 40007988: 94 10 00 11 mov %l1, %o2 4000798c: 90 10 00 1a mov %i2, %o0 ); /* * If the count is zero, don't print statistics */ if (the_stats.count == 0) { 40007990: 80 a0 60 00 cmp %g1, 0 40007994: 12 80 00 06 bne 400079ac 40007998: 92 10 00 13 mov %l3, %o1 (*print)( context, "\n" ); 4000799c: 9f c6 40 00 call %i1 400079a0: 90 10 00 18 mov %i0, %o0 continue; 400079a4: 10 80 00 35 b 40007a78 400079a8: a0 04 20 01 inc %l0 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 ); 400079ac: 40 00 0e 72 call 4000b374 <_Timespec_Divide_by_integer> 400079b0: 92 10 00 01 mov %g1, %o1 (*print)( context, 400079b4: d0 07 bf ac ld [ %fp + -84 ], %o0 400079b8: 40 00 57 a3 call 4001d844 <.div> 400079bc: 92 10 23 e8 mov 0x3e8, %o1 400079c0: 96 10 00 08 mov %o0, %o3 400079c4: d0 07 bf b4 ld [ %fp + -76 ], %o0 400079c8: d6 27 bf 9c st %o3, [ %fp + -100 ] 400079cc: 40 00 57 9e call 4001d844 <.div> 400079d0: 92 10 23 e8 mov 0x3e8, %o1 400079d4: c2 07 bf f0 ld [ %fp + -16 ], %g1 400079d8: b6 10 00 08 mov %o0, %i3 400079dc: d0 07 bf f4 ld [ %fp + -12 ], %o0 400079e0: c2 23 a0 5c st %g1, [ %sp + 0x5c ] 400079e4: 40 00 57 98 call 4001d844 <.div> 400079e8: 92 10 23 e8 mov 0x3e8, %o1 400079ec: d8 07 bf b0 ld [ %fp + -80 ], %o4 400079f0: d6 07 bf 9c ld [ %fp + -100 ], %o3 400079f4: d4 07 bf a8 ld [ %fp + -88 ], %o2 400079f8: 9a 10 00 1b mov %i3, %o5 400079fc: d0 23 a0 60 st %o0, [ %sp + 0x60 ] 40007a00: 92 10 00 15 mov %l5, %o1 40007a04: 9f c6 40 00 call %i1 40007a08: 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); 40007a0c: d2 07 bf a0 ld [ %fp + -96 ], %o1 40007a10: 94 10 00 11 mov %l1, %o2 40007a14: 40 00 0e 58 call 4000b374 <_Timespec_Divide_by_integer> 40007a18: 90 07 bf d0 add %fp, -48, %o0 (*print)( context, 40007a1c: d0 07 bf c4 ld [ %fp + -60 ], %o0 40007a20: 40 00 57 89 call 4001d844 <.div> 40007a24: 92 10 23 e8 mov 0x3e8, %o1 40007a28: 96 10 00 08 mov %o0, %o3 40007a2c: d0 07 bf cc ld [ %fp + -52 ], %o0 40007a30: d6 27 bf 9c st %o3, [ %fp + -100 ] 40007a34: 40 00 57 84 call 4001d844 <.div> 40007a38: 92 10 23 e8 mov 0x3e8, %o1 40007a3c: c2 07 bf f0 ld [ %fp + -16 ], %g1 40007a40: b6 10 00 08 mov %o0, %i3 40007a44: d0 07 bf f4 ld [ %fp + -12 ], %o0 40007a48: 92 10 23 e8 mov 0x3e8, %o1 40007a4c: 40 00 57 7e call 4001d844 <.div> 40007a50: c2 23 a0 5c st %g1, [ %sp + 0x5c ] 40007a54: d4 07 bf c0 ld [ %fp + -64 ], %o2 40007a58: d6 07 bf 9c ld [ %fp + -100 ], %o3 40007a5c: d8 07 bf c8 ld [ %fp + -56 ], %o4 40007a60: d0 23 a0 60 st %o0, [ %sp + 0x60 ] 40007a64: 9a 10 00 1b mov %i3, %o5 40007a68: 90 10 00 18 mov %i0, %o0 40007a6c: 9f c6 40 00 call %i1 40007a70: 92 10 00 14 mov %l4, %o1 * 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++ ) { 40007a74: a0 04 20 01 inc %l0 /* * 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 ; 40007a78: c2 05 e0 0c ld [ %l7 + 0xc ], %g1 40007a7c: 80 a4 00 01 cmp %l0, %g1 40007a80: 08 bf ff af bleu 4000793c 40007a84: 90 10 00 10 mov %l0, %o0 40007a88: 81 c7 e0 08 ret 40007a8c: 81 e8 00 00 restore =============================================================================== 40014e2c : rtems_status_code rtems_signal_send( rtems_id id, rtems_signal_set signal_set ) { 40014e2c: 9d e3 bf 98 save %sp, -104, %sp register Thread_Control *the_thread; Objects_Locations location; RTEMS_API_Control *api; ASR_Information *asr; if ( !signal_set ) 40014e30: 82 10 20 0a mov 0xa, %g1 40014e34: 80 a6 60 00 cmp %i1, 0 40014e38: 02 80 00 2a be 40014ee0 40014e3c: 90 10 00 18 mov %i0, %o0 return RTEMS_INVALID_NUMBER; the_thread = _Thread_Get( id, &location ); 40014e40: 40 00 10 8c call 40019070 <_Thread_Get> 40014e44: 92 07 bf fc add %fp, -4, %o1 switch ( location ) { 40014e48: c4 07 bf fc ld [ %fp + -4 ], %g2 ASR_Information *asr; if ( !signal_set ) return RTEMS_INVALID_NUMBER; the_thread = _Thread_Get( id, &location ); 40014e4c: a0 10 00 08 mov %o0, %l0 switch ( location ) { 40014e50: 80 a0 a0 00 cmp %g2, 0 40014e54: 12 80 00 23 bne 40014ee0 40014e58: 82 10 20 04 mov 4, %g1 case OBJECTS_LOCAL: api = the_thread->API_Extensions[ THREAD_API_RTEMS ]; 40014e5c: d2 02 21 5c ld [ %o0 + 0x15c ], %o1 asr = &api->Signal; 40014e60: c2 02 60 0c ld [ %o1 + 0xc ], %g1 40014e64: 80 a0 60 00 cmp %g1, 0 40014e68: 02 80 00 1b be 40014ed4 40014e6c: 01 00 00 00 nop if ( ! _ASR_Is_null_handler( asr->handler ) ) { if ( asr->is_enabled ) { 40014e70: c2 0a 60 08 ldub [ %o1 + 8 ], %g1 40014e74: 80 a0 60 00 cmp %g1, 0 40014e78: 02 80 00 11 be 40014ebc 40014e7c: 90 10 00 19 mov %i1, %o0 _ASR_Post_signals( signal_set, &asr->signals_posted ); 40014e80: 7f ff ff e2 call 40014e08 <_ASR_Post_signals> 40014e84: 92 02 60 14 add %o1, 0x14, %o1 the_thread->do_post_task_switch_extension = true; if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) 40014e88: 03 10 00 f9 sethi %hi(0x4003e400), %g1 40014e8c: c4 00 61 d8 ld [ %g1 + 0x1d8 ], %g2 ! 4003e5d8 <_ISR_Nest_level> if ( ! _ASR_Is_null_handler( asr->handler ) ) { if ( asr->is_enabled ) { _ASR_Post_signals( signal_set, &asr->signals_posted ); the_thread->do_post_task_switch_extension = true; 40014e90: 82 10 20 01 mov 1, %g1 if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) 40014e94: 80 a0 a0 00 cmp %g2, 0 40014e98: 02 80 00 0b be 40014ec4 40014e9c: c2 2c 20 74 stb %g1, [ %l0 + 0x74 ] 40014ea0: 05 10 00 f9 sethi %hi(0x4003e400), %g2 40014ea4: c4 00 a1 fc ld [ %g2 + 0x1fc ], %g2 ! 4003e5fc <_Thread_Executing> 40014ea8: 80 a4 00 02 cmp %l0, %g2 40014eac: 12 80 00 06 bne 40014ec4 <== NEVER TAKEN 40014eb0: 05 10 00 f9 sethi %hi(0x4003e400), %g2 _ISR_Signals_to_thread_executing = true; 40014eb4: 10 80 00 04 b 40014ec4 40014eb8: c2 28 a2 98 stb %g1, [ %g2 + 0x298 ] ! 4003e698 <_ISR_Signals_to_thread_executing> } else { _ASR_Post_signals( signal_set, &asr->signals_pending ); 40014ebc: 7f ff ff d3 call 40014e08 <_ASR_Post_signals> 40014ec0: 92 02 60 18 add %o1, 0x18, %o1 } _Thread_Enable_dispatch(); 40014ec4: 40 00 10 48 call 40018fe4 <_Thread_Enable_dispatch> 40014ec8: 01 00 00 00 nop return RTEMS_SUCCESSFUL; 40014ecc: 10 80 00 05 b 40014ee0 40014ed0: 82 10 20 00 clr %g1 ! 0 } _Thread_Enable_dispatch(); 40014ed4: 40 00 10 44 call 40018fe4 <_Thread_Enable_dispatch> 40014ed8: 01 00 00 00 nop 40014edc: 82 10 20 0b mov 0xb, %g1 ! b case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 40014ee0: 81 c7 e0 08 ret 40014ee4: 91 e8 00 01 restore %g0, %g1, %o0 =============================================================================== 4000e3e8 : rtems_status_code rtems_task_mode( rtems_mode mode_set, rtems_mode mask, rtems_mode *previous_mode_set ) { 4000e3e8: 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 ) 4000e3ec: 80 a6 a0 00 cmp %i2, 0 4000e3f0: 02 80 00 54 be 4000e540 4000e3f4: 82 10 20 09 mov 9, %g1 return RTEMS_INVALID_ADDRESS; executing = _Thread_Executing; 4000e3f8: 03 10 00 76 sethi %hi(0x4001d800), %g1 4000e3fc: e0 00 62 2c ld [ %g1 + 0x22c ], %l0 ! 4001da2c <_Thread_Executing> api = executing->API_Extensions[ THREAD_API_RTEMS ]; asr = &api->Signal; old_mode = (executing->is_preemptible) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT; 4000e400: c4 0c 20 75 ldub [ %l0 + 0x75 ], %g2 if ( executing->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_NONE ) 4000e404: c2 04 20 7c ld [ %l0 + 0x7c ], %g1 executing = _Thread_Executing; api = executing->API_Extensions[ THREAD_API_RTEMS ]; asr = &api->Signal; old_mode = (executing->is_preemptible) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT; 4000e408: 80 a0 00 02 cmp %g0, %g2 if ( !previous_mode_set ) return RTEMS_INVALID_ADDRESS; executing = _Thread_Executing; api = executing->API_Extensions[ THREAD_API_RTEMS ]; 4000e40c: e2 04 21 5c ld [ %l0 + 0x15c ], %l1 asr = &api->Signal; old_mode = (executing->is_preemptible) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT; 4000e410: a4 60 3f ff subx %g0, -1, %l2 if ( executing->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_NONE ) 4000e414: 80 a0 60 00 cmp %g1, 0 4000e418: 02 80 00 03 be 4000e424 4000e41c: a5 2c a0 08 sll %l2, 8, %l2 old_mode |= RTEMS_NO_TIMESLICE; else old_mode |= RTEMS_TIMESLICE; 4000e420: a4 14 a2 00 or %l2, 0x200, %l2 if ( !previous_mode_set ) return RTEMS_INVALID_ADDRESS; executing = _Thread_Executing; api = executing->API_Extensions[ THREAD_API_RTEMS ]; asr = &api->Signal; 4000e424: c2 0c 60 08 ldub [ %l1 + 8 ], %g1 4000e428: 80 a0 00 01 cmp %g0, %g1 old_mode |= RTEMS_NO_TIMESLICE; else old_mode |= RTEMS_TIMESLICE; old_mode |= (asr->is_enabled) ? RTEMS_ASR : RTEMS_NO_ASR; old_mode |= _ISR_Get_level(); 4000e42c: 7f ff ee d1 call 40009f70 <_CPU_ISR_Get_level> 4000e430: a6 60 3f ff subx %g0, -1, %l3 if ( !previous_mode_set ) return RTEMS_INVALID_ADDRESS; executing = _Thread_Executing; api = executing->API_Extensions[ THREAD_API_RTEMS ]; asr = &api->Signal; 4000e434: a7 2c e0 0a sll %l3, 0xa, %l3 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; 4000e438: a6 14 c0 08 or %l3, %o0, %l3 old_mode |= _ISR_Get_level(); *previous_mode_set = old_mode; 4000e43c: a4 14 c0 12 or %l3, %l2, %l2 /* * These are generic thread scheduling characteristics. */ if ( mask & RTEMS_PREEMPT_MASK ) 4000e440: 80 8e 61 00 btst 0x100, %i1 4000e444: 02 80 00 06 be 4000e45c 4000e448: e4 26 80 00 st %l2, [ %i2 ] executing->is_preemptible = _Modes_Is_preempt(mode_set) ? true : false; 4000e44c: 83 36 20 08 srl %i0, 8, %g1 4000e450: 82 18 60 01 xor %g1, 1, %g1 4000e454: 82 08 60 01 and %g1, 1, %g1 4000e458: c2 2c 20 75 stb %g1, [ %l0 + 0x75 ] if ( mask & RTEMS_TIMESLICE_MASK ) { 4000e45c: 80 8e 62 00 btst 0x200, %i1 4000e460: 02 80 00 0b be 4000e48c 4000e464: 80 8e 60 0f btst 0xf, %i1 if ( _Modes_Is_timeslice(mode_set) ) { 4000e468: 80 8e 22 00 btst 0x200, %i0 4000e46c: 22 80 00 07 be,a 4000e488 4000e470: c0 24 20 7c clr [ %l0 + 0x7c ] executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE; executing->cpu_time_budget = _Thread_Ticks_per_timeslice; 4000e474: 03 10 00 76 sethi %hi(0x4001d800), %g1 4000e478: c2 00 60 c8 ld [ %g1 + 0xc8 ], %g1 ! 4001d8c8 <_Thread_Ticks_per_timeslice> 4000e47c: c2 24 20 78 st %g1, [ %l0 + 0x78 ] if ( mask & RTEMS_PREEMPT_MASK ) executing->is_preemptible = _Modes_Is_preempt(mode_set) ? true : false; if ( mask & RTEMS_TIMESLICE_MASK ) { if ( _Modes_Is_timeslice(mode_set) ) { executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE; 4000e480: 82 10 20 01 mov 1, %g1 4000e484: c2 24 20 7c st %g1, [ %l0 + 0x7c ] /* * Set the new interrupt level */ if ( mask & RTEMS_INTERRUPT_MASK ) 4000e488: 80 8e 60 0f btst 0xf, %i1 4000e48c: 02 80 00 06 be 4000e4a4 4000e490: 80 8e 64 00 btst 0x400, %i1 */ RTEMS_INLINE_ROUTINE void _Modes_Set_interrupt_level ( Modes_Control mode_set ) { _ISR_Set_level( _Modes_Get_interrupt_level( mode_set ) ); 4000e494: 90 0e 20 0f and %i0, 0xf, %o0 4000e498: 7f ff ce 31 call 40001d5c 4000e49c: 91 2a 20 08 sll %o0, 8, %o0 */ is_asr_enabled = false; needs_asr_dispatching = false; if ( mask & RTEMS_ASR_MASK ) { 4000e4a0: 80 8e 64 00 btst 0x400, %i1 4000e4a4: 22 80 00 18 be,a 4000e504 4000e4a8: a0 10 20 00 clr %l0 if ( !previous_mode_set ) return RTEMS_INVALID_ADDRESS; executing = _Thread_Executing; api = executing->API_Extensions[ THREAD_API_RTEMS ]; asr = &api->Signal; 4000e4ac: c2 0c 60 08 ldub [ %l1 + 8 ], %g1 * Output: * *previous_mode_set - previous mode set * always return RTEMS_SUCCESSFUL; */ rtems_status_code rtems_task_mode( 4000e4b0: b1 36 20 0a srl %i0, 0xa, %i0 4000e4b4: b0 1e 20 01 xor %i0, 1, %i0 4000e4b8: b0 0e 20 01 and %i0, 1, %i0 if ( !previous_mode_set ) return RTEMS_INVALID_ADDRESS; executing = _Thread_Executing; api = executing->API_Extensions[ THREAD_API_RTEMS ]; asr = &api->Signal; 4000e4bc: 80 a6 00 01 cmp %i0, %g1 4000e4c0: 22 80 00 11 be,a 4000e504 4000e4c4: a0 10 20 00 clr %l0 ) { rtems_signal_set _signals; ISR_Level _level; _ISR_Disable( _level ); 4000e4c8: 7f ff ce 21 call 40001d4c 4000e4cc: f0 2c 60 08 stb %i0, [ %l1 + 8 ] _signals = information->signals_pending; 4000e4d0: c4 04 60 18 ld [ %l1 + 0x18 ], %g2 information->signals_pending = information->signals_posted; 4000e4d4: c2 04 60 14 ld [ %l1 + 0x14 ], %g1 information->signals_posted = _signals; 4000e4d8: c4 24 60 14 st %g2, [ %l1 + 0x14 ] rtems_signal_set _signals; ISR_Level _level; _ISR_Disable( _level ); _signals = information->signals_pending; information->signals_pending = information->signals_posted; 4000e4dc: c2 24 60 18 st %g1, [ %l1 + 0x18 ] information->signals_posted = _signals; _ISR_Enable( _level ); 4000e4e0: 7f ff ce 1f call 40001d5c 4000e4e4: 01 00 00 00 nop 4000e4e8: c2 04 60 14 ld [ %l1 + 0x14 ], %g1 4000e4ec: 80 a0 60 00 cmp %g1, 0 4000e4f0: 22 80 00 05 be,a 4000e504 4000e4f4: a0 10 20 00 clr %l0 if ( is_asr_enabled != asr->is_enabled ) { asr->is_enabled = is_asr_enabled; _ASR_Swap_signals( asr ); if ( _ASR_Are_signals_pending( asr ) ) { needs_asr_dispatching = true; executing->do_post_task_switch_extension = true; 4000e4f8: 82 10 20 01 mov 1, %g1 4000e4fc: c2 2c 20 74 stb %g1, [ %l0 + 0x74 ] 4000e500: a0 10 20 01 mov 1, %l0 } } } if ( _System_state_Is_up( _System_state_Get() ) ) 4000e504: 03 10 00 76 sethi %hi(0x4001d800), %g1 4000e508: c2 00 63 10 ld [ %g1 + 0x310 ], %g1 ! 4001db10 <_System_state_Current> 4000e50c: 80 a0 60 03 cmp %g1, 3 4000e510: 12 80 00 0c bne 4000e540 <== NEVER TAKEN 4000e514: 82 10 20 00 clr %g1 if ( _Thread_Evaluate_mode() || needs_asr_dispatching ) 4000e518: 40 00 00 bc call 4000e808 <_Thread_Evaluate_mode> 4000e51c: 01 00 00 00 nop 4000e520: 80 8a 20 ff btst 0xff, %o0 4000e524: 12 80 00 04 bne 4000e534 4000e528: 80 8c 20 ff btst 0xff, %l0 4000e52c: 02 80 00 05 be 4000e540 4000e530: 82 10 20 00 clr %g1 _Thread_Dispatch(); 4000e534: 7f ff e7 f5 call 40008508 <_Thread_Dispatch> 4000e538: 01 00 00 00 nop 4000e53c: 82 10 20 00 clr %g1 ! 0 return RTEMS_SUCCESSFUL; } 4000e540: 81 c7 e0 08 ret 4000e544: 91 e8 00 01 restore %g0, %g1, %o0 =============================================================================== 4000ba44 : rtems_status_code rtems_task_set_priority( rtems_id id, rtems_task_priority new_priority, rtems_task_priority *old_priority ) { 4000ba44: 9d e3 bf 98 save %sp, -104, %sp register Thread_Control *the_thread; Objects_Locations location; if ( new_priority != RTEMS_CURRENT_PRIORITY && 4000ba48: 80 a6 60 00 cmp %i1, 0 4000ba4c: 02 80 00 07 be 4000ba68 4000ba50: 90 10 00 18 mov %i0, %o0 4000ba54: 03 10 00 8e sethi %hi(0x40023800), %g1 4000ba58: c2 08 61 34 ldub [ %g1 + 0x134 ], %g1 ! 40023934 4000ba5c: 80 a6 40 01 cmp %i1, %g1 4000ba60: 18 80 00 1c bgu 4000bad0 4000ba64: b0 10 20 13 mov 0x13, %i0 !_RTEMS_tasks_Priority_is_valid( new_priority ) ) return RTEMS_INVALID_PRIORITY; if ( !old_priority ) 4000ba68: 80 a6 a0 00 cmp %i2, 0 4000ba6c: 02 80 00 19 be 4000bad0 4000ba70: b0 10 20 09 mov 9, %i0 return RTEMS_INVALID_ADDRESS; the_thread = _Thread_Get( id, &location ); 4000ba74: 40 00 08 3e call 4000db6c <_Thread_Get> 4000ba78: 92 07 bf fc add %fp, -4, %o1 switch ( location ) { 4000ba7c: c2 07 bf fc ld [ %fp + -4 ], %g1 4000ba80: 80 a0 60 00 cmp %g1, 0 4000ba84: 12 80 00 13 bne 4000bad0 4000ba88: b0 10 20 04 mov 4, %i0 case OBJECTS_LOCAL: /* XXX need helper to "convert" from core priority */ *old_priority = the_thread->current_priority; 4000ba8c: c2 02 20 14 ld [ %o0 + 0x14 ], %g1 if ( new_priority != RTEMS_CURRENT_PRIORITY ) { 4000ba90: 80 a6 60 00 cmp %i1, 0 4000ba94: 02 80 00 0d be 4000bac8 4000ba98: c2 26 80 00 st %g1, [ %i2 ] the_thread->real_priority = new_priority; if ( the_thread->resource_count == 0 || 4000ba9c: c2 02 20 1c ld [ %o0 + 0x1c ], %g1 4000baa0: 80 a0 60 00 cmp %g1, 0 4000baa4: 02 80 00 06 be 4000babc 4000baa8: f2 22 20 18 st %i1, [ %o0 + 0x18 ] the_thread->current_priority > new_priority ) 4000baac: c2 02 20 14 ld [ %o0 + 0x14 ], %g1 4000bab0: 80 a0 40 19 cmp %g1, %i1 4000bab4: 08 80 00 05 bleu 4000bac8 <== ALWAYS TAKEN 4000bab8: 01 00 00 00 nop _Thread_Change_priority( the_thread, new_priority, false ); 4000babc: 92 10 00 19 mov %i1, %o1 4000bac0: 40 00 06 98 call 4000d520 <_Thread_Change_priority> 4000bac4: 94 10 20 00 clr %o2 } _Thread_Enable_dispatch(); 4000bac8: 40 00 08 06 call 4000dae0 <_Thread_Enable_dispatch> 4000bacc: b0 10 20 00 clr %i0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 4000bad0: 81 c7 e0 08 ret 4000bad4: 81 e8 00 00 restore =============================================================================== 400157e4 : */ rtems_status_code rtems_timer_cancel( rtems_id id ) { 400157e4: 9d e3 bf 98 save %sp, -104, %sp RTEMS_INLINE_ROUTINE Timer_Control *_Timer_Get ( Objects_Id id, Objects_Locations *location ) { return (Timer_Control *) 400157e8: 11 10 00 fb sethi %hi(0x4003ec00), %o0 400157ec: 92 10 00 18 mov %i0, %o1 400157f0: 90 12 22 c0 or %o0, 0x2c0, %o0 400157f4: 40 00 0b 83 call 40018600 <_Objects_Get> 400157f8: 94 07 bf fc add %fp, -4, %o2 Timer_Control *the_timer; Objects_Locations location; the_timer = _Timer_Get( id, &location ); switch ( location ) { 400157fc: c2 07 bf fc ld [ %fp + -4 ], %g1 40015800: 80 a0 60 00 cmp %g1, 0 40015804: 12 80 00 0a bne 4001582c 40015808: b0 10 20 04 mov 4, %i0 case OBJECTS_LOCAL: if ( !_Timer_Is_dormant_class( the_timer->the_class ) ) 4001580c: c2 02 20 38 ld [ %o0 + 0x38 ], %g1 40015810: 80 a0 60 04 cmp %g1, 4 40015814: 02 80 00 04 be 40015824 <== NEVER TAKEN 40015818: 01 00 00 00 nop (void) _Watchdog_Remove( &the_timer->Ticker ); 4001581c: 40 00 14 03 call 4001a828 <_Watchdog_Remove> 40015820: 90 02 20 10 add %o0, 0x10, %o0 _Thread_Enable_dispatch(); 40015824: 40 00 0d f0 call 40018fe4 <_Thread_Enable_dispatch> 40015828: b0 10 20 00 clr %i0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 4001582c: 81 c7 e0 08 ret 40015830: 81 e8 00 00 restore =============================================================================== 40015cd4 : rtems_id id, rtems_time_of_day *wall_time, rtems_timer_service_routine_entry routine, void *user_data ) { 40015cd4: 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; 40015cd8: 03 10 00 fb sethi %hi(0x4003ec00), %g1 40015cdc: e0 00 63 00 ld [ %g1 + 0x300 ], %l0 ! 4003ef00 <_Timer_server> rtems_id id, rtems_time_of_day *wall_time, rtems_timer_service_routine_entry routine, void *user_data ) { 40015ce0: a2 10 00 18 mov %i0, %l1 Timer_Control *the_timer; Objects_Locations location; rtems_interval seconds; Timer_server_Control *timer_server = _Timer_server; if ( !timer_server ) 40015ce4: 80 a4 20 00 cmp %l0, 0 40015ce8: 02 80 00 32 be 40015db0 40015cec: b0 10 20 0e mov 0xe, %i0 return RTEMS_INCORRECT_STATE; if ( !_TOD_Is_set ) 40015cf0: 03 10 00 f9 sethi %hi(0x4003e400), %g1 40015cf4: c2 08 61 54 ldub [ %g1 + 0x154 ], %g1 ! 4003e554 <_TOD_Is_set> 40015cf8: 80 a0 60 00 cmp %g1, 0 40015cfc: 02 80 00 2d be 40015db0 <== NEVER TAKEN 40015d00: b0 10 20 0b mov 0xb, %i0 return RTEMS_NOT_DEFINED; if ( !routine ) 40015d04: 80 a6 a0 00 cmp %i2, 0 40015d08: 02 80 00 2a be 40015db0 40015d0c: b0 10 20 09 mov 9, %i0 return RTEMS_INVALID_ADDRESS; if ( !_TOD_Validate( wall_time ) ) 40015d10: 7f ff f4 0d call 40012d44 <_TOD_Validate> 40015d14: 90 10 00 19 mov %i1, %o0 40015d18: 80 8a 20 ff btst 0xff, %o0 40015d1c: 22 80 00 25 be,a 40015db0 40015d20: b0 10 20 14 mov 0x14, %i0 return RTEMS_INVALID_CLOCK; seconds = _TOD_To_seconds( wall_time ); 40015d24: 7f ff f3 d4 call 40012c74 <_TOD_To_seconds> 40015d28: 90 10 00 19 mov %i1, %o0 if ( seconds <= _TOD_Seconds_since_epoch() ) 40015d2c: 27 10 00 f9 sethi %hi(0x4003e400), %l3 40015d30: c2 04 e1 d0 ld [ %l3 + 0x1d0 ], %g1 ! 4003e5d0 <_TOD_Now> 40015d34: 80 a2 00 01 cmp %o0, %g1 40015d38: 08 80 00 20 bleu 40015db8 40015d3c: a4 10 00 08 mov %o0, %l2 40015d40: 11 10 00 fb sethi %hi(0x4003ec00), %o0 40015d44: 92 10 00 11 mov %l1, %o1 40015d48: 90 12 22 c0 or %o0, 0x2c0, %o0 40015d4c: 40 00 0a 2d call 40018600 <_Objects_Get> 40015d50: 94 07 bf fc add %fp, -4, %o2 return RTEMS_INVALID_CLOCK; the_timer = _Timer_Get( id, &location ); switch ( location ) { 40015d54: c2 07 bf fc ld [ %fp + -4 ], %g1 40015d58: b2 10 00 08 mov %o0, %i1 40015d5c: 80 a0 60 00 cmp %g1, 0 40015d60: 12 80 00 14 bne 40015db0 40015d64: b0 10 20 04 mov 4, %i0 case OBJECTS_LOCAL: (void) _Watchdog_Remove( &the_timer->Ticker ); 40015d68: 40 00 12 b0 call 4001a828 <_Watchdog_Remove> 40015d6c: 90 02 20 10 add %o0, 0x10, %o0 the_watchdog->routine = routine; the_watchdog->id = id; 40015d70: e2 26 60 30 st %l1, [ %i1 + 0x30 ] 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(); 40015d74: c4 04 e1 d0 ld [ %l3 + 0x1d0 ], %g2 (*timer_server->schedule_operation)( timer_server, the_timer ); 40015d78: c2 04 20 04 ld [ %l0 + 4 ], %g1 40015d7c: 90 10 00 10 mov %l0, %o0 40015d80: 92 10 00 19 mov %i1, %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(); 40015d84: a4 24 80 02 sub %l2, %g2, %l2 the_timer = _Timer_Get( id, &location ); switch ( location ) { case OBJECTS_LOCAL: (void) _Watchdog_Remove( &the_timer->Ticker ); the_timer->the_class = TIMER_TIME_OF_DAY_ON_TASK; 40015d88: 84 10 20 03 mov 3, %g2 Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 40015d8c: f4 26 60 2c st %i2, [ %i1 + 0x2c ] 40015d90: c4 26 60 38 st %g2, [ %i1 + 0x38 ] the_watchdog->id = id; the_watchdog->user_data = user_data; 40015d94: f6 26 60 34 st %i3, [ %i1 + 0x34 ] _Watchdog_Initialize( &the_timer->Ticker, routine, id, user_data ); the_timer->Ticker.initial = seconds - _TOD_Seconds_since_epoch(); 40015d98: e4 26 60 1c st %l2, [ %i1 + 0x1c ] Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 40015d9c: c0 26 60 18 clr [ %i1 + 0x18 ] (*timer_server->schedule_operation)( timer_server, the_timer ); 40015da0: 9f c0 40 00 call %g1 40015da4: b0 10 20 00 clr %i0 _Thread_Enable_dispatch(); 40015da8: 40 00 0c 8f call 40018fe4 <_Thread_Enable_dispatch> 40015dac: 01 00 00 00 nop return RTEMS_SUCCESSFUL; 40015db0: 81 c7 e0 08 ret 40015db4: 81 e8 00 00 restore 40015db8: b0 10 20 14 mov 0x14, %i0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 40015dbc: 81 c7 e0 08 ret 40015dc0: 81 e8 00 00 restore =============================================================================== 40006d98 : #include int sched_get_priority_max( int policy ) { 40006d98: 9d e3 bf a0 save %sp, -96, %sp switch ( policy ) { 40006d9c: 80 a6 20 04 cmp %i0, 4 40006da0: 18 80 00 06 bgu 40006db8 40006da4: 82 10 20 01 mov 1, %g1 40006da8: b1 28 40 18 sll %g1, %i0, %i0 40006dac: 80 8e 20 17 btst 0x17, %i0 40006db0: 12 80 00 08 bne 40006dd0 <== ALWAYS TAKEN 40006db4: 03 10 00 78 sethi %hi(0x4001e000), %g1 case SCHED_RR: case SCHED_SPORADIC: break; default: rtems_set_errno_and_return_minus_one( EINVAL ); 40006db8: 40 00 25 4b call 400102e4 <__errno> 40006dbc: b0 10 3f ff mov -1, %i0 40006dc0: 82 10 20 16 mov 0x16, %g1 40006dc4: c2 22 00 00 st %g1, [ %o0 ] 40006dc8: 81 c7 e0 08 ret 40006dcc: 81 e8 00 00 restore } return POSIX_SCHEDULER_MAXIMUM_PRIORITY; 40006dd0: f0 08 62 38 ldub [ %g1 + 0x238 ], %i0 } 40006dd4: 81 c7 e0 08 ret 40006dd8: 91 ee 3f ff restore %i0, -1, %o0 =============================================================================== 40006ddc : #include int sched_get_priority_min( int policy ) { 40006ddc: 9d e3 bf a0 save %sp, -96, %sp switch ( policy ) { 40006de0: 80 a6 20 04 cmp %i0, 4 40006de4: 18 80 00 06 bgu 40006dfc 40006de8: 82 10 20 01 mov 1, %g1 40006dec: b1 28 40 18 sll %g1, %i0, %i0 40006df0: 80 8e 20 17 btst 0x17, %i0 40006df4: 12 80 00 06 bne 40006e0c <== ALWAYS TAKEN 40006df8: b0 10 20 01 mov 1, %i0 case SCHED_RR: case SCHED_SPORADIC: break; default: rtems_set_errno_and_return_minus_one( EINVAL ); 40006dfc: 40 00 25 3a call 400102e4 <__errno> 40006e00: b0 10 3f ff mov -1, %i0 40006e04: 82 10 20 16 mov 0x16, %g1 40006e08: c2 22 00 00 st %g1, [ %o0 ] } return POSIX_SCHEDULER_MINIMUM_PRIORITY; } 40006e0c: 81 c7 e0 08 ret 40006e10: 81 e8 00 00 restore =============================================================================== 40006e14 : int sched_rr_get_interval( pid_t pid, struct timespec *interval ) { 40006e14: 9d e3 bf a0 save %sp, -96, %sp /* * Only supported for the "calling process" (i.e. this node). */ if ( pid && pid != getpid() ) 40006e18: 80 a6 20 00 cmp %i0, 0 40006e1c: 02 80 00 0b be 40006e48 <== NEVER TAKEN 40006e20: 80 a6 60 00 cmp %i1, 0 40006e24: 7f ff f2 d5 call 40003978 40006e28: 01 00 00 00 nop 40006e2c: 80 a6 00 08 cmp %i0, %o0 40006e30: 02 80 00 06 be 40006e48 40006e34: 80 a6 60 00 cmp %i1, 0 rtems_set_errno_and_return_minus_one( ESRCH ); 40006e38: 40 00 25 2b call 400102e4 <__errno> 40006e3c: 01 00 00 00 nop 40006e40: 10 80 00 07 b 40006e5c 40006e44: 82 10 20 03 mov 3, %g1 ! 3 if ( !interval ) 40006e48: 12 80 00 08 bne 40006e68 40006e4c: 03 10 00 7b sethi %hi(0x4001ec00), %g1 rtems_set_errno_and_return_minus_one( EINVAL ); 40006e50: 40 00 25 25 call 400102e4 <__errno> 40006e54: 01 00 00 00 nop 40006e58: 82 10 20 16 mov 0x16, %g1 ! 16 40006e5c: c2 22 00 00 st %g1, [ %o0 ] 40006e60: 81 c7 e0 08 ret 40006e64: 91 e8 3f ff restore %g0, -1, %o0 _Timespec_From_ticks( _Thread_Ticks_per_timeslice, interval ); 40006e68: d0 00 60 18 ld [ %g1 + 0x18 ], %o0 40006e6c: 92 10 00 19 mov %i1, %o1 40006e70: 40 00 0d cb call 4000a59c <_Timespec_From_ticks> 40006e74: b0 10 20 00 clr %i0 return 0; } 40006e78: 81 c7 e0 08 ret 40006e7c: 81 e8 00 00 restore =============================================================================== 40009730 : int oflag, ... /* mode_t mode, */ /* unsigned int value */ ) { 40009730: 9d e3 bf 90 save %sp, -112, %sp rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 40009734: 03 10 00 8f sethi %hi(0x40023c00), %g1 40009738: c4 00 60 b0 ld [ %g1 + 0xb0 ], %g2 ! 40023cb0 <_Thread_Dispatch_disable_level> Objects_Locations location; _Thread_Disable_dispatch(); if ( oflag & O_CREAT ) { va_start(arg, oflag); 4000973c: f4 27 a0 4c st %i2, [ %fp + 0x4c ] 40009740: 84 00 a0 01 inc %g2 40009744: f6 27 a0 50 st %i3, [ %fp + 0x50 ] 40009748: f8 27 a0 54 st %i4, [ %fp + 0x54 ] 4000974c: fa 27 a0 58 st %i5, [ %fp + 0x58 ] 40009750: c4 20 60 b0 st %g2, [ %g1 + 0xb0 ] POSIX_Semaphore_Control *the_semaphore; Objects_Locations location; _Thread_Disable_dispatch(); if ( oflag & O_CREAT ) { 40009754: a2 8e 62 00 andcc %i1, 0x200, %l1 40009758: 02 80 00 05 be 4000976c 4000975c: a0 10 20 00 clr %l0 va_start(arg, oflag); mode = (mode_t) va_arg( arg, unsigned int ); value = va_arg( arg, unsigned int ); 40009760: e0 07 a0 50 ld [ %fp + 0x50 ], %l0 40009764: 82 07 a0 54 add %fp, 0x54, %g1 40009768: c2 27 bf fc st %g1, [ %fp + -4 ] va_end(arg); } status = _POSIX_Semaphore_Name_to_id( name, &the_semaphore_id ); 4000976c: 90 10 00 18 mov %i0, %o0 40009770: 40 00 19 da call 4000fed8 <_POSIX_Semaphore_Name_to_id> 40009774: 92 07 bf f8 add %fp, -8, %o1 * and we can just return a pointer to the id. Otherwise we may * need to check to see if this is a "semaphore does not exist" * or some other miscellaneous error on the name. */ if ( status ) { 40009778: a4 92 20 00 orcc %o0, 0, %l2 4000977c: 22 80 00 0e be,a 400097b4 40009780: b2 0e 6a 00 and %i1, 0xa00, %i1 /* * Unless provided a valid name that did not already exist * and we are willing to create then it is an error. */ if ( !( status == ENOENT && (oflag & O_CREAT) ) ) { 40009784: 80 a4 a0 02 cmp %l2, 2 40009788: 12 80 00 04 bne 40009798 <== NEVER TAKEN 4000978c: 80 a4 60 00 cmp %l1, 0 40009790: 12 80 00 21 bne 40009814 40009794: 94 10 00 10 mov %l0, %o2 _Thread_Enable_dispatch(); 40009798: 40 00 0a 87 call 4000c1b4 <_Thread_Enable_dispatch> 4000979c: b0 10 3f ff mov -1, %i0 rtems_set_errno_and_return_minus_one_cast( status, sem_t * ); 400097a0: 40 00 28 50 call 400138e0 <__errno> 400097a4: 01 00 00 00 nop 400097a8: e4 22 00 00 st %l2, [ %o0 ] 400097ac: 81 c7 e0 08 ret 400097b0: 81 e8 00 00 restore /* * Check for existence with creation. */ if ( (oflag & (O_CREAT | O_EXCL)) == (O_CREAT | O_EXCL) ) { 400097b4: 80 a6 6a 00 cmp %i1, 0xa00 400097b8: 12 80 00 0a bne 400097e0 400097bc: d2 07 bf f8 ld [ %fp + -8 ], %o1 _Thread_Enable_dispatch(); 400097c0: 40 00 0a 7d call 4000c1b4 <_Thread_Enable_dispatch> 400097c4: b0 10 3f ff mov -1, %i0 rtems_set_errno_and_return_minus_one_cast( EEXIST, sem_t * ); 400097c8: 40 00 28 46 call 400138e0 <__errno> 400097cc: 01 00 00 00 nop 400097d0: 82 10 20 11 mov 0x11, %g1 ! 11 400097d4: c2 22 00 00 st %g1, [ %o0 ] 400097d8: 81 c7 e0 08 ret 400097dc: 81 e8 00 00 restore 400097e0: 94 07 bf f0 add %fp, -16, %o2 400097e4: 11 10 00 8f sethi %hi(0x40023c00), %o0 400097e8: 40 00 08 27 call 4000b884 <_Objects_Get> 400097ec: 90 12 23 c0 or %o0, 0x3c0, %o0 ! 40023fc0 <_POSIX_Semaphore_Information> } the_semaphore = _POSIX_Semaphore_Get( &the_semaphore_id, &location ); the_semaphore->open_count += 1; 400097f0: c2 02 20 18 ld [ %o0 + 0x18 ], %g1 if ( (oflag & (O_CREAT | O_EXCL)) == (O_CREAT | O_EXCL) ) { _Thread_Enable_dispatch(); rtems_set_errno_and_return_minus_one_cast( EEXIST, sem_t * ); } the_semaphore = _POSIX_Semaphore_Get( &the_semaphore_id, &location ); 400097f4: d0 27 bf f4 st %o0, [ %fp + -12 ] the_semaphore->open_count += 1; 400097f8: 82 00 60 01 inc %g1 _Thread_Enable_dispatch(); 400097fc: 40 00 0a 6e call 4000c1b4 <_Thread_Enable_dispatch> 40009800: c2 22 20 18 st %g1, [ %o0 + 0x18 ] _Thread_Enable_dispatch(); 40009804: 40 00 0a 6c call 4000c1b4 <_Thread_Enable_dispatch> 40009808: 01 00 00 00 nop goto return_id; 4000980c: 10 80 00 0c b 4000983c 40009810: f0 07 bf f4 ld [ %fp + -12 ], %i0 /* * At this point, the semaphore does not exist and everything has been * checked. We should go ahead and create a semaphore. */ status =_POSIX_Semaphore_Create_support( 40009814: 90 10 00 18 mov %i0, %o0 40009818: 92 10 20 00 clr %o1 4000981c: 40 00 19 59 call 4000fd80 <_POSIX_Semaphore_Create_support> 40009820: 96 07 bf f4 add %fp, -12, %o3 /* * errno was set by Create_support, so don't set it again. */ _Thread_Enable_dispatch(); 40009824: 40 00 0a 64 call 4000c1b4 <_Thread_Enable_dispatch> 40009828: a0 10 00 08 mov %o0, %l0 if ( status == -1 ) 4000982c: 80 a4 3f ff cmp %l0, -1 40009830: 02 bf ff ea be 400097d8 40009834: b0 10 3f ff mov -1, %i0 return_id: #if defined(RTEMS_USE_16_BIT_OBJECT) the_semaphore->Semaphore_id = the_semaphore->Object.id; id = &the_semaphore->Semaphore_id; #else id = (sem_t *)&the_semaphore->Object.id; 40009838: f0 07 bf f4 ld [ %fp + -12 ], %i0 4000983c: b0 06 20 08 add %i0, 8, %i0 #endif return id; } 40009840: 81 c7 e0 08 ret 40009844: 81 e8 00 00 restore =============================================================================== 40006d40 : int sigaction( int sig, const struct sigaction *act, struct sigaction *oact ) { 40006d40: 9d e3 bf a0 save %sp, -96, %sp 40006d44: 90 10 00 1a mov %i2, %o0 ISR_Level level; if ( oact ) 40006d48: 80 a6 a0 00 cmp %i2, 0 40006d4c: 02 80 00 0a be 40006d74 40006d50: a0 10 00 18 mov %i0, %l0 *oact = _POSIX_signals_Vectors[ sig ]; 40006d54: 83 2e 20 02 sll %i0, 2, %g1 40006d58: 85 2e 20 04 sll %i0, 4, %g2 40006d5c: 82 20 80 01 sub %g2, %g1, %g1 40006d60: 13 10 00 80 sethi %hi(0x40020000), %o1 40006d64: 94 10 20 0c mov 0xc, %o2 40006d68: 92 12 61 a4 or %o1, 0x1a4, %o1 40006d6c: 40 00 28 32 call 40010e34 40006d70: 92 02 40 01 add %o1, %g1, %o1 if ( !sig ) 40006d74: 80 a4 20 00 cmp %l0, 0 40006d78: 02 80 00 07 be 40006d94 40006d7c: 82 04 3f ff add %l0, -1, %g1 rtems_set_errno_and_return_minus_one( EINVAL ); if ( !is_valid_signo(sig) ) 40006d80: 80 a0 60 1f cmp %g1, 0x1f 40006d84: 18 80 00 04 bgu 40006d94 40006d88: 80 a4 20 09 cmp %l0, 9 * * NOTE: Solaris documentation claims to "silently enforce" this which * contradicts the POSIX specification. */ if ( sig == SIGKILL ) 40006d8c: 12 80 00 08 bne 40006dac 40006d90: 80 a6 60 00 cmp %i1, 0 rtems_set_errno_and_return_minus_one( EINVAL ); 40006d94: 40 00 25 e7 call 40010530 <__errno> 40006d98: b0 10 3f ff mov -1, %i0 40006d9c: 82 10 20 16 mov 0x16, %g1 40006da0: c2 22 00 00 st %g1, [ %o0 ] 40006da4: 81 c7 e0 08 ret 40006da8: 81 e8 00 00 restore /* * Evaluate the new action structure and set the global signal vector * appropriately. */ if ( act ) { 40006dac: 02 bf ff fe be 40006da4 <== NEVER TAKEN 40006db0: b0 10 20 00 clr %i0 /* * Unless the user is installing the default signal actions, then * we can just copy the provided sigaction structure into the vectors. */ _ISR_Disable( level ); 40006db4: 7f ff ed 80 call 400023b4 40006db8: 01 00 00 00 nop 40006dbc: a2 10 00 08 mov %o0, %l1 if ( act->sa_handler == SIG_DFL ) { 40006dc0: c2 06 60 08 ld [ %i1 + 8 ], %g1 40006dc4: 25 10 00 80 sethi %hi(0x40020000), %l2 40006dc8: 80 a0 60 00 cmp %g1, 0 40006dcc: a4 14 a1 a4 or %l2, 0x1a4, %l2 40006dd0: a7 2c 20 02 sll %l0, 2, %l3 40006dd4: 12 80 00 08 bne 40006df4 40006dd8: a9 2c 20 04 sll %l0, 4, %l4 _POSIX_signals_Vectors[ sig ] = _POSIX_signals_Default_vectors[ sig ]; 40006ddc: a6 25 00 13 sub %l4, %l3, %l3 40006de0: 13 10 00 79 sethi %hi(0x4001e400), %o1 40006de4: 90 04 80 13 add %l2, %l3, %o0 40006de8: 92 12 60 18 or %o1, 0x18, %o1 40006dec: 10 80 00 07 b 40006e08 40006df0: 92 02 40 13 add %o1, %l3, %o1 } else { _POSIX_signals_Clear_process_signals( sig ); 40006df4: 40 00 17 e5 call 4000cd88 <_POSIX_signals_Clear_process_signals> 40006df8: 90 10 00 10 mov %l0, %o0 _POSIX_signals_Vectors[ sig ] = *act; 40006dfc: a6 25 00 13 sub %l4, %l3, %l3 40006e00: 92 10 00 19 mov %i1, %o1 40006e04: 90 04 80 13 add %l2, %l3, %o0 40006e08: 40 00 28 0b call 40010e34 40006e0c: 94 10 20 0c mov 0xc, %o2 } _ISR_Enable( level ); 40006e10: b0 10 20 00 clr %i0 40006e14: 7f ff ed 6c call 400023c4 40006e18: 90 10 00 11 mov %l1, %o0 * + If we are now ignoring a signal that was previously pending, * we clear the pending signal indicator. */ return 0; } 40006e1c: 81 c7 e0 08 ret 40006e20: 81 e8 00 00 restore =============================================================================== 40008f6c : #include int sigsuspend( const sigset_t *sigmask ) { 40008f6c: 9d e3 bf 98 save %sp, -104, %sp int status; POSIX_API_Control *api; api = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; status = sigprocmask( SIG_BLOCK, sigmask, &saved_signals_blocked ); 40008f70: 90 10 20 01 mov 1, %o0 40008f74: 92 10 00 18 mov %i0, %o1 40008f78: a0 07 bf fc add %fp, -4, %l0 40008f7c: 7f ff ff f1 call 40008f40 40008f80: 94 10 00 10 mov %l0, %o2 (void) sigfillset( &all_signals ); 40008f84: a2 07 bf f8 add %fp, -8, %l1 40008f88: 7f ff ff b6 call 40008e60 40008f8c: 90 10 00 11 mov %l1, %o0 status = sigtimedwait( &all_signals, NULL, NULL ); 40008f90: 90 10 00 11 mov %l1, %o0 40008f94: 92 10 20 00 clr %o1 40008f98: 40 00 00 28 call 40009038 40008f9c: 94 10 20 00 clr %o2 (void) sigprocmask( SIG_SETMASK, &saved_signals_blocked, NULL ); 40008fa0: 92 10 00 10 mov %l0, %o1 status = sigprocmask( SIG_BLOCK, sigmask, &saved_signals_blocked ); (void) sigfillset( &all_signals ); status = sigtimedwait( &all_signals, NULL, NULL ); 40008fa4: a2 10 00 08 mov %o0, %l1 (void) sigprocmask( SIG_SETMASK, &saved_signals_blocked, NULL ); 40008fa8: 94 10 20 00 clr %o2 40008fac: 7f ff ff e5 call 40008f40 40008fb0: 90 10 20 00 clr %o0 /* * sigtimedwait() returns the signal number while sigsuspend() * is supposed to return -1 and EINTR when a signal is caught. */ if ( status != -1 ) 40008fb4: 80 a4 7f ff cmp %l1, -1 40008fb8: 02 80 00 06 be 40008fd0 <== NEVER TAKEN 40008fbc: 01 00 00 00 nop rtems_set_errno_and_return_minus_one( EINTR ); 40008fc0: 40 00 25 38 call 400124a0 <__errno> 40008fc4: 01 00 00 00 nop 40008fc8: 82 10 20 04 mov 4, %g1 ! 4 40008fcc: c2 22 00 00 st %g1, [ %o0 ] return status; } 40008fd0: 81 c7 e0 08 ret 40008fd4: 91 e8 3f ff restore %g0, -1, %o0 =============================================================================== 400071bc : int sigtimedwait( const sigset_t *set, siginfo_t *info, const struct timespec *timeout ) { 400071bc: 9d e3 bf 90 save %sp, -112, %sp ISR_Level level; /* * Error check parameters before disabling interrupts. */ if ( !set ) 400071c0: 80 a6 20 00 cmp %i0, 0 400071c4: 02 80 00 0e be 400071fc 400071c8: 80 a6 a0 00 cmp %i2, 0 /* NOTE: This is very specifically a RELATIVE not ABSOLUTE time * in the Open Group specification. */ interval = 0; if ( timeout ) { 400071cc: 02 80 00 12 be 40007214 400071d0: a8 10 20 00 clr %l4 if ( !_Timespec_Is_valid( timeout ) ) 400071d4: 40 00 0d fd call 4000a9c8 <_Timespec_Is_valid> 400071d8: 90 10 00 1a mov %i2, %o0 400071dc: 80 8a 20 ff btst 0xff, %o0 400071e0: 02 80 00 07 be 400071fc 400071e4: 01 00 00 00 nop rtems_set_errno_and_return_minus_one( EINVAL ); interval = _Timespec_To_ticks( timeout ); 400071e8: 40 00 0e 1d call 4000aa5c <_Timespec_To_ticks> 400071ec: 90 10 00 1a mov %i2, %o0 if ( !interval ) 400071f0: a8 92 20 00 orcc %o0, 0, %l4 400071f4: 12 80 00 09 bne 40007218 <== ALWAYS TAKEN 400071f8: 80 a6 60 00 cmp %i1, 0 rtems_set_errno_and_return_minus_one( EINVAL ); 400071fc: 40 00 25 a9 call 400108a0 <__errno> 40007200: b0 10 3f ff mov -1, %i0 40007204: 82 10 20 16 mov 0x16, %g1 40007208: c2 22 00 00 st %g1, [ %o0 ] 4000720c: 81 c7 e0 08 ret 40007210: 81 e8 00 00 restore /* * Initialize local variables. */ the_info = ( info ) ? info : &signal_information; 40007214: 80 a6 60 00 cmp %i1, 0 40007218: 02 80 00 03 be 40007224 4000721c: a0 07 bf f4 add %fp, -12, %l0 40007220: a0 10 00 19 mov %i1, %l0 the_thread = _Thread_Executing; 40007224: 23 10 00 80 sethi %hi(0x40020000), %l1 40007228: f2 04 60 fc ld [ %l1 + 0xfc ], %i1 ! 400200fc <_Thread_Executing> * What if they are already pending? */ /* API signals pending? */ _ISR_Disable( level ); 4000722c: 7f ff ed 33 call 400026f8 40007230: e6 06 61 60 ld [ %i1 + 0x160 ], %l3 40007234: a4 10 00 08 mov %o0, %l2 if ( *set & api->signals_pending ) { 40007238: c4 06 00 00 ld [ %i0 ], %g2 4000723c: c2 04 e0 d0 ld [ %l3 + 0xd0 ], %g1 40007240: 80 88 80 01 btst %g2, %g1 40007244: 22 80 00 10 be,a 40007284 40007248: 03 10 00 81 sethi %hi(0x40020400), %g1 /* XXX real info later */ the_info->si_signo = _POSIX_signals_Get_highest( api->signals_pending ); 4000724c: 7f ff ff c4 call 4000715c <_POSIX_signals_Get_highest> 40007250: 90 10 00 01 mov %g1, %o0 _POSIX_signals_Clear_signals( 40007254: 94 10 00 10 mov %l0, %o2 /* API signals pending? */ _ISR_Disable( level ); if ( *set & api->signals_pending ) { /* XXX real info later */ the_info->si_signo = _POSIX_signals_Get_highest( api->signals_pending ); 40007258: 92 10 00 08 mov %o0, %o1 _POSIX_signals_Clear_signals( 4000725c: 96 10 20 00 clr %o3 40007260: 90 10 00 13 mov %l3, %o0 /* API signals pending? */ _ISR_Disable( level ); if ( *set & api->signals_pending ) { /* XXX real info later */ the_info->si_signo = _POSIX_signals_Get_highest( api->signals_pending ); 40007264: d2 24 00 00 st %o1, [ %l0 ] _POSIX_signals_Clear_signals( 40007268: 40 00 18 a7 call 4000d504 <_POSIX_signals_Clear_signals> 4000726c: 98 10 20 00 clr %o4 the_info->si_signo, the_info, false, false ); _ISR_Enable( level ); 40007270: 7f ff ed 26 call 40002708 40007274: 90 10 00 12 mov %l2, %o0 the_info->si_code = SI_USER; the_info->si_value.sival_int = 0; 40007278: c0 24 20 08 clr [ %l0 + 8 ] return the_info->si_signo; 4000727c: 10 80 00 13 b 400072c8 40007280: f0 04 00 00 ld [ %l0 ], %i0 } /* Process pending signals? */ if ( *set & _POSIX_signals_Pending ) { 40007284: c2 00 63 c8 ld [ %g1 + 0x3c8 ], %g1 40007288: 80 88 80 01 btst %g2, %g1 4000728c: 22 80 00 13 be,a 400072d8 40007290: 03 10 00 80 sethi %hi(0x40020000), %g1 signo = _POSIX_signals_Get_highest( _POSIX_signals_Pending ); 40007294: 7f ff ff b2 call 4000715c <_POSIX_signals_Get_highest> 40007298: 90 10 00 01 mov %g1, %o0 _POSIX_signals_Clear_signals( api, signo, the_info, true, false ); 4000729c: 94 10 00 10 mov %l0, %o2 } /* Process pending signals? */ if ( *set & _POSIX_signals_Pending ) { signo = _POSIX_signals_Get_highest( _POSIX_signals_Pending ); 400072a0: b0 10 00 08 mov %o0, %i0 _POSIX_signals_Clear_signals( api, signo, the_info, true, false ); 400072a4: 96 10 20 01 mov 1, %o3 400072a8: 90 10 00 13 mov %l3, %o0 400072ac: 92 10 00 18 mov %i0, %o1 400072b0: 40 00 18 95 call 4000d504 <_POSIX_signals_Clear_signals> 400072b4: 98 10 20 00 clr %o4 _ISR_Enable( level ); 400072b8: 7f ff ed 14 call 40002708 400072bc: 90 10 00 12 mov %l2, %o0 the_info->si_signo = signo; the_info->si_code = SI_USER; the_info->si_value.sival_int = 0; 400072c0: c0 24 20 08 clr [ %l0 + 8 ] if ( *set & _POSIX_signals_Pending ) { signo = _POSIX_signals_Get_highest( _POSIX_signals_Pending ); _POSIX_signals_Clear_signals( api, signo, the_info, true, false ); _ISR_Enable( level ); the_info->si_signo = signo; 400072c4: f0 24 00 00 st %i0, [ %l0 ] the_info->si_code = SI_USER; 400072c8: 82 10 20 01 mov 1, %g1 400072cc: c2 24 20 04 st %g1, [ %l0 + 4 ] the_info->si_value.sival_int = 0; return signo; 400072d0: 81 c7 e0 08 ret 400072d4: 81 e8 00 00 restore 400072d8: c4 00 60 40 ld [ %g1 + 0x40 ], %g2 400072dc: 84 00 a0 01 inc %g2 400072e0: c4 20 60 40 st %g2, [ %g1 + 0x40 ] } the_info->si_signo = -1; 400072e4: 82 10 3f ff mov -1, %g1 400072e8: c2 24 00 00 st %g1, [ %l0 ] _Thread_Disable_dispatch(); the_thread->Wait.queue = &_POSIX_signals_Wait_queue; the_thread->Wait.return_code = EINTR; 400072ec: 82 10 20 04 mov 4, %g1 400072f0: c2 26 60 34 st %g1, [ %i1 + 0x34 ] the_thread->Wait.option = *set; 400072f4: c2 06 00 00 ld [ %i0 ], %g1 the_thread->Wait.return_argument = the_info; 400072f8: e0 26 60 28 st %l0, [ %i1 + 0x28 ] the_info->si_signo = -1; _Thread_Disable_dispatch(); the_thread->Wait.queue = &_POSIX_signals_Wait_queue; the_thread->Wait.return_code = EINTR; the_thread->Wait.option = *set; 400072fc: c2 26 60 30 st %g1, [ %i1 + 0x30 ] } the_info->si_signo = -1; _Thread_Disable_dispatch(); the_thread->Wait.queue = &_POSIX_signals_Wait_queue; 40007300: 25 10 00 81 sethi %hi(0x40020400), %l2 RTEMS_INLINE_ROUTINE void _Thread_queue_Enter_critical_section ( Thread_queue_Control *the_thread_queue ) { the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; 40007304: 82 10 20 01 mov 1, %g1 40007308: a4 14 a3 60 or %l2, 0x360, %l2 4000730c: e4 26 60 44 st %l2, [ %i1 + 0x44 ] 40007310: c2 24 a0 30 st %g1, [ %l2 + 0x30 ] the_thread->Wait.return_code = EINTR; the_thread->Wait.option = *set; the_thread->Wait.return_argument = the_info; _Thread_queue_Enter_critical_section( &_POSIX_signals_Wait_queue ); _ISR_Enable( level ); 40007314: 7f ff ec fd call 40002708 40007318: 01 00 00 00 nop _Thread_queue_Enqueue( &_POSIX_signals_Wait_queue, interval ); 4000731c: 90 10 00 12 mov %l2, %o0 40007320: 92 10 00 14 mov %l4, %o1 40007324: 15 10 00 29 sethi %hi(0x4000a400), %o2 40007328: 40 00 0b 67 call 4000a0c4 <_Thread_queue_Enqueue_with_handler> 4000732c: 94 12 a0 24 or %o2, 0x24, %o2 ! 4000a424 <_Thread_queue_Timeout> _Thread_Enable_dispatch(); 40007330: 40 00 0a 12 call 40009b78 <_Thread_Enable_dispatch> 40007334: 01 00 00 00 nop /* * When the thread is set free by a signal, it is need to eliminate * the signal. */ _POSIX_signals_Clear_signals( api, the_info->si_signo, the_info, false, false ); 40007338: d2 04 00 00 ld [ %l0 ], %o1 4000733c: 94 10 00 10 mov %l0, %o2 40007340: 96 10 20 00 clr %o3 40007344: 98 10 20 00 clr %o4 40007348: 40 00 18 6f call 4000d504 <_POSIX_signals_Clear_signals> 4000734c: 90 10 00 13 mov %l3, %o0 errno = _Thread_Executing->Wait.return_code; 40007350: 40 00 25 54 call 400108a0 <__errno> 40007354: 01 00 00 00 nop 40007358: c2 04 60 fc ld [ %l1 + 0xfc ], %g1 4000735c: c2 00 60 34 ld [ %g1 + 0x34 ], %g1 40007360: c2 22 00 00 st %g1, [ %o0 ] return the_info->si_signo; 40007364: f0 04 00 00 ld [ %l0 ], %i0 } 40007368: 81 c7 e0 08 ret 4000736c: 81 e8 00 00 restore =============================================================================== 40009200 : int sigwait( const sigset_t *set, int *sig ) { 40009200: 9d e3 bf a0 save %sp, -96, %sp int status; status = sigtimedwait( set, NULL, NULL ); 40009204: 92 10 20 00 clr %o1 40009208: 90 10 00 18 mov %i0, %o0 4000920c: 7f ff ff 8b call 40009038 40009210: 94 10 20 00 clr %o2 if ( status != -1 ) { 40009214: 80 a2 3f ff cmp %o0, -1 40009218: 02 80 00 07 be 40009234 4000921c: 80 a6 60 00 cmp %i1, 0 if ( sig ) 40009220: 02 80 00 03 be 4000922c <== NEVER TAKEN 40009224: b0 10 20 00 clr %i0 *sig = status; 40009228: d0 26 40 00 st %o0, [ %i1 ] 4000922c: 81 c7 e0 08 ret 40009230: 81 e8 00 00 restore return 0; } return errno; 40009234: 40 00 24 9b call 400124a0 <__errno> 40009238: 01 00 00 00 nop 4000923c: f0 02 00 00 ld [ %o0 ], %i0 } 40009240: 81 c7 e0 08 ret 40009244: 81 e8 00 00 restore =============================================================================== 40006064 : */ long sysconf( int name ) { 40006064: 9d e3 bf a0 save %sp, -96, %sp if ( name == _SC_CLK_TCK ) 40006068: 80 a6 20 02 cmp %i0, 2 4000606c: 12 80 00 09 bne 40006090 40006070: 80 a6 20 04 cmp %i0, 4 return (TOD_MICROSECONDS_PER_SECOND / 40006074: 03 10 00 78 sethi %hi(0x4001e000), %g1 40006078: d2 00 62 08 ld [ %g1 + 0x208 ], %o1 ! 4001e208 4000607c: 11 00 03 d0 sethi %hi(0xf4000), %o0 40006080: 40 00 4d 65 call 40019614 <.udiv> 40006084: 90 12 22 40 or %o0, 0x240, %o0 ! f4240 40006088: 81 c7 e0 08 ret 4000608c: 91 e8 00 08 restore %g0, %o0, %o0 rtems_configuration_get_microseconds_per_tick()); if ( name == _SC_OPEN_MAX ) 40006090: 12 80 00 05 bne 400060a4 40006094: 80 a6 20 33 cmp %i0, 0x33 return rtems_libio_number_iops; 40006098: 03 10 00 78 sethi %hi(0x4001e000), %g1 4000609c: 10 80 00 0f b 400060d8 400060a0: d0 00 61 24 ld [ %g1 + 0x124 ], %o0 ! 4001e124 if ( name == _SC_GETPW_R_SIZE_MAX ) 400060a4: 02 80 00 0d be 400060d8 400060a8: 90 10 24 00 mov 0x400, %o0 return 1024; if ( name == _SC_PAGESIZE ) 400060ac: 80 a6 20 08 cmp %i0, 8 400060b0: 02 80 00 0a be 400060d8 400060b4: 90 02 2c 00 add %o0, 0xc00, %o0 return PAGE_SIZE; #if defined(__sparc__) if ( name == 515 ) /* Solaris _SC_STACK_PROT */ 400060b8: 80 a6 22 03 cmp %i0, 0x203 400060bc: 02 80 00 07 be 400060d8 <== NEVER TAKEN 400060c0: 90 10 20 00 clr %o0 return 0; #endif rtems_set_errno_and_return_minus_one( EINVAL ); 400060c4: 40 00 26 6c call 4000fa74 <__errno> 400060c8: 01 00 00 00 nop 400060cc: 82 10 20 16 mov 0x16, %g1 ! 16 400060d0: c2 22 00 00 st %g1, [ %o0 ] 400060d4: 90 10 3f ff mov -1, %o0 } 400060d8: b0 10 00 08 mov %o0, %i0 400060dc: 81 c7 e0 08 ret 400060e0: 81 e8 00 00 restore =============================================================================== 400063d0 : int timer_create( clockid_t clock_id, struct sigevent *evp, timer_t *timerid ) { 400063d0: 9d e3 bf a0 save %sp, -96, %sp POSIX_Timer_Control *ptimer; if ( clock_id != CLOCK_REALTIME ) 400063d4: 80 a6 20 01 cmp %i0, 1 400063d8: 12 80 00 13 bne 40006424 400063dc: 80 a6 a0 00 cmp %i2, 0 rtems_set_errno_and_return_minus_one( EINVAL ); if ( !timerid ) 400063e0: 02 80 00 11 be 40006424 400063e4: 80 a6 60 00 cmp %i1, 0 /* * The data of the structure evp are checked in order to verify if they * are coherent. */ if (evp != NULL) { 400063e8: 02 80 00 13 be 40006434 400063ec: 03 10 00 88 sethi %hi(0x40022000), %g1 /* The structure has data */ if ( ( evp->sigev_notify != SIGEV_NONE ) && 400063f0: c2 06 40 00 ld [ %i1 ], %g1 400063f4: 82 00 7f ff add %g1, -1, %g1 400063f8: 80 a0 60 01 cmp %g1, 1 400063fc: 18 80 00 0a bgu 40006424 <== NEVER TAKEN 40006400: 01 00 00 00 nop ( evp->sigev_notify != SIGEV_SIGNAL ) ) { /* The value of the field sigev_notify is not valid */ rtems_set_errno_and_return_minus_one( EINVAL ); } if ( !evp->sigev_signo ) 40006404: c2 06 60 04 ld [ %i1 + 4 ], %g1 40006408: 80 a0 60 00 cmp %g1, 0 4000640c: 02 80 00 06 be 40006424 <== NEVER TAKEN 40006410: 01 00 00 00 nop rtems_set_errno_and_return_minus_one( EINVAL ); if ( !is_valid_signo(evp->sigev_signo) ) 40006414: 82 00 7f ff add %g1, -1, %g1 40006418: 80 a0 60 1f cmp %g1, 0x1f 4000641c: 28 80 00 06 bleu,a 40006434 <== ALWAYS TAKEN 40006420: 03 10 00 88 sethi %hi(0x40022000), %g1 rtems_set_errno_and_return_minus_one( EINVAL ); 40006424: 40 00 26 ef call 4000ffe0 <__errno> 40006428: 01 00 00 00 nop 4000642c: 10 80 00 10 b 4000646c 40006430: 82 10 20 16 mov 0x16, %g1 ! 16 rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 40006434: c4 00 60 70 ld [ %g1 + 0x70 ], %g2 40006438: 84 00 a0 01 inc %g2 4000643c: c4 20 60 70 st %g2, [ %g1 + 0x70 ] * the inactive chain of free timer control blocks. */ RTEMS_INLINE_ROUTINE POSIX_Timer_Control *_POSIX_Timer_Allocate( void ) { return (POSIX_Timer_Control *) _Objects_Allocate( &_POSIX_Timer_Information ); 40006440: 11 10 00 88 sethi %hi(0x40022000), %o0 40006444: 40 00 07 c1 call 40008348 <_Objects_Allocate> 40006448: 90 12 23 c0 or %o0, 0x3c0, %o0 ! 400223c0 <_POSIX_Timer_Information> /* * Allocate a timer */ ptimer = _POSIX_Timer_Allocate(); if ( !ptimer ) { 4000644c: 80 a2 20 00 cmp %o0, 0 40006450: 12 80 00 0a bne 40006478 40006454: 82 10 20 02 mov 2, %g1 _Thread_Enable_dispatch(); 40006458: 40 00 0b 1b call 400090c4 <_Thread_Enable_dispatch> 4000645c: 01 00 00 00 nop rtems_set_errno_and_return_minus_one( EAGAIN ); 40006460: 40 00 26 e0 call 4000ffe0 <__errno> 40006464: 01 00 00 00 nop 40006468: 82 10 20 0b mov 0xb, %g1 ! b 4000646c: c2 22 00 00 st %g1, [ %o0 ] 40006470: 81 c7 e0 08 ret 40006474: 91 e8 3f ff restore %g0, -1, %o0 } /* The data of the created timer are stored to use them later */ ptimer->state = POSIX_TIMER_STATE_CREATE_NEW; 40006478: c2 2a 20 3c stb %g1, [ %o0 + 0x3c ] ptimer->thread_id = _Thread_Executing->Object.id; 4000647c: 03 10 00 88 sethi %hi(0x40022000), %g1 40006480: c2 00 61 2c ld [ %g1 + 0x12c ], %g1 ! 4002212c <_Thread_Executing> if ( evp != NULL ) { 40006484: 80 a6 60 00 cmp %i1, 0 } /* The data of the created timer are stored to use them later */ ptimer->state = POSIX_TIMER_STATE_CREATE_NEW; ptimer->thread_id = _Thread_Executing->Object.id; 40006488: c2 00 60 08 ld [ %g1 + 8 ], %g1 if ( evp != NULL ) { 4000648c: 02 80 00 08 be 400064ac 40006490: c2 22 20 38 st %g1, [ %o0 + 0x38 ] ptimer->inf.sigev_notify = evp->sigev_notify; ptimer->inf.sigev_signo = evp->sigev_signo; ptimer->inf.sigev_value = evp->sigev_value; 40006494: c2 06 60 08 ld [ %i1 + 8 ], %g1 ptimer->state = POSIX_TIMER_STATE_CREATE_NEW; ptimer->thread_id = _Thread_Executing->Object.id; if ( evp != NULL ) { ptimer->inf.sigev_notify = evp->sigev_notify; 40006498: c6 06 40 00 ld [ %i1 ], %g3 ptimer->inf.sigev_signo = evp->sigev_signo; 4000649c: c4 06 60 04 ld [ %i1 + 4 ], %g2 ptimer->state = POSIX_TIMER_STATE_CREATE_NEW; ptimer->thread_id = _Thread_Executing->Object.id; if ( evp != NULL ) { ptimer->inf.sigev_notify = evp->sigev_notify; 400064a0: c6 22 20 40 st %g3, [ %o0 + 0x40 ] ptimer->inf.sigev_signo = evp->sigev_signo; 400064a4: c4 22 20 44 st %g2, [ %o0 + 0x44 ] ptimer->inf.sigev_value = evp->sigev_value; 400064a8: c2 22 20 48 st %g1, [ %o0 + 0x48 ] #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 400064ac: c2 12 20 0a lduh [ %o0 + 0xa ], %g1 400064b0: 05 10 00 88 sethi %hi(0x40022000), %g2 400064b4: c4 00 a3 dc ld [ %g2 + 0x3dc ], %g2 ! 400223dc <_POSIX_Timer_Information+0x1c> 400064b8: 83 28 60 02 sll %g1, 2, %g1 400064bc: d0 20 80 01 st %o0, [ %g2 + %g1 ] 400064c0: c2 02 20 08 ld [ %o0 + 8 ], %g1 _Objects_Get_index( the_object->id ), the_object ); /* ASSERT: information->is_string == false */ the_object->name.name_u32 = name; 400064c4: c0 22 20 0c clr [ %o0 + 0xc ] } ptimer->overrun = 0; 400064c8: c0 22 20 68 clr [ %o0 + 0x68 ] ptimer->timer_data.it_value.tv_sec = 0; 400064cc: c0 22 20 5c clr [ %o0 + 0x5c ] ptimer->timer_data.it_value.tv_nsec = 0; 400064d0: c0 22 20 60 clr [ %o0 + 0x60 ] ptimer->timer_data.it_interval.tv_sec = 0; 400064d4: c0 22 20 54 clr [ %o0 + 0x54 ] ptimer->timer_data.it_interval.tv_nsec = 0; 400064d8: c0 22 20 58 clr [ %o0 + 0x58 ] void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; the_watchdog->id = id; 400064dc: c0 22 20 30 clr [ %o0 + 0x30 ] _Watchdog_Initialize( &ptimer->Timer, NULL, 0, NULL ); _Objects_Open_u32(&_POSIX_Timer_Information, &ptimer->Object, 0); *timerid = ptimer->Object.id; 400064e0: c2 26 80 00 st %g1, [ %i2 ] Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 400064e4: c0 22 20 18 clr [ %o0 + 0x18 ] the_watchdog->routine = routine; 400064e8: c0 22 20 2c clr [ %o0 + 0x2c ] the_watchdog->id = id; the_watchdog->user_data = user_data; 400064ec: c0 22 20 34 clr [ %o0 + 0x34 ] _Thread_Enable_dispatch(); 400064f0: 40 00 0a f5 call 400090c4 <_Thread_Enable_dispatch> 400064f4: b0 10 20 00 clr %i0 return 0; } 400064f8: 81 c7 e0 08 ret 400064fc: 81 e8 00 00 restore =============================================================================== 40006500 : timer_t timerid, int flags, const struct itimerspec *value, struct itimerspec *ovalue ) { 40006500: 9d e3 bf 80 save %sp, -128, %sp Objects_Locations location; bool activated; uint32_t initial_period; struct itimerspec normalize; if ( !value ) 40006504: 80 a6 a0 00 cmp %i2, 0 40006508: 02 80 00 20 be 40006588 <== NEVER TAKEN 4000650c: 03 0e e6 b2 sethi %hi(0x3b9ac800), %g1 rtems_set_errno_and_return_minus_one( EINVAL ); /* First, it verifies if the structure "value" is correct */ if ( ( value->it_value.tv_nsec >= TOD_NANOSECONDS_PER_SECOND ) || 40006510: c4 06 a0 0c ld [ %i2 + 0xc ], %g2 40006514: 82 10 61 ff or %g1, 0x1ff, %g1 40006518: 80 a0 80 01 cmp %g2, %g1 4000651c: 18 80 00 1b bgu 40006588 40006520: 01 00 00 00 nop ( value->it_value.tv_nsec < 0 ) || ( value->it_interval.tv_nsec >= TOD_NANOSECONDS_PER_SECOND) || 40006524: c4 06 a0 04 ld [ %i2 + 4 ], %g2 40006528: 80 a0 80 01 cmp %g2, %g1 4000652c: 18 80 00 17 bgu 40006588 <== NEVER TAKEN 40006530: 80 a6 60 00 cmp %i1, 0 ( value->it_interval.tv_nsec < 0 )) { /* The number of nanoseconds is not correct */ rtems_set_errno_and_return_minus_one( EINVAL ); } if ( flags != TIMER_ABSTIME && flags != POSIX_TIMER_RELATIVE ) { 40006534: 02 80 00 05 be 40006548 40006538: 90 07 bf e4 add %fp, -28, %o0 4000653c: 80 a6 60 04 cmp %i1, 4 40006540: 12 80 00 12 bne 40006588 40006544: 01 00 00 00 nop rtems_set_errno_and_return_minus_one( EINVAL ); } normalize = *value; 40006548: 92 10 00 1a mov %i2, %o1 4000654c: 40 00 28 fb call 40010938 40006550: 94 10 20 10 mov 0x10, %o2 /* Convert absolute to relative time */ if (flags == TIMER_ABSTIME) { 40006554: 80 a6 60 04 cmp %i1, 4 40006558: 12 80 00 16 bne 400065b0 4000655c: 92 10 00 18 mov %i0, %o1 struct timespec now; _TOD_Get( &now ); 40006560: a0 07 bf f4 add %fp, -12, %l0 40006564: 40 00 06 18 call 40007dc4 <_TOD_Get> 40006568: 90 10 00 10 mov %l0, %o0 /* Check for seconds in the past */ if ( _Timespec_Greater_than( &now, &normalize.it_value ) ) 4000656c: b2 07 bf ec add %fp, -20, %i1 40006570: 90 10 00 10 mov %l0, %o0 40006574: 40 00 0e 68 call 40009f14 <_Timespec_Greater_than> 40006578: 92 10 00 19 mov %i1, %o1 4000657c: 80 8a 20 ff btst 0xff, %o0 40006580: 02 80 00 08 be 400065a0 40006584: 92 10 00 19 mov %i1, %o1 rtems_set_errno_and_return_minus_one( EINVAL ); 40006588: 40 00 26 96 call 4000ffe0 <__errno> 4000658c: b0 10 3f ff mov -1, %i0 40006590: 82 10 20 16 mov 0x16, %g1 40006594: c2 22 00 00 st %g1, [ %o0 ] 40006598: 81 c7 e0 08 ret 4000659c: 81 e8 00 00 restore _Timespec_Subtract( &now, &normalize.it_value, &normalize.it_value ); 400065a0: 90 10 00 10 mov %l0, %o0 400065a4: 40 00 0e 6d call 40009f58 <_Timespec_Subtract> 400065a8: 94 10 00 19 mov %i1, %o2 RTEMS_INLINE_ROUTINE POSIX_Timer_Control *_POSIX_Timer_Get ( timer_t id, Objects_Locations *location ) { return (POSIX_Timer_Control *) 400065ac: 92 10 00 18 mov %i0, %o1 400065b0: 11 10 00 88 sethi %hi(0x40022000), %o0 400065b4: 94 07 bf fc add %fp, -4, %o2 400065b8: 40 00 08 a3 call 40008844 <_Objects_Get> 400065bc: 90 12 23 c0 or %o0, 0x3c0, %o0 * something with the structure of times of the timer: to stop, start * or start it again */ ptimer = _POSIX_Timer_Get( timerid, &location ); switch ( location ) { 400065c0: c2 07 bf fc ld [ %fp + -4 ], %g1 400065c4: 80 a0 60 00 cmp %g1, 0 400065c8: 12 80 00 38 bne 400066a8 400065cc: a0 10 00 08 mov %o0, %l0 case OBJECTS_LOCAL: /* First, it verifies if the timer must be stopped */ if ( normalize.it_value.tv_sec == 0 && normalize.it_value.tv_nsec == 0 ) { 400065d0: c2 07 bf ec ld [ %fp + -20 ], %g1 400065d4: 80 a0 60 00 cmp %g1, 0 400065d8: 12 80 00 14 bne 40006628 400065dc: c2 07 bf f0 ld [ %fp + -16 ], %g1 400065e0: 80 a0 60 00 cmp %g1, 0 400065e4: 12 80 00 11 bne 40006628 400065e8: 01 00 00 00 nop /* Stop the timer */ (void) _Watchdog_Remove( &ptimer->Timer ); 400065ec: 40 00 0f 99 call 4000a450 <_Watchdog_Remove> 400065f0: 90 02 20 10 add %o0, 0x10, %o0 /* The old data of the timer are returned */ if ( ovalue ) 400065f4: 80 a6 e0 00 cmp %i3, 0 400065f8: 02 80 00 05 be 4000660c 400065fc: 90 10 00 1b mov %i3, %o0 *ovalue = ptimer->timer_data; 40006600: 92 04 20 54 add %l0, 0x54, %o1 40006604: 40 00 28 cd call 40010938 40006608: 94 10 20 10 mov 0x10, %o2 /* The new data are set */ ptimer->timer_data = normalize; 4000660c: 92 07 bf e4 add %fp, -28, %o1 40006610: 94 10 20 10 mov 0x10, %o2 40006614: 40 00 28 c9 call 40010938 40006618: 90 04 20 54 add %l0, 0x54, %o0 /* Indicates that the timer is created and stopped */ ptimer->state = POSIX_TIMER_STATE_CREATE_STOP; 4000661c: 82 10 20 04 mov 4, %g1 40006620: 10 80 00 1e b 40006698 40006624: c2 2c 20 3c stb %g1, [ %l0 + 0x3c ] _Thread_Enable_dispatch(); return 0; } /* Convert from seconds and nanoseconds to ticks */ ptimer->ticks = _Timespec_To_ticks( &value->it_interval ); 40006628: 40 00 0e 60 call 40009fa8 <_Timespec_To_ticks> 4000662c: 90 10 00 1a mov %i2, %o0 40006630: d0 24 20 64 st %o0, [ %l0 + 0x64 ] initial_period = _Timespec_To_ticks( &normalize.it_value ); 40006634: 40 00 0e 5d call 40009fa8 <_Timespec_To_ticks> 40006638: 90 07 bf ec add %fp, -20, %o0 activated = _POSIX_Timer_Insert_helper( 4000663c: d4 04 20 08 ld [ %l0 + 8 ], %o2 return 0; } /* Convert from seconds and nanoseconds to ticks */ ptimer->ticks = _Timespec_To_ticks( &value->it_interval ); initial_period = _Timespec_To_ticks( &normalize.it_value ); 40006640: 92 10 00 08 mov %o0, %o1 activated = _POSIX_Timer_Insert_helper( 40006644: 17 10 00 19 sethi %hi(0x40006400), %o3 40006648: 90 04 20 10 add %l0, 0x10, %o0 4000664c: 96 12 e2 c0 or %o3, 0x2c0, %o3 40006650: 40 00 19 5c call 4000cbc0 <_POSIX_Timer_Insert_helper> 40006654: 98 10 00 10 mov %l0, %o4 initial_period, ptimer->Object.id, _POSIX_Timer_TSR, ptimer ); if ( !activated ) { 40006658: 80 8a 20 ff btst 0xff, %o0 4000665c: 02 80 00 0f be 40006698 40006660: 80 a6 e0 00 cmp %i3, 0 /* * The timer has been started and is running. So we return the * old ones in "ovalue" */ if ( ovalue ) 40006664: 02 80 00 05 be 40006678 40006668: 90 10 00 1b mov %i3, %o0 *ovalue = ptimer->timer_data; 4000666c: 92 04 20 54 add %l0, 0x54, %o1 40006670: 40 00 28 b2 call 40010938 40006674: 94 10 20 10 mov 0x10, %o2 ptimer->timer_data = normalize; 40006678: 92 07 bf e4 add %fp, -28, %o1 4000667c: 94 10 20 10 mov 0x10, %o2 40006680: 40 00 28 ae call 40010938 40006684: 90 04 20 54 add %l0, 0x54, %o0 /* Indicate that the time is running */ ptimer->state = POSIX_TIMER_STATE_CREATE_RUN; 40006688: 82 10 20 03 mov 3, %g1 _TOD_Get( &ptimer->time ); 4000668c: 90 04 20 6c add %l0, 0x6c, %o0 40006690: 40 00 05 cd call 40007dc4 <_TOD_Get> 40006694: c2 2c 20 3c stb %g1, [ %l0 + 0x3c ] _Thread_Enable_dispatch(); 40006698: 40 00 0a 8b call 400090c4 <_Thread_Enable_dispatch> 4000669c: b0 10 20 00 clr %i0 return 0; 400066a0: 81 c7 e0 08 ret 400066a4: 81 e8 00 00 restore #endif case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( EINVAL ); 400066a8: 40 00 26 4e call 4000ffe0 <__errno> 400066ac: b0 10 3f ff mov -1, %i0 400066b0: 82 10 20 16 mov 0x16, %g1 400066b4: c2 22 00 00 st %g1, [ %o0 ] } 400066b8: 81 c7 e0 08 ret 400066bc: 81 e8 00 00 restore =============================================================================== 400062d4 : useconds_t ualarm( useconds_t useconds, useconds_t interval ) { 400062d4: 9d e3 bf 98 save %sp, -104, %sp /* * Initialize the timer used to implement alarm(). */ if ( !the_timer->routine ) { 400062d8: 21 10 00 7f sethi %hi(0x4001fc00), %l0 400062dc: a0 14 22 dc or %l0, 0x2dc, %l0 ! 4001fedc <_POSIX_signals_Ualarm_timer> 400062e0: c2 04 20 1c ld [ %l0 + 0x1c ], %g1 400062e4: 80 a0 60 00 cmp %g1, 0 400062e8: 12 80 00 0a bne 40006310 400062ec: a2 10 00 18 mov %i0, %l1 Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 400062f0: 03 10 00 18 sethi %hi(0x40006000), %g1 the_watchdog->id = id; the_watchdog->user_data = user_data; 400062f4: c0 24 20 24 clr [ %l0 + 0x24 ] Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 400062f8: 82 10 63 e8 or %g1, 0x3e8, %g1 Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 400062fc: c0 24 20 08 clr [ %l0 + 8 ] the_watchdog->routine = routine; the_watchdog->id = id; 40006300: c0 24 20 20 clr [ %l0 + 0x20 ] Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 40006304: c2 24 20 1c st %g1, [ %l0 + 0x1c ] the_watchdog->id = id; the_watchdog->user_data = user_data; 40006308: 10 80 00 1b b 40006374 4000630c: b0 10 20 00 clr %i0 _Watchdog_Initialize( the_timer, _POSIX_signals_Ualarm_TSR, 0, NULL ); } else { Watchdog_States state; state = _Watchdog_Remove( the_timer ); 40006310: 40 00 0f 2a call 40009fb8 <_Watchdog_Remove> 40006314: 90 10 00 10 mov %l0, %o0 if ( (state == WATCHDOG_ACTIVE) || (state == WATCHDOG_REMOVE_IT) ) { 40006318: 90 02 3f fe add %o0, -2, %o0 4000631c: 80 a2 20 01 cmp %o0, 1 40006320: 18 80 00 15 bgu 40006374 <== NEVER TAKEN 40006324: b0 10 20 00 clr %i0 ticks = the_timer->initial; ticks -= (the_timer->stop_time - the_timer->start_time); /* remaining is now in ticks */ _Timespec_From_ticks( ticks, &tp ); 40006328: c2 04 20 18 ld [ %l0 + 0x18 ], %g1 * boot. Since alarm() is dealing in seconds, we must account for * this. */ ticks = the_timer->initial; ticks -= (the_timer->stop_time - the_timer->start_time); 4000632c: c4 04 20 0c ld [ %l0 + 0xc ], %g2 40006330: d0 04 20 14 ld [ %l0 + 0x14 ], %o0 /* remaining is now in ticks */ _Timespec_From_ticks( ticks, &tp ); 40006334: 92 07 bf f8 add %fp, -8, %o1 * boot. Since alarm() is dealing in seconds, we must account for * this. */ ticks = the_timer->initial; ticks -= (the_timer->stop_time - the_timer->start_time); 40006338: 90 02 00 02 add %o0, %g2, %o0 /* remaining is now in ticks */ _Timespec_From_ticks( ticks, &tp ); 4000633c: 40 00 0d a5 call 400099d0 <_Timespec_From_ticks> 40006340: 90 22 00 01 sub %o0, %g1, %o0 remaining = tp.tv_sec * TOD_MICROSECONDS_PER_SECOND; 40006344: c2 07 bf f8 ld [ %fp + -8 ], %g1 remaining += tp.tv_nsec / 1000; 40006348: d0 07 bf fc ld [ %fp + -4 ], %o0 ticks = the_timer->initial; ticks -= (the_timer->stop_time - the_timer->start_time); /* remaining is now in ticks */ _Timespec_From_ticks( ticks, &tp ); remaining = tp.tv_sec * TOD_MICROSECONDS_PER_SECOND; 4000634c: b1 28 60 08 sll %g1, 8, %i0 40006350: 85 28 60 03 sll %g1, 3, %g2 40006354: 84 26 00 02 sub %i0, %g2, %g2 remaining += tp.tv_nsec / 1000; 40006358: 92 10 23 e8 mov 0x3e8, %o1 ticks = the_timer->initial; ticks -= (the_timer->stop_time - the_timer->start_time); /* remaining is now in ticks */ _Timespec_From_ticks( ticks, &tp ); remaining = tp.tv_sec * TOD_MICROSECONDS_PER_SECOND; 4000635c: b1 28 a0 06 sll %g2, 6, %i0 40006360: b0 26 00 02 sub %i0, %g2, %i0 remaining += tp.tv_nsec / 1000; 40006364: 40 00 50 45 call 4001a478 <.div> 40006368: b0 06 00 01 add %i0, %g1, %i0 ticks = the_timer->initial; ticks -= (the_timer->stop_time - the_timer->start_time); /* remaining is now in ticks */ _Timespec_From_ticks( ticks, &tp ); remaining = tp.tv_sec * TOD_MICROSECONDS_PER_SECOND; 4000636c: b1 2e 20 06 sll %i0, 6, %i0 remaining += tp.tv_nsec / 1000; 40006370: b0 02 00 18 add %o0, %i0, %i0 /* * If useconds is non-zero, then the caller wants to schedule * the alarm repeatedly at that interval. If the interval is * less than a single clock tick, then fudge it to a clock tick. */ if ( useconds ) { 40006374: 80 a4 60 00 cmp %l1, 0 40006378: 02 80 00 1a be 400063e0 4000637c: 21 00 03 d0 sethi %hi(0xf4000), %l0 Watchdog_Interval ticks; tp.tv_sec = useconds / TOD_MICROSECONDS_PER_SECOND; 40006380: 90 10 00 11 mov %l1, %o0 40006384: 40 00 50 3b call 4001a470 <.udiv> 40006388: 92 14 22 40 or %l0, 0x240, %o1 tp.tv_nsec = (useconds % TOD_MICROSECONDS_PER_SECOND) * 1000; 4000638c: 92 14 22 40 or %l0, 0x240, %o1 * less than a single clock tick, then fudge it to a clock tick. */ if ( useconds ) { Watchdog_Interval ticks; tp.tv_sec = useconds / TOD_MICROSECONDS_PER_SECOND; 40006390: d0 27 bf f8 st %o0, [ %fp + -8 ] tp.tv_nsec = (useconds % TOD_MICROSECONDS_PER_SECOND) * 1000; 40006394: 40 00 50 e3 call 4001a720 <.urem> 40006398: 90 10 00 11 mov %l1, %o0 4000639c: 85 2a 20 07 sll %o0, 7, %g2 400063a0: 83 2a 20 02 sll %o0, 2, %g1 400063a4: 82 20 80 01 sub %g2, %g1, %g1 400063a8: 90 00 40 08 add %g1, %o0, %o0 400063ac: 91 2a 20 03 sll %o0, 3, %o0 ticks = _Timespec_To_ticks( &tp ); 400063b0: a0 07 bf f8 add %fp, -8, %l0 */ if ( useconds ) { Watchdog_Interval ticks; tp.tv_sec = useconds / TOD_MICROSECONDS_PER_SECOND; tp.tv_nsec = (useconds % TOD_MICROSECONDS_PER_SECOND) * 1000; 400063b4: d0 27 bf fc st %o0, [ %fp + -4 ] ticks = _Timespec_To_ticks( &tp ); 400063b8: 40 00 0d af call 40009a74 <_Timespec_To_ticks> 400063bc: 90 10 00 10 mov %l0, %o0 if ( ticks == 0 ) ticks = 1; _Watchdog_Insert_ticks( the_timer, _Timespec_To_ticks( &tp ) ); 400063c0: 40 00 0d ad call 40009a74 <_Timespec_To_ticks> 400063c4: 90 10 00 10 mov %l0, %o0 Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 400063c8: 13 10 00 7f sethi %hi(0x4001fc00), %o1 400063cc: 92 12 62 dc or %o1, 0x2dc, %o1 ! 4001fedc <_POSIX_signals_Ualarm_timer> 400063d0: d0 22 60 0c st %o0, [ %o1 + 0xc ] _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 400063d4: 11 10 00 7d sethi %hi(0x4001f400), %o0 400063d8: 40 00 0e 9b call 40009e44 <_Watchdog_Insert> 400063dc: 90 12 22 ac or %o0, 0x2ac, %o0 ! 4001f6ac <_Watchdog_Ticks_chain> } return remaining; } 400063e0: 81 c7 e0 08 ret 400063e4: 81 e8 00 00 restore