=============================================================================== ffc0b798 <_CORE_RWLock_Obtain_for_reading>: Objects_Id id, bool wait, Watchdog_Interval timeout, CORE_RWLock_API_mp_support_callout api_rwlock_mp_support ) { ffc0b798: 94 21 ff e0 stwu r1,-32(r1) ffc0b79c: 7c 08 02 a6 mflr r0 ISR_Level level; Thread_Control *executing = _Thread_Executing; ffc0b7a0: 3d 20 00 00 lis r9,0 Objects_Id id, bool wait, Watchdog_Interval timeout, CORE_RWLock_API_mp_support_callout api_rwlock_mp_support ) { ffc0b7a4: 90 01 00 24 stw r0,36(r1) ffc0b7a8: 93 41 00 08 stw r26,8(r1) ffc0b7ac: 7c da 33 78 mr r26,r6 ffc0b7b0: 93 81 00 10 stw r28,16(r1) ffc0b7b4: 7c 7c 1b 78 mr r28,r3 ffc0b7b8: 93 a1 00 14 stw r29,20(r1) ffc0b7bc: 7c bd 2b 78 mr r29,r5 ffc0b7c0: 93 c1 00 18 stw r30,24(r1) ffc0b7c4: 7c 9e 23 78 mr r30,r4 ffc0b7c8: 93 e1 00 1c stw r31,28(r1) ffc0b7cc: 93 61 00 0c stw r27,12(r1) ISR_Level level; Thread_Control *executing = _Thread_Executing; ffc0b7d0: 83 e9 27 fc lwz r31,10236(r9) static inline uint32_t ppc_interrupt_disable( void ) { uint32_t level; uint32_t mask; asm volatile ( ffc0b7d4: 7f 60 00 a6 mfmsr r27 ffc0b7d8: 7c 10 42 a6 mfsprg r0,0 ffc0b7dc: 7f 60 00 78 andc r0,r27,r0 ffc0b7e0: 7c 00 01 24 mtmsr r0 * If locked for reading and no waiters, then OK to read. * If any thread is waiting, then we wait. */ _ISR_Disable( level ); switch ( the_rwlock->current_state ) { ffc0b7e4: 80 03 00 44 lwz r0,68(r3) ffc0b7e8: 2f 80 00 00 cmpwi cr7,r0,0 ffc0b7ec: 41 9e 00 10 beq- cr7,ffc0b7fc <_CORE_RWLock_Obtain_for_reading+0x64> ffc0b7f0: 2f 80 00 01 cmpwi cr7,r0,1 ffc0b7f4: 40 be 00 44 bne+ cr7,ffc0b838 <_CORE_RWLock_Obtain_for_reading+0xa0> ffc0b7f8: 48 00 00 1c b ffc0b814 <_CORE_RWLock_Obtain_for_reading+0x7c> case CORE_RWLOCK_UNLOCKED: the_rwlock->current_state = CORE_RWLOCK_LOCKED_FOR_READING; the_rwlock->number_of_readers += 1; ffc0b7fc: 81 23 00 48 lwz r9,72(r3) ffc0b800: 38 09 00 01 addi r0,r9,1 ffc0b804: 90 03 00 48 stw r0,72(r3) */ _ISR_Disable( level ); switch ( the_rwlock->current_state ) { case CORE_RWLOCK_UNLOCKED: the_rwlock->current_state = CORE_RWLOCK_LOCKED_FOR_READING; ffc0b808: 38 00 00 01 li r0,1 ffc0b80c: 90 03 00 44 stw r0,68(r3) the_rwlock->number_of_readers += 1; _ISR_Enable( level ); ffc0b810: 48 00 00 1c b ffc0b82c <_CORE_RWLock_Obtain_for_reading+0x94> 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 ); ffc0b814: 48 00 23 f1 bl ffc0dc04 <_Thread_queue_First> if ( !waiter ) { ffc0b818: 2f 83 00 00 cmpwi cr7,r3,0 ffc0b81c: 40 be 00 1c bne+ cr7,ffc0b838 <_CORE_RWLock_Obtain_for_reading+0xa0><== NEVER TAKEN the_rwlock->number_of_readers += 1; ffc0b820: 81 3c 00 48 lwz r9,72(r28) ffc0b824: 38 09 00 01 addi r0,r9,1 ffc0b828: 90 1c 00 48 stw r0,72(r28) return level; } static inline void ppc_interrupt_enable( uint32_t level ) { asm volatile ( ffc0b82c: 7f 60 01 24 mtmsr r27 _ISR_Enable( level ); executing->Wait.return_code = CORE_RWLOCK_SUCCESSFUL; ffc0b830: 38 00 00 00 li r0,0 ffc0b834: 48 00 00 14 b ffc0b848 <_CORE_RWLock_Obtain_for_reading+0xb0> /* * If the thread is not willing to wait, then return immediately. */ if ( !wait ) { ffc0b838: 2f 9d 00 00 cmpwi cr7,r29,0 ffc0b83c: 40 9e 00 14 bne- cr7,ffc0b850 <_CORE_RWLock_Obtain_for_reading+0xb8> ffc0b840: 7f 60 01 24 mtmsr r27 _ISR_Enable( level ); executing->Wait.return_code = CORE_RWLOCK_UNAVAILABLE; ffc0b844: 38 00 00 02 li r0,2 ffc0b848: 90 1f 00 34 stw r0,52(r31) return; ffc0b84c: 48 00 00 38 b ffc0b884 <_CORE_RWLock_Obtain_for_reading+0xec> */ _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; ffc0b850: 38 00 00 00 li r0,0 * 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; executing->Wait.id = id; ffc0b854: 93 df 00 20 stw r30,32(r31) ffc0b858: 39 20 00 01 li r9,1 executing->Wait.option = CORE_RWLOCK_THREAD_WAITING_FOR_READ; executing->Wait.return_code = CORE_RWLOCK_SUCCESSFUL; ffc0b85c: 90 1f 00 34 stw r0,52(r31) ffc0b860: 91 3c 00 30 stw r9,48(r28) /* * 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; ffc0b864: 93 9f 00 44 stw r28,68(r31) executing->Wait.id = id; executing->Wait.option = CORE_RWLOCK_THREAD_WAITING_FOR_READ; ffc0b868: 90 1f 00 30 stw r0,48(r31) ffc0b86c: 7f 60 01 24 mtmsr r27 executing->Wait.return_code = CORE_RWLOCK_SUCCESSFUL; _ISR_Enable( level ); _Thread_queue_Enqueue_with_handler( ffc0b870: 3c a0 ff c1 lis r5,-63 ffc0b874: 7f 83 e3 78 mr r3,r28 ffc0b878: 7f 44 d3 78 mr r4,r26 ffc0b87c: 38 a5 ba 50 addi r5,r5,-17840 ffc0b880: 48 00 1f 89 bl ffc0d808 <_Thread_queue_Enqueue_with_handler> timeout, _CORE_RWLock_Timeout ); /* return to API level so it can dispatch and we block */ } ffc0b884: 80 01 00 24 lwz r0,36(r1) ffc0b888: 83 41 00 08 lwz r26,8(r1) ffc0b88c: 7c 08 03 a6 mtlr r0 ffc0b890: 83 61 00 0c lwz r27,12(r1) ffc0b894: 83 81 00 10 lwz r28,16(r1) ffc0b898: 83 a1 00 14 lwz r29,20(r1) ffc0b89c: 83 c1 00 18 lwz r30,24(r1) ffc0b8a0: 83 e1 00 1c lwz r31,28(r1) ffc0b8a4: 38 21 00 20 addi r1,r1,32 ffc0b8a8: 4e 80 00 20 blr =============================================================================== ffc0b948 <_CORE_RWLock_Release>: */ CORE_RWLock_Status _CORE_RWLock_Release( CORE_RWLock_Control *the_rwlock ) { ffc0b948: 94 21 ff f0 stwu r1,-16(r1) ffc0b94c: 7c 08 02 a6 mflr r0 ISR_Level level; Thread_Control *executing = _Thread_Executing; ffc0b950: 3d 20 00 00 lis r9,0 */ CORE_RWLock_Status _CORE_RWLock_Release( CORE_RWLock_Control *the_rwlock ) { ffc0b954: 90 01 00 14 stw r0,20(r1) ffc0b958: 93 e1 00 0c stw r31,12(r1) ffc0b95c: 7c 7f 1b 78 mr r31,r3 ISR_Level level; Thread_Control *executing = _Thread_Executing; ffc0b960: 81 29 27 fc lwz r9,10236(r9) static inline uint32_t ppc_interrupt_disable( void ) { uint32_t level; uint32_t mask; asm volatile ( ffc0b964: 7c 00 00 a6 mfmsr r0 ffc0b968: 7d 70 42 a6 mfsprg r11,0 ffc0b96c: 7c 0b 58 78 andc r11,r0,r11 ffc0b970: 7d 60 01 24 mtmsr r11 * If locked for reading and no waiters, then OK to read. * If any thread is waiting, then we wait. */ _ISR_Disable( level ); if ( the_rwlock->current_state == CORE_RWLOCK_UNLOCKED){ ffc0b974: 81 63 00 44 lwz r11,68(r3) ffc0b978: 2f 8b 00 00 cmpwi cr7,r11,0 ffc0b97c: 40 be 00 14 bne+ cr7,ffc0b990 <_CORE_RWLock_Release+0x48> return level; } static inline void ppc_interrupt_enable( uint32_t level ) { asm volatile ( ffc0b980: 7c 00 01 24 mtmsr r0 _ISR_Enable( level ); executing->Wait.return_code = CORE_RWLOCK_UNAVAILABLE; ffc0b984: 38 00 00 02 li r0,2 ffc0b988: 90 09 00 34 stw r0,52(r9) return CORE_RWLOCK_SUCCESSFUL; ffc0b98c: 48 00 00 ac b ffc0ba38 <_CORE_RWLock_Release+0xf0> } if ( the_rwlock->current_state == CORE_RWLOCK_LOCKED_FOR_READING ) { ffc0b990: 2f 8b 00 01 cmpwi cr7,r11,1 ffc0b994: 40 9e 00 20 bne- cr7,ffc0b9b4 <_CORE_RWLock_Release+0x6c> the_rwlock->number_of_readers -= 1; ffc0b998: 81 63 00 48 lwz r11,72(r3) ffc0b99c: 39 6b ff ff addi r11,r11,-1 if ( the_rwlock->number_of_readers != 0 ) { ffc0b9a0: 2f 8b 00 00 cmpwi cr7,r11,0 _ISR_Enable( level ); executing->Wait.return_code = CORE_RWLOCK_UNAVAILABLE; return CORE_RWLOCK_SUCCESSFUL; } if ( the_rwlock->current_state == CORE_RWLOCK_LOCKED_FOR_READING ) { the_rwlock->number_of_readers -= 1; ffc0b9a4: 91 63 00 48 stw r11,72(r3) if ( the_rwlock->number_of_readers != 0 ) { ffc0b9a8: 41 be 00 0c beq+ cr7,ffc0b9b4 <_CORE_RWLock_Release+0x6c> ffc0b9ac: 7c 00 01 24 mtmsr r0 /* must be unlocked again */ _ISR_Enable( level ); return CORE_RWLOCK_SUCCESSFUL; ffc0b9b0: 48 00 00 88 b ffc0ba38 <_CORE_RWLock_Release+0xf0> } } /* CORE_RWLOCK_LOCKED_FOR_WRITING or READING with readers */ executing->Wait.return_code = CORE_RWLOCK_SUCCESSFUL; ffc0b9b4: 39 60 00 00 li r11,0 ffc0b9b8: 91 69 00 34 stw r11,52(r9) /* * Implicitly transition to "unlocked" and find another thread interested * in obtaining this rwlock. */ the_rwlock->current_state = CORE_RWLOCK_UNLOCKED; ffc0b9bc: 91 7f 00 44 stw r11,68(r31) ffc0b9c0: 7c 00 01 24 mtmsr r0 _ISR_Enable( level ); next = _Thread_queue_Dequeue( &the_rwlock->Wait_queue ); ffc0b9c4: 7f e3 fb 78 mr r3,r31 ffc0b9c8: 48 00 1c 85 bl ffc0d64c <_Thread_queue_Dequeue> if ( next ) { ffc0b9cc: 2c 03 00 00 cmpwi r3,0 ffc0b9d0: 41 82 00 68 beq- ffc0ba38 <_CORE_RWLock_Release+0xf0> if ( next->Wait.option == CORE_RWLOCK_THREAD_WAITING_FOR_WRITE ) { ffc0b9d4: 80 03 00 30 lwz r0,48(r3) ffc0b9d8: 2f 80 00 01 cmpwi cr7,r0,1 ffc0b9dc: 40 be 00 10 bne+ cr7,ffc0b9ec <_CORE_RWLock_Release+0xa4> the_rwlock->current_state = CORE_RWLOCK_LOCKED_FOR_WRITING; ffc0b9e0: 38 00 00 02 li r0,2 ffc0b9e4: 90 1f 00 44 stw r0,68(r31) return CORE_RWLOCK_SUCCESSFUL; ffc0b9e8: 48 00 00 50 b ffc0ba38 <_CORE_RWLock_Release+0xf0> } /* * Must be CORE_RWLOCK_THREAD_WAITING_FOR_READING */ the_rwlock->number_of_readers += 1; ffc0b9ec: 81 3f 00 48 lwz r9,72(r31) ffc0b9f0: 38 09 00 01 addi r0,r9,1 ffc0b9f4: 90 1f 00 48 stw r0,72(r31) the_rwlock->current_state = CORE_RWLOCK_LOCKED_FOR_READING; ffc0b9f8: 38 00 00 01 li r0,1 ffc0b9fc: 90 1f 00 44 stw r0,68(r31) /* * Now see if more readers can be let go. */ while ( 1 ) { next = _Thread_queue_First( &the_rwlock->Wait_queue ); ffc0ba00: 7f e3 fb 78 mr r3,r31 ffc0ba04: 48 00 22 01 bl ffc0dc04 <_Thread_queue_First> if ( !next || ffc0ba08: 7c 69 1b 79 mr. r9,r3 next->Wait.option == CORE_RWLOCK_THREAD_WAITING_FOR_WRITE ) return CORE_RWLOCK_SUCCESSFUL; the_rwlock->number_of_readers += 1; _Thread_queue_Extract( &the_rwlock->Wait_queue, next ); ffc0ba0c: 7f e3 fb 78 mr r3,r31 ffc0ba10: 7d 24 4b 78 mr r4,r9 /* * Now see if more readers can be let go. */ while ( 1 ) { next = _Thread_queue_First( &the_rwlock->Wait_queue ); if ( !next || ffc0ba14: 41 82 00 24 beq- ffc0ba38 <_CORE_RWLock_Release+0xf0> next->Wait.option == CORE_RWLOCK_THREAD_WAITING_FOR_WRITE ) ffc0ba18: 80 09 00 30 lwz r0,48(r9) ffc0ba1c: 2f 80 00 01 cmpwi cr7,r0,1 ffc0ba20: 41 9e 00 18 beq- cr7,ffc0ba38 <_CORE_RWLock_Release+0xf0><== NEVER TAKEN return CORE_RWLOCK_SUCCESSFUL; the_rwlock->number_of_readers += 1; ffc0ba24: 81 3f 00 48 lwz r9,72(r31) ffc0ba28: 38 09 00 01 addi r0,r9,1 ffc0ba2c: 90 1f 00 48 stw r0,72(r31) _Thread_queue_Extract( &the_rwlock->Wait_queue, next ); ffc0ba30: 48 00 20 5d bl ffc0da8c <_Thread_queue_Extract> } ffc0ba34: 4b ff ff cc b ffc0ba00 <_CORE_RWLock_Release+0xb8> } /* indentation is to match _ISR_Disable at top */ return CORE_RWLOCK_SUCCESSFUL; } ffc0ba38: 80 01 00 14 lwz r0,20(r1) ffc0ba3c: 38 60 00 00 li r3,0 ffc0ba40: 83 e1 00 0c lwz r31,12(r1) ffc0ba44: 38 21 00 10 addi r1,r1,16 ffc0ba48: 7c 08 03 a6 mtlr r0 ffc0ba4c: 4e 80 00 20 blr =============================================================================== ffc0ba50 <_CORE_RWLock_Timeout>: void _CORE_RWLock_Timeout( Objects_Id id, void *ignored ) { ffc0ba50: 94 21 ff e8 stwu r1,-24(r1) ffc0ba54: 7c 08 02 a6 mflr r0 Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); ffc0ba58: 38 81 00 08 addi r4,r1,8 void _CORE_RWLock_Timeout( Objects_Id id, void *ignored ) { ffc0ba5c: 90 01 00 1c stw r0,28(r1) Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); ffc0ba60: 48 00 17 c9 bl ffc0d228 <_Thread_Get> switch ( location ) { ffc0ba64: 80 01 00 08 lwz r0,8(r1) ffc0ba68: 2f 80 00 00 cmpwi cr7,r0,0 ffc0ba6c: 40 9e 00 18 bne- cr7,ffc0ba84 <_CORE_RWLock_Timeout+0x34><== NEVER TAKEN #if defined(RTEMS_MULTIPROCESSING) case OBJECTS_REMOTE: /* impossible */ #endif break; case OBJECTS_LOCAL: _Thread_queue_Process_timeout( the_thread ); ffc0ba70: 48 00 22 b9 bl ffc0dd28 <_Thread_queue_Process_timeout> */ RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void ) { RTEMS_COMPILER_MEMORY_BARRIER(); _Thread_Dispatch_disable_level -= 1; ffc0ba74: 3d 20 00 00 lis r9,0 ffc0ba78: 81 69 27 bc lwz r11,10172(r9) ffc0ba7c: 38 0b ff ff addi r0,r11,-1 ffc0ba80: 90 09 27 bc stw r0,10172(r9) _Thread_Unnest_dispatch(); break; } } ffc0ba84: 80 01 00 1c lwz r0,28(r1) ffc0ba88: 38 21 00 18 addi r1,r1,24 ffc0ba8c: 7c 08 03 a6 mtlr r0 ffc0ba90: 4e 80 00 20 blr =============================================================================== ffc1aa10 <_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 ) { ffc1aa10: 94 21 ff e0 stwu r1,-32(r1) ffc1aa14: 7c 08 02 a6 mflr r0 ffc1aa18: 90 01 00 24 stw r0,36(r1) Thread_Control *the_thread; uint32_t number_broadcasted; Thread_Wait_information *waitp; if ( size > the_message_queue->maximum_message_size ) { ffc1aa1c: 80 03 00 4c lwz r0,76(r3) Objects_Id id __attribute__((unused)), CORE_message_queue_API_mp_support_callout api_message_queue_mp_support __attribute__((unused)), #endif uint32_t *count ) { ffc1aa20: 93 61 00 0c stw r27,12(r1) ffc1aa24: 7d 1b 43 78 mr r27,r8 Thread_Control *the_thread; uint32_t number_broadcasted; Thread_Wait_information *waitp; if ( size > the_message_queue->maximum_message_size ) { ffc1aa28: 7f 85 00 40 cmplw cr7,r5,r0 Objects_Id id __attribute__((unused)), CORE_message_queue_API_mp_support_callout api_message_queue_mp_support __attribute__((unused)), #endif uint32_t *count ) { ffc1aa2c: 93 a1 00 14 stw r29,20(r1) ffc1aa30: 7c 9d 23 78 mr r29,r4 ffc1aa34: 93 c1 00 18 stw r30,24(r1) ffc1aa38: 7c be 2b 78 mr r30,r5 ffc1aa3c: 93 e1 00 1c stw r31,28(r1) ffc1aa40: 7c 7f 1b 78 mr r31,r3 Thread_Control *the_thread; uint32_t number_broadcasted; Thread_Wait_information *waitp; if ( size > the_message_queue->maximum_message_size ) { ffc1aa44: 38 60 00 01 li r3,1 Objects_Id id __attribute__((unused)), CORE_message_queue_API_mp_support_callout api_message_queue_mp_support __attribute__((unused)), #endif uint32_t *count ) { ffc1aa48: 93 41 00 08 stw r26,8(r1) ffc1aa4c: 93 81 00 10 stw r28,16(r1) Thread_Control *the_thread; uint32_t number_broadcasted; Thread_Wait_information *waitp; if ( size > the_message_queue->maximum_message_size ) { ffc1aa50: 41 9d 00 54 bgt- cr7,ffc1aaa4 <_CORE_message_queue_Broadcast+0x94><== NEVER TAKEN * NOTE: This check is critical because threads can block on * send and receive and this ensures that we are broadcasting * the message to threads waiting to receive -- not to send. */ if ( the_message_queue->number_of_pending_messages != 0 ) { ffc1aa54: 80 1f 00 48 lwz r0,72(r31) * 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))) { ffc1aa58: 3b 80 00 00 li r28,0 * 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 ) { ffc1aa5c: 2f 80 00 00 cmpwi cr7,r0,0 ffc1aa60: 41 be 00 28 beq+ cr7,ffc1aa88 <_CORE_message_queue_Broadcast+0x78> *count = 0; ffc1aa64: 38 00 00 00 li r0,0 ffc1aa68: 90 08 00 00 stw r0,0(r8) ffc1aa6c: 38 60 00 00 li r3,0 return CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL; ffc1aa70: 48 00 00 34 b ffc1aaa4 <_CORE_message_queue_Broadcast+0x94> const void *source, void *destination, size_t size ) { memcpy(destination, source, size); ffc1aa74: 80 7a 00 2c lwz r3,44(r26) */ number_broadcasted = 0; while ((the_thread = _Thread_queue_Dequeue(&the_message_queue->Wait_queue))) { waitp = &the_thread->Wait; number_broadcasted += 1; ffc1aa78: 3b 9c 00 01 addi r28,r28,1 ffc1aa7c: 48 00 ac 39 bl ffc256b4 buffer, waitp->return_argument_second.mutable_object, size ); *(size_t *) the_thread->Wait.return_argument = size; ffc1aa80: 81 3a 00 28 lwz r9,40(r26) ffc1aa84: 93 c9 00 00 stw r30,0(r9) * 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))) { ffc1aa88: 7f e3 fb 78 mr r3,r31 ffc1aa8c: 48 00 2e 31 bl ffc1d8bc <_Thread_queue_Dequeue> ffc1aa90: 7f a4 eb 78 mr r4,r29 /* * There must be no pending messages if there is a thread waiting to * receive a message. */ number_broadcasted = 0; while ((the_thread = ffc1aa94: 7c 7a 1b 79 mr. r26,r3 ffc1aa98: 7f c5 f3 78 mr r5,r30 ffc1aa9c: 40 82 ff d8 bne+ ffc1aa74 <_CORE_message_queue_Broadcast+0x64> if ( !_Objects_Is_local_id( the_thread->Object.id ) ) (*api_message_queue_mp_support) ( the_thread, id ); #endif } *count = number_broadcasted; ffc1aaa0: 93 9b 00 00 stw r28,0(r27) return CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL; } ffc1aaa4: 80 01 00 24 lwz r0,36(r1) ffc1aaa8: 83 41 00 08 lwz r26,8(r1) ffc1aaac: 7c 08 03 a6 mtlr r0 ffc1aab0: 83 61 00 0c lwz r27,12(r1) ffc1aab4: 83 81 00 10 lwz r28,16(r1) ffc1aab8: 83 a1 00 14 lwz r29,20(r1) ffc1aabc: 83 c1 00 18 lwz r30,24(r1) ffc1aac0: 83 e1 00 1c lwz r31,28(r1) ffc1aac4: 38 21 00 20 addi r1,r1,32 ffc1aac8: 4e 80 00 20 blr =============================================================================== ffc12fac <_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 ) { ffc12fac: 94 21 ff e0 stwu r1,-32(r1) ffc12fb0: 7c 08 02 a6 mflr r0 /* * 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)) { ffc12fb4: 7c c9 33 78 mr r9,r6 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 ) { ffc12fb8: 90 01 00 24 stw r0,36(r1) /* * 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)) { ffc12fbc: 70 c0 00 03 andi. r0,r6,3 { 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; ffc12fc0: 38 00 00 00 li r0,0 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 ) { ffc12fc4: 93 c1 00 18 stw r30,24(r1) ffc12fc8: 7c 9e 23 78 mr r30,r4 ffc12fcc: 93 e1 00 1c stw r31,28(r1) ffc12fd0: 7c 7f 1b 78 mr r31,r3 ffc12fd4: 93 a1 00 14 stw r29,20(r1) CORE_message_queue_Notify_Handler the_handler, void *the_argument ) { the_message_queue->notify_handler = the_handler; the_message_queue->notify_argument = the_argument; ffc12fd8: 90 03 00 64 stw r0,100(r3) size_t message_buffering_required; size_t allocated_message_size; the_message_queue->maximum_pending_messages = maximum_pending_messages; ffc12fdc: 90 a3 00 44 stw r5,68(r3) the_message_queue->number_of_pending_messages = 0; ffc12fe0: 90 03 00 48 stw r0,72(r3) the_message_queue->maximum_message_size = maximum_message_size; ffc12fe4: 90 c3 00 4c stw r6,76(r3) CORE_message_queue_Control *the_message_queue, CORE_message_queue_Notify_Handler the_handler, void *the_argument ) { the_message_queue->notify_handler = the_handler; ffc12fe8: 90 03 00 60 stw r0,96(r3) /* * Round size up to multiple of a pointer for chain init and * check for overflow on adding overhead to each message. */ allocated_message_size = maximum_message_size; if (allocated_message_size & (sizeof(uint32_t) - 1)) { ffc12fec: 41 82 00 14 beq- ffc13000 <_CORE_message_queue_Initialize+0x54> allocated_message_size += sizeof(uint32_t); ffc12ff0: 39 26 00 04 addi r9,r6,4 allocated_message_size &= ~(sizeof(uint32_t) - 1); ffc12ff4: 55 29 00 3a rlwinm r9,r9,0,0,29 } if (allocated_message_size < maximum_message_size) ffc12ff8: 7f 89 30 40 cmplw cr7,r9,r6 ffc12ffc: 41 bc 00 7c blt+ cr7,ffc13078 <_CORE_message_queue_Initialize+0xcc><== NEVER TAKEN /* * Calculate how much total memory is required for message buffering and * check for overflow on the multiplication. */ message_buffering_required = (size_t) maximum_pending_messages * (allocated_message_size + sizeof(CORE_message_queue_Buffer_control)); ffc13000: 3b a9 00 14 addi r29,r9,20 /* * 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 * ffc13004: 7c 7d 29 d6 mullw r3,r29,r5 (allocated_message_size + sizeof(CORE_message_queue_Buffer_control)); if (message_buffering_required < allocated_message_size) ffc13008: 7f 83 48 40 cmplw cr7,r3,r9 ffc1300c: 41 bc 00 6c blt+ cr7,ffc13078 <_CORE_message_queue_Initialize+0xcc><== NEVER TAKEN return false; /* * Attempt to allocate the message memory */ the_message_queue->message_buffers = (CORE_message_queue_Buffer *) ffc13010: 90 a1 00 08 stw r5,8(r1) ffc13014: 48 00 37 6d bl ffc16780 <_Workspace_Allocate> _Workspace_Allocate( message_buffering_required ); if (the_message_queue->message_buffers == 0) ffc13018: 2f 83 00 00 cmpwi cr7,r3,0 return false; /* * Attempt to allocate the message memory */ the_message_queue->message_buffers = (CORE_message_queue_Buffer *) ffc1301c: 7c 64 1b 78 mr r4,r3 ffc13020: 90 7f 00 5c stw r3,92(r31) _Workspace_Allocate( message_buffering_required ); if (the_message_queue->message_buffers == 0) ffc13024: 80 a1 00 08 lwz r5,8(r1) ffc13028: 41 9e 00 50 beq- cr7,ffc13078 <_CORE_message_queue_Initialize+0xcc> /* * Initialize the pool of inactive messages, pending messages, * and set of waiting threads. */ _Chain_Initialize ( ffc1302c: 7f a6 eb 78 mr r6,r29 ffc13030: 38 7f 00 68 addi r3,r31,104 ffc13034: 48 00 5f 31 bl ffc18f64 <_Chain_Initialize> allocated_message_size + sizeof( CORE_message_queue_Buffer_control ) ); _Chain_Initialize_empty( &the_message_queue->Pending_messages ); _Thread_queue_Initialize( ffc13038: 80 9e 00 00 lwz r4,0(r30) */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); ffc1303c: 39 3f 00 54 addi r9,r31,84 the_chain->permanent_null = NULL; the_chain->last = _Chain_Head(the_chain); ffc13040: 38 1f 00 50 addi r0,r31,80 */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); ffc13044: 91 3f 00 50 stw r9,80(r31) ffc13048: 68 84 00 01 xori r4,r4,1 the_chain->permanent_null = NULL; ffc1304c: 39 20 00 00 li r9,0 the_chain->last = _Chain_Head(the_chain); ffc13050: 90 1f 00 58 stw r0,88(r31) ffc13054: 7c 84 00 34 cntlzw r4,r4 RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); the_chain->permanent_null = NULL; ffc13058: 91 3f 00 54 stw r9,84(r31) ffc1305c: 7f e3 fb 78 mr r3,r31 ffc13060: 54 84 d9 7e rlwinm r4,r4,27,5,31 ffc13064: 38 a0 00 80 li r5,128 ffc13068: 38 c0 00 06 li r6,6 ffc1306c: 48 00 27 91 bl ffc157fc <_Thread_queue_Initialize> ffc13070: 38 60 00 01 li r3,1 THREAD_QUEUE_DISCIPLINE_PRIORITY : THREAD_QUEUE_DISCIPLINE_FIFO, STATES_WAITING_FOR_MESSAGE, CORE_MESSAGE_QUEUE_STATUS_TIMEOUT ); return true; ffc13074: 48 00 00 08 b ffc1307c <_CORE_message_queue_Initialize+0xd0> ffc13078: 38 60 00 00 li r3,0 } ffc1307c: 80 01 00 24 lwz r0,36(r1) ffc13080: 83 a1 00 14 lwz r29,20(r1) ffc13084: 7c 08 03 a6 mtlr r0 ffc13088: 83 c1 00 18 lwz r30,24(r1) ffc1308c: 83 e1 00 1c lwz r31,28(r1) ffc13090: 38 21 00 20 addi r1,r1,32 ffc13094: 4e 80 00 20 blr =============================================================================== ffc13098 <_CORE_message_queue_Seize>: void *buffer, size_t *size_p, bool wait, Watchdog_Interval timeout ) { ffc13098: 94 21 ff e8 stwu r1,-24(r1) ffc1309c: 7c 08 02 a6 mflr r0 ISR_Level level; CORE_message_queue_Buffer_control *the_message; Thread_Control *executing; executing = _Thread_Executing; ffc130a0: 3d 20 00 00 lis r9,0 void *buffer, size_t *size_p, bool wait, Watchdog_Interval timeout ) { ffc130a4: 90 01 00 1c stw r0,28(r1) 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; ffc130a8: 38 00 00 00 li r0,0 void *buffer, size_t *size_p, bool wait, Watchdog_Interval timeout ) { ffc130ac: 7c 8b 23 78 mr r11,r4 ISR_Level level; CORE_message_queue_Buffer_control *the_message; Thread_Control *executing; executing = _Thread_Executing; ffc130b0: 81 29 28 70 lwz r9,10352(r9) void *buffer, size_t *size_p, bool wait, Watchdog_Interval timeout ) { ffc130b4: 93 e1 00 14 stw r31,20(r1) ffc130b8: 7c 7f 1b 78 mr r31,r3 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; ffc130bc: 90 09 00 34 stw r0,52(r9) void *buffer, size_t *size_p, bool wait, Watchdog_Interval timeout ) { ffc130c0: 7c a0 2b 78 mr r0,r5 ffc130c4: 93 a1 00 0c stw r29,12(r1) ffc130c8: 93 c1 00 10 stw r30,16(r1) static inline uint32_t ppc_interrupt_disable( void ) { uint32_t level; uint32_t mask; asm volatile ( ffc130cc: 7d 40 00 a6 mfmsr r10 ffc130d0: 7c b0 42 a6 mfsprg r5,0 ffc130d4: 7d 45 28 78 andc r5,r10,r5 ffc130d8: 7c a0 01 24 mtmsr r5 */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); ffc130dc: 83 c3 00 50 lwz r30,80(r3) */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; ffc130e0: 38 a3 00 54 addi r5,r3,84 ffc130e4: 7f 9e 28 00 cmpw cr7,r30,r5 ffc130e8: 41 9e 00 a4 beq- cr7,ffc1318c <_CORE_message_queue_Seize+0xf4> executing = _Thread_Executing; executing->Wait.return_code = CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL; _ISR_Disable( level ); the_message = _CORE_message_queue_Get_pending_message( the_message_queue ); if ( the_message != NULL ) { ffc130ec: 2f 9e 00 00 cmpwi cr7,r30,0 { Chain_Node *return_node; Chain_Node *new_first; return_node = the_chain->first; new_first = return_node->next; ffc130f0: 80 9e 00 00 lwz r4,0(r30) the_chain->first = new_first; ffc130f4: 7c 65 1b 78 mr r5,r3 ffc130f8: 94 85 00 50 stwu r4,80(r5) new_first->previous = _Chain_Head(the_chain); ffc130fc: 90 a4 00 04 stw r5,4(r4) ffc13100: 41 9e 00 8c beq- cr7,ffc1318c <_CORE_message_queue_Seize+0xf4><== NEVER TAKEN the_message_queue->number_of_pending_messages -= 1; ffc13104: 81 23 00 48 lwz r9,72(r3) ffc13108: 39 29 ff ff addi r9,r9,-1 ffc1310c: 91 23 00 48 stw r9,72(r3) return level; } static inline void ppc_interrupt_enable( uint32_t level ) { asm volatile ( ffc13110: 7d 40 01 24 mtmsr r10 _ISR_Enable( level ); *size_p = the_message->Contents.size; ffc13114: 80 be 00 0c lwz r5,12(r30) _Thread_Executing->Wait.count = ffc13118: 3d 20 00 00 lis r9,0 ffc1311c: 81 29 28 70 lwz r9,10352(r9) _CORE_message_queue_Get_message_priority( the_message ); _CORE_message_queue_Copy_buffer( the_message->Contents.buffer, ffc13120: 3b be 00 10 addi r29,r30,16 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; ffc13124: 90 a6 00 00 stw r5,0(r6) const void *source, void *destination, size_t size ) { memcpy(destination, source, size); ffc13128: 7c 03 03 78 mr r3,r0 ffc1312c: 7f a4 eb 78 mr r4,r29 _Thread_Executing->Wait.count = ffc13130: 81 7e 00 08 lwz r11,8(r30) ffc13134: 91 69 00 24 stw r11,36(r9) ffc13138: 48 00 9c e9 bl ffc1ce20 * 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 ); ffc1313c: 7f e3 fb 78 mr r3,r31 ffc13140: 48 00 21 ed bl ffc1532c <_Thread_queue_Dequeue> if ( !the_thread ) { ffc13144: 7c 69 1b 79 mr. r9,r3 ffc13148: 40 a2 00 14 bne+ ffc1315c <_CORE_message_queue_Seize+0xc4> 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 ); ffc1314c: 38 7f 00 68 addi r3,r31,104 ffc13150: 7f c4 f3 78 mr r4,r30 ffc13154: 4b ff fd 95 bl ffc12ee8 <_Chain_Append> _CORE_message_queue_Free_message_buffer( the_message_queue, the_message ); return; ffc13158: 48 00 00 7c b ffc131d4 <_CORE_message_queue_Seize+0x13c> */ _CORE_message_queue_Set_message_priority( the_message, the_thread->Wait.count ); the_message->Contents.size = (size_t) the_thread->Wait.option; ffc1315c: 80 a9 00 30 lwz r5,48(r9) const void *source, void *destination, size_t size ) { memcpy(destination, source, size); ffc13160: 7f a3 eb 78 mr r3,r29 CORE_message_queue_Buffer_control *the_message, int priority ) { #if defined(RTEMS_SCORE_COREMSG_ENABLE_MESSAGE_PRIORITY) the_message->priority = priority; ffc13164: 80 09 00 24 lwz r0,36(r9) ffc13168: 90 be 00 0c stw r5,12(r30) ffc1316c: 90 1e 00 08 stw r0,8(r30) const void *source, void *destination, size_t size ) { memcpy(destination, source, size); ffc13170: 80 89 00 2c lwz r4,44(r9) ffc13174: 48 00 9c ad bl ffc1ce20 the_thread->Wait.return_argument_second.immutable_object, the_message->Contents.buffer, the_message->Contents.size ); _CORE_message_queue_Insert_message( ffc13178: 80 be 00 08 lwz r5,8(r30) ffc1317c: 7f e3 fb 78 mr r3,r31 ffc13180: 7f c4 f3 78 mr r4,r30 ffc13184: 48 00 5e 1d bl ffc18fa0 <_CORE_message_queue_Insert_message> the_message_queue, the_message, _CORE_message_queue_Get_message_priority( the_message ) ); return; ffc13188: 48 00 00 4c b ffc131d4 <_CORE_message_queue_Seize+0x13c> } #endif } if ( !wait ) { ffc1318c: 2f 87 00 00 cmpwi cr7,r7,0 ffc13190: 40 9e 00 14 bne- cr7,ffc131a4 <_CORE_message_queue_Seize+0x10c> ffc13194: 7d 40 01 24 mtmsr r10 _ISR_Enable( level ); executing->Wait.return_code = CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED_NOWAIT; ffc13198: 38 00 00 04 li r0,4 ffc1319c: 90 09 00 34 stw r0,52(r9) return; ffc131a0: 48 00 00 34 b ffc131d4 <_CORE_message_queue_Seize+0x13c> 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; ffc131a4: 38 e0 00 01 li r7,1 _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; ffc131a8: 90 c9 00 28 stw r6,40(r9) ffc131ac: 90 ff 00 30 stw r7,48(r31) return; } _Thread_queue_Enter_critical_section( &the_message_queue->Wait_queue ); executing->Wait.queue = &the_message_queue->Wait_queue; executing->Wait.id = id; ffc131b0: 91 69 00 20 stw r11,32(r9) executing->Wait.return_argument_second.mutable_object = buffer; ffc131b4: 90 09 00 2c stw r0,44(r9) 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; ffc131b8: 93 e9 00 44 stw r31,68(r9) ffc131bc: 7d 40 01 24 mtmsr r10 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 ); _Thread_queue_Enqueue( &the_message_queue->Wait_queue, timeout ); ffc131c0: 3c a0 ff c1 lis r5,-63 ffc131c4: 7f e3 fb 78 mr r3,r31 ffc131c8: 7d 04 43 78 mr r4,r8 ffc131cc: 38 a5 58 e0 addi r5,r5,22752 ffc131d0: 48 00 23 19 bl ffc154e8 <_Thread_queue_Enqueue_with_handler> } ffc131d4: 80 01 00 1c lwz r0,28(r1) ffc131d8: 83 a1 00 0c lwz r29,12(r1) ffc131dc: 7c 08 03 a6 mtlr r0 ffc131e0: 83 c1 00 10 lwz r30,16(r1) ffc131e4: 83 e1 00 14 lwz r31,20(r1) ffc131e8: 38 21 00 18 addi r1,r1,24 ffc131ec: 4e 80 00 20 blr =============================================================================== ffc0ab64 <_CORE_mutex_Seize>: Objects_Id _id, bool _wait, Watchdog_Interval _timeout, ISR_Level _level ) { ffc0ab64: 94 21 ff e0 stwu r1,-32(r1) ffc0ab68: 7c 08 02 a6 mflr r0 _CORE_mutex_Seize_body( _the_mutex, _id, _wait, _timeout, _level ); ffc0ab6c: 3d 20 00 00 lis r9,0 Objects_Id _id, bool _wait, Watchdog_Interval _timeout, ISR_Level _level ) { ffc0ab70: 90 01 00 24 stw r0,36(r1) _CORE_mutex_Seize_body( _the_mutex, _id, _wait, _timeout, _level ); ffc0ab74: 80 09 27 90 lwz r0,10128(r9) Objects_Id _id, bool _wait, Watchdog_Interval _timeout, ISR_Level _level ) { ffc0ab78: 93 81 00 10 stw r28,16(r1) ffc0ab7c: 7c dc 33 78 mr r28,r6 _CORE_mutex_Seize_body( _the_mutex, _id, _wait, _timeout, _level ); ffc0ab80: 2f 80 00 00 cmpwi cr7,r0,0 Objects_Id _id, bool _wait, Watchdog_Interval _timeout, ISR_Level _level ) { ffc0ab84: 93 a1 00 14 stw r29,20(r1) ffc0ab88: 7c bd 2b 78 mr r29,r5 ffc0ab8c: 93 c1 00 18 stw r30,24(r1) ffc0ab90: 7c 9e 23 78 mr r30,r4 ffc0ab94: 93 e1 00 1c stw r31,28(r1) ffc0ab98: 7c 7f 1b 78 mr r31,r3 ffc0ab9c: 90 e1 00 08 stw r7,8(r1) _CORE_mutex_Seize_body( _the_mutex, _id, _wait, _timeout, _level ); ffc0aba0: 41 9e 00 2c beq- cr7,ffc0abcc <_CORE_mutex_Seize+0x68> ffc0aba4: 2f 85 00 00 cmpwi cr7,r5,0 ffc0aba8: 41 9e 00 24 beq- cr7,ffc0abcc <_CORE_mutex_Seize+0x68> <== NEVER TAKEN ffc0abac: 3d 20 00 00 lis r9,0 ffc0abb0: 80 09 27 f4 lwz r0,10228(r9) ffc0abb4: 2b 80 00 01 cmplwi cr7,r0,1 ffc0abb8: 40 bd 00 14 ble+ cr7,ffc0abcc <_CORE_mutex_Seize+0x68> ffc0abbc: 38 60 00 00 li r3,0 ffc0abc0: 38 80 00 00 li r4,0 ffc0abc4: 38 a0 00 13 li r5,19 ffc0abc8: 48 00 07 65 bl ffc0b32c <_Internal_error_Occurred> ffc0abcc: 7f e3 fb 78 mr r3,r31 ffc0abd0: 38 81 00 08 addi r4,r1,8 ffc0abd4: 48 00 9d fd bl ffc149d0 <_CORE_mutex_Seize_interrupt_trylock> ffc0abd8: 2f 83 00 00 cmpwi cr7,r3,0 ffc0abdc: 41 9e 00 60 beq- cr7,ffc0ac3c <_CORE_mutex_Seize+0xd8> ffc0abe0: 2f 9d 00 00 cmpwi cr7,r29,0 ffc0abe4: 3d 60 00 00 lis r11,0 ffc0abe8: 40 9e 00 1c bne- cr7,ffc0ac04 <_CORE_mutex_Seize+0xa0> ffc0abec: 80 01 00 08 lwz r0,8(r1) ffc0abf0: 7c 00 01 24 mtmsr r0 ffc0abf4: 81 2b 27 d0 lwz r9,10192(r11) ffc0abf8: 38 00 00 01 li r0,1 ffc0abfc: 90 09 00 34 stw r0,52(r9) ffc0ac00: 48 00 00 3c b ffc0ac3c <_CORE_mutex_Seize+0xd8> ffc0ac04: 3d 20 00 00 lis r9,0 ffc0ac08: 81 6b 27 d0 lwz r11,10192(r11) ffc0ac0c: 81 49 27 90 lwz r10,10128(r9) ffc0ac10: 93 cb 00 20 stw r30,32(r11) ffc0ac14: 38 0a 00 01 addi r0,r10,1 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; ffc0ac18: 39 40 00 01 li r10,1 ffc0ac1c: 93 eb 00 44 stw r31,68(r11) ffc0ac20: 91 5f 00 30 stw r10,48(r31) ffc0ac24: 90 09 27 90 stw r0,10128(r9) ffc0ac28: 80 01 00 08 lwz r0,8(r1) ffc0ac2c: 7c 00 01 24 mtmsr r0 ffc0ac30: 7f e3 fb 78 mr r3,r31 ffc0ac34: 7f 84 e3 78 mr r4,r28 ffc0ac38: 4b ff fe a5 bl ffc0aadc <_CORE_mutex_Seize_interrupt_blocking> } ffc0ac3c: 80 01 00 24 lwz r0,36(r1) ffc0ac40: 83 81 00 10 lwz r28,16(r1) ffc0ac44: 7c 08 03 a6 mtlr r0 ffc0ac48: 83 a1 00 14 lwz r29,20(r1) ffc0ac4c: 83 c1 00 18 lwz r30,24(r1) ffc0ac50: 83 e1 00 1c lwz r31,28(r1) ffc0ac54: 38 21 00 20 addi r1,r1,32 ffc0ac58: 4e 80 00 20 blr =============================================================================== ffc0ae1c <_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 ) { ffc0ae1c: 94 21 ff f0 stwu r1,-16(r1) ffc0ae20: 7c 08 02 a6 mflr r0 ffc0ae24: 93 e1 00 0c stw r31,12(r1) ffc0ae28: 7c 7f 1b 78 mr r31,r3 ffc0ae2c: 90 01 00 14 stw r0,20(r1) ISR_Level level; CORE_semaphore_Status status; status = CORE_SEMAPHORE_STATUS_SUCCESSFUL; if ( (the_thread = _Thread_queue_Dequeue(&the_semaphore->Wait_queue)) ) { ffc0ae30: 48 00 1b 31 bl ffc0c960 <_Thread_queue_Dequeue> ffc0ae34: 2f 83 00 00 cmpwi cr7,r3,0 ffc0ae38: 38 60 00 00 li r3,0 ffc0ae3c: 40 be 00 38 bne+ cr7,ffc0ae74 <_CORE_semaphore_Surrender+0x58> static inline uint32_t ppc_interrupt_disable( void ) { uint32_t level; uint32_t mask; asm volatile ( ffc0ae40: 7c 00 00 a6 mfmsr r0 ffc0ae44: 7d 30 42 a6 mfsprg r9,0 ffc0ae48: 7c 09 48 78 andc r9,r0,r9 ffc0ae4c: 7d 20 01 24 mtmsr r9 (*api_semaphore_mp_support) ( the_thread, id ); #endif } else { _ISR_Disable( level ); if ( the_semaphore->count < the_semaphore->Attributes.maximum_count ) ffc0ae50: 81 3f 00 48 lwz r9,72(r31) ffc0ae54: 38 60 00 04 li r3,4 ffc0ae58: 81 7f 00 40 lwz r11,64(r31) ffc0ae5c: 7f 89 58 40 cmplw cr7,r9,r11 ffc0ae60: 40 9c 00 10 bge- cr7,ffc0ae70 <_CORE_semaphore_Surrender+0x54><== NEVER TAKEN the_semaphore->count += 1; ffc0ae64: 39 29 00 01 addi r9,r9,1 ffc0ae68: 91 3f 00 48 stw r9,72(r31) ffc0ae6c: 38 60 00 00 li r3,0 return level; } static inline void ppc_interrupt_enable( uint32_t level ) { asm volatile ( ffc0ae70: 7c 00 01 24 mtmsr r0 status = CORE_SEMAPHORE_MAXIMUM_COUNT_EXCEEDED; _ISR_Enable( level ); } return status; } ffc0ae74: 80 01 00 14 lwz r0,20(r1) ffc0ae78: 83 e1 00 0c lwz r31,12(r1) ffc0ae7c: 38 21 00 10 addi r1,r1,16 ffc0ae80: 7c 08 03 a6 mtlr r0 ffc0ae84: 4e 80 00 20 blr =============================================================================== ffc0941c <_Event_Seize>: rtems_event_set event_in, rtems_option option_set, rtems_interval ticks, rtems_event_set *event_out ) { ffc0941c: 94 21 ff f0 stwu r1,-16(r1) ffc09420: 7c 08 02 a6 mflr r0 rtems_event_set pending_events; ISR_Level level; RTEMS_API_Control *api; Thread_blocking_operation_States sync_state; executing = _Thread_Executing; ffc09424: 3d 20 00 00 lis r9,0 rtems_event_set event_in, rtems_option option_set, rtems_interval ticks, rtems_event_set *event_out ) { ffc09428: 93 e1 00 0c stw r31,12(r1) rtems_event_set pending_events; ISR_Level level; RTEMS_API_Control *api; Thread_blocking_operation_States sync_state; executing = _Thread_Executing; ffc0942c: 83 e9 27 d0 lwz r31,10192(r9) rtems_event_set event_in, rtems_option option_set, rtems_interval ticks, rtems_event_set *event_out ) { ffc09430: 90 01 00 14 stw r0,20(r1) ISR_Level level; RTEMS_API_Control *api; Thread_blocking_operation_States sync_state; executing = _Thread_Executing; executing->Wait.return_code = RTEMS_SUCCESSFUL; ffc09434: 38 00 00 00 li r0,0 ffc09438: 90 1f 00 34 stw r0,52(r31) api = executing->API_Extensions[ THREAD_API_RTEMS ]; ffc0943c: 81 5f 01 44 lwz r10,324(r31) static inline uint32_t ppc_interrupt_disable( void ) { uint32_t level; uint32_t mask; asm volatile ( ffc09440: 7d 20 00 a6 mfmsr r9 ffc09444: 7c 10 42 a6 mfsprg r0,0 ffc09448: 7d 20 00 78 andc r0,r9,r0 ffc0944c: 7c 00 01 24 mtmsr r0 _ISR_Disable( level ); pending_events = api->pending_events; ffc09450: 81 6a 00 00 lwz r11,0(r10) seized_events = _Event_sets_Get( pending_events, event_in ); if ( !_Event_sets_Is_empty( seized_events ) && ffc09454: 7c 60 58 39 and. r0,r3,r11 ffc09458: 41 82 00 24 beq- ffc0947c <_Event_Seize+0x60> ffc0945c: 7f 80 18 00 cmpw cr7,r0,r3 ffc09460: 41 9e 00 0c beq- cr7,ffc0946c <_Event_Seize+0x50> ffc09464: 70 88 00 02 andi. r8,r4,2 ffc09468: 41 a2 00 14 beq+ ffc0947c <_Event_Seize+0x60> <== NEVER TAKEN (seized_events == event_in || _Options_Is_any( option_set )) ) { api->pending_events = ffc0946c: 7d 6b 00 78 andc r11,r11,r0 ffc09470: 91 6a 00 00 stw r11,0(r10) return level; } static inline void ppc_interrupt_enable( uint32_t level ) { asm volatile ( ffc09474: 7d 20 01 24 mtmsr r9 ffc09478: 48 00 00 18 b ffc09490 <_Event_Seize+0x74> _ISR_Enable( level ); *event_out = seized_events; return; } if ( _Options_Is_no_wait( option_set ) ) { ffc0947c: 70 8b 00 01 andi. r11,r4,1 ffc09480: 41 a2 00 18 beq+ ffc09498 <_Event_Seize+0x7c> ffc09484: 7d 20 01 24 mtmsr r9 _ISR_Enable( level ); executing->Wait.return_code = RTEMS_UNSATISFIED; ffc09488: 39 20 00 0d li r9,13 ffc0948c: 91 3f 00 34 stw r9,52(r31) *event_out = seized_events; ffc09490: 90 06 00 00 stw r0,0(r6) return; ffc09494: 48 00 00 a0 b ffc09534 <_Event_Seize+0x118> */ executing->Wait.option = (uint32_t) option_set; executing->Wait.count = (uint32_t) event_in; executing->Wait.return_argument = event_out; _Event_Sync_state = THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; ffc09498: 38 00 00 01 li r0,1 * set properly when we are marked as in the event critical section. * * NOTE: Since interrupts are disabled, this isn't that much of an * issue but better safe than sorry. */ executing->Wait.option = (uint32_t) option_set; ffc0949c: 90 9f 00 30 stw r4,48(r31) executing->Wait.count = (uint32_t) event_in; executing->Wait.return_argument = event_out; _Event_Sync_state = THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; ffc094a0: 3d 60 00 00 lis r11,0 ffc094a4: 90 0b 28 04 stw r0,10244(r11) * * 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; ffc094a8: 90 7f 00 24 stw r3,36(r31) executing->Wait.return_argument = event_out; ffc094ac: 90 df 00 28 stw r6,40(r31) ffc094b0: 7d 20 01 24 mtmsr r9 _Event_Sync_state = THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; _ISR_Enable( level ); if ( ticks ) { ffc094b4: 2f 85 00 00 cmpwi cr7,r5,0 ffc094b8: 41 be 00 38 beq+ cr7,ffc094f0 <_Event_Seize+0xd4> _Watchdog_Initialize( ffc094bc: 81 3f 00 08 lwz r9,8(r31) Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; ffc094c0: 3d 60 ff c1 lis r11,-63 Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; ffc094c4: 38 00 00 00 li r0,0 Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; ffc094c8: 90 bf 00 54 stw r5,84(r31) Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; ffc094cc: 39 6b 97 04 addi r11,r11,-26876 ) { the_watchdog->initial = units; _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); ffc094d0: 3c 60 00 00 lis r3,0 Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; ffc094d4: 91 7f 00 64 stw r11,100(r31) ) { the_watchdog->initial = units; _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); ffc094d8: 38 63 2e 08 addi r3,r3,11784 void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; the_watchdog->id = id; ffc094dc: 91 3f 00 68 stw r9,104(r31) ) { the_watchdog->initial = units; _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); ffc094e0: 38 9f 00 48 addi r4,r31,72 ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; the_watchdog->id = id; the_watchdog->user_data = user_data; ffc094e4: 90 1f 00 6c stw r0,108(r31) Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; ffc094e8: 90 1f 00 50 stw r0,80(r31) ) { the_watchdog->initial = units; _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); ffc094ec: 48 00 44 f9 bl ffc0d9e4 <_Watchdog_Insert> NULL ); _Watchdog_Insert_ticks( &executing->Timer, ticks ); } _Thread_Set_state( executing, STATES_WAITING_FOR_EVENT ); ffc094f0: 7f e3 fb 78 mr r3,r31 ffc094f4: 38 80 01 00 li r4,256 ffc094f8: 48 00 3a bd bl ffc0cfb4 <_Thread_Set_state> static inline uint32_t ppc_interrupt_disable( void ) { uint32_t level; uint32_t mask; asm volatile ( ffc094fc: 7c a0 00 a6 mfmsr r5 ffc09500: 7c 10 42 a6 mfsprg r0,0 ffc09504: 7c a0 00 78 andc r0,r5,r0 ffc09508: 7c 00 01 24 mtmsr r0 _ISR_Disable( level ); sync_state = _Event_Sync_state; ffc0950c: 3d 20 00 00 lis r9,0 ffc09510: 80 69 28 04 lwz r3,10244(r9) _Event_Sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; ffc09514: 38 00 00 00 li r0,0 ffc09518: 90 09 28 04 stw r0,10244(r9) if ( sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) { ffc0951c: 2f 83 00 01 cmpwi cr7,r3,1 ffc09520: 40 be 00 0c bne+ cr7,ffc0952c <_Event_Seize+0x110> return level; } static inline void ppc_interrupt_enable( uint32_t level ) { asm volatile ( ffc09524: 7c a0 01 24 mtmsr r5 ffc09528: 48 00 00 0c b ffc09534 <_Event_Seize+0x118> * 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 ); ffc0952c: 7f e4 fb 78 mr r4,r31 ffc09530: 48 00 28 fd bl ffc0be2c <_Thread_blocking_operation_Cancel> } ffc09534: 80 01 00 14 lwz r0,20(r1) ffc09538: 83 e1 00 0c lwz r31,12(r1) ffc0953c: 38 21 00 10 addi r1,r1,16 ffc09540: 7c 08 03 a6 mtlr r0 ffc09544: 4e 80 00 20 blr =============================================================================== ffc095bc <_Event_Surrender>: */ void _Event_Surrender( Thread_Control *the_thread ) { ffc095bc: 94 21 ff f0 stwu r1,-16(r1) ffc095c0: 7c 08 02 a6 mflr r0 ffc095c4: 90 01 00 14 stw r0,20(r1) ffc095c8: 93 e1 00 0c stw r31,12(r1) ffc095cc: 7c 7f 1b 78 mr r31,r3 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 ]; ffc095d0: 81 03 01 44 lwz r8,324(r3) option_set = (rtems_option) the_thread->Wait.option; ffc095d4: 80 e3 00 30 lwz r7,48(r3) static inline uint32_t ppc_interrupt_disable( void ) { uint32_t level; uint32_t mask; asm volatile ( ffc095d8: 7c 00 00 a6 mfmsr r0 ffc095dc: 7d 30 42 a6 mfsprg r9,0 ffc095e0: 7c 09 48 78 andc r9,r0,r9 ffc095e4: 7d 20 01 24 mtmsr r9 _ISR_Disable( level ); pending_events = api->pending_events; ffc095e8: 81 68 00 00 lwz r11,0(r8) event_condition = (rtems_event_set) the_thread->Wait.count; ffc095ec: 81 43 00 24 lwz r10,36(r3) seized_events = _Event_sets_Get( pending_events, event_condition ); /* * No events were seized in this operation */ if ( _Event_sets_Is_empty( seized_events ) ) { ffc095f0: 7d 49 58 39 and. r9,r10,r11 ffc095f4: 40 a2 00 08 bne+ ffc095fc <_Event_Surrender+0x40> _ISR_Enable( level ); ffc095f8: 48 00 00 f4 b ffc096ec <_Event_Surrender+0x130> /* * If we are in an ISR and sending to the current thread, then * we have a critical section issue to deal with. */ if ( _ISR_Is_in_progress() && ffc095fc: 3c c0 00 00 lis r6,0 ffc09600: 80 c6 27 b8 lwz r6,10168(r6) ffc09604: 2f 86 00 00 cmpwi cr7,r6,0 ffc09608: 41 9e 00 68 beq- cr7,ffc09670 <_Event_Surrender+0xb4> ffc0960c: 3c c0 00 00 lis r6,0 ffc09610: 80 c6 27 d0 lwz r6,10192(r6) ffc09614: 7f 83 30 00 cmpw cr7,r3,r6 ffc09618: 40 be 00 58 bne+ cr7,ffc09670 <_Event_Surrender+0xb4> _Thread_Is_executing( the_thread ) && ((_Event_Sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || ffc0961c: 3c c0 00 00 lis r6,0 ffc09620: 80 a6 28 04 lwz r5,10244(r6) /* * 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() && ffc09624: 2f 85 00 02 cmpwi cr7,r5,2 ffc09628: 41 9e 00 10 beq- cr7,ffc09638 <_Event_Surrender+0x7c> <== NEVER TAKEN _Thread_Is_executing( the_thread ) && ((_Event_Sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || (_Event_Sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED)) ) { ffc0962c: 80 c6 28 04 lwz r6,10244(r6) /* * 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() && ffc09630: 2f 86 00 01 cmpwi cr7,r6,1 ffc09634: 40 be 00 3c bne+ cr7,ffc09670 <_Event_Surrender+0xb4> _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) ) { ffc09638: 7f 89 50 00 cmpw cr7,r9,r10 ffc0963c: 41 9e 00 0c beq- cr7,ffc09648 <_Event_Surrender+0x8c> ffc09640: 70 e5 00 02 andi. r5,r7,2 ffc09644: 41 82 00 28 beq- ffc0966c <_Event_Surrender+0xb0> <== NEVER TAKEN api->pending_events = _Event_sets_Clear( pending_events,seized_events ); ffc09648: 7d 6b 48 78 andc r11,r11,r9 the_thread->Wait.count = 0; *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; ffc0964c: 81 5f 00 28 lwz r10,40(r31) if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) && ((_Event_Sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || (_Event_Sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED)) ) { if ( seized_events == event_condition || _Options_Is_any(option_set) ) { api->pending_events = _Event_sets_Clear( pending_events,seized_events ); ffc09650: 91 68 00 00 stw r11,0(r8) the_thread->Wait.count = 0; *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; _Event_Sync_state = THREAD_BLOCKING_OPERATION_SATISFIED; ffc09654: 3d 60 00 00 lis r11,0 ffc09658: 39 00 00 03 li r8,3 ffc0965c: 91 0b 28 04 stw r8,10244(r11) _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; ffc09660: 39 60 00 00 li r11,0 ffc09664: 91 7f 00 24 stw r11,36(r31) *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; ffc09668: 91 2a 00 00 stw r9,0(r10) _Event_Sync_state = THREAD_BLOCKING_OPERATION_SATISFIED; } _ISR_Enable( level ); ffc0966c: 48 00 00 80 b ffc096ec <_Event_Surrender+0x130> } /* * Otherwise, this is a normal send to another thread */ if ( _States_Is_waiting_for_event( the_thread->current_state ) ) { ffc09670: 80 df 00 10 lwz r6,16(r31) ffc09674: 70 c5 01 00 andi. r5,r6,256 ffc09678: 41 82 00 74 beq- ffc096ec <_Event_Surrender+0x130> if ( seized_events == event_condition || _Options_Is_any( option_set ) ) { ffc0967c: 7f 89 50 00 cmpw cr7,r9,r10 ffc09680: 41 9e 00 0c beq- cr7,ffc0968c <_Event_Surrender+0xd0> ffc09684: 70 ea 00 02 andi. r10,r7,2 ffc09688: 41 82 00 64 beq- ffc096ec <_Event_Surrender+0x130> <== NEVER TAKEN api->pending_events = _Event_sets_Clear( pending_events, seized_events ); the_thread->Wait.count = 0; *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; ffc0968c: 81 5f 00 28 lwz r10,40(r31) /* * 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 ); ffc09690: 7d 6b 48 78 andc r11,r11,r9 ffc09694: 91 68 00 00 stw r11,0(r8) the_thread->Wait.count = 0; ffc09698: 39 60 00 00 li r11,0 ffc0969c: 91 7f 00 24 stw r11,36(r31) *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; ffc096a0: 91 2a 00 00 stw r9,0(r10) static inline void ppc_interrupt_flash( uint32_t level ) { uint32_t current_level; asm volatile ( ffc096a4: 7d 20 00 a6 mfmsr r9 ffc096a8: 7c 00 01 24 mtmsr r0 ffc096ac: 7d 20 01 24 mtmsr r9 _ISR_Flash( level ); if ( !_Watchdog_Is_active( &the_thread->Timer ) ) { ffc096b0: 81 3f 00 50 lwz r9,80(r31) ffc096b4: 2f 89 00 02 cmpwi cr7,r9,2 ffc096b8: 41 9e 00 0c beq- cr7,ffc096c4 <_Event_Surrender+0x108> return level; } static inline void ppc_interrupt_enable( uint32_t level ) { asm volatile ( ffc096bc: 7c 00 01 24 mtmsr r0 ffc096c0: 48 00 00 18 b ffc096d8 <_Event_Surrender+0x11c> RTEMS_INLINE_ROUTINE void _Watchdog_Deactivate( Watchdog_Control *the_watchdog ) { the_watchdog->state = WATCHDOG_REMOVE_IT; ffc096c4: 39 20 00 03 li r9,3 ffc096c8: 91 3f 00 50 stw r9,80(r31) ffc096cc: 7c 00 01 24 mtmsr r0 _ISR_Enable( level ); _Thread_Unblock( the_thread ); } else { _Watchdog_Deactivate( &the_thread->Timer ); _ISR_Enable( level ); (void) _Watchdog_Remove( &the_thread->Timer ); ffc096d0: 38 7f 00 48 addi r3,r31,72 ffc096d4: 48 00 44 69 bl ffc0db3c <_Watchdog_Remove> RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); ffc096d8: 3c 80 10 03 lis r4,4099 ffc096dc: 7f e3 fb 78 mr r3,r31 ffc096e0: 60 84 ff f8 ori r4,r4,65528 ffc096e4: 48 00 29 55 bl ffc0c038 <_Thread_Clear_state> ffc096e8: 48 00 00 08 b ffc096f0 <_Event_Surrender+0x134> ffc096ec: 7c 00 01 24 mtmsr r0 } return; } } _ISR_Enable( level ); } ffc096f0: 80 01 00 14 lwz r0,20(r1) ffc096f4: 83 e1 00 0c lwz r31,12(r1) ffc096f8: 38 21 00 10 addi r1,r1,16 ffc096fc: 7c 08 03 a6 mtlr r0 ffc09700: 4e 80 00 20 blr =============================================================================== ffc09704 <_Event_Timeout>: void _Event_Timeout( Objects_Id id, void *ignored ) { ffc09704: 94 21 ff e8 stwu r1,-24(r1) ffc09708: 7c 08 02 a6 mflr r0 Thread_Control *the_thread; Objects_Locations location; ISR_Level level; the_thread = _Thread_Get( id, &location ); ffc0970c: 38 81 00 08 addi r4,r1,8 void _Event_Timeout( Objects_Id id, void *ignored ) { ffc09710: 90 01 00 1c stw r0,28(r1) Thread_Control *the_thread; Objects_Locations location; ISR_Level level; the_thread = _Thread_Get( id, &location ); ffc09714: 48 00 2e 29 bl ffc0c53c <_Thread_Get> switch ( location ) { ffc09718: 80 01 00 08 lwz r0,8(r1) ffc0971c: 2f 80 00 00 cmpwi cr7,r0,0 ffc09720: 40 9e 00 68 bne- cr7,ffc09788 <_Event_Timeout+0x84> <== NEVER TAKEN static inline uint32_t ppc_interrupt_disable( void ) { uint32_t level; uint32_t mask; asm volatile ( ffc09724: 7d 60 00 a6 mfmsr r11 ffc09728: 7d 30 42 a6 mfsprg r9,0 ffc0972c: 7d 69 48 78 andc r9,r11,r9 ffc09730: 7d 20 01 24 mtmsr r9 return; } #endif the_thread->Wait.count = 0; if ( _Thread_Is_executing( the_thread ) ) { ffc09734: 3d 20 00 00 lis r9,0 _ISR_Enable( level ); return; } #endif the_thread->Wait.count = 0; ffc09738: 90 03 00 24 stw r0,36(r3) if ( _Thread_Is_executing( the_thread ) ) { ffc0973c: 81 29 27 d0 lwz r9,10192(r9) ffc09740: 7f 83 48 00 cmpw cr7,r3,r9 ffc09744: 40 be 00 1c bne+ cr7,ffc09760 <_Event_Timeout+0x5c> if ( _Event_Sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) ffc09748: 3d 20 00 00 lis r9,0 ffc0974c: 80 09 28 04 lwz r0,10244(r9) ffc09750: 2f 80 00 01 cmpwi cr7,r0,1 ffc09754: 40 be 00 0c bne+ cr7,ffc09760 <_Event_Timeout+0x5c> _Event_Sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT; ffc09758: 38 00 00 02 li r0,2 ffc0975c: 90 09 28 04 stw r0,10244(r9) } the_thread->Wait.return_code = RTEMS_TIMEOUT; ffc09760: 38 00 00 06 li r0,6 ffc09764: 90 03 00 34 stw r0,52(r3) return level; } static inline void ppc_interrupt_enable( uint32_t level ) { asm volatile ( ffc09768: 7d 60 01 24 mtmsr r11 ffc0976c: 3c 80 10 03 lis r4,4099 ffc09770: 60 84 ff f8 ori r4,r4,65528 ffc09774: 48 00 28 c5 bl ffc0c038 <_Thread_Clear_state> */ RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void ) { RTEMS_COMPILER_MEMORY_BARRIER(); _Thread_Dispatch_disable_level -= 1; ffc09778: 3d 20 00 00 lis r9,0 ffc0977c: 81 69 27 90 lwz r11,10128(r9) ffc09780: 38 0b ff ff addi r0,r11,-1 ffc09784: 90 09 27 90 stw r0,10128(r9) case OBJECTS_REMOTE: /* impossible */ #endif case OBJECTS_ERROR: break; } } ffc09788: 80 01 00 1c lwz r0,28(r1) ffc0978c: 38 21 00 18 addi r1,r1,24 ffc09790: 7c 08 03 a6 mtlr r0 ffc09794: 4e 80 00 20 blr =============================================================================== ffc14bb4 <_Heap_Allocate_aligned_with_boundary>: Heap_Control *heap, uintptr_t alloc_size, uintptr_t alignment, uintptr_t boundary ) { ffc14bb4: 94 21 ff d8 stwu r1,-40(r1) ffc14bb8: 7c 08 02 a6 mflr r0 ffc14bbc: 7d 80 00 26 mfcr r12 ffc14bc0: 7c 89 23 78 mr r9,r4 ffc14bc4: 90 01 00 2c stw r0,44(r1) 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; ffc14bc8: 38 04 00 04 addi r0,r4,4 uintptr_t const page_size = heap->page_size; uintptr_t alloc_begin = 0; uint32_t search_count = 0; if ( block_size_floor < alloc_size ) { ffc14bcc: 7f 80 20 40 cmplw cr7,r0,r4 Heap_Control *heap, uintptr_t alloc_size, uintptr_t alignment, uintptr_t boundary ) { ffc14bd0: 93 c1 00 20 stw r30,32(r1) ffc14bd4: 7c 7e 1b 78 mr r30,r3 ffc14bd8: 93 41 00 10 stw r26,16(r1) ffc14bdc: 93 61 00 14 stw r27,20(r1) ffc14be0: 93 81 00 18 stw r28,24(r1) ffc14be4: 93 a1 00 1c stw r29,28(r1) ffc14be8: 93 e1 00 24 stw r31,36(r1) ffc14bec: 91 81 00 0c stw r12,12(r1) return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next; ffc14bf0: 80 83 00 08 lwz r4,8(r3) Heap_Statistics *const stats = &heap->stats; Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); Heap_Block *block = _Heap_Free_list_first( heap ); uintptr_t const block_size_floor = alloc_size + HEAP_BLOCK_HEADER_SIZE - HEAP_BLOCK_SIZE_OFFSET; uintptr_t const page_size = heap->page_size; ffc14bf4: 81 43 00 10 lwz r10,16(r3) uintptr_t alloc_begin = 0; uint32_t search_count = 0; if ( block_size_floor < alloc_size ) { ffc14bf8: 41 9c 01 48 blt- cr7,ffc14d40 <_Heap_Allocate_aligned_with_boundary+0x18c> /* Integer overflow occured */ return NULL; } if ( boundary != 0 ) { ffc14bfc: 2f 86 00 00 cmpwi cr7,r6,0 ffc14c00: 41 be 00 18 beq+ cr7,ffc14c18 <_Heap_Allocate_aligned_with_boundary+0x64> if ( boundary < alloc_size ) { ffc14c04: 7f 86 48 40 cmplw cr7,r6,r9 ffc14c08: 41 9c 01 38 blt- cr7,ffc14d40 <_Heap_Allocate_aligned_with_boundary+0x18c> return NULL; } if ( alignment == 0 ) { ffc14c0c: 2f 85 00 00 cmpwi cr7,r5,0 ffc14c10: 40 9e 00 08 bne- cr7,ffc14c18 <_Heap_Allocate_aligned_with_boundary+0x64> ffc14c14: 7d 45 53 78 mr r5,r10 ffc14c18: 3b a0 00 00 li r29,0 * The HEAP_PREV_BLOCK_USED flag is always set in the block size_and_flag * field. Thus the value is about one unit larger than the real block * size. The greater than operator takes this into account. */ if ( block->size_and_flag > block_size_floor ) { if ( alignment == 0 ) { ffc14c1c: 2f 05 00 00 cmpwi cr6,r5,0 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; ffc14c20: 3b 8a 00 07 addi r28,r10,7 uintptr_t alloc_end = block_end + HEAP_BLOCK_SIZE_OFFSET; uintptr_t alloc_begin = alloc_end - alloc_size; ffc14c24: 21 89 00 04 subfic r12,r9,4 } alloc_end = alloc_begin + alloc_size; /* Ensure boundary constaint */ if ( boundary != 0 ) { ffc14c28: 2f 86 00 00 cmpwi cr7,r6,0 ffc14c2c: 48 00 00 d0 b ffc14cfc <_Heap_Allocate_aligned_with_boundary+0x148> /* * 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 ) { ffc14c30: 81 64 00 04 lwz r11,4(r4) while ( block != free_list_tail ) { _HAssert( _Heap_Is_prev_used( block ) ); /* Statistics */ ++search_count; ffc14c34: 3b bd 00 01 addi r29,r29,1 /* * The HEAP_PREV_BLOCK_USED flag is always set in the block size_and_flag * field. Thus the value is about one unit larger than the real block * size. The greater than operator takes this into account. */ if ( block->size_and_flag > block_size_floor ) { ffc14c38: 7c 8b 00 40 cmplw cr1,r11,r0 ffc14c3c: 40 85 00 bc ble- cr1,ffc14cf8 <_Heap_Allocate_aligned_with_boundary+0x144> ffc14c40: 38 e4 00 08 addi r7,r4,8 if ( alignment == 0 ) { ffc14c44: 40 9a 00 0c bne- cr6,ffc14c50 <_Heap_Allocate_aligned_with_boundary+0x9c> RTEMS_INLINE_ROUTINE uintptr_t _Heap_Alloc_area_of_block( const Heap_Block *block ) { return (uintptr_t) block + HEAP_BLOCK_HEADER_SIZE; ffc14c48: 7c ff 3b 78 mr r31,r7 ffc14c4c: 48 00 00 a4 b ffc14cf0 <_Heap_Allocate_aligned_with_boundary+0x13c> uintptr_t const page_size = heap->page_size; uintptr_t const min_block_size = heap->min_block_size; uintptr_t const block_begin = (uintptr_t) block; uintptr_t const block_size = _Heap_Block_size( block ); uintptr_t const block_end = block_begin + block_size; ffc14c50: 55 6b 00 3c rlwinm r11,r11,0,0,30 uintptr_t alignment, uintptr_t boundary ) { uintptr_t const page_size = heap->page_size; uintptr_t const min_block_size = heap->min_block_size; ffc14c54: 80 7e 00 14 lwz r3,20(r30) 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; ffc14c58: 7d 64 5a 14 add r11,r4,r11 uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block ); uintptr_t const alloc_begin_ceiling = block_end - min_block_size + HEAP_BLOCK_HEADER_SIZE + page_size - 1; uintptr_t alloc_end = block_end + HEAP_BLOCK_SIZE_OFFSET; uintptr_t alloc_begin = alloc_end - alloc_size; ffc14c5c: 7f ec 5a 14 add r31,r12,r11 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); ffc14c60: 7f ff 2b 96 divwu r31,r31,r5 ffc14c64: 7f ff 29 d6 mullw r31,r31,r5 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; ffc14c68: 7d 03 e0 50 subf r8,r3,r28 ffc14c6c: 7d 68 5a 14 add r11,r8,r11 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 ) { ffc14c70: 7c 9f 58 40 cmplw cr1,r31,r11 ffc14c74: 40 85 00 0c ble- cr1,ffc14c80 <_Heap_Allocate_aligned_with_boundary+0xcc> ffc14c78: 7f eb 2b 96 divwu r31,r11,r5 ffc14c7c: 7f ff 29 d6 mullw r31,r31,r5 } alloc_end = alloc_begin + alloc_size; /* Ensure boundary constaint */ if ( boundary != 0 ) { ffc14c80: 41 9e 00 48 beq- cr7,ffc14cc8 <_Heap_Allocate_aligned_with_boundary+0x114> /* 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; ffc14c84: 7d 1f 4a 14 add r8,r31,r9 ffc14c88: 7d 68 33 96 divwu r11,r8,r6 /* Ensure boundary constaint */ if ( boundary != 0 ) { uintptr_t const boundary_floor = alloc_begin_floor + alloc_size; ffc14c8c: 7f 67 4a 14 add r27,r7,r9 ffc14c90: 7d 6b 31 d6 mullw r11,r11,r6 ffc14c94: 48 00 00 1c b ffc14cb0 <_Heap_Allocate_aligned_with_boundary+0xfc> uintptr_t boundary_line = _Heap_Align_down( alloc_end, boundary ); while ( alloc_begin < boundary_line && boundary_line < alloc_end ) { if ( boundary_line < boundary_floor ) { ffc14c98: 41 80 00 60 blt- ffc14cf8 <_Heap_Allocate_aligned_with_boundary+0x144> ffc14c9c: 7f fa 2b 96 divwu r31,r26,r5 ffc14ca0: 7f ff 29 d6 mullw r31,r31,r5 return 0; } alloc_begin = boundary_line - alloc_size; alloc_begin = _Heap_Align_down( alloc_begin, alignment ); alloc_end = alloc_begin + alloc_size; ffc14ca4: 7d 1f 4a 14 add r8,r31,r9 ffc14ca8: 7d 68 33 96 divwu r11,r8,r6 ffc14cac: 7d 6b 31 d6 mullw r11,r11,r6 /* 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 ) { ffc14cb0: 7e 1f 58 40 cmplw cr4,r31,r11 if ( boundary_line < boundary_floor ) { return 0; } alloc_begin = boundary_line - alloc_size; ffc14cb4: 7f 49 58 50 subf r26,r9,r11 /* 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 ) { ffc14cb8: 7c 8b 40 40 cmplw cr1,r11,r8 if ( boundary_line < boundary_floor ) { ffc14cbc: 7c 0b d8 40 cmplw r11,r27 /* 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 ) { ffc14cc0: 40 90 00 08 bge- cr4,ffc14cc8 <_Heap_Allocate_aligned_with_boundary+0x114> ffc14cc4: 41 84 ff d4 blt+ cr1,ffc14c98 <_Heap_Allocate_aligned_with_boundary+0xe4> 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 ) { ffc14cc8: 7c 9f 38 40 cmplw cr1,r31,r7 ffc14ccc: 41 84 00 2c blt- cr1,ffc14cf8 <_Heap_Allocate_aligned_with_boundary+0x144> 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; ffc14cd0: 7d 7f 53 96 divwu r11,r31,r10 ffc14cd4: 7d 6b 51 d6 mullw r11,r11,r10 ffc14cd8: 21 04 ff f8 subfic r8,r4,-8 ffc14cdc: 7d 68 5a 14 add r11,r8,r11 if ( free_size >= min_block_size || free_size == 0 ) { ffc14ce0: 7c 8b 18 40 cmplw cr1,r11,r3 ffc14ce4: 40 84 00 0c bge- cr1,ffc14cf0 <_Heap_Allocate_aligned_with_boundary+0x13c> ffc14ce8: 2c 8b 00 00 cmpwi cr1,r11,0 ffc14cec: 40 86 00 0c bne- cr1,ffc14cf8 <_Heap_Allocate_aligned_with_boundary+0x144> boundary ); } } if ( alloc_begin != 0 ) { ffc14cf0: 2c 9f 00 00 cmpwi cr1,r31,0 ffc14cf4: 40 86 00 18 bne- cr1,ffc14d0c <_Heap_Allocate_aligned_with_boundary+0x158><== ALWAYS TAKEN break; } block = block->next; ffc14cf8: 80 84 00 08 lwz r4,8(r4) if ( alignment == 0 ) { alignment = page_size; } } while ( block != free_list_tail ) { ffc14cfc: 7c 84 f0 00 cmpw cr1,r4,r30 ffc14d00: 40 86 ff 30 bne+ cr1,ffc14c30 <_Heap_Allocate_aligned_with_boundary+0x7c> ffc14d04: 3b e0 00 00 li r31,0 ffc14d08: 48 00 00 20 b ffc14d28 <_Heap_Allocate_aligned_with_boundary+0x174> block = block->next; } if ( alloc_begin != 0 ) { /* Statistics */ stats->searches += search_count; ffc14d0c: 80 1e 00 4c lwz r0,76(r30) block = _Heap_Block_allocate( heap, block, alloc_begin, alloc_size ); ffc14d10: 7d 26 4b 78 mr r6,r9 ffc14d14: 7f c3 f3 78 mr r3,r30 block = block->next; } if ( alloc_begin != 0 ) { /* Statistics */ stats->searches += search_count; ffc14d18: 7c 00 ea 14 add r0,r0,r29 ffc14d1c: 90 1e 00 4c stw r0,76(r30) block = _Heap_Block_allocate( heap, block, alloc_begin, alloc_size ); ffc14d20: 7f e5 fb 78 mr r5,r31 ffc14d24: 4b ff 64 91 bl ffc0b1b4 <_Heap_Block_allocate> uintptr_t alloc_size, uintptr_t alignment, uintptr_t boundary ) { Heap_Statistics *const stats = &heap->stats; ffc14d28: 80 1e 00 44 lwz r0,68(r30) ffc14d2c: 7f 80 e8 40 cmplw cr7,r0,r29 ffc14d30: 40 9c 00 08 bge- cr7,ffc14d38 <_Heap_Allocate_aligned_with_boundary+0x184> ); } /* Statistics */ if ( stats->max_search < search_count ) { stats->max_search = search_count; ffc14d34: 93 be 00 44 stw r29,68(r30) } return (void *) alloc_begin; ffc14d38: 7f e3 fb 78 mr r3,r31 ffc14d3c: 48 00 00 08 b ffc14d44 <_Heap_Allocate_aligned_with_boundary+0x190> ffc14d40: 38 60 00 00 li r3,0 } ffc14d44: 80 01 00 2c lwz r0,44(r1) ffc14d48: 81 81 00 0c lwz r12,12(r1) ffc14d4c: 7c 08 03 a6 mtlr r0 ffc14d50: 83 41 00 10 lwz r26,16(r1) ffc14d54: 83 61 00 14 lwz r27,20(r1) ffc14d58: 7d 80 81 20 mtcrf 8,r12 ffc14d5c: 83 81 00 18 lwz r28,24(r1) ffc14d60: 83 a1 00 1c lwz r29,28(r1) ffc14d64: 83 c1 00 20 lwz r30,32(r1) ffc14d68: 83 e1 00 24 lwz r31,36(r1) ffc14d6c: 38 21 00 28 addi r1,r1,40 ffc14d70: 4e 80 00 20 blr =============================================================================== ffc13560 <_Heap_Extend>: Heap_Control *heap, void *area_begin_ptr, uintptr_t area_size, uintptr_t *amount_extended ) { ffc13560: 7c 08 02 a6 mflr r0 ffc13564: 94 21 ff f8 stwu r1,-8(r1) ffc13568: 7c 69 1b 78 mr r9,r3 ffc1356c: 90 01 00 0c stw r0,12(r1) 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; ffc13570: 80 03 00 18 lwz r0,24(r3) uintptr_t const heap_area_end = heap->area_end; uintptr_t const new_heap_area_end = heap_area_end + area_size; uintptr_t extend_size = 0; Heap_Block *const last_block = heap->last_block; ffc13574: 81 43 00 24 lwz r10,36(r3) 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; ffc13578: 7f 84 00 40 cmplw cr7,r4,r0 uintptr_t const heap_area_end = heap->area_end; ffc1357c: 80 03 00 1c lwz r0,28(r3) 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; ffc13580: 41 bc 00 10 blt+ cr7,ffc13590 <_Heap_Extend+0x30> * 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 ) { ffc13584: 7f 84 00 40 cmplw cr7,r4,r0 ffc13588: 38 60 00 01 li r3,1 ffc1358c: 41 9c 00 9c blt- cr7,ffc13628 <_Heap_Extend+0xc8> return HEAP_EXTEND_ERROR; /* case 3 */ } else if ( area_begin != heap_area_end ) { ffc13590: 7f 84 00 00 cmpw cr7,r4,r0 ffc13594: 38 60 00 02 li r3,2 ffc13598: 40 be 00 90 bne+ cr7,ffc13628 <_Heap_Extend+0xc8> RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); ffc1359c: 81 69 00 10 lwz r11,16(r9) { 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; ffc135a0: 7c 84 2a 14 add r4,r4,r5 * block and free it. */ heap->area_end = new_heap_area_end; extend_size = new_heap_area_end ffc135a4: 20 0a ff f8 subfic r0,r10,-8 * 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; ffc135a8: 90 89 00 1c stw r4,28(r9) extend_size = new_heap_area_end ffc135ac: 7c 00 22 14 add r0,r0,r4 ffc135b0: 7c 00 5b 96 divwu r0,r0,r11 ffc135b4: 7c 00 59 d6 mullw r0,r0,r11 - (uintptr_t) last_block - HEAP_BLOCK_HEADER_SIZE; extend_size = _Heap_Align_down( extend_size, heap->page_size ); *amount_extended = extend_size; if( extend_size >= heap->min_block_size ) { ffc135b8: 38 60 00 00 li r3,0 extend_size = new_heap_area_end - (uintptr_t) last_block - HEAP_BLOCK_HEADER_SIZE; extend_size = _Heap_Align_down( extend_size, heap->page_size ); *amount_extended = extend_size; ffc135bc: 90 06 00 00 stw r0,0(r6) if( extend_size >= heap->min_block_size ) { ffc135c0: 81 69 00 14 lwz r11,20(r9) ffc135c4: 7f 80 58 40 cmplw cr7,r0,r11 ffc135c8: 41 bc 00 60 blt+ cr7,ffc13628 <_Heap_Extend+0xc8> <== NEVER TAKEN uintptr_t size ) { uintptr_t flag = block->size_and_flag & HEAP_PREV_BLOCK_USED; block->size_and_flag = size | flag; ffc135cc: 80 ea 00 04 lwz r7,4(r10) RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); ffc135d0: 7d 60 52 14 add r11,r0,r10 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 = ffc135d4: 81 09 00 20 lwz r8,32(r9) /* Statistics */ stats->size += extend_size; ++stats->used_blocks; --stats->frees; /* Do not count subsequent call as actual free() */ _Heap_Free( heap, (void *) _Heap_Alloc_area_of_block( last_block )); ffc135d8: 38 8a 00 08 addi r4,r10,8 uintptr_t size ) { uintptr_t flag = block->size_and_flag & HEAP_PREV_BLOCK_USED; block->size_and_flag = size | flag; ffc135dc: 54 e7 07 fe clrlwi r7,r7,31 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; ffc135e0: 91 69 00 24 stw r11,36(r9) if( extend_size >= heap->min_block_size ) { 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 = ffc135e4: 7d 0b 40 50 subf r8,r11,r8 ffc135e8: 7c 07 3b 78 or r7,r0,r7 ffc135ec: 61 08 00 01 ori r8,r8,1 ffc135f0: 90 ea 00 04 stw r7,4(r10) /* Statistics */ stats->size += extend_size; ++stats->used_blocks; --stats->frees; /* Do not count subsequent call as actual free() */ _Heap_Free( heap, (void *) _Heap_Alloc_area_of_block( last_block )); ffc135f4: 7d 23 4b 78 mr r3,r9 if( extend_size >= heap->min_block_size ) { 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 = ffc135f8: 91 0b 00 04 stw r8,4(r11) | HEAP_PREV_BLOCK_USED; heap->last_block = new_last_block; /* Statistics */ stats->size += extend_size; ffc135fc: 80 e9 00 2c lwz r7,44(r9) ++stats->used_blocks; ffc13600: 81 09 00 40 lwz r8,64(r9) --stats->frees; /* Do not count subsequent call as actual free() */ ffc13604: 81 49 00 50 lwz r10,80(r9) | HEAP_PREV_BLOCK_USED; heap->last_block = new_last_block; /* Statistics */ stats->size += extend_size; ffc13608: 7c 07 02 14 add r0,r7,r0 ++stats->used_blocks; ffc1360c: 39 08 00 01 addi r8,r8,1 | HEAP_PREV_BLOCK_USED; heap->last_block = new_last_block; /* Statistics */ stats->size += extend_size; ffc13610: 90 09 00 2c stw r0,44(r9) ++stats->used_blocks; --stats->frees; /* Do not count subsequent call as actual free() */ ffc13614: 39 4a ff ff addi r10,r10,-1 heap->last_block = new_last_block; /* Statistics */ stats->size += extend_size; ++stats->used_blocks; ffc13618: 91 09 00 40 stw r8,64(r9) --stats->frees; /* Do not count subsequent call as actual free() */ ffc1361c: 91 49 00 50 stw r10,80(r9) _Heap_Free( heap, (void *) _Heap_Alloc_area_of_block( last_block )); ffc13620: 4b ff 99 75 bl ffc0cf94 <_Heap_Free> ffc13624: 38 60 00 00 li r3,0 } return HEAP_EXTEND_SUCCESSFUL; } ffc13628: 80 01 00 0c lwz r0,12(r1) ffc1362c: 38 21 00 08 addi r1,r1,8 ffc13630: 7c 08 03 a6 mtlr r0 ffc13634: 4e 80 00 20 blr =============================================================================== ffc14d74 <_Heap_Free>: 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 ) ffc14d74: 81 63 00 10 lwz r11,16(r3) #include #include #include bool _Heap_Free( Heap_Control *heap, void *alloc_begin_ptr ) { ffc14d78: 7c 69 1b 78 mr r9,r3 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; ffc14d7c: 80 03 00 20 lwz r0,32(r3) 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 ffc14d80: 39 40 00 00 li r10,0 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 ) ffc14d84: 7c 84 5b 96 divwu r4,r4,r11 ffc14d88: 7d 64 59 d6 mullw r11,r4,r11 ffc14d8c: 39 6b ff f8 addi r11,r11,-8 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 ffc14d90: 7f 8b 00 40 cmplw cr7,r11,r0 ffc14d94: 41 9c 00 14 blt- cr7,ffc14da8 <_Heap_Free+0x34> ffc14d98: 81 43 00 24 lwz r10,36(r3) ffc14d9c: 7d 4b 50 10 subfc r10,r11,r10 ffc14da0: 39 40 00 00 li r10,0 ffc14da4: 7d 4a 51 14 adde r10,r10,r10 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 ) ) { ffc14da8: 2f 8a 00 00 cmpwi cr7,r10,0 ffc14dac: 41 9e 01 a8 beq- cr7,ffc14f54 <_Heap_Free+0x1e0> - 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; ffc14db0: 80 ab 00 04 lwz r5,4(r11) 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 ffc14db4: 38 e0 00 00 li r7,0 - 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; ffc14db8: 54 a8 00 3c rlwinm r8,r5,0,0,30 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); ffc14dbc: 7d 4b 42 14 add r10,r11,r8 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 ffc14dc0: 7f 8a 00 40 cmplw cr7,r10,r0 ffc14dc4: 41 9c 00 14 blt- cr7,ffc14dd8 <_Heap_Free+0x64> <== NEVER TAKEN ffc14dc8: 80 e9 00 24 lwz r7,36(r9) ffc14dcc: 7c ea 38 10 subfc r7,r10,r7 ffc14dd0: 38 e0 00 00 li r7,0 ffc14dd4: 7c e7 39 14 adde r7,r7,r7 } block_size = _Heap_Block_size( block ); next_block = _Heap_Block_at( block, block_size ); if ( !_Heap_Is_block_in_heap( heap, next_block ) ) { ffc14dd8: 2f 87 00 00 cmpwi cr7,r7,0 ffc14ddc: 41 9e 01 78 beq- cr7,ffc14f54 <_Heap_Free+0x1e0> <== NEVER TAKEN block->size_and_flag = size | flag; } RTEMS_INLINE_ROUTINE bool _Heap_Is_prev_used( const Heap_Block *block ) { return block->size_and_flag & HEAP_PREV_BLOCK_USED; ffc14de0: 80 ca 00 04 lwz r6,4(r10) _HAssert( false ); return false; } if ( !_Heap_Is_prev_used( next_block ) ) { ffc14de4: 70 c3 00 01 andi. r3,r6,1 ffc14de8: 41 82 01 6c beq- ffc14f54 <_Heap_Free+0x1e0> <== NEVER TAKEN 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 )); ffc14dec: 81 89 00 24 lwz r12,36(r9) - 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; ffc14df0: 54 c6 00 3c rlwinm r6,r6,0,0,30 _HAssert( false ); return false; } next_block_size = _Heap_Block_size( next_block ); next_is_free = next_block != heap->last_block ffc14df4: 38 80 00 00 li r4,0 ffc14df8: 7f 8a 60 00 cmpw cr7,r10,r12 ffc14dfc: 41 9e 00 14 beq- cr7,ffc14e10 <_Heap_Free+0x9c> ffc14e00: 7c ea 32 14 add r7,r10,r6 ffc14e04: 80 87 00 04 lwz r4,4(r7) ffc14e08: 54 84 07 fe clrlwi r4,r4,31 ffc14e0c: 68 84 00 01 xori r4,r4,1 && !_Heap_Is_prev_used( _Heap_Block_at( next_block, next_block_size )); if ( !_Heap_Is_prev_used( block ) ) { ffc14e10: 70 a7 00 01 andi. r7,r5,1 _HAssert( false ); return false; } next_block_size = _Heap_Block_size( next_block ); next_is_free = next_block != heap->last_block ffc14e14: 54 84 06 3e clrlwi r4,r4,24 && !_Heap_Is_prev_used( _Heap_Block_at( next_block, next_block_size )); if ( !_Heap_Is_prev_used( block ) ) { ffc14e18: 40 82 00 94 bne- ffc14eac <_Heap_Free+0x138> uintptr_t const prev_size = block->prev_size; ffc14e1c: 80 ab 00 00 lwz r5,0(r11) 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 ffc14e20: 38 60 00 00 li r3,0 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); ffc14e24: 7c e5 58 50 subf r7,r5,r11 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 ffc14e28: 7f 87 00 40 cmplw cr7,r7,r0 ffc14e2c: 41 9c 00 10 blt- cr7,ffc14e3c <_Heap_Free+0xc8> <== NEVER TAKEN ffc14e30: 7c 67 60 10 subfc r3,r7,r12 ffc14e34: 38 60 00 00 li r3,0 ffc14e38: 7c 63 19 14 adde r3,r3,r3 Heap_Block * const prev_block = _Heap_Block_at( block, -prev_size ); if ( !_Heap_Is_block_in_heap( heap, prev_block ) ) { ffc14e3c: 2f 83 00 00 cmpwi cr7,r3,0 ffc14e40: 41 9e 01 14 beq- cr7,ffc14f54 <_Heap_Free+0x1e0> <== NEVER TAKEN 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) ) { ffc14e44: 80 07 00 04 lwz r0,4(r7) ffc14e48: 70 03 00 01 andi. r3,r0,1 ffc14e4c: 41 82 01 08 beq- ffc14f54 <_Heap_Free+0x1e0> <== NEVER TAKEN _HAssert( false ); return( false ); } if ( next_is_free ) { /* coalesce both */ ffc14e50: 2f 84 00 00 cmpwi cr7,r4,0 ffc14e54: 41 9e 00 38 beq- cr7,ffc14e8c <_Heap_Free+0x118> uintptr_t const size = block_size + prev_size + next_block_size; _Heap_Free_list_remove( next_block ); stats->free_blocks -= 1; ffc14e58: 80 89 00 38 lwz r4,56(r9) _HAssert( false ); return( false ); } if ( next_is_free ) { /* coalesce both */ uintptr_t const size = block_size + prev_size + next_block_size; ffc14e5c: 7c c8 32 14 add r6,r8,r6 ffc14e60: 7c a6 2a 14 add r5,r6,r5 } RTEMS_INLINE_ROUTINE void _Heap_Free_list_remove( Heap_Block *block ) { Heap_Block *next = block->next; Heap_Block *prev = block->prev; ffc14e64: 81 6a 00 0c lwz r11,12(r10) return _Heap_Free_list_tail(heap)->prev; } RTEMS_INLINE_ROUTINE void _Heap_Free_list_remove( Heap_Block *block ) { Heap_Block *next = block->next; ffc14e68: 81 4a 00 08 lwz r10,8(r10) _Heap_Free_list_remove( next_block ); stats->free_blocks -= 1; ffc14e6c: 38 c4 ff ff addi r6,r4,-1 prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; ffc14e70: 60 a0 00 01 ori r0,r5,1 } 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; ffc14e74: 90 c9 00 38 stw r6,56(r9) Heap_Block *prev = block->prev; prev->next = next; next->prev = prev; ffc14e78: 91 6a 00 0c stw r11,12(r10) 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; ffc14e7c: 7c a7 29 2e stwx r5,r7,r5 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; ffc14e80: 90 07 00 04 stw r0,4(r7) RTEMS_INLINE_ROUTINE void _Heap_Free_list_remove( Heap_Block *block ) { Heap_Block *next = block->next; Heap_Block *prev = block->prev; prev->next = next; ffc14e84: 91 4b 00 08 stw r10,8(r11) ffc14e88: 48 00 00 a0 b ffc14f28 <_Heap_Free+0x1b4> 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; ffc14e8c: 7c a8 2a 14 add r5,r8,r5 prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; ffc14e90: 60 a0 00 01 ori r0,r5,1 next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; next_block->prev_size = size; ffc14e94: 7c ab 41 2e stwx r5,r11,r8 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; ffc14e98: 90 07 00 04 stw r0,4(r7) next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; ffc14e9c: 80 0a 00 04 lwz r0,4(r10) ffc14ea0: 54 00 00 3c rlwinm r0,r0,0,0,30 ffc14ea4: 90 0a 00 04 stw r0,4(r10) ffc14ea8: 48 00 00 80 b ffc14f28 <_Heap_Free+0x1b4> next_block->prev_size = size; } } else if ( next_is_free ) { /* coalesce next */ ffc14eac: 2f 84 00 00 cmpwi cr7,r4,0 ffc14eb0: 41 9e 00 30 beq- cr7,ffc14ee0 <_Heap_Free+0x16c> Heap_Block *old_block, Heap_Block *new_block ) { Heap_Block *next = old_block->next; Heap_Block *prev = old_block->prev; ffc14eb4: 80 aa 00 0c lwz r5,12(r10) uintptr_t const size = block_size + next_block_size; ffc14eb8: 7c e6 42 14 add r7,r6,r8 RTEMS_INLINE_ROUTINE void _Heap_Free_list_replace( Heap_Block *old_block, Heap_Block *new_block ) { Heap_Block *next = old_block->next; ffc14ebc: 81 4a 00 08 lwz r10,8(r10) _Heap_Free_list_replace( next_block, block ); block->size_and_flag = size | HEAP_PREV_BLOCK_USED; ffc14ec0: 60 e0 00 01 ori r0,r7,1 Heap_Block *prev = old_block->prev; new_block->next = next; new_block->prev = prev; ffc14ec4: 90 ab 00 0c stw r5,12(r11) ) { Heap_Block *next = old_block->next; Heap_Block *prev = old_block->prev; new_block->next = next; ffc14ec8: 91 4b 00 08 stw r10,8(r11) next_block = _Heap_Block_at( block, size ); next_block->prev_size = size; ffc14ecc: 7c eb 39 2e stwx r7,r11,r7 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; ffc14ed0: 90 0b 00 04 stw r0,4(r11) new_block->prev = prev; next->prev = new_block; prev->next = new_block; ffc14ed4: 91 65 00 08 stw r11,8(r5) Heap_Block *prev = old_block->prev; new_block->next = next; new_block->prev = prev; next->prev = new_block; ffc14ed8: 91 6a 00 0c stw r11,12(r10) ffc14edc: 48 00 00 4c b ffc14f28 <_Heap_Free+0x1b4> 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; ffc14ee0: 61 00 00 01 ori r0,r8,1 next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; next_block->prev_size = block_size; ffc14ee4: 7d 0b 41 2e stwx r8,r11,r8 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; ffc14ee8: 90 0b 00 04 stw r0,4(r11) next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; ffc14eec: 80 0a 00 04 lwz r0,4(r10) ) { Heap_Block *next = block_before->next; new_block->next = next; new_block->prev = block_before; ffc14ef0: 91 2b 00 0c stw r9,12(r11) ffc14ef4: 54 00 00 3c rlwinm r0,r0,0,0,30 ffc14ef8: 90 0a 00 04 stw r0,4(r10) next_block->prev_size = block_size; /* Statistics */ ++stats->free_blocks; ffc14efc: 80 e9 00 38 lwz r7,56(r9) #include #include bool _Heap_Free( Heap_Control *heap, void *alloc_begin_ptr ) { Heap_Statistics *const stats = &heap->stats; ffc14f00: 81 49 00 3c lwz r10,60(r9) 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; ffc14f04: 38 07 00 01 addi r0,r7,1 #include #include bool _Heap_Free( Heap_Control *heap, void *alloc_begin_ptr ) { Heap_Statistics *const stats = &heap->stats; ffc14f08: 7f 8a 00 40 cmplw cr7,r10,r0 RTEMS_INLINE_ROUTINE void _Heap_Free_list_insert_after( Heap_Block *block_before, Heap_Block *new_block ) { Heap_Block *next = block_before->next; ffc14f0c: 81 49 00 08 lwz r10,8(r9) 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; ffc14f10: 90 09 00 38 stw r0,56(r9) new_block->next = next; ffc14f14: 91 4b 00 08 stw r10,8(r11) new_block->prev = block_before; block_before->next = new_block; next->prev = new_block; ffc14f18: 91 6a 00 0c stw r11,12(r10) { Heap_Block *next = block_before->next; new_block->next = next; new_block->prev = block_before; block_before->next = new_block; ffc14f1c: 91 69 00 08 stw r11,8(r9) #include #include bool _Heap_Free( Heap_Control *heap, void *alloc_begin_ptr ) { Heap_Statistics *const stats = &heap->stats; ffc14f20: 40 9c 00 08 bge- cr7,ffc14f28 <_Heap_Free+0x1b4> 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; ffc14f24: 90 09 00 3c stw r0,60(r9) } /* Statistics */ --stats->used_blocks; ++stats->frees; stats->free_size += block_size; ffc14f28: 80 09 00 30 lwz r0,48(r9) ffc14f2c: 38 60 00 01 li r3,1 stats->max_free_blocks = stats->free_blocks; } } /* Statistics */ --stats->used_blocks; ffc14f30: 81 69 00 40 lwz r11,64(r9) ++stats->frees; ffc14f34: 81 49 00 50 lwz r10,80(r9) stats->free_size += block_size; ffc14f38: 7d 00 42 14 add r8,r0,r8 stats->max_free_blocks = stats->free_blocks; } } /* Statistics */ --stats->used_blocks; ffc14f3c: 39 6b ff ff addi r11,r11,-1 ++stats->frees; stats->free_size += block_size; ffc14f40: 91 09 00 30 stw r8,48(r9) } } /* Statistics */ --stats->used_blocks; ++stats->frees; ffc14f44: 38 0a 00 01 addi r0,r10,1 stats->max_free_blocks = stats->free_blocks; } } /* Statistics */ --stats->used_blocks; ffc14f48: 91 69 00 40 stw r11,64(r9) ++stats->frees; ffc14f4c: 90 09 00 50 stw r0,80(r9) stats->free_size += block_size; return( true ); ffc14f50: 4e 80 00 20 blr ffc14f54: 38 60 00 00 li r3,0 } ffc14f58: 4e 80 00 20 blr =============================================================================== ffc150b4 <_Heap_Size_of_alloc_area>: 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 ) ffc150b4: 80 03 00 10 lwz r0,16(r3) 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; ffc150b8: 81 23 00 20 lwz r9,32(r3) 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 ) ffc150bc: 7d 64 03 96 divwu r11,r4,r0 ffc150c0: 7d 6b 01 d6 mullw r11,r11,r0 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 ffc150c4: 38 00 00 00 li r0,0 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 ) ffc150c8: 39 6b ff f8 addi r11,r11,-8 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 ffc150cc: 7f 8b 48 40 cmplw cr7,r11,r9 ffc150d0: 41 9c 00 14 blt- cr7,ffc150e4 <_Heap_Size_of_alloc_area+0x30><== NEVER TAKEN ffc150d4: 80 03 00 24 lwz r0,36(r3) ffc150d8: 7c 0b 00 10 subfc r0,r11,r0 ffc150dc: 38 00 00 00 li r0,0 ffc150e0: 7c 00 01 14 adde r0,r0,r0 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 ) ) { ffc150e4: 2f 80 00 00 cmpwi cr7,r0,0 ffc150e8: 41 9e 00 54 beq- cr7,ffc1513c <_Heap_Size_of_alloc_area+0x88> RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); ffc150ec: 80 0b 00 04 lwz r0,4(r11) 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 ffc150f0: 39 40 00 00 li r10,0 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); ffc150f4: 54 00 00 3c rlwinm r0,r0,0,0,30 ffc150f8: 7d 6b 02 14 add r11,r11,r0 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 ffc150fc: 7f 8b 48 40 cmplw cr7,r11,r9 ffc15100: 41 9c 00 14 blt- cr7,ffc15114 <_Heap_Size_of_alloc_area+0x60><== NEVER TAKEN ffc15104: 81 43 00 24 lwz r10,36(r3) ffc15108: 7d 4b 50 10 subfc r10,r11,r10 ffc1510c: 39 40 00 00 li r10,0 ffc15110: 7d 4a 51 14 adde r10,r10,r10 } block_size = _Heap_Block_size( block ); next_block = _Heap_Block_at( block, block_size ); if ( ffc15114: 2f 8a 00 00 cmpwi cr7,r10,0 ffc15118: 41 9e 00 24 beq- cr7,ffc1513c <_Heap_Size_of_alloc_area+0x88><== NEVER TAKEN ffc1511c: 80 0b 00 04 lwz r0,4(r11) ffc15120: 70 09 00 01 andi. r9,r0,1 ffc15124: 41 82 00 18 beq- ffc1513c <_Heap_Size_of_alloc_area+0x88><== NEVER TAKEN || !_Heap_Is_prev_used( next_block ) ) { return false; } *alloc_size = (uintptr_t) next_block + HEAP_BLOCK_SIZE_OFFSET - alloc_begin; ffc15128: 20 84 00 04 subfic r4,r4,4 ffc1512c: 7d 64 5a 14 add r11,r4,r11 ffc15130: 91 65 00 00 stw r11,0(r5) ffc15134: 38 60 00 01 li r3,1 return true; ffc15138: 4e 80 00 20 blr ffc1513c: 38 60 00 00 li r3,0 } ffc15140: 4e 80 00 20 blr =============================================================================== ffc0a0a0 <_Heap_Walk>: 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; ffc0a0a0: 2f 85 00 00 cmpwi cr7,r5,0 bool _Heap_Walk( Heap_Control *heap, int source, bool dump ) { ffc0a0a4: 94 21 ff 98 stwu r1,-104(r1) ffc0a0a8: 7c 08 02 a6 mflr r0 ffc0a0ac: 93 21 00 4c stw r25,76(r1) ffc0a0b0: 90 01 00 6c stw r0,108(r1) ffc0a0b4: 93 61 00 54 stw r27,84(r1) ffc0a0b8: 93 81 00 58 stw r28,88(r1) ffc0a0bc: 93 a1 00 5c stw r29,92(r1) ffc0a0c0: 7c 7d 1b 78 mr r29,r3 ffc0a0c4: 93 c1 00 60 stw r30,96(r1) ffc0a0c8: 7c 9e 23 78 mr r30,r4 ffc0a0cc: 93 e1 00 64 stw r31,100(r1) ffc0a0d0: 91 c1 00 20 stw r14,32(r1) ffc0a0d4: 91 e1 00 24 stw r15,36(r1) ffc0a0d8: 92 01 00 28 stw r16,40(r1) ffc0a0dc: 92 21 00 2c stw r17,44(r1) ffc0a0e0: 92 41 00 30 stw r18,48(r1) ffc0a0e4: 92 61 00 34 stw r19,52(r1) ffc0a0e8: 92 81 00 38 stw r20,56(r1) ffc0a0ec: 92 a1 00 3c stw r21,60(r1) ffc0a0f0: 92 c1 00 40 stw r22,64(r1) ffc0a0f4: 92 e1 00 44 stw r23,68(r1) ffc0a0f8: 93 01 00 48 stw r24,72(r1) ffc0a0fc: 93 41 00 50 stw r26,80(r1) uintptr_t const page_size = heap->page_size; ffc0a100: 83 83 00 10 lwz r28,16(r3) uintptr_t const min_block_size = heap->min_block_size; ffc0a104: 83 63 00 14 lwz r27,20(r3) Heap_Block *const last_block = heap->last_block; ffc0a108: 83 23 00 24 lwz r25,36(r3) Heap_Block *block = heap->first_block; ffc0a10c: 83 e3 00 20 lwz r31,32(r3) Heap_Walk_printer printer = dump ? _Heap_Walk_print : _Heap_Walk_print_nothing; ffc0a110: 40 9e 00 10 bne- cr7,ffc0a120 <_Heap_Walk+0x80> ffc0a114: 3d 20 ff c1 lis r9,-63 ffc0a118: 39 29 a0 9c addi r9,r9,-24420 ffc0a11c: 48 00 00 0c b ffc0a128 <_Heap_Walk+0x88> ffc0a120: 3d 20 ff c1 lis r9,-63 ffc0a124: 39 29 a6 38 addi r9,r9,-22984 ffc0a128: 91 21 00 18 stw r9,24(r1) if ( !_System_state_Is_up( _System_state_Get() ) ) { ffc0a12c: 3d 20 00 00 lis r9,0 ffc0a130: 80 09 27 d4 lwz r0,10196(r9) ffc0a134: 2f 80 00 03 cmpwi cr7,r0,3 ffc0a138: 40 be 04 94 bne+ cr7,ffc0a5cc <_Heap_Walk+0x52c> 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)( ffc0a13c: 80 1d 00 0c lwz r0,12(r29) ffc0a140: 3c a0 ff c2 lis r5,-62 ffc0a144: 81 1d 00 18 lwz r8,24(r29) ffc0a148: 38 a5 f3 50 addi r5,r5,-3248 ffc0a14c: 81 3d 00 1c lwz r9,28(r29) ffc0a150: 7f c3 f3 78 mr r3,r30 ffc0a154: 81 7d 00 08 lwz r11,8(r29) ffc0a158: 38 80 00 00 li r4,0 ffc0a15c: 90 01 00 10 stw r0,16(r1) ffc0a160: 7f 86 e3 78 mr r6,r28 ffc0a164: 7f 67 db 78 mr r7,r27 ffc0a168: 80 01 00 18 lwz r0,24(r1) ffc0a16c: 7f ea fb 78 mr r10,r31 ffc0a170: 91 61 00 0c stw r11,12(r1) ffc0a174: 7c 09 03 a6 mtctr r0 ffc0a178: 93 21 00 08 stw r25,8(r1) ffc0a17c: 4c c6 31 82 crclr 4*cr1+eq ffc0a180: 4e 80 04 21 bctrl heap->area_begin, heap->area_end, first_block, last_block, first_free_block, last_free_block ); if ( page_size == 0 ) { ffc0a184: 2f 9c 00 00 cmpwi cr7,r28,0 ffc0a188: 40 be 00 14 bne+ cr7,ffc0a19c <_Heap_Walk+0xfc> (*printer)( source, true, "page size is zero\n" ); ffc0a18c: 3c a0 ff c2 lis r5,-62 ffc0a190: 7f c3 f3 78 mr r3,r30 ffc0a194: 38 a5 f3 e1 addi r5,r5,-3103 ffc0a198: 48 00 00 c8 b ffc0a260 <_Heap_Walk+0x1c0> return false; } if ( !_Addresses_Is_aligned( (void *) page_size ) ) { ffc0a19c: 73 89 00 07 andi. r9,r28,7 ffc0a1a0: 41 a2 00 18 beq+ ffc0a1b8 <_Heap_Walk+0x118> (*printer)( ffc0a1a4: 3c a0 ff c2 lis r5,-62 ffc0a1a8: 7f c3 f3 78 mr r3,r30 ffc0a1ac: 38 a5 f3 f4 addi r5,r5,-3084 ffc0a1b0: 7f 86 e3 78 mr r6,r28 ffc0a1b4: 48 00 03 8c b ffc0a540 <_Heap_Walk+0x4a0> ); return false; } if ( !_Heap_Is_aligned( min_block_size, page_size ) ) { ffc0a1b8: 7c 1b e3 96 divwu r0,r27,r28 ffc0a1bc: 7c 00 e1 d6 mullw r0,r0,r28 ffc0a1c0: 7f 9b 00 00 cmpw cr7,r27,r0 ffc0a1c4: 41 be 00 18 beq+ cr7,ffc0a1dc <_Heap_Walk+0x13c> (*printer)( ffc0a1c8: 3c a0 ff c2 lis r5,-62 ffc0a1cc: 7f c3 f3 78 mr r3,r30 ffc0a1d0: 38 a5 f4 12 addi r5,r5,-3054 ffc0a1d4: 7f 66 db 78 mr r6,r27 ffc0a1d8: 48 00 03 68 b ffc0a540 <_Heap_Walk+0x4a0> ); return false; } if ( ffc0a1dc: 38 1f 00 08 addi r0,r31,8 ffc0a1e0: 7d 20 e3 96 divwu r9,r0,r28 ffc0a1e4: 7d 29 e1 d6 mullw r9,r9,r28 ffc0a1e8: 7f 80 48 00 cmpw cr7,r0,r9 ffc0a1ec: 41 be 00 14 beq+ cr7,ffc0a200 <_Heap_Walk+0x160> !_Heap_Is_aligned( _Heap_Alloc_area_of_block( first_block ), page_size ) ) { (*printer)( ffc0a1f0: 3c a0 ff c2 lis r5,-62 ffc0a1f4: 7f c3 f3 78 mr r3,r30 ffc0a1f8: 38 a5 f4 36 addi r5,r5,-3018 ffc0a1fc: 48 00 03 40 b ffc0a53c <_Heap_Walk+0x49c> ); return false; } if ( !_Heap_Is_prev_used( first_block ) ) { ffc0a200: 80 1f 00 04 lwz r0,4(r31) ffc0a204: 70 09 00 01 andi. r9,r0,1 ffc0a208: 40 a2 00 14 bne+ ffc0a21c <_Heap_Walk+0x17c> (*printer)( ffc0a20c: 3c a0 ff c2 lis r5,-62 ffc0a210: 7f c3 f3 78 mr r3,r30 ffc0a214: 38 a5 f4 67 addi r5,r5,-2969 ffc0a218: 48 00 00 48 b ffc0a260 <_Heap_Walk+0x1c0> ); return false; } if ( first_block->prev_size != page_size ) { ffc0a21c: 83 5f 00 00 lwz r26,0(r31) ffc0a220: 7f 9a e0 00 cmpw cr7,r26,r28 ffc0a224: 41 be 00 18 beq+ cr7,ffc0a23c <_Heap_Walk+0x19c> (*printer)( ffc0a228: 3c a0 ff c2 lis r5,-62 ffc0a22c: 7f c3 f3 78 mr r3,r30 ffc0a230: 38 a5 f4 95 addi r5,r5,-2923 ffc0a234: 7f 46 d3 78 mr r6,r26 ffc0a238: 48 00 02 18 b ffc0a450 <_Heap_Walk+0x3b0> ); return false; } if ( _Heap_Is_free( last_block ) ) { ffc0a23c: 81 39 00 04 lwz r9,4(r25) ffc0a240: 55 29 00 3c rlwinm r9,r9,0,0,30 ffc0a244: 7d 39 4a 14 add r9,r25,r9 ffc0a248: 80 09 00 04 lwz r0,4(r9) ffc0a24c: 70 09 00 01 andi. r9,r0,1 ffc0a250: 40 a2 00 28 bne+ ffc0a278 <_Heap_Walk+0x1d8> (*printer)( ffc0a254: 3c a0 ff c2 lis r5,-62 ffc0a258: 7f c3 f3 78 mr r3,r30 ffc0a25c: 38 a5 f4 c0 addi r5,r5,-2880 ffc0a260: 80 01 00 18 lwz r0,24(r1) ffc0a264: 38 80 00 01 li r4,1 ffc0a268: 7c 09 03 a6 mtctr r0 ffc0a26c: 4c c6 31 82 crclr 4*cr1+eq ffc0a270: 4e 80 04 21 bctrl ffc0a274: 48 00 02 e0 b ffc0a554 <_Heap_Walk+0x4b4> int source, Heap_Walk_printer printer, Heap_Control *heap ) { uintptr_t const page_size = heap->page_size; ffc0a278: 81 3d 00 10 lwz r9,16(r29) return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next; ffc0a27c: 7f a0 eb 78 mr r0,r29 ffc0a280: 80 dd 00 08 lwz r6,8(r29) ffc0a284: 48 00 00 a4 b ffc0a328 <_Heap_Walk+0x288> 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 ffc0a288: 81 1d 00 20 lwz r8,32(r29) ffc0a28c: 7f 88 30 40 cmplw cr7,r8,r6 ffc0a290: 41 9d 00 14 bgt- cr7,ffc0a2a4 <_Heap_Walk+0x204> ffc0a294: 81 7d 00 24 lwz r11,36(r29) ffc0a298: 7d 66 58 10 subfc r11,r6,r11 ffc0a29c: 39 60 00 00 li r11,0 ffc0a2a0: 7d 6b 59 14 adde r11,r11,r11 const Heap_Block *const first_free_block = _Heap_Free_list_first( heap ); const Heap_Block *prev_block = free_list_tail; const Heap_Block *free_block = first_free_block; while ( free_block != free_list_tail ) { if ( !_Heap_Is_block_in_heap( heap, free_block ) ) { ffc0a2a4: 2f 8b 00 00 cmpwi cr7,r11,0 ffc0a2a8: 40 be 00 14 bne+ cr7,ffc0a2bc <_Heap_Walk+0x21c> (*printer)( ffc0a2ac: 3c a0 ff c2 lis r5,-62 ffc0a2b0: 7f c3 f3 78 mr r3,r30 ffc0a2b4: 38 a5 f4 d5 addi r5,r5,-2859 ffc0a2b8: 48 00 02 88 b ffc0a540 <_Heap_Walk+0x4a0> ); return false; } if ( ffc0a2bc: 7d 6a 4b 96 divwu r11,r10,r9 ffc0a2c0: 7d 6b 49 d6 mullw r11,r11,r9 ffc0a2c4: 7f 8a 58 00 cmpw cr7,r10,r11 ffc0a2c8: 41 be 00 14 beq+ cr7,ffc0a2dc <_Heap_Walk+0x23c> !_Heap_Is_aligned( _Heap_Alloc_area_of_block( free_block ), page_size ) ) { (*printer)( ffc0a2cc: 3c a0 ff c2 lis r5,-62 ffc0a2d0: 7f c3 f3 78 mr r3,r30 ffc0a2d4: 38 a5 f4 f5 addi r5,r5,-2827 ffc0a2d8: 48 00 02 68 b ffc0a540 <_Heap_Walk+0x4a0> ); return false; } if ( _Heap_Is_used( free_block ) ) { ffc0a2dc: 81 66 00 04 lwz r11,4(r6) ffc0a2e0: 55 6b 00 3c rlwinm r11,r11,0,0,30 ffc0a2e4: 7d 66 5a 14 add r11,r6,r11 ffc0a2e8: 81 6b 00 04 lwz r11,4(r11) ffc0a2ec: 71 6a 00 01 andi. r10,r11,1 ffc0a2f0: 41 a2 00 14 beq+ ffc0a304 <_Heap_Walk+0x264> (*printer)( ffc0a2f4: 3c a0 ff c2 lis r5,-62 ffc0a2f8: 7f c3 f3 78 mr r3,r30 ffc0a2fc: 38 a5 f5 25 addi r5,r5,-2779 ffc0a300: 48 00 02 40 b ffc0a540 <_Heap_Walk+0x4a0> ); return false; } if ( free_block->prev != prev_block ) { ffc0a304: 80 e6 00 0c lwz r7,12(r6) ffc0a308: 7f 87 00 00 cmpw cr7,r7,r0 return false; } prev_block = free_block; free_block = free_block->next; ffc0a30c: 7c c0 33 78 mr r0,r6 ); return false; } if ( free_block->prev != prev_block ) { ffc0a310: 41 be 00 14 beq+ cr7,ffc0a324 <_Heap_Walk+0x284> (*printer)( ffc0a314: 3c a0 ff c2 lis r5,-62 ffc0a318: 7f c3 f3 78 mr r3,r30 ffc0a31c: 38 a5 f5 41 addi r5,r5,-2751 ffc0a320: 48 00 01 34 b ffc0a454 <_Heap_Walk+0x3b4> return false; } prev_block = free_block; free_block = free_block->next; ffc0a324: 80 c6 00 08 lwz r6,8(r6) 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 ) { ffc0a328: 7f 86 e8 00 cmpw cr7,r6,r29 ); return false; } if ( ffc0a32c: 39 46 00 08 addi r10,r6,8 ffc0a330: 39 60 00 00 li r11,0 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 ) { ffc0a334: 40 9e ff 54 bne+ cr7,ffc0a288 <_Heap_Walk+0x1e8> ffc0a338: 48 00 02 4c b ffc0a584 <_Heap_Walk+0x4e4> - 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; ffc0a33c: 83 1f 00 04 lwz r24,4(r31) 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 ) { ffc0a340: 73 09 00 01 andi. r9,r24,1 ffc0a344: 57 18 00 3c rlwinm r24,r24,0,0,30 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); ffc0a348: 7f 9f c2 14 add r28,r31,r24 ffc0a34c: 41 82 00 2c beq- ffc0a378 <_Heap_Walk+0x2d8> (*printer)( ffc0a350: 80 01 00 18 lwz r0,24(r1) ffc0a354: 7f c3 f3 78 mr r3,r30 ffc0a358: 38 80 00 00 li r4,0 ffc0a35c: 7e 85 a3 78 mr r5,r20 ffc0a360: 7c 09 03 a6 mtctr r0 ffc0a364: 7f e6 fb 78 mr r6,r31 ffc0a368: 7f 07 c3 78 mr r7,r24 ffc0a36c: 4c c6 31 82 crclr 4*cr1+eq ffc0a370: 4e 80 04 21 bctrl ffc0a374: 48 00 00 2c b ffc0a3a0 <_Heap_Walk+0x300> "block 0x%08x: size %u\n", block, block_size ); } else { (*printer)( ffc0a378: 80 01 00 18 lwz r0,24(r1) ffc0a37c: 7f c3 f3 78 mr r3,r30 ffc0a380: 38 80 00 00 li r4,0 ffc0a384: 81 1f 00 00 lwz r8,0(r31) ffc0a388: 7e 65 9b 78 mr r5,r19 ffc0a38c: 7c 09 03 a6 mtctr r0 ffc0a390: 7f e6 fb 78 mr r6,r31 ffc0a394: 7f 07 c3 78 mr r7,r24 ffc0a398: 4c c6 31 82 crclr 4*cr1+eq ffc0a39c: 4e 80 04 21 bctrl 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 ffc0a3a0: 81 3d 00 20 lwz r9,32(r29) ffc0a3a4: 38 00 00 00 li r0,0 ffc0a3a8: 7f 89 e0 40 cmplw cr7,r9,r28 ffc0a3ac: 41 9d 00 14 bgt- cr7,ffc0a3c0 <_Heap_Walk+0x320> <== NEVER TAKEN ffc0a3b0: 80 1d 00 24 lwz r0,36(r29) ffc0a3b4: 7c 1c 00 10 subfc r0,r28,r0 ffc0a3b8: 38 00 00 00 li r0,0 ffc0a3bc: 7c 00 01 14 adde r0,r0,r0 block_size, block->prev_size ); } if ( !_Heap_Is_block_in_heap( heap, next_block ) ) { ffc0a3c0: 2f 80 00 00 cmpwi cr7,r0,0 ffc0a3c4: 40 be 00 14 bne+ cr7,ffc0a3d8 <_Heap_Walk+0x338> (*printer)( ffc0a3c8: 3c a0 ff c2 lis r5,-62 ffc0a3cc: 7f c3 f3 78 mr r3,r30 ffc0a3d0: 38 a5 f5 af addi r5,r5,-2641 ffc0a3d4: 48 00 00 78 b ffc0a44c <_Heap_Walk+0x3ac> ); return false; } if ( !_Heap_Is_aligned( block_size, page_size ) ) { ffc0a3d8: 7c 18 d3 96 divwu r0,r24,r26 ffc0a3dc: 7c 00 d1 d6 mullw r0,r0,r26 ffc0a3e0: 7f 98 00 00 cmpw cr7,r24,r0 ffc0a3e4: 41 be 00 1c beq+ cr7,ffc0a400 <_Heap_Walk+0x360> (*printer)( ffc0a3e8: 3c a0 ff c2 lis r5,-62 ffc0a3ec: 7f c3 f3 78 mr r3,r30 ffc0a3f0: 38 a5 f5 dc addi r5,r5,-2596 ffc0a3f4: 7f e6 fb 78 mr r6,r31 ffc0a3f8: 7f 07 c3 78 mr r7,r24 ffc0a3fc: 48 00 00 58 b ffc0a454 <_Heap_Walk+0x3b4> ); return false; } if ( block_size < min_block_size ) { ffc0a400: 7f 98 d8 40 cmplw cr7,r24,r27 ffc0a404: 40 bc 00 34 bge+ cr7,ffc0a438 <_Heap_Walk+0x398> (*printer)( ffc0a408: 80 01 00 18 lwz r0,24(r1) ffc0a40c: 3c a0 ff c2 lis r5,-62 ffc0a410: 7f c3 f3 78 mr r3,r30 ffc0a414: 38 a5 f6 0a addi r5,r5,-2550 ffc0a418: 7c 09 03 a6 mtctr r0 ffc0a41c: 7f e6 fb 78 mr r6,r31 ffc0a420: 7f 07 c3 78 mr r7,r24 ffc0a424: 7f 68 db 78 mr r8,r27 ffc0a428: 38 80 00 01 li r4,1 ffc0a42c: 4c c6 31 82 crclr 4*cr1+eq ffc0a430: 4e 80 04 21 bctrl ffc0a434: 48 00 01 20 b ffc0a554 <_Heap_Walk+0x4b4> ); return false; } if ( next_block_begin <= block_begin ) { ffc0a438: 7f 9c f8 40 cmplw cr7,r28,r31 ffc0a43c: 41 bd 00 30 bgt+ cr7,ffc0a46c <_Heap_Walk+0x3cc> (*printer)( ffc0a440: 3c a0 ff c2 lis r5,-62 ffc0a444: 7f c3 f3 78 mr r3,r30 ffc0a448: 38 a5 f6 35 addi r5,r5,-2507 ffc0a44c: 7f e6 fb 78 mr r6,r31 ffc0a450: 7f 87 e3 78 mr r7,r28 ffc0a454: 80 01 00 18 lwz r0,24(r1) ffc0a458: 38 80 00 01 li r4,1 ffc0a45c: 7c 09 03 a6 mtctr r0 ffc0a460: 4c c6 31 82 crclr 4*cr1+eq ffc0a464: 4e 80 04 21 bctrl ffc0a468: 48 00 00 ec b ffc0a554 <_Heap_Walk+0x4b4> ); return false; } if ( !_Heap_Is_prev_used( next_block ) ) { ffc0a46c: 80 1c 00 04 lwz r0,4(r28) ffc0a470: 70 09 00 01 andi. r9,r0,1 ffc0a474: 40 82 01 08 bne- ffc0a57c <_Heap_Walk+0x4dc> return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next; ffc0a478: 80 1d 00 08 lwz r0,8(r29) ffc0a47c: 7d c8 73 78 mr r8,r14 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)( ffc0a480: 80 ff 00 0c lwz r7,12(r31) 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; ffc0a484: 82 bf 00 04 lwz r21,4(r31) return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next; ffc0a488: 7f 87 00 00 cmpw cr7,r7,r0 } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_last( Heap_Control *heap ) { return _Heap_Free_list_tail(heap)->prev; ffc0a48c: 80 1d 00 0c lwz r0,12(r29) - 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; ffc0a490: 56 b8 00 3c rlwinm r24,r21,0,0,30 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); ffc0a494: 7e df c2 14 add r22,r31,r24 return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next; ffc0a498: 41 9e 00 14 beq- cr7,ffc0a4ac <_Heap_Walk+0x40c> "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)" : ""), ffc0a49c: 7f 87 e8 00 cmpw cr7,r7,r29 ffc0a4a0: 7e e8 bb 78 mr r8,r23 ffc0a4a4: 40 be 00 08 bne+ cr7,ffc0a4ac <_Heap_Walk+0x40c> ffc0a4a8: 7d e8 7b 78 mr r8,r15 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)( ffc0a4ac: 81 3f 00 08 lwz r9,8(r31) ffc0a4b0: 7e 0a 83 78 mr r10,r16 ffc0a4b4: 7f 89 00 00 cmpw cr7,r9,r0 ffc0a4b8: 41 9e 00 14 beq- cr7,ffc0a4cc <_Heap_Walk+0x42c> " (= first)" : (block->prev == free_list_head ? " (= head)" : ""), block->next, block->next == last_free_block ? " (= last)" : (block->next == free_list_tail ? " (= tail)" : "") ffc0a4bc: 7f 89 e8 00 cmpw cr7,r9,r29 ffc0a4c0: 7e ea bb 78 mr r10,r23 ffc0a4c4: 40 be 00 08 bne+ cr7,ffc0a4cc <_Heap_Walk+0x42c> ffc0a4c8: 7e 2a 8b 78 mr r10,r17 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)( ffc0a4cc: 80 01 00 18 lwz r0,24(r1) ffc0a4d0: 7f c3 f3 78 mr r3,r30 ffc0a4d4: 38 80 00 00 li r4,0 ffc0a4d8: 7e 45 93 78 mr r5,r18 ffc0a4dc: 7c 09 03 a6 mtctr r0 ffc0a4e0: 7f e6 fb 78 mr r6,r31 ffc0a4e4: 4c c6 31 82 crclr 4*cr1+eq ffc0a4e8: 4e 80 04 21 bctrl block->next == last_free_block ? " (= last)" : (block->next == free_list_tail ? " (= tail)" : "") ); if ( block_size != next_block->prev_size ) { ffc0a4ec: 81 16 00 00 lwz r8,0(r22) ffc0a4f0: 7f 98 40 00 cmpw cr7,r24,r8 ffc0a4f4: 41 9e 00 34 beq- cr7,ffc0a528 <_Heap_Walk+0x488> (*printer)( ffc0a4f8: 80 01 00 18 lwz r0,24(r1) ffc0a4fc: 3c a0 ff c2 lis r5,-62 ffc0a500: 7f c3 f3 78 mr r3,r30 ffc0a504: 38 a5 f6 be addi r5,r5,-2370 ffc0a508: 7c 09 03 a6 mtctr r0 ffc0a50c: 7f e6 fb 78 mr r6,r31 ffc0a510: 7f 07 c3 78 mr r7,r24 ffc0a514: 7e c9 b3 78 mr r9,r22 ffc0a518: 38 80 00 01 li r4,1 ffc0a51c: 4c c6 31 82 crclr 4*cr1+eq ffc0a520: 4e 80 04 21 bctrl ffc0a524: 48 00 00 30 b ffc0a554 <_Heap_Walk+0x4b4> ); return false; } if ( !prev_used ) { ffc0a528: 72 a9 00 01 andi. r9,r21,1 ffc0a52c: 40 a2 00 30 bne+ ffc0a55c <_Heap_Walk+0x4bc> (*printer)( ffc0a530: 3c a0 ff c2 lis r5,-62 ffc0a534: 7f c3 f3 78 mr r3,r30 ffc0a538: 38 a5 f6 f7 addi r5,r5,-2313 ffc0a53c: 7f e6 fb 78 mr r6,r31 ffc0a540: 80 01 00 18 lwz r0,24(r1) ffc0a544: 38 80 00 01 li r4,1 ffc0a548: 7c 09 03 a6 mtctr r0 ffc0a54c: 4c c6 31 82 crclr 4*cr1+eq ffc0a550: 4e 80 04 21 bctrl ffc0a554: 38 60 00 00 li r3,0 ffc0a558: 48 00 00 78 b ffc0a5d0 <_Heap_Walk+0x530> ffc0a55c: 81 3d 00 08 lwz r9,8(r29) ffc0a560: 48 00 00 0c b ffc0a56c <_Heap_Walk+0x4cc> { 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 ) { ffc0a564: 41 9a 00 18 beq- cr6,ffc0a57c <_Heap_Walk+0x4dc> return true; } free_block = free_block->next; ffc0a568: 81 29 00 08 lwz r9,8(r9) ) { 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 ) { ffc0a56c: 7f 89 e8 00 cmpw cr7,r9,r29 if ( free_block == block ) { ffc0a570: 7f 09 f8 00 cmpw cr6,r9,r31 ) { 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 ) { ffc0a574: 40 9e ff f0 bne+ cr7,ffc0a564 <_Heap_Walk+0x4c4> ffc0a578: 48 00 00 b0 b ffc0a628 <_Heap_Walk+0x588> ffc0a57c: 7f 9f e3 78 mr r31,r28 ffc0a580: 48 00 00 44 b ffc0a5c4 <_Heap_Walk+0x524> "block 0x%08x: size %u\n", block, block_size ); } else { (*printer)( ffc0a584: 3e 60 ff c2 lis r19,-62 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)( ffc0a588: 3e 80 ff c2 lis r20,-62 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)( ffc0a58c: 3e 40 ff c2 lis r18,-62 " (= first)" : (block->prev == free_list_head ? " (= head)" : ""), block->next, block->next == last_free_block ? " (= last)" : (block->next == free_list_tail ? " (= tail)" : "") ffc0a590: 3e 20 ff c2 lis r17,-62 ffc0a594: 3e e0 ff c2 lis r23,-62 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)( ffc0a598: 3e 00 ff c2 lis r16,-62 "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)" : ""), ffc0a59c: 3d e0 ff c2 lis r15,-62 ffc0a5a0: 3d c0 ff c2 lis r14,-62 "block 0x%08x: size %u\n", block, block_size ); } else { (*printer)( ffc0a5a4: 3a 73 f5 8a addi r19,r19,-2678 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)( ffc0a5a8: 3a 94 f5 73 addi r20,r20,-2701 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)( ffc0a5ac: 3a 52 f6 92 addi r18,r18,-2414 " (= first)" : (block->prev == free_list_head ? " (= head)" : ""), block->next, block->next == last_free_block ? " (= last)" : (block->next == free_list_tail ? " (= tail)" : "") ffc0a5b0: 3a 31 f6 88 addi r17,r17,-2424 ffc0a5b4: 3a f7 f2 9c addi r23,r23,-3428 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)( ffc0a5b8: 3a 10 f6 7e addi r16,r16,-2434 "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)" : ""), ffc0a5bc: 39 ef f6 74 addi r15,r15,-2444 ffc0a5c0: 39 ce f6 69 addi r14,r14,-2455 if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; } while ( block != last_block ) { ffc0a5c4: 7f 9f c8 00 cmpw cr7,r31,r25 ffc0a5c8: 40 9e fd 74 bne+ cr7,ffc0a33c <_Heap_Walk+0x29c> ffc0a5cc: 38 60 00 01 li r3,1 block = next_block; } return true; } ffc0a5d0: 80 01 00 6c lwz r0,108(r1) ffc0a5d4: 81 c1 00 20 lwz r14,32(r1) ffc0a5d8: 7c 08 03 a6 mtlr r0 ffc0a5dc: 81 e1 00 24 lwz r15,36(r1) ffc0a5e0: 82 01 00 28 lwz r16,40(r1) ffc0a5e4: 82 21 00 2c lwz r17,44(r1) ffc0a5e8: 82 41 00 30 lwz r18,48(r1) ffc0a5ec: 82 61 00 34 lwz r19,52(r1) ffc0a5f0: 82 81 00 38 lwz r20,56(r1) ffc0a5f4: 82 a1 00 3c lwz r21,60(r1) ffc0a5f8: 82 c1 00 40 lwz r22,64(r1) ffc0a5fc: 82 e1 00 44 lwz r23,68(r1) ffc0a600: 83 01 00 48 lwz r24,72(r1) ffc0a604: 83 21 00 4c lwz r25,76(r1) ffc0a608: 83 41 00 50 lwz r26,80(r1) ffc0a60c: 83 61 00 54 lwz r27,84(r1) ffc0a610: 83 81 00 58 lwz r28,88(r1) ffc0a614: 83 a1 00 5c lwz r29,92(r1) ffc0a618: 83 c1 00 60 lwz r30,96(r1) ffc0a61c: 83 e1 00 64 lwz r31,100(r1) ffc0a620: 38 21 00 68 addi r1,r1,104 ffc0a624: 4e 80 00 20 blr return false; } if ( !_Heap_Walk_is_in_free_list( heap, block ) ) { (*printer)( ffc0a628: 3c a0 ff c2 lis r5,-62 ffc0a62c: 7f c3 f3 78 mr r3,r30 ffc0a630: 38 a5 f7 26 addi r5,r5,-2266 ffc0a634: 4b ff ff 08 b ffc0a53c <_Heap_Walk+0x49c> =============================================================================== ffc0a638 <_Heap_Walk_print>: { /* Do nothing */ } static void _Heap_Walk_print( int source, bool error, const char *fmt, ... ) { ffc0a638: 94 21 ff 88 stwu r1,-120(r1) ffc0a63c: 7c 08 02 a6 mflr r0 ffc0a640: 93 e1 00 74 stw r31,116(r1) ffc0a644: 90 01 00 7c stw r0,124(r1) ffc0a648: 7c 60 1b 78 mr r0,r3 ffc0a64c: 90 c1 00 1c stw r6,28(r1) ffc0a650: 90 e1 00 20 stw r7,32(r1) ffc0a654: 91 01 00 24 stw r8,36(r1) ffc0a658: 91 21 00 28 stw r9,40(r1) ffc0a65c: 91 41 00 2c stw r10,44(r1) ffc0a660: 40 86 00 24 bne- cr1,ffc0a684 <_Heap_Walk_print+0x4c> <== ALWAYS TAKEN ffc0a664: d8 21 00 30 stfd f1,48(r1) <== NOT EXECUTED ffc0a668: d8 41 00 38 stfd f2,56(r1) <== NOT EXECUTED ffc0a66c: d8 61 00 40 stfd f3,64(r1) <== NOT EXECUTED ffc0a670: d8 81 00 48 stfd f4,72(r1) <== NOT EXECUTED ffc0a674: d8 a1 00 50 stfd f5,80(r1) <== NOT EXECUTED ffc0a678: d8 c1 00 58 stfd f6,88(r1) <== NOT EXECUTED ffc0a67c: d8 e1 00 60 stfd f7,96(r1) <== NOT EXECUTED ffc0a680: d9 01 00 68 stfd f8,104(r1) <== NOT EXECUTED va_list ap; if ( error ) { ffc0a684: 2f 84 00 00 cmpwi cr7,r4,0 { /* Do nothing */ } static void _Heap_Walk_print( int source, bool error, const char *fmt, ... ) { ffc0a688: 7c bf 2b 78 mr r31,r5 va_list ap; if ( error ) { ffc0a68c: 41 be 00 10 beq+ cr7,ffc0a69c <_Heap_Walk_print+0x64> printk( "FAIL[%d]: ", source ); ffc0a690: 3c 60 ff c2 lis r3,-62 ffc0a694: 38 63 f7 51 addi r3,r3,-2223 ffc0a698: 48 00 00 0c b ffc0a6a4 <_Heap_Walk_print+0x6c> } else { printk( "PASS[%d]: ", source ); ffc0a69c: 3c 60 ff c2 lis r3,-62 ffc0a6a0: 38 63 f7 5c addi r3,r3,-2212 ffc0a6a4: 7c 04 03 78 mr r4,r0 ffc0a6a8: 4c c6 31 82 crclr 4*cr1+eq ffc0a6ac: 4b ff b4 49 bl ffc05af4 } va_start( ap, fmt ); ffc0a6b0: 38 00 00 03 li r0,3 ffc0a6b4: 98 01 00 08 stb r0,8(r1) ffc0a6b8: 38 00 00 00 li r0,0 vprintk( fmt, ap ); ffc0a6bc: 7f e3 fb 78 mr r3,r31 printk( "FAIL[%d]: ", source ); } else { printk( "PASS[%d]: ", source ); } va_start( ap, fmt ); ffc0a6c0: 98 01 00 09 stb r0,9(r1) ffc0a6c4: 38 01 00 80 addi r0,r1,128 vprintk( fmt, ap ); ffc0a6c8: 38 81 00 08 addi r4,r1,8 printk( "FAIL[%d]: ", source ); } else { printk( "PASS[%d]: ", source ); } va_start( ap, fmt ); ffc0a6cc: 90 01 00 0c stw r0,12(r1) ffc0a6d0: 38 01 00 10 addi r0,r1,16 ffc0a6d4: 90 01 00 10 stw r0,16(r1) vprintk( fmt, ap ); ffc0a6d8: 4b ff d4 79 bl ffc07b50 va_end( ap ); } ffc0a6dc: 80 01 00 7c lwz r0,124(r1) ffc0a6e0: 83 e1 00 74 lwz r31,116(r1) ffc0a6e4: 38 21 00 78 addi r1,r1,120 ffc0a6e8: 7c 08 03 a6 mtlr r0 ffc0a6ec: 4e 80 00 20 blr =============================================================================== ffc0a30c <_IO_Manager_initialization>: * workspace. * */ void _IO_Manager_initialization(void) { ffc0a30c: 94 21 ff d8 stwu r1,-40(r1) ffc0a310: 7c 08 02 a6 mflr r0 uint32_t index; rtems_driver_address_table *driver_table; uint32_t drivers_in_table; uint32_t number_of_drivers; driver_table = Configuration.Device_driver_table; ffc0a314: 3d 20 00 00 lis r9,0 * workspace. * */ void _IO_Manager_initialization(void) { ffc0a318: 90 01 00 2c stw r0,44(r1) uint32_t index; rtems_driver_address_table *driver_table; uint32_t drivers_in_table; uint32_t number_of_drivers; driver_table = Configuration.Device_driver_table; ffc0a31c: 39 29 20 88 addi r9,r9,8328 * workspace. * */ void _IO_Manager_initialization(void) { ffc0a320: 93 c1 00 20 stw r30,32(r1) ffc0a324: 93 e1 00 24 stw r31,36(r1) uint32_t drivers_in_table; uint32_t number_of_drivers; driver_table = Configuration.Device_driver_table; drivers_in_table = Configuration.number_of_device_drivers; number_of_drivers = Configuration.maximum_drivers; ffc0a328: 83 c9 00 2c lwz r30,44(r9) rtems_driver_address_table *driver_table; uint32_t drivers_in_table; uint32_t number_of_drivers; driver_table = Configuration.Device_driver_table; drivers_in_table = Configuration.number_of_device_drivers; ffc0a32c: 83 e9 00 30 lwz r31,48(r9) * workspace. * */ void _IO_Manager_initialization(void) { ffc0a330: 93 61 00 14 stw r27,20(r1) /* * If the user claims there are less drivers than are actually in * the table, then let's just go with the table's count. */ if ( number_of_drivers <= drivers_in_table ) ffc0a334: 7f 9e f8 40 cmplw cr7,r30,r31 * workspace. * */ void _IO_Manager_initialization(void) { ffc0a338: 93 81 00 18 stw r28,24(r1) ffc0a33c: 3f 80 00 00 lis r28,0 ffc0a340: 93 a1 00 1c stw r29,28(r1) ffc0a344: 3f a0 00 00 lis r29,0 ffc0a348: 93 21 00 0c stw r25,12(r1) ffc0a34c: 93 41 00 10 stw r26,16(r1) uint32_t index; rtems_driver_address_table *driver_table; uint32_t drivers_in_table; uint32_t number_of_drivers; driver_table = Configuration.Device_driver_table; ffc0a350: 83 69 00 34 lwz r27,52(r9) /* * If the user claims there are less drivers than are actually in * the table, then let's just go with the table's count. */ if ( number_of_drivers <= drivers_in_table ) ffc0a354: 40 9d 00 40 ble- cr7,ffc0a394 <_IO_Manager_initialization+0x88> * have to allocate a new driver table and copy theirs to it. */ _IO_Driver_address_table = (rtems_driver_address_table *) _Workspace_Allocate_or_fatal_error( sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ffc0a358: 1f 3e 00 18 mulli r25,r30,24 /* * The application requested extra slots in the driver table, so we * have to allocate a new driver table and copy theirs to it. */ _IO_Driver_address_table = (rtems_driver_address_table *) ffc0a35c: 7f 23 cb 78 mr r3,r25 ffc0a360: 48 00 38 89 bl ffc0dbe8 <_Workspace_Allocate_or_fatal_error> _Workspace_Allocate_or_fatal_error( sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); _IO_Number_of_drivers = number_of_drivers; memset( ffc0a364: 7f 25 cb 78 mr r5,r25 ffc0a368: 38 80 00 00 li r4,0 _IO_Driver_address_table = (rtems_driver_address_table *) _Workspace_Allocate_or_fatal_error( sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); _IO_Number_of_drivers = number_of_drivers; ffc0a36c: 93 dd 28 08 stw r30,10248(r29) /* * The application requested extra slots in the driver table, so we * have to allocate a new driver table and copy theirs to it. */ _IO_Driver_address_table = (rtems_driver_address_table *) ffc0a370: 7c 7a 1b 78 mr r26,r3 ffc0a374: 90 7c 28 0c stw r3,10252(r28) _Workspace_Allocate_or_fatal_error( sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); _IO_Number_of_drivers = number_of_drivers; memset( ffc0a378: 48 00 e9 dd bl ffc18d54 ffc0a37c: 2f 9f 00 00 cmpwi cr7,r31,0 _IO_Driver_address_table, 0, sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); for ( index = 0 ; index < drivers_in_table ; index++ ) _IO_Driver_address_table[index] = driver_table[index]; ffc0a380: 39 40 00 00 li r10,0 ffc0a384: 3b ff 00 01 addi r31,r31,1 ffc0a388: 40 be 00 4c bne+ cr7,ffc0a3d4 <_IO_Manager_initialization+0xc8><== ALWAYS TAKEN ffc0a38c: 3b e0 00 01 li r31,1 <== NOT EXECUTED ffc0a390: 48 00 00 44 b ffc0a3d4 <_IO_Manager_initialization+0xc8><== NOT EXECUTED * If the maximum number of driver is the same as the number in the * table, then we do not have to copy the driver table. They can't * register any dynamically. */ if ( number_of_drivers == drivers_in_table ) { _IO_Driver_address_table = driver_table; ffc0a394: 93 7c 28 0c stw r27,10252(r28) _IO_Number_of_drivers = number_of_drivers; ffc0a398: 93 fd 28 08 stw r31,10248(r29) return; ffc0a39c: 48 00 00 48 b ffc0a3e4 <_IO_Manager_initialization+0xd8> _IO_Driver_address_table, 0, sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); for ( index = 0 ; index < drivers_in_table ; index++ ) _IO_Driver_address_table[index] = driver_table[index]; ffc0a3a0: 7c c9 50 6e lwzux r6,r9,r10 ffc0a3a4: 81 09 00 08 lwz r8,8(r9) ffc0a3a8: 80 09 00 0c lwz r0,12(r9) ffc0a3ac: 80 e9 00 04 lwz r7,4(r9) ffc0a3b0: 7c da 51 2e stwx r6,r26,r10 memset( _IO_Driver_address_table, 0, sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); for ( index = 0 ; index < drivers_in_table ; index++ ) ffc0a3b4: 39 4a 00 18 addi r10,r10,24 _IO_Driver_address_table[index] = driver_table[index]; ffc0a3b8: 90 eb 00 04 stw r7,4(r11) ffc0a3bc: 91 0b 00 08 stw r8,8(r11) ffc0a3c0: 90 0b 00 0c stw r0,12(r11) ffc0a3c4: 81 09 00 14 lwz r8,20(r9) ffc0a3c8: 80 09 00 10 lwz r0,16(r9) ffc0a3cc: 91 0b 00 14 stw r8,20(r11) ffc0a3d0: 90 0b 00 10 stw r0,16(r11) memset( _IO_Driver_address_table, 0, sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); for ( index = 0 ; index < drivers_in_table ; index++ ) ffc0a3d4: 37 ff ff ff addic. r31,r31,-1 _IO_Driver_address_table[index] = driver_table[index]; ffc0a3d8: 7f 69 db 78 mr r9,r27 ffc0a3dc: 7d 7a 52 14 add r11,r26,r10 memset( _IO_Driver_address_table, 0, sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); for ( index = 0 ; index < drivers_in_table ; index++ ) ffc0a3e0: 40 82 ff c0 bne+ ffc0a3a0 <_IO_Manager_initialization+0x94> _IO_Driver_address_table[index] = driver_table[index]; number_of_drivers = drivers_in_table; } ffc0a3e4: 80 01 00 2c lwz r0,44(r1) ffc0a3e8: 83 21 00 0c lwz r25,12(r1) ffc0a3ec: 7c 08 03 a6 mtlr r0 ffc0a3f0: 83 41 00 10 lwz r26,16(r1) ffc0a3f4: 83 61 00 14 lwz r27,20(r1) ffc0a3f8: 83 81 00 18 lwz r28,24(r1) ffc0a3fc: 83 a1 00 1c lwz r29,28(r1) ffc0a400: 83 c1 00 20 lwz r30,32(r1) ffc0a404: 83 e1 00 24 lwz r31,36(r1) ffc0a408: 38 21 00 28 addi r1,r1,40 ffc0a40c: 4e 80 00 20 blr =============================================================================== ffc0b32c <_Internal_error_Occurred>: void _Internal_error_Occurred( Internal_errors_Source the_source, bool is_internal, Internal_errors_t the_error ) { ffc0b32c: 94 21 ff f0 stwu r1,-16(r1) ffc0b330: 7c 08 02 a6 mflr r0 _Internal_errors_What_happened.the_source = the_source; ffc0b334: 3d 60 00 00 lis r11,0 ffc0b338: 39 2b 2d f0 addi r9,r11,11760 void _Internal_error_Occurred( Internal_errors_Source the_source, bool is_internal, Internal_errors_t the_error ) { ffc0b33c: 90 01 00 14 stw r0,20(r1) _Internal_errors_What_happened.the_source = the_source; _Internal_errors_What_happened.is_internal = is_internal; _Internal_errors_What_happened.the_error = the_error; ffc0b340: 90 a9 00 08 stw r5,8(r9) Internal_errors_t the_error ) { _Internal_errors_What_happened.the_source = the_source; _Internal_errors_What_happened.is_internal = is_internal; ffc0b344: 98 89 00 04 stb r4,4(r9) void _Internal_error_Occurred( Internal_errors_Source the_source, bool is_internal, Internal_errors_t the_error ) { ffc0b348: 93 e1 00 0c stw r31,12(r1) ffc0b34c: 7c bf 2b 78 mr r31,r5 _Internal_errors_What_happened.the_source = the_source; ffc0b350: 90 6b 2d f0 stw r3,11760(r11) _Internal_errors_What_happened.is_internal = is_internal; _Internal_errors_What_happened.the_error = the_error; _User_extensions_Fatal( the_source, is_internal, the_error ); ffc0b354: 48 00 23 f1 bl ffc0d744 <_User_extensions_Fatal> RTEMS_INLINE_ROUTINE void _System_state_Set ( System_state_Codes state ) { _System_state_Current = state; ffc0b358: 38 00 00 05 li r0,5 ffc0b35c: 3d 20 00 00 lis r9,0 _System_state_Set( SYSTEM_STATE_FAILED ); _CPU_Fatal_halt( the_error ); ffc0b360: 7f e3 fb 78 mr r3,r31 ffc0b364: 90 09 27 f4 stw r0,10228(r9) ffc0b368: 4b ff 89 b9 bl ffc03d20 <_BSP_Fatal_error> ffc0b36c: 48 00 00 00 b ffc0b36c <_Internal_error_Occurred+0x40><== NOT EXECUTED =============================================================================== ffc0b38c <_Objects_Allocate>: */ Objects_Control *_Objects_Allocate( Objects_Information *information ) { ffc0b38c: 94 21 ff f0 stwu r1,-16(r1) ffc0b390: 7c 08 02 a6 mflr r0 ffc0b394: 90 01 00 14 stw r0,20(r1) * If the application is using the optional manager stubs and * still attempts to create the object, the information block * should be all zeroed out because it is in the BSS. So let's * check that code for this manager is even present. */ if ( information->size == 0 ) ffc0b398: 80 03 00 18 lwz r0,24(r3) */ Objects_Control *_Objects_Allocate( Objects_Information *information ) { ffc0b39c: 93 e1 00 0c stw r31,12(r1) ffc0b3a0: 7c 7f 1b 78 mr r31,r3 * 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 ) ffc0b3a4: 2f 80 00 00 cmpwi cr7,r0,0 */ Objects_Control *_Objects_Allocate( Objects_Information *information ) { ffc0b3a8: 93 c1 00 08 stw r30,8(r1) * If the application is using the optional manager stubs and * still attempts to create the object, the information block * should be all zeroed out because it is in the BSS. So let's * check that code for this manager is even present. */ if ( information->size == 0 ) ffc0b3ac: 38 60 00 00 li r3,0 ffc0b3b0: 41 be 00 70 beq+ cr7,ffc0b420 <_Objects_Allocate+0x94> <== NEVER TAKEN /* * OK. The manager should be initialized and configured to have objects. * With any luck, it is safe to attempt to allocate an object. */ the_object = (Objects_Control *) _Chain_Get( &information->Inactive ); ffc0b3b4: 3b df 00 20 addi r30,r31,32 ffc0b3b8: 7f c3 f3 78 mr r3,r30 ffc0b3bc: 4b ff f5 f1 bl ffc0a9ac <_Chain_Get> if ( information->auto_extend ) { ffc0b3c0: 88 1f 00 12 lbz r0,18(r31) ffc0b3c4: 2f 80 00 00 cmpwi cr7,r0,0 ffc0b3c8: 41 9e 00 58 beq- cr7,ffc0b420 <_Objects_Allocate+0x94> /* * If the list is empty then we are out of objects and need to * extend information base. */ if ( !the_object ) { ffc0b3cc: 2f 83 00 00 cmpwi cr7,r3,0 ffc0b3d0: 40 be 00 1c bne+ cr7,ffc0b3ec <_Objects_Allocate+0x60> _Objects_Extend_information( information ); ffc0b3d4: 7f e3 fb 78 mr r3,r31 ffc0b3d8: 48 00 00 95 bl ffc0b46c <_Objects_Extend_information> the_object = (Objects_Control *) _Chain_Get( &information->Inactive ); ffc0b3dc: 7f c3 f3 78 mr r3,r30 ffc0b3e0: 4b ff f5 cd bl ffc0a9ac <_Chain_Get> } if ( the_object ) { ffc0b3e4: 2c 03 00 00 cmpwi r3,0 ffc0b3e8: 41 a2 00 38 beq+ ffc0b420 <_Objects_Allocate+0x94> uint32_t block; block = (uint32_t) _Objects_Get_index( the_object->id ) - ffc0b3ec: a1 63 00 0a lhz r11,10(r3) ffc0b3f0: a0 1f 00 0a lhz r0,10(r31) _Objects_Get_index( information->minimum_id ); block /= information->allocation_size; information->inactive_per_block[ block ]--; ffc0b3f4: a1 3f 00 14 lhz r9,20(r31) } if ( the_object ) { uint32_t block; block = (uint32_t) _Objects_Get_index( the_object->id ) - ffc0b3f8: 7c 00 58 50 subf r0,r0,r11 _Objects_Get_index( information->minimum_id ); block /= information->allocation_size; information->inactive_per_block[ block ]--; information->inactive--; ffc0b3fc: a1 7f 00 2c lhz r11,44(r31) block = (uint32_t) _Objects_Get_index( the_object->id ) - _Objects_Get_index( information->minimum_id ); block /= information->allocation_size; information->inactive_per_block[ block ]--; ffc0b400: 7c 00 4b 96 divwu r0,r0,r9 ffc0b404: 81 3f 00 30 lwz r9,48(r31) ffc0b408: 54 00 10 3a rlwinm r0,r0,2,0,29 ffc0b40c: 7d 49 00 2e lwzx r10,r9,r0 information->inactive--; ffc0b410: 39 6b ff ff addi r11,r11,-1 ffc0b414: b1 7f 00 2c sth r11,44(r31) block = (uint32_t) _Objects_Get_index( the_object->id ) - _Objects_Get_index( information->minimum_id ); block /= information->allocation_size; information->inactive_per_block[ block ]--; ffc0b418: 39 4a ff ff addi r10,r10,-1 ffc0b41c: 7d 49 01 2e stwx r10,r9,r0 information->inactive--; } } return the_object; } ffc0b420: 80 01 00 14 lwz r0,20(r1) ffc0b424: 83 c1 00 08 lwz r30,8(r1) ffc0b428: 7c 08 03 a6 mtlr r0 ffc0b42c: 83 e1 00 0c lwz r31,12(r1) ffc0b430: 38 21 00 10 addi r1,r1,16 ffc0b434: 4e 80 00 20 blr =============================================================================== ffc0b46c <_Objects_Extend_information>: */ void _Objects_Extend_information( Objects_Information *information ) { ffc0b46c: 94 21 ff b8 stwu r1,-72(r1) ffc0b470: 7c 08 02 a6 mflr r0 ffc0b474: 90 01 00 4c stw r0,76(r1) minimum_index = _Objects_Get_index( information->minimum_id ); index_base = minimum_index; block = 0; /* if ( information->maximum < minimum_index ) */ if ( information->object_blocks == NULL ) ffc0b478: 81 63 00 34 lwz r11,52(r3) */ void _Objects_Extend_information( Objects_Information *information ) { ffc0b47c: 93 61 00 34 stw r27,52(r1) minimum_index = _Objects_Get_index( information->minimum_id ); index_base = minimum_index; block = 0; /* if ( information->maximum < minimum_index ) */ if ( information->object_blocks == NULL ) ffc0b480: 2f 8b 00 00 cmpwi cr7,r11,0 */ void _Objects_Extend_information( Objects_Information *information ) { ffc0b484: 93 e1 00 44 stw r31,68(r1) ffc0b488: 7c 7f 1b 78 mr r31,r3 ffc0b48c: 92 a1 00 1c stw r21,28(r1) ffc0b490: 92 c1 00 20 stw r22,32(r1) ffc0b494: 92 e1 00 24 stw r23,36(r1) ffc0b498: 93 01 00 28 stw r24,40(r1) ffc0b49c: 93 21 00 2c stw r25,44(r1) ffc0b4a0: 93 41 00 30 stw r26,48(r1) ffc0b4a4: 93 81 00 38 stw r28,56(r1) ffc0b4a8: 93 a1 00 3c stw r29,60(r1) ffc0b4ac: 93 c1 00 40 stw r30,64(r1) /* * Search for a free block of indexes. The block variable ends up set * to block_count + 1 if the table needs to be extended. */ minimum_index = _Objects_Get_index( information->minimum_id ); ffc0b4b0: a3 63 00 0a lhz r27,10(r3) index_base = minimum_index; block = 0; /* if ( information->maximum < minimum_index ) */ if ( information->object_blocks == NULL ) ffc0b4b4: 40 be 00 14 bne+ cr7,ffc0b4c8 <_Objects_Extend_information+0x5c> ffc0b4b8: 7f 7e db 78 mr r30,r27 ffc0b4bc: 3b 80 00 00 li r28,0 ffc0b4c0: 3b 40 00 00 li r26,0 ffc0b4c4: 48 00 00 4c b ffc0b510 <_Objects_Extend_information+0xa4> block_count = 0; else { block_count = information->maximum / information->allocation_size; ffc0b4c8: a1 23 00 14 lhz r9,20(r3) ffc0b4cc: 7f 7e db 78 mr r30,r27 ffc0b4d0: a3 43 00 10 lhz r26,16(r3) ffc0b4d4: 3b 80 00 00 li r28,0 ffc0b4d8: 7f 5a 4b 96 divwu r26,r26,r9 ffc0b4dc: 2f 9a 00 00 cmpwi cr7,r26,0 ffc0b4e0: 38 1a 00 01 addi r0,r26,1 ffc0b4e4: 40 be 00 20 bne+ cr7,ffc0b504 <_Objects_Extend_information+0x98><== ALWAYS TAKEN ffc0b4e8: 38 00 00 01 li r0,1 <== NOT EXECUTED ffc0b4ec: 48 00 00 18 b ffc0b504 <_Objects_Extend_information+0x98><== NOT EXECUTED for ( ; block < block_count; block++ ) { if ( information->object_blocks[ block ] == NULL ) ffc0b4f0: 7d 4b 50 2e lwzx r10,r11,r10 ffc0b4f4: 2f 8a 00 00 cmpwi cr7,r10,0 ffc0b4f8: 41 9e 00 18 beq- cr7,ffc0b510 <_Objects_Extend_information+0xa4> ffc0b4fc: 7f de 4a 14 add r30,r30,r9 if ( information->object_blocks == NULL ) block_count = 0; else { block_count = information->maximum / information->allocation_size; for ( ; block < block_count; block++ ) { ffc0b500: 3b 9c 00 01 addi r28,r28,1 ffc0b504: 34 00 ff ff addic. r0,r0,-1 if ( information->object_blocks[ block ] == NULL ) ffc0b508: 57 8a 10 3a rlwinm r10,r28,2,0,29 if ( information->object_blocks == NULL ) block_count = 0; else { block_count = information->maximum / information->allocation_size; for ( ; block < block_count; block++ ) { ffc0b50c: 40 82 ff e4 bne+ ffc0b4f0 <_Objects_Extend_information+0x84> else index_base += information->allocation_size; } } maximum = (uint32_t) information->maximum + information->allocation_size; ffc0b510: a0 1f 00 14 lhz r0,20(r31) ffc0b514: a2 df 00 10 lhz r22,16(r31) ffc0b518: 7e c0 b2 14 add r22,r0,r22 /* * 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 ) { ffc0b51c: 2b 96 ff ff cmplwi cr7,r22,65535 ffc0b520: 41 9d 02 1c bgt- cr7,ffc0b73c <_Objects_Extend_information+0x2d0><== NEVER TAKEN /* * 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; if ( information->auto_extend ) { ffc0b524: 89 3f 00 12 lbz r9,18(r31) /* * 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; ffc0b528: 80 7f 00 18 lwz r3,24(r31) if ( information->auto_extend ) { ffc0b52c: 2f 89 00 00 cmpwi cr7,r9,0 /* * 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; ffc0b530: 7c 60 19 d6 mullw r3,r0,r3 if ( information->auto_extend ) { ffc0b534: 41 9e 00 14 beq- cr7,ffc0b548 <_Objects_Extend_information+0xdc> new_object_block = _Workspace_Allocate( block_size ); ffc0b538: 48 00 26 f9 bl ffc0dc30 <_Workspace_Allocate> if ( !new_object_block ) ffc0b53c: 7c 7d 1b 79 mr. r29,r3 ffc0b540: 40 a2 00 10 bne+ ffc0b550 <_Objects_Extend_information+0xe4> ffc0b544: 48 00 01 f8 b ffc0b73c <_Objects_Extend_information+0x2d0> return; } else { new_object_block = _Workspace_Allocate_or_fatal_error( block_size ); ffc0b548: 48 00 26 a1 bl ffc0dbe8 <_Workspace_Allocate_or_fatal_error> ffc0b54c: 7c 7d 1b 78 mr r29,r3 } /* * If the index_base is the maximum we need to grow the tables. */ if (index_base >= information->maximum ) { ffc0b550: a0 1f 00 10 lhz r0,16(r31) ffc0b554: 7f 9e 00 40 cmplw cr7,r30,r0 ffc0b558: 41 9c 01 5c blt- cr7,ffc0b6b4 <_Objects_Extend_information+0x248> */ /* * Up the block count and maximum */ block_count++; ffc0b55c: 3b 3a 00 01 addi r25,r26,1 * 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 ); ffc0b560: 1c 19 00 03 mulli r0,r25,3 ffc0b564: 7c 76 da 14 add r3,r22,r27 ffc0b568: 7c 63 02 14 add r3,r3,r0 ffc0b56c: 54 63 10 3a rlwinm r3,r3,2,0,29 ffc0b570: 48 00 26 c1 bl ffc0dc30 <_Workspace_Allocate> if ( !object_blocks ) { ffc0b574: 7c 77 1b 79 mr. r23,r3 ffc0b578: 40 a2 00 10 bne+ ffc0b588 <_Objects_Extend_information+0x11c> _Workspace_Free( new_object_block ); ffc0b57c: 7f a3 eb 78 mr r3,r29 ffc0b580: 48 00 26 e5 bl ffc0dc64 <_Workspace_Free> return; ffc0b584: 48 00 01 b8 b ffc0b73c <_Objects_Extend_information+0x2d0> * Take the block count down. Saves all the (block_count - 1) * in the copies. */ block_count--; if ( information->maximum > minimum_index ) { ffc0b588: a0 1f 00 10 lhz r0,16(r31) } /* * Break the block into the various sections. */ inactive_per_block = (uint32_t *) _Addresses_Add_offset( ffc0b58c: 57 39 10 3a rlwinm r25,r25,2,0,29 RTEMS_INLINE_ROUTINE void *_Addresses_Add_offset ( const void *base, uintptr_t offset ) { return (void *)((uintptr_t)base + offset); ffc0b590: 7f 17 ca 14 add r24,r23,r25 * Take the block count down. Saves all the (block_count - 1) * in the copies. */ block_count--; if ( information->maximum > minimum_index ) { ffc0b594: 7f 80 d8 40 cmplw cr7,r0,r27 ffc0b598: 7f 38 ca 14 add r25,r24,r25 ffc0b59c: 41 9d 00 20 bgt- cr7,ffc0b5bc <_Objects_Extend_information+0x150> ffc0b5a0: 2f 9b 00 00 cmpwi cr7,r27,0 ffc0b5a4: 39 20 00 00 li r9,0 /* * Deal with the special case of the 0 to minimum_index */ for ( index = 0; index < minimum_index; index++ ) { local_table[ index ] = NULL; ffc0b5a8: 38 00 00 00 li r0,0 ffc0b5ac: 3b 7b 00 01 addi r27,r27,1 ffc0b5b0: 40 be 00 50 bne+ cr7,ffc0b600 <_Objects_Extend_information+0x194><== ALWAYS TAKEN ffc0b5b4: 3b 60 00 01 li r27,1 <== NOT EXECUTED ffc0b5b8: 48 00 00 48 b ffc0b600 <_Objects_Extend_information+0x194><== NOT EXECUTED * separate parts as size of each block has changed. */ memcpy( object_blocks, information->object_blocks, block_count * sizeof(void*) ); ffc0b5bc: 57 55 10 3a rlwinm r21,r26,2,0,29 /* * 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, ffc0b5c0: 80 9f 00 34 lwz r4,52(r31) ffc0b5c4: 7e a5 ab 78 mr r5,r21 ffc0b5c8: 48 00 d6 8d bl ffc18c54 information->object_blocks, block_count * sizeof(void*) ); memcpy( inactive_per_block, ffc0b5cc: 80 9f 00 30 lwz r4,48(r31) ffc0b5d0: 7e a5 ab 78 mr r5,r21 ffc0b5d4: 7f 03 c3 78 mr r3,r24 ffc0b5d8: 48 00 d6 7d bl ffc18c54 information->inactive_per_block, block_count * sizeof(uint32_t) ); memcpy( local_table, ffc0b5dc: a0 1f 00 10 lhz r0,16(r31) ffc0b5e0: 80 9f 00 1c lwz r4,28(r31) ffc0b5e4: 7f 23 cb 78 mr r3,r25 ffc0b5e8: 7f 7b 02 14 add r27,r27,r0 ffc0b5ec: 57 65 10 3a rlwinm r5,r27,2,0,29 ffc0b5f0: 48 00 d6 65 bl ffc18c54 ffc0b5f4: 48 00 00 18 b ffc0b60c <_Objects_Extend_information+0x1a0> /* * Deal with the special case of the 0 to minimum_index */ for ( index = 0; index < minimum_index; index++ ) { local_table[ index ] = NULL; ffc0b5f8: 7c 0b c9 2e stwx r0,r11,r25 } else { /* * Deal with the special case of the 0 to minimum_index */ for ( index = 0; index < minimum_index; index++ ) { ffc0b5fc: 39 29 00 01 addi r9,r9,1 ffc0b600: 37 7b ff ff addic. r27,r27,-1 local_table[ index ] = NULL; ffc0b604: 55 2b 10 3a rlwinm r11,r9,2,0,29 } else { /* * Deal with the special case of the 0 to minimum_index */ for ( index = 0; index < minimum_index; index++ ) { ffc0b608: 40 82 ff f0 bne+ ffc0b5f8 <_Objects_Extend_information+0x18c> */ object_blocks[block_count] = NULL; inactive_per_block[block_count] = 0; for ( index=index_base ; index < ( information->allocation_size + index_base ); ffc0b60c: a1 5f 00 14 lhz r10,20(r31) } /* * Initialise the new entries in the table. */ object_blocks[block_count] = NULL; ffc0b610: 38 00 00 00 li r0,0 ffc0b614: 57 5a 10 3a rlwinm r26,r26,2,0,29 inactive_per_block[block_count] = 0; for ( index=index_base ; index < ( information->allocation_size + index_base ); index++ ) { local_table[ index ] = NULL; ffc0b618: 7d 7e 52 14 add r11,r30,r10 /* * Initialise the new entries in the table. */ object_blocks[block_count] = NULL; inactive_per_block[block_count] = 0; ffc0b61c: 7c 18 d1 2e stwx r0,r24,r26 ffc0b620: 7f 9e 58 40 cmplw cr7,r30,r11 for ( index=index_base ; index < ( information->allocation_size + index_base ); ffc0b624: 57 c9 10 3a rlwinm r9,r30,2,0,29 } /* * Initialise the new entries in the table. */ object_blocks[block_count] = NULL; ffc0b628: 7c 17 d1 2e stwx r0,r23,r26 inactive_per_block[block_count] = 0; for ( index=index_base ; index < ( information->allocation_size + index_base ); ffc0b62c: 7d 39 4a 14 add r9,r25,r9 index++ ) { local_table[ index ] = NULL; ffc0b630: 38 0a 00 01 addi r0,r10,1 ffc0b634: 39 40 00 00 li r10,0 ffc0b638: 41 9d 00 0c bgt- cr7,ffc0b644 <_Objects_Extend_information+0x1d8><== NEVER TAKEN ffc0b63c: 2f 8b 00 00 cmpwi cr7,r11,0 ffc0b640: 40 be 00 14 bne+ cr7,ffc0b654 <_Objects_Extend_information+0x1e8><== ALWAYS TAKEN ffc0b644: 38 00 00 01 li r0,1 <== NOT EXECUTED ffc0b648: 48 00 00 0c b ffc0b654 <_Objects_Extend_information+0x1e8><== NOT EXECUTED ffc0b64c: 91 49 00 00 stw r10,0(r9) object_blocks[block_count] = NULL; inactive_per_block[block_count] = 0; for ( index=index_base ; index < ( information->allocation_size + index_base ); index++ ) { ffc0b650: 39 29 00 04 addi r9,r9,4 * Initialise the new entries in the table. */ object_blocks[block_count] = NULL; inactive_per_block[block_count] = 0; for ( index=index_base ; ffc0b654: 34 00 ff ff addic. r0,r0,-1 ffc0b658: 40 82 ff f4 bne+ ffc0b64c <_Objects_Extend_information+0x1e0> static inline uint32_t ppc_interrupt_disable( void ) { uint32_t level; uint32_t mask; asm volatile ( ffc0b65c: 7c 00 00 a6 mfmsr r0 ffc0b660: 7d 30 42 a6 mfsprg r9,0 ffc0b664: 7c 09 48 78 andc r9,r0,r9 ffc0b668: 7d 20 01 24 mtmsr r9 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( ffc0b66c: 81 7f 00 00 lwz r11,0(r31) 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; ffc0b670: 56 d6 04 3e clrlwi r22,r22,16 information->maximum_id = _Objects_Build_id( ffc0b674: a1 3f 00 04 lhz r9,4(r31) ffc0b678: 55 6b c0 0e rlwinm r11,r11,24,0,7 local_table[ index ] = NULL; } _ISR_Disable( level ); old_tables = information->object_blocks; ffc0b67c: 80 7f 00 34 lwz r3,52(r31) 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( ffc0b680: 65 6b 00 01 oris r11,r11,1 _ISR_Disable( level ); old_tables = information->object_blocks; information->object_blocks = object_blocks; information->inactive_per_block = inactive_per_block; ffc0b684: 93 1f 00 30 stw r24,48(r31) information->local_table = local_table; information->maximum = (Objects_Maximum) maximum; information->maximum_id = _Objects_Build_id( ffc0b688: 55 29 d8 08 rlwinm r9,r9,27,0,4 ffc0b68c: 7d 69 4b 78 or r9,r11,r9 old_tables = information->object_blocks; information->object_blocks = object_blocks; information->inactive_per_block = inactive_per_block; information->local_table = local_table; ffc0b690: 93 3f 00 1c stw r25,28(r31) information->maximum = (Objects_Maximum) maximum; information->maximum_id = _Objects_Build_id( ffc0b694: 7d 29 b3 78 or r9,r9,r22 ffc0b698: 91 3f 00 0c stw r9,12(r31) 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; ffc0b69c: b2 df 00 10 sth r22,16(r31) _ISR_Disable( level ); old_tables = information->object_blocks; information->object_blocks = object_blocks; ffc0b6a0: 92 ff 00 34 stw r23,52(r31) return level; } static inline void ppc_interrupt_enable( uint32_t level ) { asm volatile ( ffc0b6a4: 7c 00 01 24 mtmsr r0 information->maximum ); _ISR_Enable( level ); if ( old_tables ) ffc0b6a8: 2f 83 00 00 cmpwi cr7,r3,0 ffc0b6ac: 41 9e 00 08 beq- cr7,ffc0b6b4 <_Objects_Extend_information+0x248> _Workspace_Free( old_tables ); ffc0b6b0: 48 00 25 b5 bl ffc0dc64 <_Workspace_Free> } /* * Assign the new object block to the object block table. */ information->object_blocks[ block ] = new_object_block; ffc0b6b4: 81 3f 00 34 lwz r9,52(r31) ffc0b6b8: 57 9c 10 3a rlwinm r28,r28,2,0,29 /* * Initialize objects .. add to a local chain first. */ _Chain_Initialize( ffc0b6bc: 3b 61 00 08 addi r27,r1,8 ffc0b6c0: a0 bf 00 14 lhz r5,20(r31) } /* * Assign the new object block to the object block table. */ information->object_blocks[ block ] = new_object_block; ffc0b6c4: 7f a9 e1 2e stwx r29,r9,r28 /* * Initialize objects .. add to a local chain first. */ _Chain_Initialize( ffc0b6c8: 7f a4 eb 78 mr r4,r29 ffc0b6cc: 7f 63 db 78 mr r3,r27 ffc0b6d0: 80 df 00 18 lwz r6,24(r31) information->the_class, _Objects_Local_node, index ); _Chain_Append( &information->Inactive, &the_object->Node ); ffc0b6d4: 3b bf 00 20 addi r29,r31,32 information->object_blocks[ block ] = new_object_block; /* * Initialize objects .. add to a local chain first. */ _Chain_Initialize( ffc0b6d8: 48 00 91 89 bl ffc14860 <_Chain_Initialize> /* * Move from the local chain, initialise, then append to the inactive chain */ index = index_base; while ((the_object = (Objects_Control *) _Chain_Get( &Inactive )) != NULL ) { ffc0b6dc: 48 00 00 2c b ffc0b708 <_Objects_Extend_information+0x29c> the_object->id = _Objects_Build_id( ffc0b6e0: 81 7f 00 00 lwz r11,0(r31) ffc0b6e4: a0 1f 00 04 lhz r0,4(r31) ffc0b6e8: 55 6b c0 0e rlwinm r11,r11,24,0,7 ffc0b6ec: 65 6b 00 01 oris r11,r11,1 ffc0b6f0: 54 00 d8 08 rlwinm r0,r0,27,0,4 ffc0b6f4: 7d 60 03 78 or r0,r11,r0 ffc0b6f8: 7c 00 f3 78 or r0,r0,r30 ffc0b6fc: 90 09 00 08 stw r0,8(r9) index ); _Chain_Append( &information->Inactive, &the_object->Node ); index++; ffc0b700: 3b de 00 01 addi r30,r30,1 information->the_class, _Objects_Local_node, index ); _Chain_Append( &information->Inactive, &the_object->Node ); ffc0b704: 4b ff f2 51 bl ffc0a954 <_Chain_Append> /* * Move from the local chain, initialise, then append to the inactive chain */ index = index_base; while ((the_object = (Objects_Control *) _Chain_Get( &Inactive )) != NULL ) { ffc0b708: 7f 63 db 78 mr r3,r27 ffc0b70c: 4b ff f2 a1 bl ffc0a9ac <_Chain_Get> ffc0b710: 7c 69 1b 79 mr. r9,r3 information->the_class, _Objects_Local_node, index ); _Chain_Append( &information->Inactive, &the_object->Node ); ffc0b714: 7f a3 eb 78 mr r3,r29 ffc0b718: 7d 24 4b 78 mr r4,r9 /* * Move from the local chain, initialise, then append to the inactive chain */ index = index_base; while ((the_object = (Objects_Control *) _Chain_Get( &Inactive )) != NULL ) { ffc0b71c: 40 82 ff c4 bne+ ffc0b6e0 <_Objects_Extend_information+0x274> _Chain_Append( &information->Inactive, &the_object->Node ); index++; } information->inactive_per_block[ block ] = information->allocation_size; ffc0b720: a0 1f 00 14 lhz r0,20(r31) information->inactive = ffc0b724: a1 3f 00 2c lhz r9,44(r31) _Chain_Append( &information->Inactive, &the_object->Node ); index++; } information->inactive_per_block[ block ] = information->allocation_size; ffc0b728: 81 7f 00 30 lwz r11,48(r31) information->inactive = ffc0b72c: 7d 20 4a 14 add r9,r0,r9 _Chain_Append( &information->Inactive, &the_object->Node ); index++; } information->inactive_per_block[ block ] = information->allocation_size; ffc0b730: 54 00 04 3e clrlwi r0,r0,16 information->inactive = ffc0b734: b1 3f 00 2c sth r9,44(r31) _Chain_Append( &information->Inactive, &the_object->Node ); index++; } information->inactive_per_block[ block ] = information->allocation_size; ffc0b738: 7c 0b e1 2e stwx r0,r11,r28 information->inactive = (Objects_Maximum)(information->inactive + information->allocation_size); } ffc0b73c: 80 01 00 4c lwz r0,76(r1) ffc0b740: 82 a1 00 1c lwz r21,28(r1) ffc0b744: 7c 08 03 a6 mtlr r0 ffc0b748: 82 c1 00 20 lwz r22,32(r1) ffc0b74c: 82 e1 00 24 lwz r23,36(r1) ffc0b750: 83 01 00 28 lwz r24,40(r1) ffc0b754: 83 21 00 2c lwz r25,44(r1) ffc0b758: 83 41 00 30 lwz r26,48(r1) ffc0b75c: 83 61 00 34 lwz r27,52(r1) ffc0b760: 83 81 00 38 lwz r28,56(r1) ffc0b764: 83 a1 00 3c lwz r29,60(r1) ffc0b768: 83 c1 00 40 lwz r30,64(r1) ffc0b76c: 83 e1 00 44 lwz r31,68(r1) ffc0b770: 38 21 00 48 addi r1,r1,72 ffc0b774: 4e 80 00 20 blr =============================================================================== ffc0b844 <_Objects_Get_information>: Objects_Information *_Objects_Get_information( Objects_APIs the_api, uint32_t the_class ) { ffc0b844: 94 21 ff f0 stwu r1,-16(r1) ffc0b848: 7c 08 02 a6 mflr r0 ffc0b84c: 93 e1 00 0c stw r31,12(r1) Objects_Information *info; int the_class_api_maximum; if ( !the_class ) ffc0b850: 7c 9f 23 79 mr. r31,r4 Objects_Information *_Objects_Get_information( Objects_APIs the_api, uint32_t the_class ) { ffc0b854: 93 c1 00 08 stw r30,8(r1) ffc0b858: 7c 7e 1b 78 mr r30,r3 ffc0b85c: 90 01 00 14 stw r0,20(r1) Objects_Information *info; int the_class_api_maximum; if ( !the_class ) ffc0b860: 41 a2 00 4c beq+ ffc0b8ac <_Objects_Get_information+0x68> /* * 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 ); ffc0b864: 48 00 98 e1 bl ffc15144 <_Objects_API_maximum_class> if ( the_class_api_maximum == 0 ) ffc0b868: 2c 03 00 00 cmpwi r3,0 ffc0b86c: 41 a2 00 40 beq+ ffc0b8ac <_Objects_Get_information+0x68> return NULL; if ( the_class > (uint32_t) the_class_api_maximum ) ffc0b870: 7f 9f 18 40 cmplw cr7,r31,r3 ffc0b874: 41 bd 00 38 bgt+ cr7,ffc0b8ac <_Objects_Get_information+0x68> return NULL; if ( !_Objects_Information_table[ the_api ] ) ffc0b878: 3d 20 00 00 lis r9,0 ffc0b87c: 57 de 10 3a rlwinm r30,r30,2,0,29 ffc0b880: 39 29 2c e0 addi r9,r9,11488 ffc0b884: 7d 29 f0 2e lwzx r9,r9,r30 ffc0b888: 2f 89 00 00 cmpwi cr7,r9,0 ffc0b88c: 41 be 00 20 beq+ cr7,ffc0b8ac <_Objects_Get_information+0x68><== NEVER TAKEN return NULL; info = _Objects_Information_table[ the_api ][ the_class ]; ffc0b890: 57 ff 10 3a rlwinm r31,r31,2,0,29 ffc0b894: 7c 69 f8 2e lwzx r3,r9,r31 if ( !info ) ffc0b898: 2f 83 00 00 cmpwi cr7,r3,0 ffc0b89c: 41 be 00 14 beq+ cr7,ffc0b8b0 <_Objects_Get_information+0x6c><== NEVER TAKEN * In a multprocessing configuration, we may access remote objects. * Thus we may have 0 local instances and still have a valid object * pointer. */ #if !defined(RTEMS_MULTIPROCESSING) if ( info->maximum == 0 ) ffc0b8a0: a0 03 00 10 lhz r0,16(r3) ffc0b8a4: 2f 80 00 00 cmpwi cr7,r0,0 ffc0b8a8: 40 be 00 08 bne+ cr7,ffc0b8b0 <_Objects_Get_information+0x6c> ffc0b8ac: 38 60 00 00 li r3,0 return NULL; #endif return info; } ffc0b8b0: 80 01 00 14 lwz r0,20(r1) ffc0b8b4: 83 c1 00 08 lwz r30,8(r1) ffc0b8b8: 7c 08 03 a6 mtlr r0 ffc0b8bc: 83 e1 00 0c lwz r31,12(r1) ffc0b8c0: 38 21 00 10 addi r1,r1,16 ffc0b8c4: 4e 80 00 20 blr =============================================================================== ffc1c81c <_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; ffc1c81c: 81 23 00 08 lwz r9,8(r3) if ( information->maximum >= index ) { ffc1c820: a0 03 00 10 lhz r0,16(r3) /* * You can't just extract the index portion or you can get tricked * by a value between 1 and maximum. */ index = id - information->minimum_id + 1; ffc1c824: 21 29 00 01 subfic r9,r9,1 ffc1c828: 7d 29 22 14 add r9,r9,r4 if ( information->maximum >= index ) { ffc1c82c: 7f 80 48 40 cmplw cr7,r0,r9 ffc1c830: 41 9c 00 24 blt- cr7,ffc1c854 <_Objects_Get_no_protection+0x38> if ( (the_object = information->local_table[ index ]) != NULL ) { ffc1c834: 81 63 00 1c lwz r11,28(r3) ffc1c838: 55 29 10 3a rlwinm r9,r9,2,0,29 ffc1c83c: 7c 6b 48 2e lwzx r3,r11,r9 ffc1c840: 2f 83 00 00 cmpwi cr7,r3,0 ffc1c844: 41 9e 00 10 beq- cr7,ffc1c854 <_Objects_Get_no_protection+0x38><== NEVER TAKEN *location = OBJECTS_LOCAL; ffc1c848: 38 00 00 00 li r0,0 ffc1c84c: 90 05 00 00 stw r0,0(r5) return the_object; ffc1c850: 4e 80 00 20 blr /* * This isn't supported or required yet for Global objects so * if it isn't local, we don't find it. */ *location = OBJECTS_ERROR; ffc1c854: 38 00 00 01 li r0,1 ffc1c858: 90 05 00 00 stw r0,0(r5) ffc1c85c: 38 60 00 00 li r3,0 return NULL; } ffc1c860: 4e 80 00 20 blr =============================================================================== ffc0b40c <_Objects_Id_to_name>: /* * Caller is trusted for name != NULL. */ tmpId = (id == OBJECTS_ID_OF_SELF) ? _Thread_Executing->Object.id : id; ffc0b40c: 2c 03 00 00 cmpwi r3,0 */ Objects_Name_or_id_lookup_errors _Objects_Id_to_name ( Objects_Id id, Objects_Name *name ) { ffc0b410: 94 21 ff e0 stwu r1,-32(r1) ffc0b414: 7c 08 02 a6 mflr r0 ffc0b418: 93 e1 00 1c stw r31,28(r1) ffc0b41c: 7c 9f 23 78 mr r31,r4 ffc0b420: 90 01 00 24 stw r0,36(r1) /* * Caller is trusted for name != NULL. */ tmpId = (id == OBJECTS_ID_OF_SELF) ? _Thread_Executing->Object.id : id; ffc0b424: 41 82 00 0c beq- ffc0b430 <_Objects_Id_to_name+0x24> ffc0b428: 7c 64 1b 78 mr r4,r3 ffc0b42c: 48 00 00 10 b ffc0b43c <_Objects_Id_to_name+0x30> ffc0b430: 3d 20 00 00 lis r9,0 ffc0b434: 81 29 27 fc lwz r9,10236(r9) ffc0b438: 80 89 00 08 lwz r4,8(r9) */ RTEMS_INLINE_ROUTINE Objects_APIs _Objects_Get_API( Objects_Id id ) { return (Objects_APIs) ((id >> OBJECTS_API_START_BIT) & OBJECTS_API_VALID_BITS); ffc0b43c: 54 89 47 7e rlwinm r9,r4,8,29,31 */ RTEMS_INLINE_ROUTINE bool _Objects_Is_api_valid( uint32_t the_api ) { if ( !the_api || the_api > OBJECTS_APIS_LAST ) ffc0b440: 38 09 ff ff addi r0,r9,-1 ffc0b444: 2b 80 00 03 cmplwi cr7,r0,3 ffc0b448: 41 9d 00 48 bgt- cr7,ffc0b490 <_Objects_Id_to_name+0x84> ffc0b44c: 48 00 00 5c b ffc0b4a8 <_Objects_Id_to_name+0x9c> if ( !_Objects_Information_table[ the_api ] ) return OBJECTS_INVALID_ID; the_class = _Objects_Get_class( tmpId ); information = _Objects_Information_table[ the_api ][ the_class ]; ffc0b450: 54 80 3e 7a rlwinm r0,r4,7,25,29 ffc0b454: 7c 69 00 2e lwzx r3,r9,r0 if ( !information ) ffc0b458: 2f 83 00 00 cmpwi cr7,r3,0 ffc0b45c: 41 9e 00 34 beq- cr7,ffc0b490 <_Objects_Id_to_name+0x84><== NEVER TAKEN return OBJECTS_INVALID_ID; #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES) if ( information->is_string ) ffc0b460: 88 03 00 38 lbz r0,56(r3) ffc0b464: 2f 80 00 00 cmpwi cr7,r0,0 ffc0b468: 40 9e 00 28 bne- cr7,ffc0b490 <_Objects_Id_to_name+0x84><== NEVER TAKEN return OBJECTS_INVALID_ID; #endif the_object = _Objects_Get( information, tmpId, &ignored_location ); ffc0b46c: 38 a1 00 08 addi r5,r1,8 ffc0b470: 4b ff ff 0d bl ffc0b37c <_Objects_Get> if ( !the_object ) ffc0b474: 2c 03 00 00 cmpwi r3,0 ffc0b478: 41 82 00 18 beq- ffc0b490 <_Objects_Id_to_name+0x84> return OBJECTS_INVALID_ID; *name = the_object->name; ffc0b47c: 80 03 00 0c lwz r0,12(r3) ffc0b480: 90 1f 00 00 stw r0,0(r31) _Thread_Enable_dispatch(); ffc0b484: 48 00 0a c1 bl ffc0bf44 <_Thread_Enable_dispatch> ffc0b488: 38 60 00 00 li r3,0 return OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL; ffc0b48c: 48 00 00 08 b ffc0b494 <_Objects_Id_to_name+0x88> ffc0b490: 38 60 00 03 li r3,3 } ffc0b494: 80 01 00 24 lwz r0,36(r1) ffc0b498: 83 e1 00 1c lwz r31,28(r1) ffc0b49c: 38 21 00 20 addi r1,r1,32 ffc0b4a0: 7c 08 03 a6 mtlr r0 ffc0b4a4: 4e 80 00 20 blr the_api = _Objects_Get_API( tmpId ); if ( !_Objects_Is_api_valid( the_api ) ) return OBJECTS_INVALID_ID; if ( !_Objects_Information_table[ the_api ] ) ffc0b4a8: 3d 60 00 00 lis r11,0 ffc0b4ac: 55 29 10 3a rlwinm r9,r9,2,0,29 ffc0b4b0: 39 6b 2c 80 addi r11,r11,11392 ffc0b4b4: 7d 2b 48 2e lwzx r9,r11,r9 ffc0b4b8: 2f 89 00 00 cmpwi cr7,r9,0 ffc0b4bc: 40 9e ff 94 bne+ cr7,ffc0b450 <_Objects_Id_to_name+0x44> ffc0b4c0: 4b ff ff d0 b ffc0b490 <_Objects_Id_to_name+0x84> =============================================================================== ffc0a5e0 <_Objects_Set_name>: bool _Objects_Set_name( Objects_Information *information, Objects_Control *the_object, const char *name ) { ffc0a5e0: 94 21 ff e8 stwu r1,-24(r1) ffc0a5e4: 7c 08 02 a6 mflr r0 ffc0a5e8: 90 01 00 1c stw r0,28(r1) ffc0a5ec: 93 c1 00 10 stw r30,16(r1) ffc0a5f0: 7c 9e 23 78 mr r30,r4 size_t length; const char *s; s = name; length = strnlen( name, information->name_length ); ffc0a5f4: a0 83 00 3a lhz r4,58(r3) bool _Objects_Set_name( Objects_Information *information, Objects_Control *the_object, const char *name ) { ffc0a5f8: 93 a1 00 0c stw r29,12(r1) ffc0a5fc: 7c 7d 1b 78 mr r29,r3 size_t length; const char *s; s = name; length = strnlen( name, information->name_length ); ffc0a600: 7c a3 2b 78 mr r3,r5 bool _Objects_Set_name( Objects_Information *information, Objects_Control *the_object, const char *name ) { ffc0a604: 93 81 00 08 stw r28,8(r1) ffc0a608: 7c bc 2b 78 mr r28,r5 ffc0a60c: 93 e1 00 14 stw r31,20(r1) size_t length; const char *s; s = name; length = strnlen( name, information->name_length ); ffc0a610: 48 00 a0 75 bl ffc14684 ffc0a614: 7c 7f 1b 78 mr r31,r3 #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES) if ( information->is_string ) { ffc0a618: 88 1d 00 38 lbz r0,56(r29) ffc0a61c: 2f 80 00 00 cmpwi cr7,r0,0 ffc0a620: 41 be 00 54 beq+ cr7,ffc0a674 <_Objects_Set_name+0x94> char *d; d = _Workspace_Allocate( length + 1 ); ffc0a624: 38 63 00 01 addi r3,r3,1 ffc0a628: 48 00 22 15 bl ffc0c83c <_Workspace_Allocate> if ( !d ) ffc0a62c: 7c 7d 1b 79 mr. r29,r3 ffc0a630: 38 60 00 00 li r3,0 ffc0a634: 41 82 00 8c beq- ffc0a6c0 <_Objects_Set_name+0xe0> <== NEVER TAKEN return false; if ( the_object->name.name_p ) { ffc0a638: 80 7e 00 0c lwz r3,12(r30) ffc0a63c: 2f 83 00 00 cmpwi cr7,r3,0 ffc0a640: 41 9e 00 10 beq- cr7,ffc0a650 <_Objects_Set_name+0x70> _Workspace_Free( (void *)the_object->name.name_p ); ffc0a644: 48 00 22 2d bl ffc0c870 <_Workspace_Free> the_object->name.name_p = NULL; ffc0a648: 38 00 00 00 li r0,0 ffc0a64c: 90 1e 00 0c stw r0,12(r30) } strncpy( d, name, length ); ffc0a650: 7f 84 e3 78 mr r4,r28 ffc0a654: 7f a3 eb 78 mr r3,r29 ffc0a658: 7f e5 fb 78 mr r5,r31 ffc0a65c: 48 00 9f 49 bl ffc145a4 d[length] = '\0'; ffc0a660: 38 00 00 00 li r0,0 ffc0a664: 7c 1d f9 ae stbx r0,r29,r31 the_object->name.name_p = d; ffc0a668: 38 60 00 01 li r3,1 ffc0a66c: 93 be 00 0c stw r29,12(r30) ffc0a670: 48 00 00 50 b ffc0a6c0 <_Objects_Set_name+0xe0> } else #endif { the_object->name.name_u32 = _Objects_Build_name( ffc0a674: 2b 83 00 01 cmplwi cr7,r3,1 ffc0a678: 89 5c 00 00 lbz r10,0(r28) ffc0a67c: 40 9d 00 64 ble- cr7,ffc0a6e0 <_Objects_Set_name+0x100> ffc0a680: 2b 83 00 02 cmplwi cr7,r3,2 ffc0a684: 89 7c 00 01 lbz r11,1(r28) ffc0a688: 55 6b 80 1e rlwinm r11,r11,16,0,15 ffc0a68c: 40 9d 00 58 ble- cr7,ffc0a6e4 <_Objects_Set_name+0x104> ffc0a690: 2b 83 00 03 cmplwi cr7,r3,3 ffc0a694: 89 3c 00 02 lbz r9,2(r28) ffc0a698: 38 00 00 20 li r0,32 ffc0a69c: 55 29 40 2e rlwinm r9,r9,8,0,23 ffc0a6a0: 40 9d 00 08 ble- cr7,ffc0a6a8 <_Objects_Set_name+0xc8> ffc0a6a4: 88 1c 00 03 lbz r0,3(r28) ffc0a6a8: 55 4a c0 0e rlwinm r10,r10,24,0,7 ffc0a6ac: 7d 6b 53 78 or r11,r11,r10 ffc0a6b0: 7d 69 4b 78 or r9,r11,r9 ffc0a6b4: 7d 20 03 78 or r0,r9,r0 ffc0a6b8: 90 1e 00 0c stw r0,12(r30) ffc0a6bc: 38 60 00 01 li r3,1 ); } return true; } ffc0a6c0: 80 01 00 1c lwz r0,28(r1) ffc0a6c4: 83 81 00 08 lwz r28,8(r1) ffc0a6c8: 7c 08 03 a6 mtlr r0 ffc0a6cc: 83 a1 00 0c lwz r29,12(r1) ffc0a6d0: 83 c1 00 10 lwz r30,16(r1) ffc0a6d4: 83 e1 00 14 lwz r31,20(r1) ffc0a6d8: 38 21 00 18 addi r1,r1,24 ffc0a6dc: 4e 80 00 20 blr d[length] = '\0'; the_object->name.name_p = d; } else #endif { the_object->name.name_u32 = _Objects_Build_name( ffc0a6e0: 3d 60 00 20 lis r11,32 ffc0a6e4: 39 20 20 00 li r9,8192 ffc0a6e8: 38 00 00 20 li r0,32 ffc0a6ec: 4b ff ff bc b ffc0a6a8 <_Objects_Set_name+0xc8> =============================================================================== ffc0bb94 <_Objects_Shrink_information>: */ void _Objects_Shrink_information( Objects_Information *information ) { ffc0bb94: 94 21 ff e8 stwu r1,-24(r1) ffc0bb98: 7c 08 02 a6 mflr r0 /* * Search the list to find block or chunk with all objects inactive. */ index_base = _Objects_Get_index( information->minimum_id ); block_count = (information->maximum - index_base) / ffc0bb9c: 39 20 00 00 li r9,0 */ void _Objects_Shrink_information( Objects_Information *information ) { ffc0bba0: 90 01 00 1c stw r0,28(r1) ffc0bba4: 93 c1 00 10 stw r30,16(r1) /* * Search the list to find block or chunk with all objects inactive. */ index_base = _Objects_Get_index( information->minimum_id ); block_count = (information->maximum - index_base) / ffc0bba8: a1 43 00 10 lhz r10,16(r3) /* * Search the list to find block or chunk with all objects inactive. */ index_base = _Objects_Get_index( information->minimum_id ); ffc0bbac: a3 c3 00 0a lhz r30,10(r3) block_count = (information->maximum - index_base) / ffc0bbb0: a1 63 00 14 lhz r11,20(r3) ffc0bbb4: 7d 5e 50 50 subf r10,r30,r10 */ void _Objects_Shrink_information( Objects_Information *information ) { ffc0bbb8: 93 e1 00 14 stw r31,20(r1) /* * Search the list to find block or chunk with all objects inactive. */ index_base = _Objects_Get_index( information->minimum_id ); block_count = (information->maximum - index_base) / ffc0bbbc: 7d 4a 5b 96 divwu r10,r10,r11 */ void _Objects_Shrink_information( Objects_Information *information ) { ffc0bbc0: 93 81 00 08 stw r28,8(r1) ffc0bbc4: 93 a1 00 0c stw r29,12(r1) ffc0bbc8: 2f 8a 00 00 cmpwi cr7,r10,0 ffc0bbcc: 7c 7f 1b 78 mr r31,r3 /* * Search the list to find block or chunk with all objects inactive. */ index_base = _Objects_Get_index( information->minimum_id ); block_count = (information->maximum - index_base) / ffc0bbd0: 38 0a 00 01 addi r0,r10,1 ffc0bbd4: 40 be 00 88 bne+ cr7,ffc0bc5c <_Objects_Shrink_information+0xc8><== ALWAYS TAKEN ffc0bbd8: 38 00 00 01 li r0,1 <== NOT EXECUTED ffc0bbdc: 48 00 00 80 b ffc0bc5c <_Objects_Shrink_information+0xc8><== NOT EXECUTED information->allocation_size; for ( block = 0; block < block_count; block++ ) { if ( information->inactive_per_block[ block ] == ffc0bbe0: 81 5f 00 30 lwz r10,48(r31) index_base = _Objects_Get_index( information->minimum_id ); block_count = (information->maximum - index_base) / information->allocation_size; for ( block = 0; block < block_count; block++ ) { ffc0bbe4: 39 29 00 01 addi r9,r9,1 if ( information->inactive_per_block[ block ] == ffc0bbe8: 7d 4a e8 2e lwzx r10,r10,r29 ffc0bbec: 7f 8a 58 00 cmpw cr7,r10,r11 ffc0bbf0: 40 be 00 68 bne+ cr7,ffc0bc58 <_Objects_Shrink_information+0xc4> information->allocation_size ) { /* * Assume the Inactive chain is never empty at this point */ the_object = (Objects_Control *) information->Inactive.first; ffc0bbf4: 80 7f 00 20 lwz r3,32(r31) do { index = _Objects_Get_index( the_object->id ); ffc0bbf8: a0 03 00 0a lhz r0,10(r3) /* * Get the next node before the node is extracted */ extract_me = the_object; the_object = (Objects_Control *) the_object->Node.next; ffc0bbfc: 83 83 00 00 lwz r28,0(r3) if ((index >= index_base) && ffc0bc00: 7f 80 f0 40 cmplw cr7,r0,r30 ffc0bc04: 41 9c 00 18 blt- cr7,ffc0bc1c <_Objects_Shrink_information+0x88> (index < (index_base + information->allocation_size))) { ffc0bc08: a1 3f 00 14 lhz r9,20(r31) ffc0bc0c: 7d 3e 4a 14 add r9,r30,r9 ffc0bc10: 7f 80 48 40 cmplw cr7,r0,r9 ffc0bc14: 40 bc 00 08 bge+ cr7,ffc0bc1c <_Objects_Shrink_information+0x88> _Chain_Extract( &extract_me->Node ); ffc0bc18: 4b ff ed 6d bl ffc0a984 <_Chain_Extract> } } while ( the_object ); ffc0bc1c: 2f 9c 00 00 cmpwi cr7,r28,0 ffc0bc20: 7f 83 e3 78 mr r3,r28 ffc0bc24: 40 9e ff d4 bne+ cr7,ffc0bbf8 <_Objects_Shrink_information+0x64> /* * Free the memory and reset the structures in the object' information */ _Workspace_Free( information->object_blocks[ block ] ); ffc0bc28: 81 3f 00 34 lwz r9,52(r31) ffc0bc2c: 7c 69 e8 2e lwzx r3,r9,r29 ffc0bc30: 48 00 20 35 bl ffc0dc64 <_Workspace_Free> information->object_blocks[ block ] = NULL; information->inactive_per_block[ block ] = 0; information->inactive -= information->allocation_size; ffc0bc34: a1 5f 00 2c lhz r10,44(r31) ffc0bc38: a0 1f 00 14 lhz r0,20(r31) /* * Free the memory and reset the structures in the object' information */ _Workspace_Free( information->object_blocks[ block ] ); information->object_blocks[ block ] = NULL; ffc0bc3c: 81 3f 00 34 lwz r9,52(r31) information->inactive_per_block[ block ] = 0; ffc0bc40: 81 7f 00 30 lwz r11,48(r31) information->inactive -= information->allocation_size; ffc0bc44: 7c 00 50 50 subf r0,r0,r10 ffc0bc48: b0 1f 00 2c sth r0,44(r31) * Free the memory and reset the structures in the object' information */ _Workspace_Free( information->object_blocks[ block ] ); information->object_blocks[ block ] = NULL; information->inactive_per_block[ block ] = 0; ffc0bc4c: 7f 8b e9 2e stwx r28,r11,r29 /* * Free the memory and reset the structures in the object' information */ _Workspace_Free( information->object_blocks[ block ] ); information->object_blocks[ block ] = NULL; ffc0bc50: 7f 89 e9 2e stwx r28,r9,r29 information->inactive_per_block[ block ] = 0; information->inactive -= information->allocation_size; return; ffc0bc54: 48 00 00 14 b ffc0bc68 <_Objects_Shrink_information+0xd4> } index_base += information->allocation_size; ffc0bc58: 7f de 5a 14 add r30,r30,r11 index_base = _Objects_Get_index( information->minimum_id ); block_count = (information->maximum - index_base) / information->allocation_size; for ( block = 0; block < block_count; block++ ) { ffc0bc5c: 34 00 ff ff addic. r0,r0,-1 ffc0bc60: 55 3d 10 3a rlwinm r29,r9,2,0,29 ffc0bc64: 40 82 ff 7c bne+ ffc0bbe0 <_Objects_Shrink_information+0x4c> return; } index_base += information->allocation_size; } } ffc0bc68: 80 01 00 1c lwz r0,28(r1) ffc0bc6c: 83 81 00 08 lwz r28,8(r1) ffc0bc70: 7c 08 03 a6 mtlr r0 ffc0bc74: 83 a1 00 0c lwz r29,12(r1) ffc0bc78: 83 c1 00 10 lwz r30,16(r1) ffc0bc7c: 83 e1 00 14 lwz r31,20(r1) ffc0bc80: 38 21 00 18 addi r1,r1,24 ffc0bc84: 4e 80 00 20 blr =============================================================================== ffc091e8 <_POSIX_Condition_variables_Wait_support>: pthread_cond_t *cond, pthread_mutex_t *mutex, Watchdog_Interval timeout, bool already_timedout ) { ffc091e8: 94 21 ff d0 stwu r1,-48(r1) ffc091ec: 7c 08 02 a6 mflr r0 ffc091f0: 93 a1 00 24 stw r29,36(r1) register POSIX_Condition_variables_Control *the_cond; Objects_Locations location; int status; int mutex_status; if ( !_POSIX_Mutex_Get( mutex, &location ) ) { ffc091f4: 3b a1 00 08 addi r29,r1,8 pthread_cond_t *cond, pthread_mutex_t *mutex, Watchdog_Interval timeout, bool already_timedout ) { ffc091f8: 93 e1 00 2c stw r31,44(r1) ffc091fc: 7c 9f 23 78 mr r31,r4 register POSIX_Condition_variables_Control *the_cond; Objects_Locations location; int status; int mutex_status; if ( !_POSIX_Mutex_Get( mutex, &location ) ) { ffc09200: 7f a4 eb 78 mr r4,r29 pthread_cond_t *cond, pthread_mutex_t *mutex, Watchdog_Interval timeout, bool already_timedout ) { ffc09204: 93 c1 00 28 stw r30,40(r1) ffc09208: 7c 7e 1b 78 mr r30,r3 register POSIX_Condition_variables_Control *the_cond; Objects_Locations location; int status; int mutex_status; if ( !_POSIX_Mutex_Get( mutex, &location ) ) { ffc0920c: 7f e3 fb 78 mr r3,r31 pthread_cond_t *cond, pthread_mutex_t *mutex, Watchdog_Interval timeout, bool already_timedout ) { ffc09210: 93 61 00 1c stw r27,28(r1) ffc09214: 7c db 33 78 mr r27,r6 ffc09218: 93 81 00 20 stw r28,32(r1) ffc0921c: 7c bc 2b 78 mr r28,r5 ffc09220: 90 01 00 34 stw r0,52(r1) ffc09224: 93 41 00 18 stw r26,24(r1) register POSIX_Condition_variables_Control *the_cond; Objects_Locations location; int status; int mutex_status; if ( !_POSIX_Mutex_Get( mutex, &location ) ) { ffc09228: 48 00 02 3d bl ffc09464 <_POSIX_Mutex_Get> ffc0922c: 2f 83 00 00 cmpwi cr7,r3,0 ffc09230: 41 9e 00 d8 beq- cr7,ffc09308 <_POSIX_Condition_variables_Wait_support+0x120> */ RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void ) { RTEMS_COMPILER_MEMORY_BARRIER(); _Thread_Dispatch_disable_level -= 1; ffc09234: 3d 20 00 00 lis r9,0 ffc09238: 81 69 27 c8 lwz r11,10184(r9) return EINVAL; } _Thread_Unnest_dispatch(); the_cond = _POSIX_Condition_variables_Get( cond, &location ); ffc0923c: 7f a4 eb 78 mr r4,r29 ffc09240: 7f c3 f3 78 mr r3,r30 ffc09244: 38 0b ff ff addi r0,r11,-1 ffc09248: 90 09 27 c8 stw r0,10184(r9) ffc0924c: 4b ff fc e9 bl ffc08f34 <_POSIX_Condition_variables_Get> ffc09250: 7c 7a 1b 78 mr r26,r3 switch ( location ) { ffc09254: 80 01 00 08 lwz r0,8(r1) ffc09258: 2f 80 00 00 cmpwi cr7,r0,0 ffc0925c: 40 9e 00 ac bne- cr7,ffc09308 <_POSIX_Condition_variables_Wait_support+0x120> case OBJECTS_LOCAL: if ( the_cond->Mutex && ( the_cond->Mutex != *mutex ) ) { ffc09260: 80 03 00 14 lwz r0,20(r3) ffc09264: 2f 80 00 00 cmpwi cr7,r0,0 ffc09268: 41 9e 00 18 beq- cr7,ffc09280 <_POSIX_Condition_variables_Wait_support+0x98> ffc0926c: 81 3f 00 00 lwz r9,0(r31) ffc09270: 7f 80 48 00 cmpw cr7,r0,r9 ffc09274: 41 9e 00 0c beq- cr7,ffc09280 <_POSIX_Condition_variables_Wait_support+0x98> _Thread_Enable_dispatch(); ffc09278: 48 00 3d 21 bl ffc0cf98 <_Thread_Enable_dispatch> ffc0927c: 48 00 00 8c b ffc09308 <_POSIX_Condition_variables_Wait_support+0x120> return EINVAL; } (void) pthread_mutex_unlock( mutex ); ffc09280: 7f e3 fb 78 mr r3,r31 ffc09284: 48 00 04 99 bl ffc0971c _Thread_Enable_dispatch(); return EINVAL; } */ if ( !already_timedout ) { ffc09288: 2f 9b 00 00 cmpwi cr7,r27,0 ffc0928c: 40 be 00 64 bne+ cr7,ffc092f0 <_POSIX_Condition_variables_Wait_support+0x108> the_cond->Mutex = *mutex; _Thread_queue_Enter_critical_section( &the_cond->Wait_queue ); _Thread_Executing->Wait.return_code = 0; ffc09290: 3f a0 00 00 lis r29,0 return EINVAL; } */ if ( !already_timedout ) { the_cond->Mutex = *mutex; ffc09294: 80 1f 00 00 lwz r0,0(r31) _Thread_queue_Enter_critical_section( &the_cond->Wait_queue ); _Thread_Executing->Wait.return_code = 0; ffc09298: 81 3d 28 08 lwz r9,10248(r29) 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; ffc0929c: 39 40 00 01 li r10,1 return EINVAL; } */ if ( !already_timedout ) { the_cond->Mutex = *mutex; ffc092a0: 90 1a 00 14 stw r0,20(r26) _Thread_queue_Enter_critical_section( &the_cond->Wait_queue ); _Thread_Executing->Wait.return_code = 0; _Thread_Executing->Wait.queue = &the_cond->Wait_queue; ffc092a4: 38 1a 00 18 addi r0,r26,24 _Thread_Executing->Wait.id = *cond; _Thread_queue_Enqueue( &the_cond->Wait_queue, timeout ); ffc092a8: 3c a0 ff c1 lis r5,-63 if ( !already_timedout ) { the_cond->Mutex = *mutex; _Thread_queue_Enter_critical_section( &the_cond->Wait_queue ); _Thread_Executing->Wait.return_code = 0; ffc092ac: 93 69 00 34 stw r27,52(r9) _Thread_Executing->Wait.queue = &the_cond->Wait_queue; _Thread_Executing->Wait.id = *cond; _Thread_queue_Enqueue( &the_cond->Wait_queue, timeout ); ffc092b0: 7c 03 03 78 mr r3,r0 ffc092b4: 7f 84 e3 78 mr r4,r28 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; _Thread_Executing->Wait.id = *cond; ffc092b8: 81 7e 00 00 lwz r11,0(r30) _Thread_queue_Enqueue( &the_cond->Wait_queue, timeout ); ffc092bc: 38 a5 da 14 addi r5,r5,-9708 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; ffc092c0: 90 09 00 44 stw r0,68(r9) _Thread_Executing->Wait.id = *cond; ffc092c4: 91 69 00 20 stw r11,32(r9) ffc092c8: 91 5a 00 48 stw r10,72(r26) _Thread_queue_Enqueue( &the_cond->Wait_queue, timeout ); ffc092cc: 48 00 42 cd bl ffc0d598 <_Thread_queue_Enqueue_with_handler> _Thread_Enable_dispatch(); ffc092d0: 48 00 3c c9 bl ffc0cf98 <_Thread_Enable_dispatch> /* * Switch ourself out because we blocked as a result of the * _Thread_queue_Enqueue. */ status = _Thread_Executing->Wait.return_code; ffc092d4: 81 3d 28 08 lwz r9,10248(r29) ffc092d8: 83 c9 00 34 lwz r30,52(r9) if ( status && status != ETIMEDOUT ) ffc092dc: 2f 9e 00 00 cmpwi cr7,r30,0 ffc092e0: 41 be 00 18 beq+ cr7,ffc092f8 <_POSIX_Condition_variables_Wait_support+0x110> ffc092e4: 2f 9e 00 74 cmpwi cr7,r30,116 ffc092e8: 40 be 00 24 bne+ cr7,ffc0930c <_POSIX_Condition_variables_Wait_support+0x124><== NEVER TAKEN ffc092ec: 48 00 00 0c b ffc092f8 <_POSIX_Condition_variables_Wait_support+0x110> return status; } else { _Thread_Enable_dispatch(); ffc092f0: 48 00 3c a9 bl ffc0cf98 <_Thread_Enable_dispatch> ffc092f4: 3b c0 00 74 li r30,116 /* * When we get here the dispatch disable level is 0. */ mutex_status = pthread_mutex_lock( mutex ); ffc092f8: 7f e3 fb 78 mr r3,r31 ffc092fc: 48 00 03 69 bl ffc09664 if ( mutex_status ) ffc09300: 2f 83 00 00 cmpwi cr7,r3,0 ffc09304: 41 be 00 08 beq+ cr7,ffc0930c <_POSIX_Condition_variables_Wait_support+0x124> ffc09308: 3b c0 00 16 li r30,22 case OBJECTS_ERROR: break; } return EINVAL; } ffc0930c: 80 01 00 34 lwz r0,52(r1) ffc09310: 7f c3 f3 78 mr r3,r30 ffc09314: 83 41 00 18 lwz r26,24(r1) ffc09318: 7c 08 03 a6 mtlr r0 ffc0931c: 83 61 00 1c lwz r27,28(r1) ffc09320: 83 81 00 20 lwz r28,32(r1) ffc09324: 83 a1 00 24 lwz r29,36(r1) ffc09328: 83 c1 00 28 lwz r30,40(r1) ffc0932c: 83 e1 00 2c lwz r31,44(r1) ffc09330: 38 21 00 30 addi r1,r1,48 ffc09334: 4e 80 00 20 blr =============================================================================== ffc0d790 <_POSIX_Message_queue_Receive_support>: size_t msg_len, unsigned int *msg_prio, bool wait, Watchdog_Interval timeout ) { ffc0d790: 94 21 ff c8 stwu r1,-56(r1) ffc0d794: 7c 08 02 a6 mflr r0 ffc0d798: 93 e1 00 34 stw r31,52(r1) ffc0d79c: 7c 7f 1b 78 mr r31,r3 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( ffc0d7a0: 3c 60 00 00 lis r3,0 ffc0d7a4: 93 81 00 28 stw r28,40(r1) ffc0d7a8: 38 63 36 44 addi r3,r3,13892 ffc0d7ac: 7c bc 2b 78 mr r28,r5 ffc0d7b0: 93 a1 00 2c stw r29,44(r1) ffc0d7b4: 38 a1 00 08 addi r5,r1,8 ffc0d7b8: 7c 9d 23 78 mr r29,r4 ffc0d7bc: 7f e4 fb 78 mr r4,r31 ffc0d7c0: 90 01 00 3c stw r0,60(r1) ffc0d7c4: 93 61 00 24 stw r27,36(r1) ffc0d7c8: 7c fb 3b 78 mr r27,r7 ffc0d7cc: 93 c1 00 30 stw r30,48(r1) ffc0d7d0: 7c de 33 78 mr r30,r6 ffc0d7d4: 91 01 00 18 stw r8,24(r1) ffc0d7d8: 48 00 3a a9 bl ffc11280 <_Objects_Get> Objects_Locations location; size_t length_out; bool do_wait; the_mq_fd = _POSIX_Message_queue_Get_fd( mqdes, &location ); switch ( location ) { ffc0d7dc: 80 01 00 08 lwz r0,8(r1) ffc0d7e0: 81 01 00 18 lwz r8,24(r1) ffc0d7e4: 2f 80 00 00 cmpwi cr7,r0,0 ffc0d7e8: 40 9e 00 bc bne- cr7,ffc0d8a4 <_POSIX_Message_queue_Receive_support+0x114> case OBJECTS_LOCAL: if ( (the_mq_fd->oflag & O_ACCMODE) == O_WRONLY ) { ffc0d7ec: 80 03 00 14 lwz r0,20(r3) ffc0d7f0: 54 09 07 be clrlwi r9,r0,30 ffc0d7f4: 2f 89 00 01 cmpwi cr7,r9,1 ffc0d7f8: 40 be 00 0c bne+ cr7,ffc0d804 <_POSIX_Message_queue_Receive_support+0x74> _Thread_Enable_dispatch(); ffc0d7fc: 48 00 46 01 bl ffc11dfc <_Thread_Enable_dispatch> ffc0d800: 48 00 00 a4 b ffc0d8a4 <_POSIX_Message_queue_Receive_support+0x114> rtems_set_errno_and_return_minus_one( EBADF ); } the_mq = the_mq_fd->Queue; ffc0d804: 80 63 00 10 lwz r3,16(r3) if ( msg_len < the_mq->Message_queue.maximum_message_size ) { ffc0d808: 81 23 00 68 lwz r9,104(r3) ffc0d80c: 7f 9c 48 40 cmplw cr7,r28,r9 ffc0d810: 40 bc 00 14 bge+ cr7,ffc0d824 <_POSIX_Message_queue_Receive_support+0x94> _Thread_Enable_dispatch(); ffc0d814: 48 00 45 e9 bl ffc11dfc <_Thread_Enable_dispatch> rtems_set_errno_and_return_minus_one( EMSGSIZE ); ffc0d818: 48 00 bf 09 bl ffc19720 <__errno> ffc0d81c: 38 00 00 7a li r0,122 ffc0d820: 48 00 00 8c b ffc0d8ac <_POSIX_Message_queue_Receive_support+0x11c> length_out = -1; /* * A timed receive with a bad time will do a poll regardless. */ if ( wait ) ffc0d824: 2f 9b 00 00 cmpwi cr7,r27,0 ffc0d828: 38 e0 00 00 li r7,0 ffc0d82c: 41 9e 00 0c beq- cr7,ffc0d838 <_POSIX_Message_queue_Receive_support+0xa8><== NEVER TAKEN do_wait = (the_mq_fd->oflag & O_NONBLOCK) ? false : true; ffc0d830: 68 07 40 00 xori r7,r0,16384 ffc0d834: 54 e7 97 fe rlwinm r7,r7,18,31,31 /* * Now if something goes wrong, we return a "length" of -1 * to indicate an error. */ length_out = -1; ffc0d838: 38 00 ff ff li r0,-1 ffc0d83c: 7c 26 0b 78 mr r6,r1 ffc0d840: 94 06 00 0c stwu r0,12(r6) do_wait = wait; /* * Now perform the actual message receive */ _CORE_message_queue_Seize( ffc0d844: 7f e4 fb 78 mr r4,r31 ffc0d848: 38 63 00 1c addi r3,r3,28 ffc0d84c: 7f a5 eb 78 mr r5,r29 timeout ); _Thread_Enable_dispatch(); *msg_prio = _POSIX_Message_queue_Priority_from_core(_Thread_Executing->Wait.count); ffc0d850: 3f e0 00 00 lis r31,0 do_wait = wait; /* * Now perform the actual message receive */ _CORE_message_queue_Seize( ffc0d854: 48 00 27 29 bl ffc0ff7c <_CORE_message_queue_Seize> &length_out, do_wait, timeout ); _Thread_Enable_dispatch(); ffc0d858: 48 00 45 a5 bl ffc11dfc <_Thread_Enable_dispatch> *msg_prio = _POSIX_Message_queue_Priority_from_core(_Thread_Executing->Wait.count); ffc0d85c: 81 3f 2a 38 lwz r9,10808(r31) if ( !_Thread_Executing->Wait.return_code ) ffc0d860: 80 09 00 34 lwz r0,52(r9) do_wait, timeout ); _Thread_Enable_dispatch(); *msg_prio = ffc0d864: 81 29 00 24 lwz r9,36(r9) _POSIX_Message_queue_Priority_from_core(_Thread_Executing->Wait.count); if ( !_Thread_Executing->Wait.return_code ) ffc0d868: 2f 80 00 00 cmpwi cr7,r0,0 do_wait, timeout ); _Thread_Enable_dispatch(); *msg_prio = ffc0d86c: 7d 2b fe 70 srawi r11,r9,31 ffc0d870: 7d 60 4a 78 xor r0,r11,r9 ffc0d874: 7c 0b 00 50 subf r0,r11,r0 ffc0d878: 90 1e 00 00 stw r0,0(r30) _POSIX_Message_queue_Priority_from_core(_Thread_Executing->Wait.count); if ( !_Thread_Executing->Wait.return_code ) ffc0d87c: 40 9e 00 0c bne- cr7,ffc0d888 <_POSIX_Message_queue_Receive_support+0xf8> return length_out; ffc0d880: 80 61 00 0c lwz r3,12(r1) ffc0d884: 48 00 00 30 b ffc0d8b4 <_POSIX_Message_queue_Receive_support+0x124> rtems_set_errno_and_return_minus_one( ffc0d888: 48 00 be 99 bl ffc19720 <__errno> ffc0d88c: 81 3f 2a 38 lwz r9,10808(r31) ffc0d890: 7c 7e 1b 78 mr r30,r3 ffc0d894: 80 69 00 34 lwz r3,52(r9) ffc0d898: 48 00 03 29 bl ffc0dbc0 <_POSIX_Message_queue_Translate_core_message_queue_return_code> ffc0d89c: 90 7e 00 00 stw r3,0(r30) ffc0d8a0: 48 00 00 10 b ffc0d8b0 <_POSIX_Message_queue_Receive_support+0x120> #endif case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( EBADF ); ffc0d8a4: 48 00 be 7d bl ffc19720 <__errno> ffc0d8a8: 38 00 00 09 li r0,9 ffc0d8ac: 90 03 00 00 stw r0,0(r3) ffc0d8b0: 38 60 ff ff li r3,-1 } ffc0d8b4: 80 01 00 3c lwz r0,60(r1) ffc0d8b8: 83 61 00 24 lwz r27,36(r1) ffc0d8bc: 7c 08 03 a6 mtlr r0 ffc0d8c0: 83 81 00 28 lwz r28,40(r1) ffc0d8c4: 83 a1 00 2c lwz r29,44(r1) ffc0d8c8: 83 c1 00 30 lwz r30,48(r1) ffc0d8cc: 83 e1 00 34 lwz r31,52(r1) ffc0d8d0: 38 21 00 38 addi r1,r1,56 ffc0d8d4: 4e 80 00 20 blr =============================================================================== ffc0dc94 <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch>: #include void _POSIX_Thread_Evaluate_cancellation_and_enable_dispatch( Thread_Control *the_thread ) { ffc0dc94: 7c 08 02 a6 mflr r0 ffc0dc98: 94 21 ff f8 stwu r1,-8(r1) ffc0dc9c: 90 01 00 0c stw r0,12(r1) POSIX_API_Control *thread_support; thread_support = the_thread->API_Extensions[ THREAD_API_POSIX ]; ffc0dca0: 81 23 01 48 lwz r9,328(r3) if ( thread_support->cancelability_state == PTHREAD_CANCEL_ENABLE && ffc0dca4: 80 09 00 d4 lwz r0,212(r9) ffc0dca8: 2f 80 00 00 cmpwi cr7,r0,0 ffc0dcac: 40 9e 00 38 bne- cr7,ffc0dce4 <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch+0x50><== NEVER TAKEN thread_support->cancelability_type == PTHREAD_CANCEL_ASYNCHRONOUS && ffc0dcb0: 80 09 00 d8 lwz r0,216(r9) ffc0dcb4: 2f 80 00 01 cmpwi cr7,r0,1 ffc0dcb8: 40 be 00 2c bne+ cr7,ffc0dce4 <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch+0x50> thread_support->cancelation_requested ) { ffc0dcbc: 80 09 00 dc lwz r0,220(r9) ffc0dcc0: 2f 80 00 00 cmpwi cr7,r0,0 ffc0dcc4: 41 be 00 20 beq+ cr7,ffc0dce4 <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch+0x50> */ RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void ) { RTEMS_COMPILER_MEMORY_BARRIER(); _Thread_Dispatch_disable_level -= 1; ffc0dcc8: 3d 20 00 00 lis r9,0 ffc0dccc: 81 69 27 9c lwz r11,10140(r9) _Thread_Unnest_dispatch(); _POSIX_Thread_Exit( the_thread, PTHREAD_CANCELED ); ffc0dcd0: 38 80 ff ff li r4,-1 ffc0dcd4: 38 0b ff ff addi r0,r11,-1 ffc0dcd8: 90 09 27 9c stw r0,10140(r9) ffc0dcdc: 48 00 08 29 bl ffc0e504 <_POSIX_Thread_Exit> { POSIX_API_Control *thread_support; thread_support = the_thread->API_Extensions[ THREAD_API_POSIX ]; if ( thread_support->cancelability_state == PTHREAD_CANCEL_ENABLE && ffc0dce0: 48 00 00 08 b ffc0dce8 <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch+0x54> thread_support->cancelability_type == PTHREAD_CANCEL_ASYNCHRONOUS && thread_support->cancelation_requested ) { _Thread_Unnest_dispatch(); _POSIX_Thread_Exit( the_thread, PTHREAD_CANCELED ); } else _Thread_Enable_dispatch(); ffc0dce4: 4b ff cd d9 bl ffc0aabc <_Thread_Enable_dispatch> } ffc0dce8: 80 01 00 0c lwz r0,12(r1) ffc0dcec: 38 21 00 08 addi r1,r1,8 ffc0dcf0: 7c 08 03 a6 mtlr r0 ffc0dcf4: 4e 80 00 20 blr =============================================================================== ffc0f3f4 <_POSIX_Thread_Translate_sched_param>: int policy, struct sched_param *param, Thread_CPU_budget_algorithms *budget_algorithm, Thread_CPU_budget_algorithm_callout *budget_callout ) { ffc0f3f4: 94 21 ff e8 stwu r1,-24(r1) ffc0f3f8: 7c 08 02 a6 mflr r0 ffc0f3fc: 93 c1 00 10 stw r30,16(r1) ffc0f400: 7c 7e 1b 78 mr r30,r3 if ( !_POSIX_Priority_Is_valid( param->sched_priority ) ) ffc0f404: 80 64 00 00 lwz r3,0(r4) int policy, struct sched_param *param, Thread_CPU_budget_algorithms *budget_algorithm, Thread_CPU_budget_algorithm_callout *budget_callout ) { ffc0f408: 93 81 00 08 stw r28,8(r1) ffc0f40c: 7c dc 33 78 mr r28,r6 ffc0f410: 93 a1 00 0c stw r29,12(r1) ffc0f414: 7c bd 2b 78 mr r29,r5 ffc0f418: 93 e1 00 14 stw r31,20(r1) ffc0f41c: 7c 9f 23 78 mr r31,r4 ffc0f420: 90 01 00 1c stw r0,28(r1) if ( !_POSIX_Priority_Is_valid( param->sched_priority ) ) ffc0f424: 4b ff ff ad bl ffc0f3d0 <_POSIX_Priority_Is_valid> ffc0f428: 2f 83 00 00 cmpwi cr7,r3,0 ffc0f42c: 41 9e 00 c4 beq- cr7,ffc0f4f0 <_POSIX_Thread_Translate_sched_param+0xfc><== NEVER TAKEN return EINVAL; *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE; *budget_callout = NULL; if ( policy == SCHED_OTHER ) { ffc0f430: 2f 9e 00 00 cmpwi cr7,r30,0 ) { if ( !_POSIX_Priority_Is_valid( param->sched_priority ) ) return EINVAL; *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE; ffc0f434: 38 00 00 00 li r0,0 ffc0f438: 90 1d 00 00 stw r0,0(r29) *budget_callout = NULL; ffc0f43c: 90 1c 00 00 stw r0,0(r28) if ( policy == SCHED_OTHER ) { ffc0f440: 40 be 00 0c bne+ cr7,ffc0f44c <_POSIX_Thread_Translate_sched_param+0x58> *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE; ffc0f444: 38 00 00 01 li r0,1 ffc0f448: 48 00 00 0c b ffc0f454 <_POSIX_Thread_Translate_sched_param+0x60> return 0; } if ( policy == SCHED_FIFO ) { ffc0f44c: 2f 9e 00 01 cmpwi cr7,r30,1 ffc0f450: 40 be 00 0c bne+ cr7,ffc0f45c <_POSIX_Thread_Translate_sched_param+0x68> *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE; ffc0f454: 90 1d 00 00 stw r0,0(r29) ffc0f458: 48 00 00 10 b ffc0f468 <_POSIX_Thread_Translate_sched_param+0x74> return 0; } if ( policy == SCHED_RR ) { ffc0f45c: 2f 9e 00 02 cmpwi cr7,r30,2 ffc0f460: 40 be 00 10 bne+ cr7,ffc0f470 <_POSIX_Thread_Translate_sched_param+0x7c> *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_EXHAUST_TIMESLICE; ffc0f464: 93 dd 00 00 stw r30,0(r29) ffc0f468: 38 60 00 00 li r3,0 return 0; ffc0f46c: 48 00 00 88 b ffc0f4f4 <_POSIX_Thread_Translate_sched_param+0x100> } if ( policy == SCHED_SPORADIC ) { ffc0f470: 2f 9e 00 04 cmpwi cr7,r30,4 ffc0f474: 40 be 00 7c bne+ cr7,ffc0f4f0 <_POSIX_Thread_Translate_sched_param+0xfc> if ( (param->sched_ss_repl_period.tv_sec == 0) && ffc0f478: 80 1f 00 08 lwz r0,8(r31) ffc0f47c: 2f 80 00 00 cmpwi cr7,r0,0 ffc0f480: 40 9e 00 10 bne- cr7,ffc0f490 <_POSIX_Thread_Translate_sched_param+0x9c> (param->sched_ss_repl_period.tv_nsec == 0) ) ffc0f484: 80 1f 00 0c lwz r0,12(r31) ffc0f488: 2f 80 00 00 cmpwi cr7,r0,0 ffc0f48c: 41 9e 00 64 beq- cr7,ffc0f4f0 <_POSIX_Thread_Translate_sched_param+0xfc> return EINVAL; if ( (param->sched_ss_init_budget.tv_sec == 0) && ffc0f490: 80 1f 00 10 lwz r0,16(r31) ffc0f494: 2f 80 00 00 cmpwi cr7,r0,0 ffc0f498: 40 9e 00 10 bne- cr7,ffc0f4a8 <_POSIX_Thread_Translate_sched_param+0xb4> (param->sched_ss_init_budget.tv_nsec == 0) ) ffc0f49c: 80 1f 00 14 lwz r0,20(r31) ffc0f4a0: 2f 80 00 00 cmpwi cr7,r0,0 ffc0f4a4: 41 9e 00 4c beq- cr7,ffc0f4f0 <_POSIX_Thread_Translate_sched_param+0xfc> return EINVAL; if ( _Timespec_To_ticks( ¶m->sched_ss_repl_period ) < ffc0f4a8: 38 7f 00 08 addi r3,r31,8 ffc0f4ac: 4b ff d7 9d bl ffc0cc48 <_Timespec_To_ticks> ffc0f4b0: 7c 7e 1b 78 mr r30,r3 ffc0f4b4: 38 7f 00 10 addi r3,r31,16 ffc0f4b8: 4b ff d7 91 bl ffc0cc48 <_Timespec_To_ticks> ffc0f4bc: 7f 9e 18 40 cmplw cr7,r30,r3 ffc0f4c0: 41 9c 00 30 blt- cr7,ffc0f4f0 <_POSIX_Thread_Translate_sched_param+0xfc> _Timespec_To_ticks( ¶m->sched_ss_init_budget ) ) return EINVAL; if ( !_POSIX_Priority_Is_valid( param->sched_ss_low_priority ) ) ffc0f4c4: 80 7f 00 04 lwz r3,4(r31) ffc0f4c8: 4b ff ff 09 bl ffc0f3d0 <_POSIX_Priority_Is_valid> ffc0f4cc: 2f 83 00 00 cmpwi cr7,r3,0 ffc0f4d0: 41 9e 00 20 beq- cr7,ffc0f4f0 <_POSIX_Thread_Translate_sched_param+0xfc> return EINVAL; *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_CALLOUT; ffc0f4d4: 38 00 00 03 li r0,3 *budget_callout = _POSIX_Threads_Sporadic_budget_callout; ffc0f4d8: 3d 20 ff c1 lis r9,-63 return EINVAL; if ( !_POSIX_Priority_Is_valid( param->sched_ss_low_priority ) ) return EINVAL; *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_CALLOUT; ffc0f4dc: 90 1d 00 00 stw r0,0(r29) *budget_callout = _POSIX_Threads_Sporadic_budget_callout; ffc0f4e0: 38 09 88 3c addi r0,r9,-30660 ffc0f4e4: 38 60 00 00 li r3,0 ffc0f4e8: 90 1c 00 00 stw r0,0(r28) return 0; ffc0f4ec: 48 00 00 08 b ffc0f4f4 <_POSIX_Thread_Translate_sched_param+0x100> ffc0f4f0: 38 60 00 16 li r3,22 } return EINVAL; } ffc0f4f4: 80 01 00 1c lwz r0,28(r1) ffc0f4f8: 83 81 00 08 lwz r28,8(r1) ffc0f4fc: 7c 08 03 a6 mtlr r0 ffc0f500: 83 a1 00 0c lwz r29,12(r1) ffc0f504: 83 c1 00 10 lwz r30,16(r1) ffc0f508: 83 e1 00 14 lwz r31,20(r1) ffc0f50c: 38 21 00 18 addi r1,r1,24 ffc0f510: 4e 80 00 20 blr =============================================================================== ffc084ac <_POSIX_Threads_Initialize_user_threads_body>: * * Output parameters: NONE */ void _POSIX_Threads_Initialize_user_threads_body(void) { ffc084ac: 94 21 ff a0 stwu r1,-96(r1) ffc084b0: 7c 08 02 a6 mflr r0 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; ffc084b4: 3d 20 00 00 lis r9,0 * * Output parameters: NONE */ void _POSIX_Threads_Initialize_user_threads_body(void) { ffc084b8: 90 01 00 64 stw r0,100(r1) 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; ffc084bc: 39 29 20 84 addi r9,r9,8324 * * Output parameters: NONE */ void _POSIX_Threads_Initialize_user_threads_body(void) { ffc084c0: 93 c1 00 58 stw r30,88(r1) 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; ffc084c4: 83 c9 00 34 lwz r30,52(r9) * * Output parameters: NONE */ void _POSIX_Threads_Initialize_user_threads_body(void) { ffc084c8: 93 81 00 50 stw r28,80(r1) pthread_attr_t attr; user_threads = Configuration_POSIX_API.User_initialization_threads_table; maximum = Configuration_POSIX_API.number_of_initialization_threads; if ( !user_threads || maximum == 0 ) ffc084cc: 2f 9e 00 00 cmpwi cr7,r30,0 * * Output parameters: NONE */ void _POSIX_Threads_Initialize_user_threads_body(void) { ffc084d0: 93 61 00 4c stw r27,76(r1) ffc084d4: 93 a1 00 54 stw r29,84(r1) ffc084d8: 93 e1 00 5c stw r31,92(r1) posix_initialization_threads_table *user_threads; pthread_t thread_id; pthread_attr_t attr; user_threads = Configuration_POSIX_API.User_initialization_threads_table; maximum = Configuration_POSIX_API.number_of_initialization_threads; ffc084dc: 83 89 00 30 lwz r28,48(r9) if ( !user_threads || maximum == 0 ) ffc084e0: 41 9e 00 70 beq- cr7,ffc08550 <_POSIX_Threads_Initialize_user_threads_body+0xa4><== NEVER TAKEN ffc084e4: 2f 9c 00 00 cmpwi cr7,r28,0 ffc084e8: 41 9e 00 68 beq- cr7,ffc08550 <_POSIX_Threads_Initialize_user_threads_body+0xa4><== NEVER TAKEN ffc084ec: 3b a0 00 00 li r29,0 for ( index=0 ; index < maximum ; index++ ) { /* * There is no way for these calls to fail in this situation. */ (void) pthread_attr_init( &attr ); ffc084f0: 3b e1 00 0c addi r31,r1,12 (void) pthread_attr_setinheritsched( &attr, PTHREAD_EXPLICIT_SCHED ); (void) pthread_attr_setstacksize(&attr, user_threads[ index ].stack_size); status = pthread_create( ffc084f4: 3b 61 00 08 addi r27,r1,8 for ( index=0 ; index < maximum ; index++ ) { /* * There is no way for these calls to fail in this situation. */ (void) pthread_attr_init( &attr ); ffc084f8: 7f e3 fb 78 mr r3,r31 ffc084fc: 48 00 70 19 bl ffc0f514 (void) pthread_attr_setinheritsched( &attr, PTHREAD_EXPLICIT_SCHED ); ffc08500: 38 80 00 02 li r4,2 ffc08504: 7f e3 fb 78 mr r3,r31 ffc08508: 48 00 70 4d bl ffc0f554 (void) pthread_attr_setstacksize(&attr, user_threads[ index ].stack_size); ffc0850c: 80 9e 00 04 lwz r4,4(r30) ffc08510: 7f e3 fb 78 mr r3,r31 ffc08514: 48 00 70 79 bl ffc0f58c status = pthread_create( ffc08518: 80 be 00 00 lwz r5,0(r30) ffc0851c: 7f 63 db 78 mr r3,r27 ffc08520: 7f e4 fb 78 mr r4,r31 ffc08524: 38 c0 00 00 li r6,0 ffc08528: 4b ff fb c5 bl ffc080ec &thread_id, &attr, user_threads[ index ].thread_entry, NULL ); if ( status ) ffc0852c: 7c 65 1b 79 mr. r5,r3 ffc08530: 41 a2 00 10 beq+ ffc08540 <_POSIX_Threads_Initialize_user_threads_body+0x94> _Internal_error_Occurred( INTERNAL_ERROR_POSIX_API, true, status ); ffc08534: 38 60 00 02 li r3,2 ffc08538: 38 80 00 01 li r4,1 ffc0853c: 48 00 24 89 bl ffc0a9c4 <_Internal_error_Occurred> * * Setting the attributes explicitly is critical, since we don't want * to inherit the idle tasks attributes. */ for ( index=0 ; index < maximum ; index++ ) { ffc08540: 3b bd 00 01 addi r29,r29,1 ffc08544: 7f 9d e0 40 cmplw cr7,r29,r28 ffc08548: 3b de 00 08 addi r30,r30,8 ffc0854c: 41 9c ff ac blt+ cr7,ffc084f8 <_POSIX_Threads_Initialize_user_threads_body+0x4c><== NEVER TAKEN NULL ); if ( status ) _Internal_error_Occurred( INTERNAL_ERROR_POSIX_API, true, status ); } } ffc08550: 80 01 00 64 lwz r0,100(r1) ffc08554: 83 61 00 4c lwz r27,76(r1) ffc08558: 7c 08 03 a6 mtlr r0 ffc0855c: 83 81 00 50 lwz r28,80(r1) ffc08560: 83 a1 00 54 lwz r29,84(r1) ffc08564: 83 c1 00 58 lwz r30,88(r1) ffc08568: 83 e1 00 5c lwz r31,92(r1) ffc0856c: 38 21 00 60 addi r1,r1,96 ffc08570: 4e 80 00 20 blr =============================================================================== ffc13c18 <_POSIX_Threads_Sporadic_budget_TSR>: */ void _POSIX_Threads_Sporadic_budget_TSR( Objects_Id id __attribute__((unused)), void *argument ) { ffc13c18: 94 21 ff f0 stwu r1,-16(r1) ffc13c1c: 7c 08 02 a6 mflr r0 ffc13c20: 90 01 00 14 stw r0,20(r1) ffc13c24: 93 e1 00 0c stw r31,12(r1) Thread_Control *the_thread; POSIX_API_Control *api; the_thread = argument; api = the_thread->API_Extensions[ THREAD_API_POSIX ]; ffc13c28: 83 e4 01 48 lwz r31,328(r4) */ void _POSIX_Threads_Sporadic_budget_TSR( Objects_Id id __attribute__((unused)), void *argument ) { ffc13c2c: 93 c1 00 08 stw r30,8(r1) ffc13c30: 7c 9e 23 78 mr r30,r4 the_thread = argument; 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 ); ffc13c34: 38 7f 00 94 addi r3,r31,148 ffc13c38: 48 00 19 81 bl ffc155b8 <_Timespec_To_ticks> */ #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 ) { ffc13c3c: 80 1e 00 1c lwz r0,28(r30) ffc13c40: 3d 20 00 00 lis r9,0 ffc13c44: 2f 80 00 00 cmpwi cr7,r0,0 ffc13c48: 88 89 26 c4 lbz r4,9924(r9) ffc13c4c: 80 1f 00 84 lwz r0,132(r31) 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; ffc13c50: 90 7e 00 78 stw r3,120(r30) ffc13c54: 7c 80 20 50 subf r4,r0,r4 new_priority = _POSIX_Priority_To_core( api->schedparam.sched_priority ); the_thread->real_priority = new_priority; ffc13c58: 90 9e 00 18 stw r4,24(r30) */ #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 ) { ffc13c5c: 40 9e 00 1c bne- cr7,ffc13c78 <_POSIX_Threads_Sporadic_budget_TSR+0x60><== NEVER TAKEN /* * If this would make them less important, then do not change it. */ if ( the_thread->current_priority > new_priority ) { ffc13c60: 80 1e 00 14 lwz r0,20(r30) ffc13c64: 7f 80 20 40 cmplw cr7,r0,r4 ffc13c68: 40 bd 00 10 ble+ cr7,ffc13c78 <_POSIX_Threads_Sporadic_budget_TSR+0x60> _Thread_Change_priority( the_thread, new_priority, true ); ffc13c6c: 7f c3 f3 78 mr r3,r30 ffc13c70: 38 a0 00 01 li r5,1 ffc13c74: 4b ff 82 21 bl ffc0be94 <_Thread_Change_priority> #endif } } /* ticks is guaranteed to be at least one */ ticks = _Timespec_To_ticks( &api->schedparam.sched_ss_repl_period ); ffc13c78: 38 7f 00 8c addi r3,r31,140 ffc13c7c: 48 00 19 3d bl ffc155b8 <_Timespec_To_ticks> ) { the_watchdog->initial = units; _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); ffc13c80: 38 9f 00 a4 addi r4,r31,164 Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; ffc13c84: 90 7f 00 b0 stw r3,176(r31) _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); ffc13c88: 3c 60 00 00 lis r3,0 ffc13c8c: 38 63 2e 08 addi r3,r3,11784 ffc13c90: 4b ff 9d 55 bl ffc0d9e4 <_Watchdog_Insert> _Watchdog_Insert_ticks( &api->Sporadic_timer, ticks ); } ffc13c94: 80 01 00 14 lwz r0,20(r1) ffc13c98: 83 c1 00 08 lwz r30,8(r1) ffc13c9c: 7c 08 03 a6 mtlr r0 ffc13ca0: 83 e1 00 0c lwz r31,12(r1) ffc13ca4: 38 21 00 10 addi r1,r1,16 ffc13ca8: 4e 80 00 20 blr =============================================================================== ffc13bbc <_POSIX_Threads_Sporadic_budget_callout>: * _POSIX_Threads_Sporadic_budget_callout */ void _POSIX_Threads_Sporadic_budget_callout( Thread_Control *the_thread ) { ffc13bbc: 7c 08 02 a6 mflr r0 ffc13bc0: 94 21 ff f8 stwu r1,-8(r1) RTEMS_INLINE_ROUTINE Priority_Control _POSIX_Priority_To_core( int priority ) { return (Priority_Control) (POSIX_SCHEDULER_MAXIMUM_PRIORITY - priority + 1); ffc13bc4: 3d 40 00 00 lis r10,0 ffc13bc8: 90 01 00 0c stw r0,12(r1) */ #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 ) { ffc13bcc: 80 03 00 1c lwz r0,28(r3) ) { POSIX_API_Control *api; uint32_t new_priority; api = the_thread->API_Extensions[ THREAD_API_POSIX ]; ffc13bd0: 81 63 01 48 lwz r11,328(r3) */ #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 ) { ffc13bd4: 2f 80 00 00 cmpwi cr7,r0,0 ffc13bd8: 88 8a 26 c4 lbz r4,9924(r10) ffc13bdc: 80 0b 00 88 lwz r0,136(r11) ffc13be0: 7c 80 20 50 subf r4,r0,r4 /* * 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 */ ffc13be4: 38 00 ff ff li r0,-1 new_priority = _POSIX_Priority_To_core(api->schedparam.sched_ss_low_priority); the_thread->real_priority = new_priority; ffc13be8: 90 83 00 18 stw r4,24(r3) /* * 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 */ ffc13bec: 90 03 00 78 stw r0,120(r3) */ #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 ) { ffc13bf0: 40 9e 00 18 bne- cr7,ffc13c08 <_POSIX_Threads_Sporadic_budget_callout+0x4c><== NEVER TAKEN /* * 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 ) { ffc13bf4: 80 03 00 14 lwz r0,20(r3) ffc13bf8: 7f 80 20 40 cmplw cr7,r0,r4 ffc13bfc: 40 bc 00 0c bge+ cr7,ffc13c08 <_POSIX_Threads_Sporadic_budget_callout+0x4c><== NEVER TAKEN _Thread_Change_priority( the_thread, new_priority, true ); ffc13c00: 38 a0 00 01 li r5,1 ffc13c04: 4b ff 82 91 bl ffc0be94 <_Thread_Change_priority> #if 0 printk( "lower priority\n" ); #endif } } } ffc13c08: 80 01 00 0c lwz r0,12(r1) ffc13c0c: 38 21 00 08 addi r1,r1,8 ffc13c10: 7c 08 03 a6 mtlr r0 ffc13c14: 4e 80 00 20 blr =============================================================================== ffc0816c <_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) { ffc0816c: 94 21 ff f0 stwu r1,-16(r1) ffc08170: 7c 08 02 a6 mflr r0 ffc08174: 90 01 00 14 stw r0,20(r1) /* Increment the number of expirations. */ ptimer->overrun = ptimer->overrun + 1; /* The timer must be reprogrammed */ if ( ( ptimer->timer_data.it_interval.tv_sec != 0 ) || ffc08178: 80 04 00 54 lwz r0,84(r4) bool activated; ptimer = (POSIX_Timer_Control *)data; /* Increment the number of expirations. */ ptimer->overrun = ptimer->overrun + 1; ffc0817c: 81 24 00 68 lwz r9,104(r4) /* The timer must be reprogrammed */ if ( ( ptimer->timer_data.it_interval.tv_sec != 0 ) || ffc08180: 2f 80 00 00 cmpwi cr7,r0,0 * This is the operation that is run when a timer expires */ void _POSIX_Timer_TSR( Objects_Id timer __attribute__((unused)), void *data) { ffc08184: 93 e1 00 0c stw r31,12(r1) bool activated; ptimer = (POSIX_Timer_Control *)data; /* Increment the number of expirations. */ ptimer->overrun = ptimer->overrun + 1; ffc08188: 38 09 00 01 addi r0,r9,1 * This is the operation that is run when a timer expires */ void _POSIX_Timer_TSR( Objects_Id timer __attribute__((unused)), void *data) { ffc0818c: 7c 9f 23 78 mr r31,r4 bool activated; ptimer = (POSIX_Timer_Control *)data; /* Increment the number of expirations. */ ptimer->overrun = ptimer->overrun + 1; ffc08190: 90 04 00 68 stw r0,104(r4) /* The timer must be reprogrammed */ if ( ( ptimer->timer_data.it_interval.tv_sec != 0 ) || ffc08194: 40 9e 00 10 bne- cr7,ffc081a4 <_POSIX_Timer_TSR+0x38> ( ptimer->timer_data.it_interval.tv_nsec != 0 ) ) { ffc08198: 80 04 00 58 lwz r0,88(r4) ffc0819c: 2f 80 00 00 cmpwi cr7,r0,0 ffc081a0: 41 9e 00 38 beq- cr7,ffc081d8 <_POSIX_Timer_TSR+0x6c> <== NEVER TAKEN activated = _POSIX_Timer_Insert_helper( ffc081a4: 80 9f 00 64 lwz r4,100(r31) ffc081a8: 3c c0 ff c1 lis r6,-63 ffc081ac: 80 bf 00 08 lwz r5,8(r31) ffc081b0: 38 c6 81 6c addi r6,r6,-32404 ffc081b4: 38 7f 00 10 addi r3,r31,16 ffc081b8: 7f e7 fb 78 mr r7,r31 ffc081bc: 48 00 6f 09 bl ffc0f0c4 <_POSIX_Timer_Insert_helper> ptimer->ticks, ptimer->Object.id, _POSIX_Timer_TSR, ptimer ); if ( !activated ) ffc081c0: 2f 83 00 00 cmpwi cr7,r3,0 ffc081c4: 41 be 00 30 beq+ cr7,ffc081f4 <_POSIX_Timer_TSR+0x88> <== NEVER TAKEN return; /* Store the time when the timer was started again */ _TOD_Get( &ptimer->time ); ffc081c8: 38 7f 00 6c addi r3,r31,108 ffc081cc: 48 00 1b 79 bl ffc09d44 <_TOD_Get> /* The state really did not change but just to be safe */ ptimer->state = POSIX_TIMER_STATE_CREATE_RUN; ffc081d0: 38 00 00 03 li r0,3 ffc081d4: 48 00 00 08 b ffc081dc <_POSIX_Timer_TSR+0x70> } else { /* Indicates that the timer is stopped */ ptimer->state = POSIX_TIMER_STATE_CREATE_STOP; ffc081d8: 38 00 00 04 li r0,4 <== NOT EXECUTED ffc081dc: 98 1f 00 3c stb r0,60(r31) /* * 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 ) ) { ffc081e0: 80 7f 00 38 lwz r3,56(r31) ffc081e4: 80 9f 00 44 lwz r4,68(r31) ffc081e8: 48 00 69 51 bl ffc0eb38 } /* After the signal handler returns, the count of expirations of the * timer must be set to 0. */ ptimer->overrun = 0; ffc081ec: 38 00 00 00 li r0,0 ffc081f0: 90 1f 00 68 stw r0,104(r31) } ffc081f4: 80 01 00 14 lwz r0,20(r1) ffc081f8: 83 e1 00 0c lwz r31,12(r1) ffc081fc: 38 21 00 10 addi r1,r1,16 ffc08200: 7c 08 03 a6 mtlr r0 ffc08204: 4e 80 00 20 blr =============================================================================== ffc17624 <_POSIX_signals_Check_signal>: bool _POSIX_signals_Check_signal( POSIX_API_Control *api, int signo, bool is_global ) { ffc17624: 94 21 ff d8 stwu r1,-40(r1) ffc17628: 7c 08 02 a6 mflr r0 ffc1762c: 7c a6 2b 78 mr r6,r5 ffc17630: 93 a1 00 1c stw r29,28(r1) siginfo_t siginfo_struct; sigset_t saved_signals_blocked; if ( ! _POSIX_signals_Clear_signals( api, signo, &siginfo_struct, ffc17634: 3b a1 00 08 addi r29,r1,8 ffc17638: 7f a5 eb 78 mr r5,r29 ffc1763c: 38 e0 00 01 li r7,1 bool _POSIX_signals_Check_signal( POSIX_API_Control *api, int signo, bool is_global ) { ffc17640: 93 c1 00 20 stw r30,32(r1) ffc17644: 7c 9e 23 78 mr r30,r4 ffc17648: 93 e1 00 24 stw r31,36(r1) ffc1764c: 7c 7f 1b 78 mr r31,r3 ffc17650: 90 01 00 2c stw r0,44(r1) ffc17654: 93 81 00 18 stw r28,24(r1) siginfo_t siginfo_struct; sigset_t saved_signals_blocked; if ( ! _POSIX_signals_Clear_signals( api, signo, &siginfo_struct, ffc17658: 48 00 00 9d bl ffc176f4 <_POSIX_signals_Clear_signals> ffc1765c: 2f 83 00 00 cmpwi cr7,r3,0 ffc17660: 41 9e 00 70 beq- cr7,ffc176d0 <_POSIX_signals_Check_signal+0xac> #endif /* * Just to prevent sending a signal which is currently being ignored. */ if ( _POSIX_signals_Vectors[ signo ].sa_handler == SIG_IGN ) ffc17664: 1d 7e 00 0c mulli r11,r30,12 ffc17668: 3d 40 00 00 lis r10,0 ffc1766c: 39 4a 32 30 addi r10,r10,12848 ffc17670: 7d 2a 5a 14 add r9,r10,r11 ffc17674: 80 09 00 08 lwz r0,8(r9) ffc17678: 2f 80 00 01 cmpwi cr7,r0,1 ffc1767c: 41 9e 00 54 beq- cr7,ffc176d0 <_POSIX_signals_Check_signal+0xac><== NEVER TAKEN api->signals_blocked |= _POSIX_signals_Vectors[ signo ].sa_mask; /* * Here, the signal handler function executes */ switch ( _POSIX_signals_Vectors[ signo ].sa_flags ) { ffc17680: 7d 6a 58 2e lwzx r11,r10,r11 /* * Block the signals requested in sa_mask */ saved_signals_blocked = api->signals_blocked; api->signals_blocked |= _POSIX_signals_Vectors[ signo ].sa_mask; ffc17684: 81 29 00 04 lwz r9,4(r9) /* * Here, the signal handler function executes */ switch ( _POSIX_signals_Vectors[ signo ].sa_flags ) { ffc17688: 2f 8b 00 02 cmpwi cr7,r11,2 return false; /* * Block the signals requested in sa_mask */ saved_signals_blocked = api->signals_blocked; ffc1768c: 83 9f 00 cc lwz r28,204(r31) api->signals_blocked |= _POSIX_signals_Vectors[ signo ].sa_mask; ffc17690: 7d 29 e3 78 or r9,r9,r28 ffc17694: 91 3f 00 cc stw r9,204(r31) /* * Here, the signal handler function executes */ switch ( _POSIX_signals_Vectors[ signo ].sa_flags ) { ffc17698: 40 be 00 1c bne+ cr7,ffc176b4 <_POSIX_signals_Check_signal+0x90> case SA_SIGINFO: (*_POSIX_signals_Vectors[ signo ].sa_sigaction)( ffc1769c: 7f c3 f3 78 mr r3,r30 ffc176a0: 7c 09 03 a6 mtctr r0 ffc176a4: 7f a4 eb 78 mr r4,r29 ffc176a8: 38 a0 00 00 li r5,0 ffc176ac: 4e 80 04 21 bctrl signo, &siginfo_struct, NULL /* context is undefined per 1003.1b-1993, p. 66 */ ); break; ffc176b0: 48 00 00 14 b ffc176c4 <_POSIX_signals_Check_signal+0xa0> default: (*_POSIX_signals_Vectors[ signo ].sa_handler)( signo ); ffc176b4: 7f c3 f3 78 mr r3,r30 ffc176b8: 7c 09 03 a6 mtctr r0 ffc176bc: 4c c6 31 82 crclr 4*cr1+eq ffc176c0: 4e 80 04 21 bctrl } /* * Restore the previous set of blocked signals */ api->signals_blocked = saved_signals_blocked; ffc176c4: 93 9f 00 cc stw r28,204(r31) ffc176c8: 38 60 00 01 li r3,1 return true; ffc176cc: 48 00 00 08 b ffc176d4 <_POSIX_signals_Check_signal+0xb0> ffc176d0: 38 60 00 00 li r3,0 } ffc176d4: 80 01 00 2c lwz r0,44(r1) ffc176d8: 83 81 00 18 lwz r28,24(r1) ffc176dc: 7c 08 03 a6 mtlr r0 ffc176e0: 83 a1 00 1c lwz r29,28(r1) ffc176e4: 83 c1 00 20 lwz r30,32(r1) ffc176e8: 83 e1 00 24 lwz r31,36(r1) ffc176ec: 38 21 00 28 addi r1,r1,40 ffc176f0: 4e 80 00 20 blr =============================================================================== ffc17f68 <_POSIX_signals_Clear_process_signals>: static inline uint32_t ppc_interrupt_disable( void ) { uint32_t level; uint32_t mask; asm volatile ( ffc17f68: 7d 60 00 a6 mfmsr r11 ffc17f6c: 7c 10 42 a6 mfsprg r0,0 ffc17f70: 7d 60 00 78 andc r0,r11,r0 ffc17f74: 7c 00 01 24 mtmsr r0 mask = signo_to_mask( signo ); ISR_Level level; _ISR_Disable( level ); if ( _POSIX_signals_Vectors[ signo ].sa_flags == SA_SIGINFO ) { ffc17f78: 3d 20 00 00 lis r9,0 ffc17f7c: 1c 03 00 0c mulli r0,r3,12 ffc17f80: 39 29 32 30 addi r9,r9,12848 ffc17f84: 7d 29 00 2e lwzx r9,r9,r0 ffc17f88: 2f 89 00 02 cmpwi cr7,r9,2 ffc17f8c: 40 be 00 20 bne+ cr7,ffc17fac <_POSIX_signals_Clear_process_signals+0x44> if ( !_Chain_Is_empty( &_POSIX_signals_Siginfo[ signo ] ) ) ffc17f90: 3d 20 00 00 lis r9,0 ffc17f94: 39 29 34 24 addi r9,r9,13348 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; ffc17f98: 7d 49 00 2e lwzx r10,r9,r0 ffc17f9c: 7d 29 02 14 add r9,r9,r0 ffc17fa0: 38 09 00 04 addi r0,r9,4 ffc17fa4: 7f 8a 00 00 cmpw cr7,r10,r0 ffc17fa8: 40 be 00 38 bne+ cr7,ffc17fe0 <_POSIX_signals_Clear_process_signals+0x78><== NEVER TAKEN clear_signal = false; } if ( clear_signal ) { _POSIX_signals_Pending &= ~mask; ffc17fac: 3d 20 00 00 lis r9,0 ffc17fb0: 80 09 28 00 lwz r0,10240(r9) ffc17fb4: 38 63 ff ff addi r3,r3,-1 ffc17fb8: 39 40 ff fe li r10,-2 ffc17fbc: 5d 43 18 3e rotlw r3,r10,r3 ffc17fc0: 7c 63 00 38 and r3,r3,r0 if ( !_POSIX_signals_Pending ) ffc17fc4: 2f 83 00 00 cmpwi cr7,r3,0 if ( _POSIX_signals_Vectors[ signo ].sa_flags == SA_SIGINFO ) { if ( !_Chain_Is_empty( &_POSIX_signals_Siginfo[ signo ] ) ) clear_signal = false; } if ( clear_signal ) { _POSIX_signals_Pending &= ~mask; ffc17fc8: 90 69 28 00 stw r3,10240(r9) if ( !_POSIX_signals_Pending ) ffc17fcc: 40 9e 00 14 bne- cr7,ffc17fe0 <_POSIX_signals_Clear_process_signals+0x78><== NEVER TAKEN _Thread_Do_post_task_switch_extension--; ffc17fd0: 3d 20 00 00 lis r9,0 ffc17fd4: 81 49 27 c0 lwz r10,10176(r9) ffc17fd8: 38 0a ff ff addi r0,r10,-1 ffc17fdc: 90 09 27 c0 stw r0,10176(r9) return level; } static inline void ppc_interrupt_enable( uint32_t level ) { asm volatile ( ffc17fe0: 7d 60 01 24 mtmsr r11 } _ISR_Enable( level ); } ffc17fe4: 4e 80 00 20 blr =============================================================================== ffc08dec <_POSIX_signals_Get_highest>: ) { int signo; for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) { if ( set & signo_to_mask( signo ) ) { ffc08dec: 39 40 00 05 li r10,5 ffc08df0: 7d 49 03 a6 mtctr r10 #include int _POSIX_signals_Get_highest( sigset_t set ) { ffc08df4: 39 20 00 1b li r9,27 int signo; for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) { if ( set & signo_to_mask( signo ) ) { ffc08df8: 38 00 00 01 li r0,1 ffc08dfc: 39 69 ff ff addi r11,r9,-1 ffc08e00: 7c 0b 58 30 slw r11,r0,r11 ffc08e04: 7d 6a 18 39 and. r10,r11,r3 ffc08e08: 40 82 00 34 bne- ffc08e3c <_POSIX_signals_Get_highest+0x50><== NEVER TAKEN sigset_t set ) { int signo; for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) { ffc08e0c: 39 29 00 01 addi r9,r9,1 ffc08e10: 42 00 ff ec bdnz+ ffc08dfc <_POSIX_signals_Get_highest+0x10> #if (SIGHUP != 1) #error "Assumption that SIGHUP==1 violated!!" #endif for ( signo = SIGHUP ; signo <= __SIGLASTNOTRT ; signo++ ) { if ( set & signo_to_mask( signo ) ) { ffc08e14: 39 60 00 1a li r11,26 ffc08e18: 7d 69 03 a6 mtctr r11 sigset_t set ) { int signo; for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) { ffc08e1c: 39 20 00 01 li r9,1 #if (SIGHUP != 1) #error "Assumption that SIGHUP==1 violated!!" #endif for ( signo = SIGHUP ; signo <= __SIGLASTNOTRT ; signo++ ) { if ( set & signo_to_mask( signo ) ) { ffc08e20: 38 00 00 01 li r0,1 ffc08e24: 39 69 ff ff addi r11,r9,-1 ffc08e28: 7c 0b 58 30 slw r11,r0,r11 ffc08e2c: 7d 6a 18 39 and. r10,r11,r3 ffc08e30: 40 82 00 0c bne- ffc08e3c <_POSIX_signals_Get_highest+0x50> */ #if (SIGHUP != 1) #error "Assumption that SIGHUP==1 violated!!" #endif for ( signo = SIGHUP ; signo <= __SIGLASTNOTRT ; signo++ ) { ffc08e34: 39 29 00 01 addi r9,r9,1 ffc08e38: 42 00 ff ec bdnz+ ffc08e24 <_POSIX_signals_Get_highest+0x38> * a return 0. This routine will NOT be called unless a signal * is pending in the set passed in. */ found_it: return signo; } ffc08e3c: 7d 23 4b 78 mr r3,r9 ffc08e40: 4e 80 00 20 blr =============================================================================== ffc1788c <_POSIX_signals_Unblock_thread>: bool _POSIX_signals_Unblock_thread( Thread_Control *the_thread, int signo, siginfo_t *info ) { ffc1788c: 94 21 ff f0 stwu r1,-16(r1) ffc17890: 7c 08 02 a6 mflr r0 /* * Is the thread is specifically waiting for a signal? */ if ( _States_Is_interruptible_signal( the_thread->current_state ) ) { ffc17894: 3d 20 10 00 lis r9,4096 bool _POSIX_signals_Unblock_thread( Thread_Control *the_thread, int signo, siginfo_t *info ) { ffc17898: 90 01 00 14 stw r0,20(r1) /* * Is the thread is specifically waiting for a signal? */ if ( _States_Is_interruptible_signal( the_thread->current_state ) ) { ffc1789c: 61 29 80 00 ori r9,r9,32768 ffc178a0: 80 03 00 10 lwz r0,16(r3) bool _POSIX_signals_Unblock_thread( Thread_Control *the_thread, int signo, siginfo_t *info ) { ffc178a4: 93 e1 00 0c stw r31,12(r1) ffc178a8: 7c 7f 1b 78 mr r31,r3 /* * Is the thread is specifically waiting for a signal? */ if ( _States_Is_interruptible_signal( the_thread->current_state ) ) { ffc178ac: 7d 2b 00 38 and r11,r9,r0 ffc178b0: 7f 8b 48 00 cmpw cr7,r11,r9 { POSIX_API_Control *api; sigset_t mask; siginfo_t *the_info = NULL; api = the_thread->API_Extensions[ THREAD_API_POSIX ]; ffc178b4: 81 43 01 48 lwz r10,328(r3) ffc178b8: 39 64 ff ff addi r11,r4,-1 ffc178bc: 39 20 00 01 li r9,1 ffc178c0: 7d 2b 58 30 slw r11,r9,r11 /* * Is the thread is specifically waiting for a signal? */ if ( _States_Is_interruptible_signal( the_thread->current_state ) ) { ffc178c4: 40 be 00 68 bne+ cr7,ffc1792c <_POSIX_signals_Unblock_thread+0xa0> if ( (the_thread->Wait.option & mask) || (~api->signals_blocked & mask) ) { ffc178c8: 80 03 00 30 lwz r0,48(r3) ffc178cc: 7d 68 00 39 and. r8,r11,r0 ffc178d0: 40 82 00 10 bne- ffc178e0 <_POSIX_signals_Unblock_thread+0x54> ffc178d4: 80 0a 00 cc lwz r0,204(r10) ffc178d8: 7d 69 00 79 andc. r9,r11,r0 ffc178dc: 41 82 00 d0 beq- ffc179ac <_POSIX_signals_Unblock_thread+0x120> the_thread->Wait.return_code = EINTR; the_info = (siginfo_t *) the_thread->Wait.return_argument; if ( !info ) { ffc178e0: 2f 85 00 00 cmpwi cr7,r5,0 if ( _States_Is_interruptible_signal( the_thread->current_state ) ) { if ( (the_thread->Wait.option & mask) || (~api->signals_blocked & mask) ) { the_thread->Wait.return_code = EINTR; the_info = (siginfo_t *) the_thread->Wait.return_argument; ffc178e4: 81 3f 00 28 lwz r9,40(r31) */ if ( _States_Is_interruptible_signal( the_thread->current_state ) ) { if ( (the_thread->Wait.option & mask) || (~api->signals_blocked & mask) ) { the_thread->Wait.return_code = EINTR; ffc178e8: 38 00 00 04 li r0,4 ffc178ec: 90 1f 00 34 stw r0,52(r31) the_info = (siginfo_t *) the_thread->Wait.return_argument; if ( !info ) { ffc178f0: 40 be 00 14 bne+ cr7,ffc17904 <_POSIX_signals_Unblock_thread+0x78> the_info->si_signo = signo; the_info->si_code = SI_USER; the_info->si_value.sival_int = 0; ffc178f4: 90 a9 00 08 stw r5,8(r9) the_info = (siginfo_t *) the_thread->Wait.return_argument; if ( !info ) { the_info->si_signo = signo; the_info->si_code = SI_USER; ffc178f8: 38 00 00 01 li r0,1 the_thread->Wait.return_code = EINTR; the_info = (siginfo_t *) the_thread->Wait.return_argument; if ( !info ) { the_info->si_signo = signo; ffc178fc: 90 89 00 00 stw r4,0(r9) ffc17900: 48 00 00 18 b ffc17918 <_POSIX_signals_Unblock_thread+0x8c> the_info->si_code = SI_USER; the_info->si_value.sival_int = 0; } else { *the_info = *info; ffc17904: 81 45 00 08 lwz r10,8(r5) ffc17908: 81 65 00 00 lwz r11,0(r5) ffc1790c: 80 05 00 04 lwz r0,4(r5) ffc17910: 91 49 00 08 stw r10,8(r9) ffc17914: 91 69 00 00 stw r11,0(r9) ffc17918: 90 09 00 04 stw r0,4(r9) } _Thread_queue_Extract_with_proxy( the_thread ); ffc1791c: 7f e3 fb 78 mr r3,r31 ffc17920: 4b ff 54 81 bl ffc0cda0 <_Thread_queue_Extract_with_proxy> ffc17924: 38 60 00 01 li r3,1 return true; ffc17928: 48 00 00 88 b ffc179b0 <_POSIX_signals_Unblock_thread+0x124> } /* * Thread is not waiting due to a sigwait. */ if ( ~api->signals_blocked & mask ) { ffc1792c: 81 4a 00 cc lwz r10,204(r10) ffc17930: 7d 68 50 79 andc. r8,r11,r10 ffc17934: 41 82 00 78 beq- ffc179ac <_POSIX_signals_Unblock_thread+0x120> * + Any other combination, do nothing. */ the_thread->do_post_task_switch_extension = true; if ( the_thread->current_state & STATES_INTERRUPTIBLE_BY_SIGNAL ) { ffc17938: 74 0b 10 00 andis. r11,r0,4096 * it is not blocked, THEN * we need to dispatch at the end of this ISR. * + Any other combination, do nothing. */ the_thread->do_post_task_switch_extension = true; ffc1793c: 99 23 00 74 stb r9,116(r3) if ( the_thread->current_state & STATES_INTERRUPTIBLE_BY_SIGNAL ) { ffc17940: 41 82 00 3c beq- ffc1797c <_POSIX_signals_Unblock_thread+0xf0> #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) ){ ffc17944: 70 08 00 08 andi. r8,r0,8 */ the_thread->do_post_task_switch_extension = true; if ( the_thread->current_state & STATES_INTERRUPTIBLE_BY_SIGNAL ) { the_thread->Wait.return_code = EINTR; ffc17948: 38 00 00 04 li r0,4 ffc1794c: 90 03 00 34 stw r0,52(r3) #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) ){ ffc17950: 41 82 00 5c beq- ffc179ac <_POSIX_signals_Unblock_thread+0x120><== NEVER TAKEN if ( _Watchdog_Is_active( &the_thread->Timer ) ) ffc17954: 80 03 00 50 lwz r0,80(r3) ffc17958: 2f 80 00 02 cmpwi cr7,r0,2 ffc1795c: 40 be 00 0c bne+ cr7,ffc17968 <_POSIX_signals_Unblock_thread+0xdc><== NEVER TAKEN (void) _Watchdog_Remove( &the_thread->Timer ); ffc17960: 38 63 00 48 addi r3,r3,72 ffc17964: 4b ff 61 d9 bl ffc0db3c <_Watchdog_Remove> RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); ffc17968: 3c 80 10 03 lis r4,4099 ffc1796c: 7f e3 fb 78 mr r3,r31 ffc17970: 60 84 ff f8 ori r4,r4,65528 ffc17974: 4b ff 46 c5 bl ffc0c038 <_Thread_Clear_state> ffc17978: 48 00 00 34 b ffc179ac <_POSIX_signals_Unblock_thread+0x120> _Thread_Unblock( the_thread ); } } else if ( the_thread->current_state == STATES_READY ) { ffc1797c: 2f 80 00 00 cmpwi cr7,r0,0 ffc17980: 40 9e 00 2c bne- cr7,ffc179ac <_POSIX_signals_Unblock_thread+0x120><== NEVER TAKEN if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) ffc17984: 3d 60 00 00 lis r11,0 ffc17988: 80 0b 27 b8 lwz r0,10168(r11) ffc1798c: 2f 80 00 00 cmpwi cr7,r0,0 ffc17990: 41 9e 00 1c beq- cr7,ffc179ac <_POSIX_signals_Unblock_thread+0x120> ffc17994: 3d 60 00 00 lis r11,0 ffc17998: 80 0b 27 d0 lwz r0,10192(r11) ffc1799c: 7f 83 00 00 cmpw cr7,r3,r0 ffc179a0: 40 be 00 0c bne+ cr7,ffc179ac <_POSIX_signals_Unblock_thread+0x120><== NEVER TAKEN _ISR_Signals_to_thread_executing = true; ffc179a4: 3d 60 00 00 lis r11,0 ffc179a8: 99 2b 27 ec stb r9,10220(r11) ffc179ac: 38 60 00 00 li r3,0 } } return false; } ffc179b0: 80 01 00 14 lwz r0,20(r1) ffc179b4: 83 e1 00 0c lwz r31,12(r1) ffc179b8: 38 21 00 10 addi r1,r1,16 ffc179bc: 7c 08 03 a6 mtlr r0 ffc179c0: 4e 80 00 20 blr =============================================================================== ffc14548 <_RTEMS_tasks_Post_switch_extension>: */ void _RTEMS_tasks_Post_switch_extension( Thread_Control *executing ) { ffc14548: 94 21 ff d8 stwu r1,-40(r1) ffc1454c: 7c 08 02 a6 mflr r0 ffc14550: 90 01 00 2c stw r0,44(r1) ffc14554: 93 e1 00 24 stw r31,36(r1) RTEMS_API_Control *api; ASR_Information *asr; rtems_signal_set signal_set; Modes_Control prev_mode; api = executing->API_Extensions[ THREAD_API_RTEMS ]; ffc14558: 83 e3 01 44 lwz r31,324(r3) */ void _RTEMS_tasks_Post_switch_extension( Thread_Control *executing ) { ffc1455c: 93 a1 00 1c stw r29,28(r1) ASR_Information *asr; rtems_signal_set signal_set; Modes_Control prev_mode; api = executing->API_Extensions[ THREAD_API_RTEMS ]; if ( !api ) ffc14560: 2f 9f 00 00 cmpwi cr7,r31,0 */ void _RTEMS_tasks_Post_switch_extension( Thread_Control *executing ) { ffc14564: 93 c1 00 20 stw r30,32(r1) ASR_Information *asr; rtems_signal_set signal_set; Modes_Control prev_mode; api = executing->API_Extensions[ THREAD_API_RTEMS ]; if ( !api ) ffc14568: 41 9e 00 80 beq- cr7,ffc145e8 <_RTEMS_tasks_Post_switch_extension+0xa0><== NEVER TAKEN static inline uint32_t ppc_interrupt_disable( void ) { uint32_t level; uint32_t mask; asm volatile ( ffc1456c: 7c 00 00 a6 mfmsr r0 ffc14570: 7d 30 42 a6 mfsprg r9,0 ffc14574: 7c 09 48 78 andc r9,r0,r9 ffc14578: 7d 20 01 24 mtmsr r9 asr = &api->Signal; _ISR_Disable( level ); signal_set = asr->signals_posted; asr->signals_posted = 0; ffc1457c: 39 20 00 00 li r9,0 */ asr = &api->Signal; _ISR_Disable( level ); signal_set = asr->signals_posted; ffc14580: 83 bf 00 14 lwz r29,20(r31) asr->signals_posted = 0; ffc14584: 91 3f 00 14 stw r9,20(r31) return level; } static inline void ppc_interrupt_enable( uint32_t level ) { asm volatile ( ffc14588: 7c 00 01 24 mtmsr r0 _ISR_Enable( level ); if ( !signal_set ) /* similar to _ASR_Are_signals_pending( asr ) */ ffc1458c: 2f 9d 00 00 cmpwi cr7,r29,0 ffc14590: 41 be 00 58 beq+ cr7,ffc145e8 <_RTEMS_tasks_Post_switch_extension+0xa0> return; asr->nest_level += 1; ffc14594: 81 3f 00 1c lwz r9,28(r31) rtems_task_mode( asr->mode_set, RTEMS_ALL_MODE_MASKS, &prev_mode ); ffc14598: 3b c1 00 08 addi r30,r1,8 ffc1459c: 80 7f 00 10 lwz r3,16(r31) ffc145a0: 38 80 00 00 li r4,0 if ( !signal_set ) /* similar to _ASR_Are_signals_pending( asr ) */ return; asr->nest_level += 1; ffc145a4: 38 09 00 01 addi r0,r9,1 ffc145a8: 90 1f 00 1c stw r0,28(r31) rtems_task_mode( asr->mode_set, RTEMS_ALL_MODE_MASKS, &prev_mode ); ffc145ac: 60 84 ff ff ori r4,r4,65535 ffc145b0: 7f c5 f3 78 mr r5,r30 ffc145b4: 4b ff fc fd bl ffc142b0 (*asr->handler)( signal_set ); ffc145b8: 80 1f 00 0c lwz r0,12(r31) ffc145bc: 7f a3 eb 78 mr r3,r29 ffc145c0: 7c 09 03 a6 mtctr r0 ffc145c4: 4e 80 04 21 bctrl asr->nest_level -= 1; ffc145c8: 81 3f 00 1c lwz r9,28(r31) rtems_task_mode( prev_mode, RTEMS_ALL_MODE_MASKS, &prev_mode ); ffc145cc: 38 80 00 00 li r4,0 asr->nest_level += 1; rtems_task_mode( asr->mode_set, RTEMS_ALL_MODE_MASKS, &prev_mode ); (*asr->handler)( signal_set ); asr->nest_level -= 1; ffc145d0: 38 09 ff ff addi r0,r9,-1 ffc145d4: 90 1f 00 1c stw r0,28(r31) rtems_task_mode( prev_mode, RTEMS_ALL_MODE_MASKS, &prev_mode ); ffc145d8: 60 84 ff ff ori r4,r4,65535 ffc145dc: 7f c5 f3 78 mr r5,r30 ffc145e0: 80 61 00 08 lwz r3,8(r1) ffc145e4: 4b ff fc cd bl ffc142b0 } ffc145e8: 80 01 00 2c lwz r0,44(r1) ffc145ec: 83 a1 00 1c lwz r29,28(r1) ffc145f0: 7c 08 03 a6 mtlr r0 ffc145f4: 83 c1 00 20 lwz r30,32(r1) ffc145f8: 83 e1 00 24 lwz r31,36(r1) ffc145fc: 38 21 00 28 addi r1,r1,40 ffc14600: 4e 80 00 20 blr =============================================================================== ffc09844 <_Rate_monotonic_Timeout>: void _Rate_monotonic_Timeout( Objects_Id id, void *ignored ) { ffc09844: 94 21 ff e0 stwu r1,-32(r1) ffc09848: 7c 08 02 a6 mflr r0 ffc0984c: 7c 64 1b 78 mr r4,r3 ffc09850: 3c 60 00 00 lis r3,0 ffc09854: 90 01 00 24 stw r0,36(r1) ffc09858: 38 63 2c 64 addi r3,r3,11364 ffc0985c: 38 a1 00 08 addi r5,r1,8 ffc09860: 93 e1 00 1c stw r31,28(r1) ffc09864: 48 00 23 c1 bl ffc0bc24 <_Objects_Get> /* * When we get here, the Timer is already off the chain so we do not * have to worry about that -- hence no _Watchdog_Remove(). */ the_period = _Rate_monotonic_Get( id, &location ); switch ( location ) { ffc09868: 80 01 00 08 lwz r0,8(r1) ffc0986c: 7c 7f 1b 78 mr r31,r3 ffc09870: 2f 80 00 00 cmpwi cr7,r0,0 ffc09874: 40 9e 00 84 bne- cr7,ffc098f8 <_Rate_monotonic_Timeout+0xb4><== NEVER TAKEN case OBJECTS_LOCAL: the_thread = the_period->owner; ffc09878: 80 63 00 40 lwz r3,64(r3) if ( _States_Is_waiting_for_period( the_thread->current_state ) && ffc0987c: 80 03 00 10 lwz r0,16(r3) ffc09880: 70 09 40 00 andi. r9,r0,16384 ffc09884: 41 82 00 24 beq- ffc098a8 <_Rate_monotonic_Timeout+0x64> the_thread->Wait.id == the_period->Object.id ) { ffc09888: 81 23 00 20 lwz r9,32(r3) ffc0988c: 80 1f 00 08 lwz r0,8(r31) ffc09890: 7f 89 00 00 cmpw cr7,r9,r0 ffc09894: 40 be 00 14 bne+ cr7,ffc098a8 <_Rate_monotonic_Timeout+0x64> RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); ffc09898: 3c 80 10 03 lis r4,4099 ffc0989c: 60 84 ff f8 ori r4,r4,65528 ffc098a0: 48 00 29 b1 bl ffc0c250 <_Thread_Clear_state> ffc098a4: 48 00 00 18 b ffc098bc <_Rate_monotonic_Timeout+0x78> _Thread_Unblock( the_thread ); _Rate_monotonic_Initiate_statistics( the_period ); _Watchdog_Insert_ticks( &the_period->Timer, the_period->next_length ); } else if ( the_period->state == RATE_MONOTONIC_OWNER_IS_BLOCKING ) { ffc098a8: 80 1f 00 38 lwz r0,56(r31) ffc098ac: 2f 80 00 01 cmpwi cr7,r0,1 ffc098b0: 40 be 00 30 bne+ cr7,ffc098e0 <_Rate_monotonic_Timeout+0x9c> the_period->state = RATE_MONOTONIC_EXPIRED_WHILE_BLOCKING; ffc098b4: 38 00 00 03 li r0,3 ffc098b8: 90 1f 00 38 stw r0,56(r31) _Rate_monotonic_Initiate_statistics( the_period ); ffc098bc: 7f e3 fb 78 mr r3,r31 ffc098c0: 4b ff f7 75 bl ffc09034 <_Rate_monotonic_Initiate_statistics> Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; ffc098c4: 80 1f 00 3c lwz r0,60(r31) _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); ffc098c8: 3c 60 00 00 lis r3,0 Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; ffc098cc: 90 1f 00 1c stw r0,28(r31) _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); ffc098d0: 38 63 2e 68 addi r3,r3,11880 ffc098d4: 38 9f 00 10 addi r4,r31,16 ffc098d8: 48 00 45 45 bl ffc0de1c <_Watchdog_Insert> ffc098dc: 48 00 00 0c b ffc098e8 <_Rate_monotonic_Timeout+0xa4> _Watchdog_Insert_ticks( &the_period->Timer, the_period->next_length ); } else the_period->state = RATE_MONOTONIC_EXPIRED; ffc098e0: 38 00 00 04 li r0,4 ffc098e4: 90 1f 00 38 stw r0,56(r31) */ RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void ) { RTEMS_COMPILER_MEMORY_BARRIER(); _Thread_Dispatch_disable_level -= 1; ffc098e8: 3d 20 00 00 lis r9,0 ffc098ec: 81 69 27 f4 lwz r11,10228(r9) ffc098f0: 38 0b ff ff addi r0,r11,-1 ffc098f4: 90 09 27 f4 stw r0,10228(r9) case OBJECTS_REMOTE: /* impossible */ #endif case OBJECTS_ERROR: break; } } ffc098f8: 80 01 00 24 lwz r0,36(r1) ffc098fc: 83 e1 00 1c lwz r31,28(r1) ffc09900: 38 21 00 20 addi r1,r1,32 ffc09904: 7c 08 03 a6 mtlr r0 ffc09908: 4e 80 00 20 blr =============================================================================== ffc09184 <_TOD_Validate>: 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) || ffc09184: 2c 03 00 00 cmpwi r3,0 { uint32_t days_in_month; uint32_t ticks_per_second; ticks_per_second = TOD_MICROSECONDS_PER_SECOND / rtems_configuration_get_microseconds_per_tick(); ffc09188: 3d 20 00 00 lis r9,0 ffc0918c: 81 29 20 cc lwz r9,8396(r9) if ((!the_tod) || ffc09190: 41 82 00 98 beq- ffc09228 <_TOD_Validate+0xa4> <== NEVER TAKEN (the_tod->ticks >= ticks_per_second) || ffc09194: 3c 00 00 0f lis r0,15 ffc09198: 60 00 42 40 ori r0,r0,16960 ffc0919c: 7c 00 4b 96 divwu r0,r0,r9 ffc091a0: 81 23 00 18 lwz r9,24(r3) ffc091a4: 7f 89 00 40 cmplw cr7,r9,r0 ffc091a8: 40 9c 00 80 bge- cr7,ffc09228 <_TOD_Validate+0xa4> (the_tod->second >= TOD_SECONDS_PER_MINUTE) || ffc091ac: 80 03 00 14 lwz r0,20(r3) ffc091b0: 2b 80 00 3b cmplwi cr7,r0,59 ffc091b4: 41 9d 00 74 bgt- cr7,ffc09228 <_TOD_Validate+0xa4> (the_tod->minute >= TOD_MINUTES_PER_HOUR) || ffc091b8: 80 03 00 10 lwz r0,16(r3) ffc091bc: 2b 80 00 3b cmplwi cr7,r0,59 ffc091c0: 41 9d 00 68 bgt- cr7,ffc09228 <_TOD_Validate+0xa4> (the_tod->hour >= TOD_HOURS_PER_DAY) || ffc091c4: 80 03 00 0c lwz r0,12(r3) ffc091c8: 2b 80 00 17 cmplwi cr7,r0,23 ffc091cc: 41 9d 00 5c bgt- cr7,ffc09228 <_TOD_Validate+0xa4> (the_tod->month == 0) || ffc091d0: 81 23 00 04 lwz r9,4(r3) 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) || ffc091d4: 2f 89 00 00 cmpwi cr7,r9,0 ffc091d8: 41 9e 00 50 beq- cr7,ffc09228 <_TOD_Validate+0xa4> <== NEVER TAKEN ffc091dc: 2b 89 00 0c cmplwi cr7,r9,12 ffc091e0: 41 9d 00 48 bgt- cr7,ffc09228 <_TOD_Validate+0xa4> (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) || ffc091e4: 80 03 00 00 lwz r0,0(r3) 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) || ffc091e8: 2b 80 07 c3 cmplwi cr7,r0,1987 ffc091ec: 40 9d 00 3c ble- cr7,ffc09228 <_TOD_Validate+0xa4> (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) ) ffc091f0: 80 63 00 08 lwz r3,8(r3) 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) || ffc091f4: 2f 83 00 00 cmpwi cr7,r3,0 ffc091f8: 41 9e 00 30 beq- cr7,ffc09228 <_TOD_Validate+0xa4> <== NEVER TAKEN (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 ) ffc091fc: 70 0b 00 03 andi. r11,r0,3 ffc09200: 3d 60 ff c2 lis r11,-62 ffc09204: 39 6b 3e 38 addi r11,r11,15928 ffc09208: 40 82 00 08 bne- ffc09210 <_TOD_Validate+0x8c> days_in_month = _TOD_Days_per_month[ 1 ][ the_tod->month ]; ffc0920c: 39 29 00 0d addi r9,r9,13 else days_in_month = _TOD_Days_per_month[ 0 ][ the_tod->month ]; ffc09210: 55 29 10 3a rlwinm r9,r9,2,0,29 ffc09214: 7c 0b 48 2e lwzx r0,r11,r9 * false - if the the_tod is invalid * * NOTE: This routine only works for leap-years through 2099. */ bool _TOD_Validate( ffc09218: 7c 63 00 10 subfc r3,r3,r0 ffc0921c: 38 60 00 00 li r3,0 ffc09220: 7c 63 19 14 adde r3,r3,r3 ffc09224: 4e 80 00 20 blr ffc09228: 38 60 00 00 li r3,0 if ( the_tod->day > days_in_month ) return false; return true; } ffc0922c: 4e 80 00 20 blr =============================================================================== ffc0be94 <_Thread_Change_priority>: void _Thread_Change_priority( Thread_Control *the_thread, Priority_Control new_priority, bool prepend_it ) { ffc0be94: 94 21 ff e0 stwu r1,-32(r1) ffc0be98: 7c 08 02 a6 mflr r0 ffc0be9c: 90 01 00 24 stw r0,36(r1) ffc0bea0: 93 e1 00 1c stw r31,28(r1) ffc0bea4: 7c 7f 1b 78 mr r31,r3 ffc0bea8: 93 a1 00 14 stw r29,20(r1) ffc0beac: 93 c1 00 18 stw r30,24(r1) ffc0beb0: 7c be 2b 78 mr r30,r5 /* * 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 ); ffc0beb4: 90 81 00 08 stw r4,8(r1) */ /* * Save original state */ original_state = the_thread->current_state; ffc0beb8: 83 a3 00 10 lwz r29,16(r3) /* * 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 ); ffc0bebc: 48 00 12 11 bl ffc0d0cc <_Thread_Set_transient> /* * Do not bother recomputing all the priority related information if * we are not REALLY changing priority. */ if ( the_thread->current_priority != new_priority ) ffc0bec0: 80 1f 00 14 lwz r0,20(r31) ffc0bec4: 80 81 00 08 lwz r4,8(r1) ffc0bec8: 7f 80 20 00 cmpw cr7,r0,r4 ffc0becc: 41 9e 00 0c beq- cr7,ffc0bed8 <_Thread_Change_priority+0x44> _Thread_Set_priority( the_thread, new_priority ); ffc0bed0: 7f e3 fb 78 mr r3,r31 ffc0bed4: 48 00 10 85 bl ffc0cf58 <_Thread_Set_priority> static inline uint32_t ppc_interrupt_disable( void ) { uint32_t level; uint32_t mask; asm volatile ( ffc0bed8: 7d 60 00 a6 mfmsr r11 ffc0bedc: 7c 10 42 a6 mfsprg r0,0 ffc0bee0: 7d 60 00 78 andc r0,r11,r0 ffc0bee4: 7c 00 01 24 mtmsr r0 /* * 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; ffc0bee8: 80 1f 00 10 lwz r0,16(r31) ffc0beec: 57 bd 07 7a rlwinm r29,r29,0,29,29 if ( state != STATES_TRANSIENT ) { ffc0bef0: 2f 80 00 04 cmpwi cr7,r0,4 ffc0bef4: 41 9e 00 38 beq- cr7,ffc0bf2c <_Thread_Change_priority+0x98> /* Only clear the transient state if it wasn't set already */ if ( ! _States_Is_transient( original_state ) ) ffc0bef8: 2f 9d 00 00 cmpwi cr7,r29,0 ffc0befc: 40 9e 00 0c bne- cr7,ffc0bf08 <_Thread_Change_priority+0x74><== NEVER TAKEN the_thread->current_state = _States_Clear( STATES_TRANSIENT, state ); ffc0bf00: 54 09 07 b8 rlwinm r9,r0,0,30,28 ffc0bf04: 91 3f 00 10 stw r9,16(r31) return level; } static inline void ppc_interrupt_enable( uint32_t level ) { asm volatile ( ffc0bf08: 7d 60 01 24 mtmsr r11 _ISR_Enable( level ); if ( _States_Is_waiting_on_thread_queue( state ) ) { ffc0bf0c: 3d 20 00 03 lis r9,3 ffc0bf10: 61 29 be e0 ori r9,r9,48864 ffc0bf14: 7c 0b 48 39 and. r11,r0,r9 ffc0bf18: 41 a2 01 04 beq+ ffc0c01c <_Thread_Change_priority+0x188> _Thread_queue_Requeue( the_thread->Wait.queue, the_thread ); ffc0bf1c: 80 7f 00 44 lwz r3,68(r31) ffc0bf20: 7f e4 fb 78 mr r4,r31 ffc0bf24: 48 00 0f 61 bl ffc0ce84 <_Thread_queue_Requeue> ffc0bf28: 48 00 00 f4 b ffc0c01c <_Thread_Change_priority+0x188> } return; } /* Only clear the transient state if it wasn't set already */ if ( ! _States_Is_transient( original_state ) ) { ffc0bf2c: 2f 9d 00 00 cmpwi cr7,r29,0 ffc0bf30: 40 9e 00 6c bne- cr7,ffc0bf9c <_Thread_Change_priority+0x108><== NEVER TAKEN * 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 ); ffc0bf34: 93 bf 00 10 stw r29,16(r31) _Priority_Add_to_bit_map( &the_thread->Priority_map ); if ( prepend_it ) ffc0bf38: 2f 9e 00 00 cmpwi cr7,r30,0 RTEMS_INLINE_ROUTINE void _Priority_Add_to_bit_map ( Priority_Information *the_priority_map ) { *the_priority_map->minor |= the_priority_map->ready_minor; _Priority_Major_bit_map |= the_priority_map->ready_major; ffc0bf3c: 3d 40 00 00 lis r10,0 RTEMS_INLINE_ROUTINE void _Priority_Add_to_bit_map ( Priority_Information *the_priority_map ) { *the_priority_map->minor |= the_priority_map->ready_minor; ffc0bf40: 81 3f 00 90 lwz r9,144(r31) ffc0bf44: 80 1f 00 98 lwz r0,152(r31) ffc0bf48: 81 09 00 00 lwz r8,0(r9) ffc0bf4c: 7d 00 03 78 or r0,r8,r0 ffc0bf50: 90 09 00 00 stw r0,0(r9) _Priority_Major_bit_map |= the_priority_map->ready_major; ffc0bf54: 81 0a 27 c4 lwz r8,10180(r10) ffc0bf58: 80 1f 00 94 lwz r0,148(r31) ffc0bf5c: 81 3f 00 8c lwz r9,140(r31) ffc0bf60: 7d 00 03 78 or r0,r8,r0 ffc0bf64: 90 0a 27 c4 stw r0,10180(r10) ffc0bf68: 41 9e 00 1c beq- cr7,ffc0bf84 <_Thread_Change_priority+0xf0> ) { Chain_Node *before_node; the_node->previous = after_node; before_node = after_node->next; ffc0bf6c: 81 49 00 00 lwz r10,0(r9) Chain_Node *the_node ) { Chain_Node *before_node; the_node->previous = after_node; ffc0bf70: 91 3f 00 04 stw r9,4(r31) before_node = after_node->next; after_node->next = the_node; ffc0bf74: 93 e9 00 00 stw r31,0(r9) the_node->next = before_node; before_node->previous = the_node; ffc0bf78: 93 ea 00 04 stw r31,4(r10) Chain_Node *before_node; the_node->previous = after_node; before_node = after_node->next; after_node->next = the_node; the_node->next = before_node; ffc0bf7c: 91 5f 00 00 stw r10,0(r31) ffc0bf80: 48 00 00 1c b ffc0bf9c <_Thread_Change_priority+0x108> Chain_Node *the_node ) { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); ffc0bf84: 38 09 00 04 addi r0,r9,4 ffc0bf88: 90 1f 00 00 stw r0,0(r31) old_last_node = the_chain->last; ffc0bf8c: 81 49 00 08 lwz r10,8(r9) the_chain->last = the_node; ffc0bf90: 93 e9 00 08 stw r31,8(r9) old_last_node->next = the_node; the_node->previous = old_last_node; ffc0bf94: 91 5f 00 04 stw r10,4(r31) 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; ffc0bf98: 93 ea 00 00 stw r31,0(r10) static inline void ppc_interrupt_flash( uint32_t level ) { uint32_t current_level; asm volatile ( ffc0bf9c: 7c 00 00 a6 mfmsr r0 ffc0bfa0: 7d 60 01 24 mtmsr r11 ffc0bfa4: 7c 00 01 24 mtmsr r0 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 ); ffc0bfa8: 3c c0 00 00 lis r6,0 */ RTEMS_INLINE_ROUTINE void _Thread_Calculate_heir( void ) { _Thread_Heir = (Thread_Control *) _Thread_Ready_chain[ _Priority_Get_highest() ].first; ffc0bfac: 3d 40 00 00 lis r10,0 ffc0bfb0: 81 26 27 c4 lwz r9,10180(r6) ffc0bfb4: 80 aa 27 84 lwz r5,10116(r10) ffc0bfb8: 7d 27 00 34 cntlzw r7,r9 _Bitfield_Find_first_bit( _Priority_Bit_map[major], minor ); ffc0bfbc: 3d 00 00 00 lis r8,0 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 ); ffc0bfc0: 91 26 27 c4 stw r9,10180(r6) _Bitfield_Find_first_bit( _Priority_Bit_map[major], minor ); ffc0bfc4: 39 08 2e 60 addi r8,r8,11872 ffc0bfc8: 54 ea 10 3a rlwinm r10,r7,2,0,29 ffc0bfcc: 7c 08 50 2e lwzx r0,r8,r10 ffc0bfd0: 7c 09 00 34 cntlzw r9,r0 * ready thread. */ RTEMS_INLINE_ROUTINE void _Thread_Calculate_heir( void ) { _Thread_Heir = (Thread_Control *) ffc0bfd4: 54 e7 20 36 rlwinm r7,r7,4,0,27 ffc0bfd8: 7c 08 51 2e stwx r0,r8,r10 ffc0bfdc: 7c e7 4a 14 add r7,r7,r9 ffc0bfe0: 1c e7 00 0c mulli r7,r7,12 * is also the heir thread, and false otherwise. */ RTEMS_INLINE_ROUTINE bool _Thread_Is_executing_also_the_heir( void ) { return ( _Thread_Executing == _Thread_Heir ); ffc0bfe4: 3d 20 00 00 lis r9,0 * ready thread. */ RTEMS_INLINE_ROUTINE void _Thread_Calculate_heir( void ) { _Thread_Heir = (Thread_Control *) ffc0bfe8: 7c 05 38 2e lwzx r0,r5,r7 * is also the heir thread, and false otherwise. */ RTEMS_INLINE_ROUTINE bool _Thread_Is_executing_also_the_heir( void ) { return ( _Thread_Executing == _Thread_Heir ); ffc0bfec: 81 29 27 d0 lwz r9,10192(r9) * ready thread. */ RTEMS_INLINE_ROUTINE void _Thread_Calculate_heir( void ) { _Thread_Heir = (Thread_Control *) ffc0bff0: 3d 40 00 00 lis r10,0 ffc0bff4: 90 0a 27 ac stw r0,10156(r10) * 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() && ffc0bff8: 7f 89 00 00 cmpw cr7,r9,r0 ffc0bffc: 41 9e 00 1c beq- cr7,ffc0c018 <_Thread_Change_priority+0x184> _Thread_Executing->is_preemptible ) ffc0c000: 88 09 00 75 lbz r0,117(r9) ffc0c004: 2f 80 00 00 cmpwi cr7,r0,0 ffc0c008: 41 9e 00 10 beq- cr7,ffc0c018 <_Thread_Change_priority+0x184> _Context_Switch_necessary = true; ffc0c00c: 38 00 00 01 li r0,1 ffc0c010: 3d 20 00 00 lis r9,0 ffc0c014: 98 09 27 e0 stb r0,10208(r9) return level; } static inline void ppc_interrupt_enable( uint32_t level ) { asm volatile ( ffc0c018: 7d 60 01 24 mtmsr r11 _ISR_Enable( level ); } ffc0c01c: 80 01 00 24 lwz r0,36(r1) ffc0c020: 83 a1 00 14 lwz r29,20(r1) ffc0c024: 7c 08 03 a6 mtlr r0 ffc0c028: 83 c1 00 18 lwz r30,24(r1) ffc0c02c: 83 e1 00 1c lwz r31,28(r1) ffc0c030: 38 21 00 20 addi r1,r1,32 ffc0c034: 4e 80 00 20 blr =============================================================================== ffc0c038 <_Thread_Clear_state>: static inline uint32_t ppc_interrupt_disable( void ) { uint32_t level; uint32_t mask; asm volatile ( ffc0c038: 7c 00 00 a6 mfmsr r0 ffc0c03c: 7d 30 42 a6 mfsprg r9,0 ffc0c040: 7c 09 48 78 andc r9,r0,r9 ffc0c044: 7d 20 01 24 mtmsr r9 { ISR_Level level; States_Control current_state; _ISR_Disable( level ); current_state = the_thread->current_state; ffc0c048: 81 23 00 10 lwz r9,16(r3) if ( current_state & state ) { ffc0c04c: 7c 8b 48 39 and. r11,r4,r9 ffc0c050: 41 82 00 a8 beq- ffc0c0f8 <_Thread_Clear_state+0xc0> RTEMS_INLINE_ROUTINE States_Control _States_Clear ( States_Control states_to_clear, States_Control current_state ) { return (current_state & ~states_to_clear); ffc0c054: 7d 24 20 78 andc r4,r9,r4 current_state = the_thread->current_state = _States_Clear( state, current_state ); if ( _States_Is_ready( current_state ) ) { ffc0c058: 2f 84 00 00 cmpwi cr7,r4,0 _ISR_Disable( level ); current_state = the_thread->current_state; if ( current_state & state ) { current_state = ffc0c05c: 90 83 00 10 stw r4,16(r3) the_thread->current_state = _States_Clear( state, current_state ); if ( _States_Is_ready( current_state ) ) { ffc0c060: 40 9e 00 98 bne- cr7,ffc0c0f8 <_Thread_Clear_state+0xc0> RTEMS_INLINE_ROUTINE void _Priority_Add_to_bit_map ( Priority_Information *the_priority_map ) { *the_priority_map->minor |= the_priority_map->ready_minor; ffc0c064: 81 63 00 90 lwz r11,144(r3) ffc0c068: 81 43 00 98 lwz r10,152(r3) ffc0c06c: 81 0b 00 00 lwz r8,0(r11) _Priority_Add_to_bit_map( &the_thread->Priority_map ); _Chain_Append_unprotected(the_thread->ready, &the_thread->Object.Node); ffc0c070: 81 23 00 8c lwz r9,140(r3) ffc0c074: 7d 0a 53 78 or r10,r8,r10 ffc0c078: 91 4b 00 00 stw r10,0(r11) Chain_Node *the_node ) { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); ffc0c07c: 39 69 00 04 addi r11,r9,4 _Priority_Major_bit_map |= the_priority_map->ready_major; ffc0c080: 3d 40 00 00 lis r10,0 ffc0c084: 91 63 00 00 stw r11,0(r3) ffc0c088: 80 ea 27 c4 lwz r7,10180(r10) ffc0c08c: 81 03 00 94 lwz r8,148(r3) old_last_node = the_chain->last; ffc0c090: 81 69 00 08 lwz r11,8(r9) ffc0c094: 7c e8 43 78 or r8,r7,r8 the_chain->last = the_node; ffc0c098: 90 69 00 08 stw r3,8(r9) ffc0c09c: 91 0a 27 c4 stw r8,10180(r10) old_last_node->next = the_node; the_node->previous = old_last_node; ffc0c0a0: 91 63 00 04 stw r11,4(r3) 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; ffc0c0a4: 90 6b 00 00 stw r3,0(r11) static inline void ppc_interrupt_flash( uint32_t level ) { uint32_t current_level; asm volatile ( ffc0c0a8: 7d 20 00 a6 mfmsr r9 ffc0c0ac: 7c 00 01 24 mtmsr r0 ffc0c0b0: 7d 20 01 24 mtmsr r9 * 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 ) { ffc0c0b4: 3d 60 00 00 lis r11,0 ffc0c0b8: 81 23 00 14 lwz r9,20(r3) ffc0c0bc: 81 4b 27 ac lwz r10,10156(r11) ffc0c0c0: 81 4a 00 14 lwz r10,20(r10) ffc0c0c4: 7f 89 50 40 cmplw cr7,r9,r10 ffc0c0c8: 40 9c 00 30 bge- cr7,ffc0c0f8 <_Thread_Clear_state+0xc0> _Thread_Heir = the_thread; if ( _Thread_Executing->is_preemptible || ffc0c0cc: 3d 40 00 00 lis r10,0 * 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; ffc0c0d0: 90 6b 27 ac stw r3,10156(r11) if ( _Thread_Executing->is_preemptible || ffc0c0d4: 81 4a 27 d0 lwz r10,10192(r10) ffc0c0d8: 89 6a 00 75 lbz r11,117(r10) ffc0c0dc: 2f 8b 00 00 cmpwi cr7,r11,0 ffc0c0e0: 40 9e 00 0c bne- cr7,ffc0c0ec <_Thread_Clear_state+0xb4> ffc0c0e4: 2f 89 00 00 cmpwi cr7,r9,0 ffc0c0e8: 40 9e 00 10 bne- cr7,ffc0c0f8 <_Thread_Clear_state+0xc0><== ALWAYS TAKEN the_thread->current_priority == 0 ) _Context_Switch_necessary = true; ffc0c0ec: 39 60 00 01 li r11,1 ffc0c0f0: 3d 20 00 00 lis r9,0 ffc0c0f4: 99 69 27 e0 stb r11,10208(r9) return level; } static inline void ppc_interrupt_enable( uint32_t level ) { asm volatile ( ffc0c0f8: 7c 00 01 24 mtmsr r0 } } } _ISR_Enable( level ); } ffc0c0fc: 4e 80 00 20 blr =============================================================================== ffc0c100 <_Thread_Close>: void _Thread_Close( Objects_Information *information, Thread_Control *the_thread ) { ffc0c100: 94 21 ff e8 stwu r1,-24(r1) ffc0c104: 7c 08 02 a6 mflr r0 ffc0c108: 39 60 00 00 li r11,0 ffc0c10c: 90 01 00 1c stw r0,28(r1) ffc0c110: a0 04 00 0a lhz r0,10(r4) ffc0c114: 81 23 00 1c lwz r9,28(r3) ffc0c118: 54 00 10 3a rlwinm r0,r0,2,0,29 ffc0c11c: 93 a1 00 0c stw r29,12(r1) ffc0c120: 7c 7d 1b 78 mr r29,r3 ffc0c124: 93 e1 00 14 stw r31,20(r1) ffc0c128: 7c 9f 23 78 mr r31,r4 ffc0c12c: 93 c1 00 10 stw r30,16(r1) ffc0c130: 7d 69 01 2e stwx r11,r9,r0 */ RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void ) { RTEMS_COMPILER_MEMORY_BARRIER(); _Thread_Dispatch_disable_level -= 1; ffc0c134: 3f c0 00 00 lis r30,0 ffc0c138: 81 3e 27 90 lwz r9,10128(r30) * disappear and set a transient state on it. So we temporarily * unnest dispatching. */ _Thread_Unnest_dispatch(); _User_extensions_Thread_delete( the_thread ); ffc0c13c: 7c 83 23 78 mr r3,r4 ffc0c140: 38 09 ff ff addi r0,r9,-1 ffc0c144: 90 1e 27 90 stw r0,10128(r30) ffc0c148: 48 00 17 1d bl ffc0d864 <_User_extensions_Thread_delete> rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; ffc0c14c: 81 3e 27 90 lwz r9,10128(r30) ffc0c150: 38 09 00 01 addi r0,r9,1 ffc0c154: 90 1e 27 90 stw r0,10128(r30) /* * Now we are in a dispatching critical section again and we * can take the thread OUT of the published set. It is invalid * to use this thread's Id OR name after this call. */ _Objects_Close( information, &the_thread->Object ); ffc0c158: 7f a3 eb 78 mr r3,r29 ffc0c15c: 7f e4 fb 78 mr r4,r31 ffc0c160: 4b ff f2 d9 bl ffc0b438 <_Objects_Close> /* * By setting the dormant state, the thread will not be considered * for scheduling when we remove any blocking states. */ _Thread_Set_state( the_thread, STATES_DORMANT ); ffc0c164: 7f e3 fb 78 mr r3,r31 ffc0c168: 38 80 00 01 li r4,1 ffc0c16c: 48 00 0e 49 bl ffc0cfb4 <_Thread_Set_state> if ( !_Thread_queue_Extract_with_proxy( the_thread ) ) { ffc0c170: 7f e3 fb 78 mr r3,r31 ffc0c174: 48 00 0c 2d bl ffc0cda0 <_Thread_queue_Extract_with_proxy> ffc0c178: 2f 83 00 00 cmpwi cr7,r3,0 ffc0c17c: 40 9e 00 18 bne- cr7,ffc0c194 <_Thread_Close+0x94> if ( _Watchdog_Is_active( &the_thread->Timer ) ) ffc0c180: 80 1f 00 50 lwz r0,80(r31) ffc0c184: 2f 80 00 02 cmpwi cr7,r0,2 ffc0c188: 40 be 00 0c bne+ cr7,ffc0c194 <_Thread_Close+0x94> (void) _Watchdog_Remove( &the_thread->Timer ); ffc0c18c: 38 7f 00 48 addi r3,r31,72 ffc0c190: 48 00 19 ad bl ffc0db3c <_Watchdog_Remove> if ( _Thread_Is_allocated_fp( the_thread ) ) _Thread_Deallocate_fp(); #endif the_thread->fp_context = NULL; if ( the_thread->Start.fp_context ) ffc0c194: 80 7f 00 d4 lwz r3,212(r31) #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) #if ( CPU_USE_DEFERRED_FP_SWITCH == TRUE ) if ( _Thread_Is_allocated_fp( the_thread ) ) _Thread_Deallocate_fp(); #endif the_thread->fp_context = NULL; ffc0c198: 38 00 00 00 li r0,0 ffc0c19c: 90 1f 01 3c stw r0,316(r31) if ( the_thread->Start.fp_context ) ffc0c1a0: 2f 83 00 00 cmpwi cr7,r3,0 ffc0c1a4: 41 9e 00 08 beq- cr7,ffc0c1ac <_Thread_Close+0xac> <== NEVER TAKEN (void) _Workspace_Free( the_thread->Start.fp_context ); ffc0c1a8: 48 00 1a bd bl ffc0dc64 <_Workspace_Free> /* * Free the rest of the memory associated with this task * and set the associated pointers to NULL for safety. */ _Thread_Stack_Free( the_thread ); ffc0c1ac: 7f e3 fb 78 mr r3,r31 ffc0c1b0: 48 00 10 3d bl ffc0d1ec <_Thread_Stack_Free> the_thread->Start.stack = NULL; if ( the_thread->extensions ) ffc0c1b4: 80 7f 01 50 lwz r3,336(r31) /* * Free the rest of the memory associated with this task * and set the associated pointers to NULL for safety. */ _Thread_Stack_Free( the_thread ); the_thread->Start.stack = NULL; ffc0c1b8: 38 00 00 00 li r0,0 if ( the_thread->extensions ) ffc0c1bc: 2f 83 00 00 cmpwi cr7,r3,0 /* * Free the rest of the memory associated with this task * and set the associated pointers to NULL for safety. */ _Thread_Stack_Free( the_thread ); the_thread->Start.stack = NULL; ffc0c1c0: 90 1f 00 d8 stw r0,216(r31) if ( the_thread->extensions ) ffc0c1c4: 41 9e 00 08 beq- cr7,ffc0c1cc <_Thread_Close+0xcc> (void) _Workspace_Free( the_thread->extensions ); ffc0c1c8: 48 00 1a 9d bl ffc0dc64 <_Workspace_Free> the_thread->extensions = NULL; ffc0c1cc: 38 00 00 00 li r0,0 } ffc0c1d0: 83 a1 00 0c lwz r29,12(r1) _Thread_Stack_Free( the_thread ); the_thread->Start.stack = NULL; if ( the_thread->extensions ) (void) _Workspace_Free( the_thread->extensions ); the_thread->extensions = NULL; ffc0c1d4: 90 1f 01 50 stw r0,336(r31) } ffc0c1d8: 80 01 00 1c lwz r0,28(r1) ffc0c1dc: 83 c1 00 10 lwz r30,16(r1) ffc0c1e0: 7c 08 03 a6 mtlr r0 ffc0c1e4: 83 e1 00 14 lwz r31,20(r1) ffc0c1e8: 38 21 00 18 addi r1,r1,24 ffc0c1ec: 4e 80 00 20 blr =============================================================================== ffc0c2e0 <_Thread_Delay_ended>: void _Thread_Delay_ended( Objects_Id id, void *ignored __attribute__((unused)) ) { ffc0c2e0: 94 21 ff e8 stwu r1,-24(r1) ffc0c2e4: 7c 08 02 a6 mflr r0 Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); ffc0c2e8: 38 81 00 08 addi r4,r1,8 void _Thread_Delay_ended( Objects_Id id, void *ignored __attribute__((unused)) ) { ffc0c2ec: 90 01 00 1c stw r0,28(r1) Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); ffc0c2f0: 48 00 02 4d bl ffc0c53c <_Thread_Get> switch ( location ) { ffc0c2f4: 80 01 00 08 lwz r0,8(r1) ffc0c2f8: 2f 80 00 00 cmpwi cr7,r0,0 ffc0c2fc: 40 9e 00 20 bne- cr7,ffc0c31c <_Thread_Delay_ended+0x3c><== NEVER TAKEN #if defined(RTEMS_MULTIPROCESSING) case OBJECTS_REMOTE: /* impossible */ #endif break; case OBJECTS_LOCAL: _Thread_Clear_state( ffc0c300: 3c 80 10 00 lis r4,4096 ffc0c304: 60 84 00 18 ori r4,r4,24 ffc0c308: 4b ff fd 31 bl ffc0c038 <_Thread_Clear_state> ffc0c30c: 3d 20 00 00 lis r9,0 ffc0c310: 81 69 27 90 lwz r11,10128(r9) ffc0c314: 38 0b ff ff addi r0,r11,-1 ffc0c318: 90 09 27 90 stw r0,10128(r9) | STATES_INTERRUPTIBLE_BY_SIGNAL ); _Thread_Unnest_dispatch(); break; } } ffc0c31c: 80 01 00 1c lwz r0,28(r1) ffc0c320: 38 21 00 18 addi r1,r1,24 ffc0c324: 7c 08 03 a6 mtlr r0 ffc0c328: 4e 80 00 20 blr =============================================================================== ffc0c32c <_Thread_Dispatch>: * dispatch thread * no dispatch thread */ void _Thread_Dispatch( void ) { ffc0c32c: 94 21 ff b0 stwu r1,-80(r1) ffc0c330: 7c 08 02 a6 mflr r0 ffc0c334: 93 41 00 38 stw r26,56(r1) Thread_Control *executing; Thread_Control *heir; ISR_Level level; executing = _Thread_Executing; ffc0c338: 3f 40 00 00 lis r26,0 * dispatch thread * no dispatch thread */ void _Thread_Dispatch( void ) { ffc0c33c: 93 e1 00 4c stw r31,76(r1) ffc0c340: 90 01 00 54 stw r0,84(r1) ffc0c344: 92 61 00 1c stw r19,28(r1) ffc0c348: 92 81 00 20 stw r20,32(r1) ffc0c34c: 92 a1 00 24 stw r21,36(r1) ffc0c350: 92 c1 00 28 stw r22,40(r1) ffc0c354: 92 e1 00 2c stw r23,44(r1) ffc0c358: 93 01 00 30 stw r24,48(r1) ffc0c35c: 93 21 00 34 stw r25,52(r1) ffc0c360: 93 61 00 3c stw r27,60(r1) ffc0c364: 93 81 00 40 stw r28,64(r1) ffc0c368: 93 a1 00 44 stw r29,68(r1) ffc0c36c: 93 c1 00 48 stw r30,72(r1) Thread_Control *executing; Thread_Control *heir; ISR_Level level; executing = _Thread_Executing; ffc0c370: 83 fa 27 d0 lwz r31,10192(r26) static inline uint32_t ppc_interrupt_disable( void ) { uint32_t level; uint32_t mask; asm volatile ( ffc0c374: 7c 00 00 a6 mfmsr r0 ffc0c378: 7d 30 42 a6 mfsprg r9,0 ffc0c37c: 7c 09 48 78 andc r9,r0,r9 ffc0c380: 7d 20 01 24 mtmsr r9 _ISR_Disable( level ); while ( _Context_Switch_necessary == true ) { ffc0c384: 3f 20 00 00 lis r25,0 heir = _Thread_Heir; ffc0c388: 3e 60 00 00 lis r19,0 _Thread_Dispatch_disable_level = 1; ffc0c38c: 3e 80 00 00 lis r20,0 #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; ffc0c390: 3e a0 00 00 lis r21,0 #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ { Timestamp_Control uptime, ran; _TOD_Get_uptime( &uptime ); _Timestamp_Subtract( ffc0c394: 3f 60 00 00 lis r27,0 #endif /* * Switch libc's task specific data. */ if ( _Thread_libc_reent ) { ffc0c398: 3e c0 00 00 lis r22,0 Thread_Control *heir; ISR_Level level; executing = _Thread_Executing; _ISR_Disable( level ); while ( _Context_Switch_necessary == true ) { ffc0c39c: 3b 39 27 e0 addi r25,r25,10208 heir = _Thread_Heir; ffc0c3a0: 3a 73 27 ac addi r19,r19,10156 _Thread_Dispatch_disable_level = 1; ffc0c3a4: 3a 94 27 90 addi r20,r20,10128 _Context_Switch_necessary = false; _Thread_Executing = heir; ffc0c3a8: 3b 5a 27 d0 addi r26,r26,10192 #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; ffc0c3ac: 3a b5 27 88 addi r21,r21,10120 #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ { Timestamp_Control uptime, ran; _TOD_Get_uptime( &uptime ); _Timestamp_Subtract( ffc0c3b0: 3b 7b 27 d8 addi r27,r27,10200 #endif /* * Switch libc's task specific data. */ if ( _Thread_libc_reent ) { ffc0c3b4: 3a d6 27 a8 addi r22,r22,10152 executing = _Thread_Executing; _ISR_Disable( level ); while ( _Context_Switch_necessary == true ) { heir = _Thread_Heir; _Thread_Dispatch_disable_level = 1; ffc0c3b8: 3a e0 00 01 li r23,1 _Context_Switch_necessary = false; ffc0c3bc: 3b 00 00 00 li r24,0 _ISR_Enable( level ); #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ { Timestamp_Control uptime, ran; _TOD_Get_uptime( &uptime ); ffc0c3c0: 3b 81 00 08 addi r28,r1,8 _Timestamp_Subtract( ffc0c3c4: 3b a1 00 10 addi r29,r1,16 Thread_Control *heir; ISR_Level level; executing = _Thread_Executing; _ISR_Disable( level ); while ( _Context_Switch_necessary == true ) { ffc0c3c8: 48 00 00 d0 b ffc0c498 <_Thread_Dispatch+0x16c> heir = _Thread_Heir; ffc0c3cc: 83 d3 00 00 lwz r30,0(r19) _Thread_Dispatch_disable_level = 1; ffc0c3d0: 92 f4 00 00 stw r23,0(r20) _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 ) ffc0c3d4: 81 3e 00 7c lwz r9,124(r30) executing = _Thread_Executing; _ISR_Disable( level ); while ( _Context_Switch_necessary == true ) { heir = _Thread_Heir; _Thread_Dispatch_disable_level = 1; _Context_Switch_necessary = false; ffc0c3d8: 9b 19 00 00 stb r24,0(r25) _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 ) ffc0c3dc: 2f 89 00 01 cmpwi cr7,r9,1 _ISR_Disable( level ); while ( _Context_Switch_necessary == true ) { heir = _Thread_Heir; _Thread_Dispatch_disable_level = 1; _Context_Switch_necessary = false; _Thread_Executing = heir; ffc0c3e0: 93 da 00 00 stw r30,0(r26) #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 ) ffc0c3e4: 40 be 00 0c bne+ cr7,ffc0c3f0 <_Thread_Dispatch+0xc4> heir->cpu_time_budget = _Thread_Ticks_per_timeslice; ffc0c3e8: 81 35 00 00 lwz r9,0(r21) ffc0c3ec: 91 3e 00 78 stw r9,120(r30) return level; } static inline void ppc_interrupt_enable( uint32_t level ) { asm volatile ( ffc0c3f0: 7c 00 01 24 mtmsr r0 _ISR_Enable( level ); #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ { Timestamp_Control uptime, ran; _TOD_Get_uptime( &uptime ); ffc0c3f4: 7f 83 e3 78 mr r3,r28 ffc0c3f8: 48 00 87 19 bl ffc14b10 <_TOD_Get_uptime> _Timestamp_Subtract( ffc0c3fc: 7f 63 db 78 mr r3,r27 ffc0c400: 7f 84 e3 78 mr r4,r28 ffc0c404: 7f a5 eb 78 mr r5,r29 ffc0c408: 48 00 11 19 bl ffc0d520 <_Timespec_Subtract> &_Thread_Time_of_last_context_switch, &uptime, &ran ); _Timestamp_Add_to( &executing->cpu_time_used, &ran ); ffc0c40c: 7f a4 eb 78 mr r4,r29 ffc0c410: 38 7f 00 84 addi r3,r31,132 ffc0c414: 48 00 10 b1 bl ffc0d4c4 <_Timespec_Add_to> #endif /* * Switch libc's task specific data. */ if ( _Thread_libc_reent ) { ffc0c418: 81 36 00 00 lwz r9,0(r22) &_Thread_Time_of_last_context_switch, &uptime, &ran ); _Timestamp_Add_to( &executing->cpu_time_used, &ran ); _Thread_Time_of_last_context_switch = uptime; ffc0c41c: 81 61 00 08 lwz r11,8(r1) if ( _Thread_libc_reent ) { executing->libc_reent = *_Thread_libc_reent; *_Thread_libc_reent = heir->libc_reent; } _User_extensions_Thread_switch( executing, heir ); ffc0c420: 7f e3 fb 78 mr r3,r31 #endif /* * Switch libc's task specific data. */ if ( _Thread_libc_reent ) { ffc0c424: 2f 89 00 00 cmpwi cr7,r9,0 &_Thread_Time_of_last_context_switch, &uptime, &ran ); _Timestamp_Add_to( &executing->cpu_time_used, &ran ); _Thread_Time_of_last_context_switch = uptime; ffc0c428: 81 81 00 0c lwz r12,12(r1) if ( _Thread_libc_reent ) { executing->libc_reent = *_Thread_libc_reent; *_Thread_libc_reent = heir->libc_reent; } _User_extensions_Thread_switch( executing, heir ); ffc0c42c: 7f c4 f3 78 mr r4,r30 &_Thread_Time_of_last_context_switch, &uptime, &ran ); _Timestamp_Add_to( &executing->cpu_time_used, &ran ); _Thread_Time_of_last_context_switch = uptime; ffc0c430: 91 7b 00 00 stw r11,0(r27) ffc0c434: 91 9b 00 04 stw r12,4(r27) #endif /* * Switch libc's task specific data. */ if ( _Thread_libc_reent ) { ffc0c438: 41 9e 00 14 beq- cr7,ffc0c44c <_Thread_Dispatch+0x120> <== NEVER TAKEN executing->libc_reent = *_Thread_libc_reent; ffc0c43c: 80 09 00 00 lwz r0,0(r9) ffc0c440: 90 1f 01 40 stw r0,320(r31) *_Thread_libc_reent = heir->libc_reent; ffc0c444: 80 1e 01 40 lwz r0,320(r30) ffc0c448: 90 09 00 00 stw r0,0(r9) } _User_extensions_Thread_switch( executing, heir ); ffc0c44c: 48 00 15 21 bl ffc0d96c <_User_extensions_Thread_switch> * operations. */ #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) #if ( CPU_USE_DEFERRED_FP_SWITCH != TRUE ) if ( executing->fp_context != NULL ) ffc0c450: 80 1f 01 3c lwz r0,316(r31) _Context_Save_fp( &executing->fp_context ); ffc0c454: 38 7f 01 3c addi r3,r31,316 * operations. */ #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) #if ( CPU_USE_DEFERRED_FP_SWITCH != TRUE ) if ( executing->fp_context != NULL ) ffc0c458: 2f 80 00 00 cmpwi cr7,r0,0 ffc0c45c: 41 9e 00 08 beq- cr7,ffc0c464 <_Thread_Dispatch+0x138> _Context_Save_fp( &executing->fp_context ); ffc0c460: 48 01 6b c1 bl ffc23020 <_CPU_Context_save_fp> #endif #endif _Context_Switch( &executing->Registers, &heir->Registers ); ffc0c464: 38 7f 00 dc addi r3,r31,220 ffc0c468: 38 9e 00 dc addi r4,r30,220 ffc0c46c: 48 01 6d 35 bl ffc231a0 <_CPU_Context_switch> _Context_Save_fp( &_Thread_Allocated_fp->fp_context ); _Context_Restore_fp( &executing->fp_context ); _Thread_Allocated_fp = executing; } #else if ( executing->fp_context != NULL ) ffc0c470: 80 1f 01 3c lwz r0,316(r31) _Context_Restore_fp( &executing->fp_context ); ffc0c474: 38 7f 01 3c addi r3,r31,316 _Context_Save_fp( &_Thread_Allocated_fp->fp_context ); _Context_Restore_fp( &executing->fp_context ); _Thread_Allocated_fp = executing; } #else if ( executing->fp_context != NULL ) ffc0c478: 2f 80 00 00 cmpwi cr7,r0,0 ffc0c47c: 41 9e 00 08 beq- cr7,ffc0c484 <_Thread_Dispatch+0x158> _Context_Restore_fp( &executing->fp_context ); ffc0c480: 48 01 6c 61 bl ffc230e0 <_CPU_Context_restore_fp> #endif #endif executing = _Thread_Executing; ffc0c484: 83 fa 00 00 lwz r31,0(r26) static inline uint32_t ppc_interrupt_disable( void ) { uint32_t level; uint32_t mask; asm volatile ( ffc0c488: 7c 00 00 a6 mfmsr r0 ffc0c48c: 7d 30 42 a6 mfsprg r9,0 ffc0c490: 7c 09 48 78 andc r9,r0,r9 ffc0c494: 7d 20 01 24 mtmsr r9 Thread_Control *heir; ISR_Level level; executing = _Thread_Executing; _ISR_Disable( level ); while ( _Context_Switch_necessary == true ) { ffc0c498: 89 39 00 00 lbz r9,0(r25) ffc0c49c: 2f 89 00 00 cmpwi cr7,r9,0 ffc0c4a0: 40 9e ff 2c bne+ cr7,ffc0c3cc <_Thread_Dispatch+0xa0> executing = _Thread_Executing; _ISR_Disable( level ); } _Thread_Dispatch_disable_level = 0; ffc0c4a4: 3d 60 00 00 lis r11,0 ffc0c4a8: 91 2b 27 90 stw r9,10128(r11) return level; } static inline void ppc_interrupt_enable( uint32_t level ) { asm volatile ( ffc0c4ac: 7c 00 01 24 mtmsr r0 _ISR_Enable( level ); if ( _Thread_Do_post_task_switch_extension || ffc0c4b0: 3d 20 00 00 lis r9,0 ffc0c4b4: 80 09 27 c0 lwz r0,10176(r9) ffc0c4b8: 2f 80 00 00 cmpwi cr7,r0,0 ffc0c4bc: 40 9e 00 10 bne- cr7,ffc0c4cc <_Thread_Dispatch+0x1a0> executing->do_post_task_switch_extension ) { ffc0c4c0: 88 1f 00 74 lbz r0,116(r31) ffc0c4c4: 2f 80 00 00 cmpwi cr7,r0,0 ffc0c4c8: 41 9e 00 10 beq- cr7,ffc0c4d8 <_Thread_Dispatch+0x1ac> executing->do_post_task_switch_extension = false; ffc0c4cc: 38 00 00 00 li r0,0 ffc0c4d0: 98 1f 00 74 stb r0,116(r31) _API_extensions_Run_postswitch(); ffc0c4d4: 4b ff e2 89 bl ffc0a75c <_API_extensions_Run_postswitch> } } ffc0c4d8: 80 01 00 54 lwz r0,84(r1) ffc0c4dc: 82 61 00 1c lwz r19,28(r1) ffc0c4e0: 7c 08 03 a6 mtlr r0 ffc0c4e4: 82 81 00 20 lwz r20,32(r1) ffc0c4e8: 82 a1 00 24 lwz r21,36(r1) ffc0c4ec: 82 c1 00 28 lwz r22,40(r1) ffc0c4f0: 82 e1 00 2c lwz r23,44(r1) ffc0c4f4: 83 01 00 30 lwz r24,48(r1) ffc0c4f8: 83 21 00 34 lwz r25,52(r1) ffc0c4fc: 83 41 00 38 lwz r26,56(r1) ffc0c500: 83 61 00 3c lwz r27,60(r1) ffc0c504: 83 81 00 40 lwz r28,64(r1) ffc0c508: 83 a1 00 44 lwz r29,68(r1) ffc0c50c: 83 c1 00 48 lwz r30,72(r1) ffc0c510: 83 e1 00 4c lwz r31,76(r1) ffc0c514: 38 21 00 50 addi r1,r1,80 ffc0c518: 4e 80 00 20 blr =============================================================================== ffc15168 <_Thread_Evaluate_mode>: bool _Thread_Evaluate_mode( void ) { Thread_Control *executing; executing = _Thread_Executing; ffc15168: 3d 20 00 00 lis r9,0 ffc1516c: 81 29 27 d0 lwz r9,10192(r9) if ( !_States_Is_ready( executing->current_state ) || ffc15170: 80 09 00 10 lwz r0,16(r9) ffc15174: 2f 80 00 00 cmpwi cr7,r0,0 ffc15178: 40 9e 00 20 bne- cr7,ffc15198 <_Thread_Evaluate_mode+0x30><== NEVER TAKEN ffc1517c: 3d 60 00 00 lis r11,0 ffc15180: 80 0b 27 ac lwz r0,10156(r11) ffc15184: 7f 89 00 00 cmpw cr7,r9,r0 ffc15188: 41 9e 00 24 beq- cr7,ffc151ac <_Thread_Evaluate_mode+0x44> ( !_Thread_Is_heir( executing ) && executing->is_preemptible ) ) { ffc1518c: 88 09 00 75 lbz r0,117(r9) ffc15190: 2f 80 00 00 cmpwi cr7,r0,0 ffc15194: 41 9e 00 18 beq- cr7,ffc151ac <_Thread_Evaluate_mode+0x44><== NEVER TAKEN _Context_Switch_necessary = true; ffc15198: 38 00 00 01 li r0,1 ffc1519c: 3d 20 00 00 lis r9,0 ffc151a0: 98 09 27 e0 stb r0,10208(r9) ffc151a4: 38 60 00 01 li r3,1 return true; ffc151a8: 4e 80 00 20 blr ffc151ac: 38 60 00 00 li r3,0 } return false; } ffc151b0: 4e 80 00 20 blr =============================================================================== ffc17d90 <_Thread_Handler>: * * Output parameters: NONE */ void _Thread_Handler( void ) { ffc17d90: 94 21 ff f0 stwu r1,-16(r1) ffc17d94: 7c 08 02 a6 mflr r0 #if defined(EXECUTE_GLOBAL_CONSTRUCTORS) static char doneConstructors; char doneCons; #endif executing = _Thread_Executing; ffc17d98: 3d 20 00 00 lis r9,0 * * Output parameters: NONE */ void _Thread_Handler( void ) { ffc17d9c: 90 01 00 14 stw r0,20(r1) ffc17da0: 93 e1 00 0c stw r31,12(r1) #if defined(EXECUTE_GLOBAL_CONSTRUCTORS) static char doneConstructors; char doneCons; #endif executing = _Thread_Executing; ffc17da4: 83 e9 27 d0 lwz r31,10192(r9) * * Output parameters: NONE */ void _Thread_Handler( void ) { ffc17da8: 93 c1 00 08 stw r30,8(r1) /* * have to put level into a register for those cpu's that use * inline asm here */ level = executing->Start.isr_level; ffc17dac: 81 3f 00 c0 lwz r9,192(r31) } static inline void _CPU_ISR_Set_level( uint32_t level ) { register unsigned int msr; _CPU_MSR_GET(msr); ffc17db0: 38 00 00 00 li r0,0 ffc17db4: 7c 00 00 a6 mfmsr r0 if (!(level & CPU_MODES_INTERRUPT_MASK)) { ffc17db8: 71 2b 00 01 andi. r11,r9,1 ffc17dbc: 40 82 00 10 bne- ffc17dcc <_Thread_Handler+0x3c> static inline uint32_t ppc_interrupt_get_disable_mask( void ) { uint32_t mask; asm volatile ( ffc17dc0: 7d 30 42 a6 mfsprg r9,0 msr |= ppc_interrupt_get_disable_mask(); ffc17dc4: 7d 20 03 78 or r0,r9,r0 ffc17dc8: 48 00 00 0c b ffc17dd4 <_Thread_Handler+0x44> ffc17dcc: 7d 30 42 a6 mfsprg r9,0 } else { msr &= ~ppc_interrupt_get_disable_mask(); ffc17dd0: 7c 00 48 78 andc r0,r0,r9 } _CPU_MSR_SET(msr); ffc17dd4: 7c 00 01 24 mtmsr r0 _ISR_Set_level(level); #if defined(EXECUTE_GLOBAL_CONSTRUCTORS) doneCons = doneConstructors; ffc17dd8: 3d 20 00 00 lis r9,0 ffc17ddc: 8b c9 2a 54 lbz r30,10836(r9) doneConstructors = 1; ffc17de0: 38 00 00 01 li r0,1 /* * 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 ); ffc17de4: 7f e3 fb 78 mr r3,r31 level = executing->Start.isr_level; _ISR_Set_level(level); #if defined(EXECUTE_GLOBAL_CONSTRUCTORS) doneCons = doneConstructors; doneConstructors = 1; ffc17de8: 98 09 2a 54 stb r0,10836(r9) /* * 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 ); ffc17dec: 4b ff 58 79 bl ffc0d664 <_User_extensions_Thread_begin> /* * At this point, the dispatch disable level BETTER be 1. */ _Thread_Enable_dispatch(); ffc17df0: 4b ff 47 2d bl ffc0c51c <_Thread_Enable_dispatch> /* * _init could be a weak symbol and we SHOULD test it but it isn't * in any configuration I know of and it generates a warning on every * RTEMS target configuration. --joel (12 May 2007) */ if (!doneCons) /* && (volatile void *)_init) */ { ffc17df4: 2f 9e 00 00 cmpwi cr7,r30,0 ffc17df8: 40 be 00 08 bne+ cr7,ffc17e00 <_Thread_Handler+0x70> INIT_NAME (); ffc17dfc: 48 00 be a1 bl ffc23c9c <_init> } #endif if ( executing->Start.prototype == THREAD_START_NUMERIC ) { ffc17e00: 80 1f 00 a8 lwz r0,168(r31) ffc17e04: 2f 80 00 00 cmpwi cr7,r0,0 ffc17e08: 40 be 00 10 bne+ cr7,ffc17e18 <_Thread_Handler+0x88> executing->Wait.return_argument = (*(Thread_Entry_numeric) executing->Start.entry_point)( ffc17e0c: 80 1f 00 a4 lwz r0,164(r31) ffc17e10: 80 7f 00 b0 lwz r3,176(r31) ffc17e14: 48 00 00 14 b ffc17e28 <_Thread_Handler+0x98> executing->Start.numeric_argument ); } #if defined(RTEMS_POSIX_API) else if ( executing->Start.prototype == THREAD_START_POINTER ) { ffc17e18: 2f 80 00 01 cmpwi cr7,r0,1 ffc17e1c: 40 be 00 18 bne+ cr7,ffc17e34 <_Thread_Handler+0xa4> <== NEVER TAKEN executing->Wait.return_argument = (*(Thread_Entry_pointer) executing->Start.entry_point)( ffc17e20: 80 1f 00 a4 lwz r0,164(r31) ffc17e24: 80 7f 00 ac lwz r3,172(r31) ffc17e28: 7c 09 03 a6 mtctr r0 ffc17e2c: 4e 80 04 21 bctrl executing->Start.numeric_argument ); } #if defined(RTEMS_POSIX_API) else if ( executing->Start.prototype == THREAD_START_POINTER ) { executing->Wait.return_argument = ffc17e30: 90 7f 00 28 stw r3,40(r31) * 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 ); ffc17e34: 7f e3 fb 78 mr r3,r31 ffc17e38: 4b ff 58 9d bl ffc0d6d4 <_User_extensions_Thread_exitted> _Internal_error_Occurred( ffc17e3c: 38 60 00 00 li r3,0 ffc17e40: 38 80 00 01 li r4,1 ffc17e44: 38 a0 00 06 li r5,6 ffc17e48: 4b ff 34 e5 bl ffc0b32c <_Internal_error_Occurred> =============================================================================== ffc0c5f0 <_Thread_Initialize>: if ( !actual_stack_size || actual_stack_size < stack_size ) return false; /* stack allocation failed */ stack = the_thread->Start.stack; #else if ( !stack_area ) { ffc0c5f0: 2c 05 00 00 cmpwi r5,0 Thread_CPU_budget_algorithms budget_algorithm, Thread_CPU_budget_algorithm_callout budget_callout, uint32_t isr_level, Objects_Name name ) { ffc0c5f4: 94 21 ff d8 stwu r1,-40(r1) ffc0c5f8: 7c 08 02 a6 mflr r0 ffc0c5fc: 93 41 00 10 stw r26,16(r1) ffc0c600: 7d 3a 4b 78 mr r26,r9 ffc0c604: 90 01 00 2c stw r0,44(r1) /* * Zero out all the allocated memory fields */ for ( i=0 ; i <= THREAD_API_LAST ; i++ ) the_thread->API_Extensions[i] = NULL; ffc0c608: 38 00 00 00 li r0,0 Thread_CPU_budget_algorithms budget_algorithm, Thread_CPU_budget_algorithm_callout budget_callout, uint32_t isr_level, Objects_Name name ) { ffc0c60c: 81 21 00 38 lwz r9,56(r1) ffc0c610: 93 01 00 08 stw r24,8(r1) ffc0c614: 93 21 00 0c stw r25,12(r1) ffc0c618: 7d 59 53 78 mr r25,r10 ffc0c61c: 93 61 00 14 stw r27,20(r1) ffc0c620: 7d 1b 43 78 mr r27,r8 ffc0c624: 93 81 00 18 stw r28,24(r1) ffc0c628: 7c fc 3b 78 mr r28,r7 ffc0c62c: 93 a1 00 1c stw r29,28(r1) ffc0c630: 7c dd 33 78 mr r29,r6 ffc0c634: 93 c1 00 20 stw r30,32(r1) ffc0c638: 7c 7e 1b 78 mr r30,r3 ffc0c63c: 93 e1 00 24 stw r31,36(r1) ffc0c640: 7c 9f 23 78 mr r31,r4 ffc0c644: 83 09 00 00 lwz r24,0(r9) /* * Zero out all the allocated memory fields */ for ( i=0 ; i <= THREAD_API_LAST ; i++ ) the_thread->API_Extensions[i] = NULL; ffc0c648: 90 04 01 44 stw r0,324(r4) ffc0c64c: 90 04 01 48 stw r0,328(r4) ffc0c650: 90 04 01 4c stw r0,332(r4) extensions_area = NULL; the_thread->libc_reent = NULL; ffc0c654: 90 04 01 40 stw r0,320(r4) if ( !actual_stack_size || actual_stack_size < stack_size ) return false; /* stack allocation failed */ stack = the_thread->Start.stack; #else if ( !stack_area ) { ffc0c658: 40 a2 00 30 bne+ ffc0c688 <_Thread_Initialize+0x98> actual_stack_size = _Thread_Stack_Allocate( the_thread, stack_size ); ffc0c65c: 7c 83 23 78 mr r3,r4 ffc0c660: 7c c4 33 78 mr r4,r6 ffc0c664: 48 00 0a fd bl ffc0d160 <_Thread_Stack_Allocate> if ( !actual_stack_size || actual_stack_size < stack_size ) ffc0c668: 2c 03 00 00 cmpwi r3,0 ffc0c66c: 41 82 01 b8 beq- ffc0c824 <_Thread_Initialize+0x234> ffc0c670: 7f 83 e8 40 cmplw cr7,r3,r29 ffc0c674: 41 9c 01 b0 blt- cr7,ffc0c824 <_Thread_Initialize+0x234><== NEVER TAKEN return false; /* stack allocation failed */ stack = the_thread->Start.stack; the_thread->Start.core_allocated_stack = true; ffc0c678: 38 00 00 01 li r0,1 if ( !stack_area ) { actual_stack_size = _Thread_Stack_Allocate( the_thread, stack_size ); if ( !actual_stack_size || actual_stack_size < stack_size ) return false; /* stack allocation failed */ stack = the_thread->Start.stack; ffc0c67c: 80 bf 00 d8 lwz r5,216(r31) the_thread->Start.core_allocated_stack = true; ffc0c680: 98 1f 00 c8 stb r0,200(r31) ffc0c684: 48 00 00 0c b ffc0c690 <_Thread_Initialize+0xa0> } else { stack = stack_area; actual_stack_size = stack_size; the_thread->Start.core_allocated_stack = false; ffc0c688: 98 04 00 c8 stb r0,200(r4) ffc0c68c: 7c c3 33 78 mr r3,r6 /* * Allocate the floating point area for this thread */ #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) if ( is_fp ) { ffc0c690: 2f 9c 00 00 cmpwi cr7,r28,0 Stack_Control *the_stack, void *starting_address, size_t size ) { the_stack->area = starting_address; ffc0c694: 90 bf 00 d0 stw r5,208(r31) ffc0c698: 3b 80 00 00 li r28,0 the_stack->size = size; ffc0c69c: 90 7f 00 cc stw r3,204(r31) ffc0c6a0: 41 be 00 1c beq+ cr7,ffc0c6bc <_Thread_Initialize+0xcc> fp_area = _Workspace_Allocate( CONTEXT_FP_SIZE ); ffc0c6a4: 38 60 01 08 li r3,264 ffc0c6a8: 48 00 15 89 bl ffc0dc30 <_Workspace_Allocate> if ( !fp_area ) ffc0c6ac: 7c 7c 1b 79 mr. r28,r3 ffc0c6b0: 40 a2 00 0c bne+ ffc0c6bc <_Thread_Initialize+0xcc> ffc0c6b4: 3b a0 00 00 li r29,0 ffc0c6b8: 48 00 01 04 b ffc0c7bc <_Thread_Initialize+0x1cc> #endif /* * Allocate the extensions area for this thread */ if ( _Thread_Maximum_extensions ) { ffc0c6bc: 3d 20 00 00 lis r9,0 fp_area = _Workspace_Allocate( CONTEXT_FP_SIZE ); if ( !fp_area ) goto failed; fp_area = _Context_Fp_start( fp_area, 0 ); } the_thread->fp_context = fp_area; ffc0c6c0: 93 9f 01 3c stw r28,316(r31) Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; ffc0c6c4: 38 00 00 00 li r0,0 #endif /* * Allocate the extensions area for this thread */ if ( _Thread_Maximum_extensions ) { ffc0c6c8: 80 69 27 bc lwz r3,10172(r9) ffc0c6cc: 3b a0 00 00 li r29,0 the_watchdog->routine = routine; the_watchdog->id = id; the_watchdog->user_data = user_data; ffc0c6d0: 90 1f 00 6c stw r0,108(r31) ffc0c6d4: 2f 83 00 00 cmpwi cr7,r3,0 if ( !fp_area ) goto failed; fp_area = _Context_Fp_start( fp_area, 0 ); } the_thread->fp_context = fp_area; the_thread->Start.fp_context = fp_area; ffc0c6d8: 93 9f 00 d4 stw r28,212(r31) Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; ffc0c6dc: 90 1f 00 50 stw r0,80(r31) the_watchdog->routine = routine; ffc0c6e0: 90 1f 00 64 stw r0,100(r31) the_watchdog->id = id; ffc0c6e4: 90 1f 00 68 stw r0,104(r31) #endif /* * Allocate the extensions area for this thread */ if ( _Thread_Maximum_extensions ) { ffc0c6e8: 41 be 00 18 beq+ cr7,ffc0c700 <_Thread_Initialize+0x110> extensions_area = _Workspace_Allocate( ffc0c6ec: 38 63 00 01 addi r3,r3,1 ffc0c6f0: 54 63 10 3a rlwinm r3,r3,2,0,29 ffc0c6f4: 48 00 15 3d bl ffc0dc30 <_Workspace_Allocate> (_Thread_Maximum_extensions + 1) * sizeof( void * ) ); if ( !extensions_area ) ffc0c6f8: 7c 7d 1b 79 mr. r29,r3 ffc0c6fc: 41 82 00 c0 beq- ffc0c7bc <_Thread_Initialize+0x1cc> * 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 ) { ffc0c700: 2f 9d 00 00 cmpwi cr7,r29,0 (_Thread_Maximum_extensions + 1) * sizeof( void * ) ); if ( !extensions_area ) goto failed; } the_thread->extensions = (void **) extensions_area; ffc0c704: 93 bf 01 50 stw r29,336(r31) * 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 ) { ffc0c708: 41 9e 00 30 beq- cr7,ffc0c738 <_Thread_Initialize+0x148> for ( i = 0; i <= _Thread_Maximum_extensions ; i++ ) ffc0c70c: 3d 20 00 00 lis r9,0 ffc0c710: 81 69 27 bc lwz r11,10172(r9) the_thread->extensions[i] = NULL; ffc0c714: 38 00 00 00 li r0,0 * 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++ ) ffc0c718: 39 20 00 00 li r9,0 ffc0c71c: 48 00 00 0c b ffc0c728 <_Thread_Initialize+0x138> the_thread->extensions[i] = NULL; ffc0c720: 81 1f 01 50 lwz r8,336(r31) ffc0c724: 7c 08 51 2e stwx r0,r8,r10 * 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++ ) ffc0c728: 7f 89 58 40 cmplw cr7,r9,r11 the_thread->extensions[i] = NULL; ffc0c72c: 55 2a 10 3a rlwinm r10,r9,2,0,29 * 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++ ) ffc0c730: 39 29 00 01 addi r9,r9,1 ffc0c734: 40 9d ff ec ble+ cr7,ffc0c720 <_Thread_Initialize+0x130> the_thread->Start.is_preemptible = is_preemptible; the_thread->Start.budget_algorithm = budget_algorithm; the_thread->Start.budget_callout = budget_callout; switch ( budget_algorithm ) { ffc0c738: 2f 99 00 02 cmpwi cr7,r25,2 * General initialization */ the_thread->Start.is_preemptible = is_preemptible; the_thread->Start.budget_algorithm = budget_algorithm; the_thread->Start.budget_callout = budget_callout; ffc0c73c: 80 01 00 30 lwz r0,48(r1) /* * General initialization */ the_thread->Start.is_preemptible = is_preemptible; ffc0c740: 9b 5f 00 b4 stb r26,180(r31) the_thread->Start.budget_algorithm = budget_algorithm; the_thread->Start.budget_callout = budget_callout; ffc0c744: 90 1f 00 bc stw r0,188(r31) /* * General initialization */ the_thread->Start.is_preemptible = is_preemptible; the_thread->Start.budget_algorithm = budget_algorithm; ffc0c748: 93 3f 00 b8 stw r25,184(r31) the_thread->Start.budget_callout = budget_callout; switch ( budget_algorithm ) { ffc0c74c: 40 be 00 10 bne+ cr7,ffc0c75c <_Thread_Initialize+0x16c> 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; ffc0c750: 3d 20 00 00 lis r9,0 ffc0c754: 80 09 27 88 lwz r0,10120(r9) ffc0c758: 90 1f 00 78 stw r0,120(r31) case THREAD_CPU_BUDGET_ALGORITHM_CALLOUT: break; #endif } the_thread->Start.isr_level = isr_level; ffc0c75c: 80 01 00 34 lwz r0,52(r1) the_thread->current_state = STATES_DORMANT; the_thread->Wait.queue = NULL; ffc0c760: 3b 40 00 00 li r26,0 ffc0c764: 93 5f 00 44 stw r26,68(r31) #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 ); ffc0c768: 7f 64 db 78 mr r4,r27 ffc0c76c: 7f e3 fb 78 mr r3,r31 case THREAD_CPU_BUDGET_ALGORITHM_CALLOUT: break; #endif } the_thread->Start.isr_level = isr_level; ffc0c770: 90 1f 00 c0 stw r0,192(r31) the_thread->current_state = STATES_DORMANT; ffc0c774: 38 00 00 01 li r0,1 ffc0c778: 90 1f 00 10 stw r0,16(r31) the_thread->Wait.queue = NULL; the_thread->resource_count = 0; ffc0c77c: 93 5f 00 1c stw r26,28(r31) #if defined(RTEMS_ITRON_API) the_thread->suspend_count = 0; #endif the_thread->real_priority = priority; ffc0c780: 93 7f 00 18 stw r27,24(r31) the_thread->Start.initial_priority = priority; ffc0c784: 93 7f 00 c4 stw r27,196(r31) _Thread_Set_priority( the_thread, priority ); ffc0c788: 48 00 07 d1 bl ffc0cf58 <_Thread_Set_priority> #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; ffc0c78c: a0 1f 00 0a lhz r0,10(r31) ffc0c790: 81 3e 00 1c lwz r9,28(r30) * 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 ); ffc0c794: 7f e3 fb 78 mr r3,r31 ffc0c798: 54 00 10 3a rlwinm r0,r0,2,0,29 /* * Initialize the CPU usage statistics */ #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ _Timestamp_Set_to_zero( &the_thread->cpu_time_used ); ffc0c79c: 93 5f 00 88 stw r26,136(r31) ffc0c7a0: 7f e9 01 2e stwx r31,r9,r0 information, _Objects_Get_index( the_object->id ), the_object ); the_object->name = name; ffc0c7a4: 93 1f 00 0c stw r24,12(r31) ffc0c7a8: 93 5f 00 84 stw r26,132(r31) * 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 ); ffc0c7ac: 48 00 10 29 bl ffc0d7d4 <_User_extensions_Thread_create> if ( extension_status ) ffc0c7b0: 2f 83 00 00 cmpwi cr7,r3,0 ffc0c7b4: 38 60 00 01 li r3,1 ffc0c7b8: 40 9e 00 70 bne- cr7,ffc0c828 <_Thread_Initialize+0x238> return true; failed: if ( the_thread->libc_reent ) ffc0c7bc: 80 7f 01 40 lwz r3,320(r31) ffc0c7c0: 2f 83 00 00 cmpwi cr7,r3,0 ffc0c7c4: 41 9e 00 08 beq- cr7,ffc0c7cc <_Thread_Initialize+0x1dc> _Workspace_Free( the_thread->libc_reent ); ffc0c7c8: 48 00 14 9d bl ffc0dc64 <_Workspace_Free> for ( i=0 ; i <= THREAD_API_LAST ; i++ ) if ( the_thread->API_Extensions[i] ) ffc0c7cc: 80 7f 01 44 lwz r3,324(r31) ffc0c7d0: 2f 83 00 00 cmpwi cr7,r3,0 ffc0c7d4: 41 9e 00 08 beq- cr7,ffc0c7dc <_Thread_Initialize+0x1ec> _Workspace_Free( the_thread->API_Extensions[i] ); ffc0c7d8: 48 00 14 8d bl ffc0dc64 <_Workspace_Free> failed: if ( the_thread->libc_reent ) _Workspace_Free( the_thread->libc_reent ); for ( i=0 ; i <= THREAD_API_LAST ; i++ ) if ( the_thread->API_Extensions[i] ) ffc0c7dc: 80 7f 01 48 lwz r3,328(r31) ffc0c7e0: 2f 83 00 00 cmpwi cr7,r3,0 ffc0c7e4: 41 9e 00 08 beq- cr7,ffc0c7ec <_Thread_Initialize+0x1fc> _Workspace_Free( the_thread->API_Extensions[i] ); ffc0c7e8: 48 00 14 7d bl ffc0dc64 <_Workspace_Free> failed: if ( the_thread->libc_reent ) _Workspace_Free( the_thread->libc_reent ); for ( i=0 ; i <= THREAD_API_LAST ; i++ ) if ( the_thread->API_Extensions[i] ) ffc0c7ec: 80 7f 01 4c lwz r3,332(r31) ffc0c7f0: 2f 83 00 00 cmpwi cr7,r3,0 ffc0c7f4: 41 9e 00 08 beq- cr7,ffc0c7fc <_Thread_Initialize+0x20c><== ALWAYS TAKEN _Workspace_Free( the_thread->API_Extensions[i] ); ffc0c7f8: 48 00 14 6d bl ffc0dc64 <_Workspace_Free> <== NOT EXECUTED if ( extensions_area ) ffc0c7fc: 2f 9d 00 00 cmpwi cr7,r29,0 ffc0c800: 41 9e 00 0c beq- cr7,ffc0c80c <_Thread_Initialize+0x21c> (void) _Workspace_Free( extensions_area ); ffc0c804: 7f a3 eb 78 mr r3,r29 ffc0c808: 48 00 14 5d bl ffc0dc64 <_Workspace_Free> #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) if ( fp_area ) ffc0c80c: 2f 9c 00 00 cmpwi cr7,r28,0 ffc0c810: 41 9e 00 0c beq- cr7,ffc0c81c <_Thread_Initialize+0x22c> (void) _Workspace_Free( fp_area ); ffc0c814: 7f 83 e3 78 mr r3,r28 ffc0c818: 48 00 14 4d bl ffc0dc64 <_Workspace_Free> #endif _Thread_Stack_Free( the_thread ); ffc0c81c: 7f e3 fb 78 mr r3,r31 ffc0c820: 48 00 09 cd bl ffc0d1ec <_Thread_Stack_Free> return false; ffc0c824: 38 60 00 00 li r3,0 } ffc0c828: 80 01 00 2c lwz r0,44(r1) ffc0c82c: 83 01 00 08 lwz r24,8(r1) ffc0c830: 7c 08 03 a6 mtlr r0 ffc0c834: 83 21 00 0c lwz r25,12(r1) ffc0c838: 83 41 00 10 lwz r26,16(r1) ffc0c83c: 83 61 00 14 lwz r27,20(r1) ffc0c840: 83 81 00 18 lwz r28,24(r1) ffc0c844: 83 a1 00 1c lwz r29,28(r1) ffc0c848: 83 c1 00 20 lwz r30,32(r1) ffc0c84c: 83 e1 00 24 lwz r31,36(r1) ffc0c850: 38 21 00 28 addi r1,r1,40 ffc0c854: 4e 80 00 20 blr =============================================================================== ffc1600c <_Thread_Reset_timeslice>: { ISR_Level level; Thread_Control *executing; Chain_Control *ready; executing = _Thread_Executing; ffc1600c: 3d 20 00 00 lis r9,0 ffc16010: 81 29 27 f4 lwz r9,10228(r9) ready = executing->ready; ffc16014: 81 69 00 8c lwz r11,140(r9) static inline uint32_t ppc_interrupt_disable( void ) { uint32_t level; uint32_t mask; asm volatile ( ffc16018: 7c 00 00 a6 mfmsr r0 ffc1601c: 7d 50 42 a6 mfsprg r10,0 ffc16020: 7c 0a 50 78 andc r10,r0,r10 ffc16024: 7d 40 01 24 mtmsr r10 _ISR_Disable( level ); if ( _Chain_Has_only_one_node( ready ) ) { ffc16028: 81 0b 00 00 lwz r8,0(r11) ffc1602c: 81 4b 00 08 lwz r10,8(r11) ffc16030: 7f 88 50 00 cmpw cr7,r8,r10 ffc16034: 40 be 00 08 bne+ cr7,ffc1603c <_Thread_Reset_timeslice+0x30> _ISR_Enable( level ); ffc16038: 48 00 00 5c b ffc16094 <_Thread_Reset_timeslice+0x88> ) { Chain_Node *next; Chain_Node *previous; next = the_node->next; ffc1603c: 81 49 00 00 lwz r10,0(r9) Chain_Node *the_node ) { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); ffc16040: 38 eb 00 04 addi r7,r11,4 { Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; ffc16044: 81 09 00 04 lwz r8,4(r9) next->previous = previous; previous->next = next; ffc16048: 91 48 00 00 stw r10,0(r8) Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; next->previous = previous; ffc1604c: 91 0a 00 04 stw r8,4(r10) Chain_Node *the_node ) { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); ffc16050: 90 e9 00 00 stw r7,0(r9) old_last_node = the_chain->last; ffc16054: 81 4b 00 08 lwz r10,8(r11) the_chain->last = the_node; ffc16058: 91 2b 00 08 stw r9,8(r11) old_last_node->next = the_node; the_node->previous = old_last_node; ffc1605c: 91 49 00 04 stw r10,4(r9) 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; ffc16060: 91 2a 00 00 stw r9,0(r10) static inline void ppc_interrupt_flash( uint32_t level ) { uint32_t current_level; asm volatile ( ffc16064: 7d 40 00 a6 mfmsr r10 ffc16068: 7c 00 01 24 mtmsr r0 ffc1606c: 7d 40 01 24 mtmsr r10 _Chain_Extract_unprotected( &executing->Object.Node ); _Chain_Append_unprotected( ready, &executing->Object.Node ); _ISR_Flash( level ); if ( _Thread_Is_heir( executing ) ) ffc16070: 3d 40 00 00 lis r10,0 ffc16074: 81 0a 27 d0 lwz r8,10192(r10) ffc16078: 7f 89 40 00 cmpw cr7,r9,r8 ffc1607c: 40 be 00 0c bne+ cr7,ffc16088 <_Thread_Reset_timeslice+0x7c><== NEVER TAKEN _Thread_Heir = (Thread_Control *) ready->first; ffc16080: 81 2b 00 00 lwz r9,0(r11) ffc16084: 91 2a 27 d0 stw r9,10192(r10) _Context_Switch_necessary = true; ffc16088: 39 60 00 01 li r11,1 ffc1608c: 3d 20 00 00 lis r9,0 ffc16090: 99 69 28 04 stb r11,10244(r9) return level; } static inline void ppc_interrupt_enable( uint32_t level ) { asm volatile ( ffc16094: 7c 00 01 24 mtmsr r0 ffc16098: 4e 80 00 20 blr =============================================================================== ffc0bfd4 <_Thread_Restart>: bool _Thread_Restart( Thread_Control *the_thread, void *pointer_argument, Thread_Entry_numeric_type numeric_argument ) { ffc0bfd4: 94 21 ff e8 stwu r1,-24(r1) ffc0bfd8: 7c 08 02 a6 mflr r0 ffc0bfdc: 90 01 00 1c stw r0,28(r1) if ( !_States_Is_dormant( the_thread->current_state ) ) { ffc0bfe0: 80 03 00 10 lwz r0,16(r3) bool _Thread_Restart( Thread_Control *the_thread, void *pointer_argument, Thread_Entry_numeric_type numeric_argument ) { ffc0bfe4: 93 e1 00 14 stw r31,20(r1) ffc0bfe8: 7c 7f 1b 78 mr r31,r3 if ( !_States_Is_dormant( the_thread->current_state ) ) { ffc0bfec: 70 09 00 01 andi. r9,r0,1 ffc0bff0: 38 00 00 00 li r0,0 ffc0bff4: 40 a2 00 74 bne+ ffc0c068 <_Thread_Restart+0x94> _Thread_Set_transient( the_thread ); ffc0bff8: 90 81 00 08 stw r4,8(r1) ffc0bffc: 90 a1 00 0c stw r5,12(r1) ffc0c000: 48 00 01 f5 bl ffc0c1f4 <_Thread_Set_transient> _Thread_Reset( the_thread, pointer_argument, numeric_argument ); ffc0c004: 7f e3 fb 78 mr r3,r31 ffc0c008: 80 81 00 08 lwz r4,8(r1) ffc0c00c: 80 a1 00 0c lwz r5,12(r1) ffc0c010: 48 00 43 09 bl ffc10318 <_Thread_Reset> _Thread_Load_environment( the_thread ); ffc0c014: 7f e3 fb 78 mr r3,r31 ffc0c018: 48 00 3e fd bl ffc0ff14 <_Thread_Load_environment> _Thread_Ready( the_thread ); ffc0c01c: 7f e3 fb 78 mr r3,r31 ffc0c020: 48 00 42 1d bl ffc1023c <_Thread_Ready> _User_extensions_Thread_restart( the_thread ); ffc0c024: 7f e3 fb 78 mr r3,r31 ffc0c028: 48 00 0a 99 bl ffc0cac0 <_User_extensions_Thread_restart> if ( _Thread_Is_executing ( the_thread ) ) ffc0c02c: 3d 20 00 00 lis r9,0 ffc0c030: 81 29 27 fc lwz r9,10236(r9) ffc0c034: 38 00 00 01 li r0,1 ffc0c038: 7f 9f 48 00 cmpw cr7,r31,r9 ffc0c03c: 40 be 00 2c bne+ cr7,ffc0c068 <_Thread_Restart+0x94> */ RTEMS_INLINE_ROUTINE void _Thread_Restart_self( void ) { #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) if ( _Thread_Executing->fp_context != NULL ) ffc0c040: 80 1f 01 3c lwz r0,316(r31) ffc0c044: 2f 80 00 00 cmpwi cr7,r0,0 ffc0c048: 41 9e 00 0c beq- cr7,ffc0c054 <_Thread_Restart+0x80> <== NEVER TAKEN _Context_Restore_fp( &_Thread_Executing->fp_context ); ffc0c04c: 38 7f 01 3c addi r3,r31,316 ffc0c050: 48 01 42 b1 bl ffc20300 <_CPU_Context_restore_fp> #endif _CPU_Context_Restart_self( &_Thread_Executing->Registers ); ffc0c054: 3d 20 00 00 lis r9,0 ffc0c058: 80 69 27 fc lwz r3,10236(r9) ffc0c05c: 38 63 00 dc addi r3,r3,220 ffc0c060: 48 01 44 61 bl ffc204c0 <_CPU_Context_restore> ffc0c064: 38 00 00 01 li r0,1 <== NOT EXECUTED return true; } return false; } ffc0c068: 7c 03 03 78 mr r3,r0 ffc0c06c: 80 01 00 1c lwz r0,28(r1) ffc0c070: 83 e1 00 14 lwz r31,20(r1) ffc0c074: 38 21 00 18 addi r1,r1,24 ffc0c078: 7c 08 03 a6 mtlr r0 ffc0c07c: 4e 80 00 20 blr =============================================================================== ffc0f6ac <_Thread_Resume>: static inline uint32_t ppc_interrupt_disable( void ) { uint32_t level; uint32_t mask; asm volatile ( ffc0f6ac: 7c 00 00 a6 mfmsr r0 ffc0f6b0: 7d 30 42 a6 mfsprg r9,0 ffc0f6b4: 7c 09 48 78 andc r9,r0,r9 ffc0f6b8: 7d 20 01 24 mtmsr r9 _ISR_Enable( level ); return; } #endif current_state = the_thread->current_state; ffc0f6bc: 81 23 00 10 lwz r9,16(r3) if ( current_state & STATES_SUSPENDED ) { ffc0f6c0: 71 2b 00 02 andi. r11,r9,2 ffc0f6c4: 41 82 00 a8 beq- ffc0f76c <_Thread_Resume+0xc0> <== NEVER TAKEN ffc0f6c8: 55 29 07 fa rlwinm r9,r9,0,31,29 current_state = the_thread->current_state = _States_Clear(STATES_SUSPENDED, current_state); if ( _States_Is_ready( current_state ) ) { ffc0f6cc: 2f 89 00 00 cmpwi cr7,r9,0 } #endif current_state = the_thread->current_state; if ( current_state & STATES_SUSPENDED ) { current_state = ffc0f6d0: 91 23 00 10 stw r9,16(r3) the_thread->current_state = _States_Clear(STATES_SUSPENDED, current_state); if ( _States_Is_ready( current_state ) ) { ffc0f6d4: 40 9e 00 98 bne- cr7,ffc0f76c <_Thread_Resume+0xc0> RTEMS_INLINE_ROUTINE void _Priority_Add_to_bit_map ( Priority_Information *the_priority_map ) { *the_priority_map->minor |= the_priority_map->ready_minor; ffc0f6d8: 81 63 00 90 lwz r11,144(r3) ffc0f6dc: 81 43 00 98 lwz r10,152(r3) ffc0f6e0: 81 0b 00 00 lwz r8,0(r11) _Priority_Add_to_bit_map( &the_thread->Priority_map ); _Chain_Append_unprotected(the_thread->ready, &the_thread->Object.Node); ffc0f6e4: 81 23 00 8c lwz r9,140(r3) ffc0f6e8: 7d 0a 53 78 or r10,r8,r10 ffc0f6ec: 91 4b 00 00 stw r10,0(r11) Chain_Node *the_node ) { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); ffc0f6f0: 39 69 00 04 addi r11,r9,4 _Priority_Major_bit_map |= the_priority_map->ready_major; ffc0f6f4: 3d 40 00 00 lis r10,0 ffc0f6f8: 91 63 00 00 stw r11,0(r3) ffc0f6fc: 80 ea 27 c4 lwz r7,10180(r10) ffc0f700: 81 03 00 94 lwz r8,148(r3) old_last_node = the_chain->last; ffc0f704: 81 69 00 08 lwz r11,8(r9) ffc0f708: 7c e8 43 78 or r8,r7,r8 the_chain->last = the_node; ffc0f70c: 90 69 00 08 stw r3,8(r9) ffc0f710: 91 0a 27 c4 stw r8,10180(r10) old_last_node->next = the_node; the_node->previous = old_last_node; ffc0f714: 91 63 00 04 stw r11,4(r3) 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; ffc0f718: 90 6b 00 00 stw r3,0(r11) static inline void ppc_interrupt_flash( uint32_t level ) { uint32_t current_level; asm volatile ( ffc0f71c: 7d 20 00 a6 mfmsr r9 ffc0f720: 7c 00 01 24 mtmsr r0 ffc0f724: 7d 20 01 24 mtmsr r9 _ISR_Flash( level ); if ( the_thread->current_priority < _Thread_Heir->current_priority ) { ffc0f728: 3d 60 00 00 lis r11,0 ffc0f72c: 81 23 00 14 lwz r9,20(r3) ffc0f730: 81 4b 27 ac lwz r10,10156(r11) ffc0f734: 81 4a 00 14 lwz r10,20(r10) ffc0f738: 7f 89 50 40 cmplw cr7,r9,r10 ffc0f73c: 40 9c 00 30 bge- cr7,ffc0f76c <_Thread_Resume+0xc0> _Thread_Heir = the_thread; if ( _Thread_Executing->is_preemptible || ffc0f740: 3d 40 00 00 lis r10,0 _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; ffc0f744: 90 6b 27 ac stw r3,10156(r11) if ( _Thread_Executing->is_preemptible || ffc0f748: 81 4a 27 d0 lwz r10,10192(r10) ffc0f74c: 89 6a 00 75 lbz r11,117(r10) ffc0f750: 2f 8b 00 00 cmpwi cr7,r11,0 ffc0f754: 40 9e 00 0c bne- cr7,ffc0f760 <_Thread_Resume+0xb4> ffc0f758: 2f 89 00 00 cmpwi cr7,r9,0 ffc0f75c: 40 9e 00 10 bne- cr7,ffc0f76c <_Thread_Resume+0xc0> <== ALWAYS TAKEN the_thread->current_priority == 0 ) _Context_Switch_necessary = true; ffc0f760: 39 60 00 01 li r11,1 ffc0f764: 3d 20 00 00 lis r9,0 ffc0f768: 99 69 27 e0 stb r11,10208(r9) return level; } static inline void ppc_interrupt_enable( uint32_t level ) { asm volatile ( ffc0f76c: 7c 00 01 24 mtmsr r0 } } } _ISR_Enable( level ); } ffc0f770: 4e 80 00 20 blr =============================================================================== ffc11378 <_Thread_Tickle_timeslice>: * * Output parameters: NONE */ void _Thread_Tickle_timeslice( void ) { ffc11378: 94 21 ff f0 stwu r1,-16(r1) ffc1137c: 7c 08 02 a6 mflr r0 Thread_Control *executing; executing = _Thread_Executing; ffc11380: 3d 20 00 00 lis r9,0 * * Output parameters: NONE */ void _Thread_Tickle_timeslice( void ) { ffc11384: 90 01 00 14 stw r0,20(r1) ffc11388: 93 e1 00 0c stw r31,12(r1) Thread_Control *executing; executing = _Thread_Executing; ffc1138c: 83 e9 27 f4 lwz r31,10228(r9) /* * If the thread is not preemptible or is not ready, then * just return. */ if ( !executing->is_preemptible ) ffc11390: 88 1f 00 75 lbz r0,117(r31) ffc11394: 2f 80 00 00 cmpwi cr7,r0,0 ffc11398: 41 9e 00 7c beq- cr7,ffc11414 <_Thread_Tickle_timeslice+0x9c> return; if ( !_States_Is_ready( executing->current_state ) ) ffc1139c: 80 1f 00 10 lwz r0,16(r31) ffc113a0: 2f 80 00 00 cmpwi cr7,r0,0 ffc113a4: 40 9e 00 70 bne- cr7,ffc11414 <_Thread_Tickle_timeslice+0x9c> /* * The cpu budget algorithm determines what happens next. */ switch ( executing->budget_algorithm ) { ffc113a8: 80 1f 00 7c lwz r0,124(r31) ffc113ac: 2b 80 00 01 cmplwi cr7,r0,1 ffc113b0: 41 9c 00 64 blt- cr7,ffc11414 <_Thread_Tickle_timeslice+0x9c> ffc113b4: 2b 80 00 02 cmplwi cr7,r0,2 ffc113b8: 40 9d 00 10 ble- cr7,ffc113c8 <_Thread_Tickle_timeslice+0x50> ffc113bc: 2f 80 00 03 cmpwi cr7,r0,3 ffc113c0: 40 be 00 54 bne+ cr7,ffc11414 <_Thread_Tickle_timeslice+0x9c><== NEVER TAKEN ffc113c4: 48 00 00 2c b ffc113f0 <_Thread_Tickle_timeslice+0x78> 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 ) { ffc113c8: 81 3f 00 78 lwz r9,120(r31) ffc113cc: 38 09 ff ff addi r0,r9,-1 ffc113d0: 2f 80 00 00 cmpwi cr7,r0,0 ffc113d4: 90 1f 00 78 stw r0,120(r31) ffc113d8: 41 bd 00 3c bgt+ cr7,ffc11414 <_Thread_Tickle_timeslice+0x9c> _Thread_Reset_timeslice(); ffc113dc: 48 00 4c 31 bl ffc1600c <_Thread_Reset_timeslice> executing->cpu_time_budget = _Thread_Ticks_per_timeslice; ffc113e0: 3d 20 00 00 lis r9,0 ffc113e4: 80 09 27 ac lwz r0,10156(r9) ffc113e8: 90 1f 00 78 stw r0,120(r31) ffc113ec: 48 00 00 28 b ffc11414 <_Thread_Tickle_timeslice+0x9c> } break; #if defined(RTEMS_SCORE_THREAD_ENABLE_SCHEDULER_CALLOUT) case THREAD_CPU_BUDGET_ALGORITHM_CALLOUT: if ( --executing->cpu_time_budget == 0 ) ffc113f0: 81 3f 00 78 lwz r9,120(r31) ffc113f4: 38 09 ff ff addi r0,r9,-1 ffc113f8: 2f 80 00 00 cmpwi cr7,r0,0 ffc113fc: 90 1f 00 78 stw r0,120(r31) ffc11400: 40 be 00 14 bne+ cr7,ffc11414 <_Thread_Tickle_timeslice+0x9c> (*executing->budget_callout)( executing ); ffc11404: 80 1f 00 80 lwz r0,128(r31) ffc11408: 7f e3 fb 78 mr r3,r31 ffc1140c: 7c 09 03 a6 mtctr r0 ffc11410: 4e 80 04 21 bctrl break; #endif } } ffc11414: 80 01 00 14 lwz r0,20(r1) ffc11418: 83 e1 00 0c lwz r31,12(r1) ffc1141c: 38 21 00 10 addi r1,r1,16 ffc11420: 7c 08 03 a6 mtlr r0 ffc11424: 4e 80 00 20 blr =============================================================================== ffc0d428 <_Thread_Yield_processor>: { ISR_Level level; Thread_Control *executing; Chain_Control *ready; executing = _Thread_Executing; ffc0d428: 3d 20 00 00 lis r9,0 ffc0d42c: 81 29 27 d0 lwz r9,10192(r9) ready = executing->ready; ffc0d430: 81 69 00 8c lwz r11,140(r9) static inline uint32_t ppc_interrupt_disable( void ) { uint32_t level; uint32_t mask; asm volatile ( ffc0d434: 7c 00 00 a6 mfmsr r0 ffc0d438: 7d 50 42 a6 mfsprg r10,0 ffc0d43c: 7c 0a 50 78 andc r10,r0,r10 ffc0d440: 7d 40 01 24 mtmsr r10 _ISR_Disable( level ); if ( !_Chain_Has_only_one_node( ready ) ) { ffc0d444: 80 eb 00 00 lwz r7,0(r11) ffc0d448: 3d 40 00 00 lis r10,0 ffc0d44c: 81 0b 00 08 lwz r8,8(r11) ffc0d450: 7f 87 40 00 cmpw cr7,r7,r8 ffc0d454: 41 9e 00 50 beq- cr7,ffc0d4a4 <_Thread_Yield_processor+0x7c> ) { Chain_Node *next; Chain_Node *previous; next = the_node->next; ffc0d458: 81 09 00 00 lwz r8,0(r9) Chain_Node *the_node ) { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); ffc0d45c: 38 cb 00 04 addi r6,r11,4 { Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; ffc0d460: 80 e9 00 04 lwz r7,4(r9) next->previous = previous; previous->next = next; ffc0d464: 91 07 00 00 stw r8,0(r7) Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; next->previous = previous; ffc0d468: 90 e8 00 04 stw r7,4(r8) Chain_Node *the_node ) { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); ffc0d46c: 90 c9 00 00 stw r6,0(r9) old_last_node = the_chain->last; ffc0d470: 81 0b 00 08 lwz r8,8(r11) the_chain->last = the_node; ffc0d474: 91 2b 00 08 stw r9,8(r11) old_last_node->next = the_node; the_node->previous = old_last_node; ffc0d478: 91 09 00 04 stw r8,4(r9) 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; ffc0d47c: 91 28 00 00 stw r9,0(r8) static inline void ppc_interrupt_flash( uint32_t level ) { uint32_t current_level; asm volatile ( ffc0d480: 7d 00 00 a6 mfmsr r8 ffc0d484: 7c 00 01 24 mtmsr r0 ffc0d488: 7d 00 01 24 mtmsr r8 _Chain_Extract_unprotected( &executing->Object.Node ); _Chain_Append_unprotected( ready, &executing->Object.Node ); _ISR_Flash( level ); if ( _Thread_Is_heir( executing ) ) ffc0d48c: 81 0a 27 ac lwz r8,10156(r10) ffc0d490: 7f 89 40 00 cmpw cr7,r9,r8 ffc0d494: 40 be 00 1c bne+ cr7,ffc0d4b0 <_Thread_Yield_processor+0x88><== NEVER TAKEN _Thread_Heir = (Thread_Control *) ready->first; ffc0d498: 81 2b 00 00 lwz r9,0(r11) ffc0d49c: 91 2a 27 ac stw r9,10156(r10) ffc0d4a0: 48 00 00 10 b ffc0d4b0 <_Thread_Yield_processor+0x88> _Context_Switch_necessary = true; } else if ( !_Thread_Is_heir( executing ) ) ffc0d4a4: 81 6a 27 ac lwz r11,10156(r10) ffc0d4a8: 7f 89 58 00 cmpw cr7,r9,r11 ffc0d4ac: 41 9e 00 10 beq- cr7,ffc0d4bc <_Thread_Yield_processor+0x94><== ALWAYS TAKEN _Context_Switch_necessary = true; ffc0d4b0: 39 60 00 01 li r11,1 ffc0d4b4: 3d 20 00 00 lis r9,0 ffc0d4b8: 99 69 27 e0 stb r11,10208(r9) return level; } static inline void ppc_interrupt_enable( uint32_t level ) { asm volatile ( ffc0d4bc: 7c 00 01 24 mtmsr r0 _ISR_Enable( level ); } ffc0d4c0: 4e 80 00 20 blr =============================================================================== ffc0cbf4 <_Thread_queue_Enqueue_priority>: Priority_Control priority; States_Control block_state; _Chain_Initialize_empty( &the_thread->Wait.Block2n ); priority = the_thread->current_priority; ffc0cbf4: 80 04 00 14 lwz r0,20(r4) */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); ffc0cbf8: 39 04 00 3c addi r8,r4,60 Thread_blocking_operation_States _Thread_queue_Enqueue_priority ( Thread_queue_Control *the_thread_queue, Thread_Control *the_thread, ISR_Level *level_p ) { ffc0cbfc: 94 21 ff f0 stwu r1,-16(r1) the_chain->permanent_null = NULL; the_chain->last = _Chain_Head(the_chain); ffc0cc00: 39 64 00 38 addi r11,r4,56 priority = the_thread->current_priority; header_index = _Thread_queue_Header_number( priority ); header = &the_thread_queue->Queues.Priority[ header_index ]; block_state = the_thread_queue->state; if ( _Thread_queue_Is_reverse_search( priority ) ) ffc0cc04: 70 09 00 20 andi. r9,r0,32 _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 ]; ffc0cc08: 54 0a d1 be rlwinm r10,r0,26,6,31 */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); ffc0cc0c: 91 04 00 38 stw r8,56(r4) ffc0cc10: 1d 4a 00 0c mulli r10,r10,12 Thread_blocking_operation_States _Thread_queue_Enqueue_priority ( Thread_queue_Control *the_thread_queue, Thread_Control *the_thread, ISR_Level *level_p ) { ffc0cc14: 93 e1 00 0c stw r31,12(r1) the_chain->permanent_null = NULL; ffc0cc18: 39 00 00 00 li r8,0 _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 ]; block_state = the_thread_queue->state; ffc0cc1c: 81 23 00 38 lwz r9,56(r3) _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 ]; ffc0cc20: 7d 43 52 14 add r10,r3,r10 ffc0cc24: 91 04 00 3c stw r8,60(r4) the_chain->last = _Chain_Head(the_chain); ffc0cc28: 91 64 00 40 stw r11,64(r4) block_state = the_thread_queue->state; if ( _Thread_queue_Is_reverse_search( priority ) ) ffc0cc2c: 40 82 00 98 bne- ffc0ccc4 <_Thread_queue_Enqueue_priority+0xd0> */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; ffc0cc30: 38 ca 00 04 addi r6,r10,4 static inline uint32_t ppc_interrupt_disable( void ) { uint32_t level; uint32_t mask; asm volatile ( ffc0cc34: 7d 00 00 a6 mfmsr r8 ffc0cc38: 7d 70 42 a6 mfsprg r11,0 ffc0cc3c: 7d 0b 58 78 andc r11,r8,r11 ffc0cc40: 7d 60 01 24 mtmsr r11 goto restart_reverse_search; restart_forward_search: search_priority = PRIORITY_MINIMUM - 1; _ISR_Disable( level ); search_thread = (Thread_Control *) header->first; ffc0cc44: 38 e0 ff ff li r7,-1 ffc0cc48: 81 6a 00 00 lwz r11,0(r10) while ( !_Chain_Is_tail( header, (Chain_Node *)search_thread ) ) { ffc0cc4c: 48 00 00 34 b ffc0cc80 <_Thread_queue_Enqueue_priority+0x8c> search_priority = search_thread->current_priority; ffc0cc50: 80 eb 00 14 lwz r7,20(r11) if ( priority <= search_priority ) ffc0cc54: 7f 80 38 40 cmplw cr7,r0,r7 ffc0cc58: 40 9d 00 30 ble- cr7,ffc0cc88 <_Thread_queue_Enqueue_priority+0x94> static inline void ppc_interrupt_flash( uint32_t level ) { uint32_t current_level; asm volatile ( ffc0cc5c: 7d 80 00 a6 mfmsr r12 ffc0cc60: 7d 00 01 24 mtmsr r8 ffc0cc64: 7d 80 01 24 mtmsr r12 search_priority = search_thread->current_priority; if ( priority <= search_priority ) break; #endif _ISR_Flash( level ); if ( !_States_Are_set( search_thread->current_state, block_state) ) { ffc0cc68: 81 8b 00 10 lwz r12,16(r11) ffc0cc6c: 7d 3f 60 39 and. r31,r9,r12 ffc0cc70: 40 a2 00 0c bne+ ffc0cc7c <_Thread_queue_Enqueue_priority+0x88><== ALWAYS TAKEN return level; } static inline void ppc_interrupt_enable( uint32_t level ) { asm volatile ( ffc0cc74: 7d 00 01 24 mtmsr r8 <== NOT EXECUTED ffc0cc78: 4b ff ff bc b ffc0cc34 <_Thread_queue_Enqueue_priority+0x40><== NOT EXECUTED _ISR_Enable( level ); goto restart_forward_search; } search_thread = (Thread_Control *)search_thread->Object.Node.next; ffc0cc7c: 81 6b 00 00 lwz r11,0(r11) 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 ) ) { ffc0cc80: 7f 8b 30 00 cmpw cr7,r11,r6 ffc0cc84: 40 9e ff cc bne+ cr7,ffc0cc50 <_Thread_queue_Enqueue_priority+0x5c> } search_thread = (Thread_Control *)search_thread->Object.Node.next; } if ( the_thread_queue->sync_state != ffc0cc88: 81 43 00 30 lwz r10,48(r3) 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 ) ) { ffc0cc8c: 7d 09 43 78 mr r9,r8 } search_thread = (Thread_Control *)search_thread->Object.Node.next; } if ( the_thread_queue->sync_state != ffc0cc90: 2f 8a 00 01 cmpwi cr7,r10,1 ffc0cc94: 40 be 00 f8 bne+ cr7,ffc0cd8c <_Thread_queue_Enqueue_priority+0x198> THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) goto synchronize; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; if ( priority == search_priority ) ffc0cc98: 7f 80 38 00 cmpw cr7,r0,r7 if ( the_thread_queue->sync_state != THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) goto synchronize; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; ffc0cc9c: 38 00 00 00 li r0,0 ffc0cca0: 90 03 00 30 stw r0,48(r3) if ( priority == search_priority ) ffc0cca4: 41 9e 00 c4 beq- cr7,ffc0cd68 <_Thread_queue_Enqueue_priority+0x174> goto equal_priority; search_node = (Chain_Node *) search_thread; previous_node = search_node->previous; ffc0cca8: 81 2b 00 04 lwz r9,4(r11) the_node = (Chain_Node *) the_thread; the_node->next = search_node; ffc0ccac: 91 64 00 00 stw r11,0(r4) the_node->previous = previous_node; ffc0ccb0: 91 24 00 04 stw r9,4(r4) previous_node->next = the_node; search_node->previous = the_node; the_thread->Wait.queue = the_thread_queue; ffc0ccb4: 90 64 00 44 stw r3,68(r4) 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; ffc0ccb8: 90 89 00 00 stw r4,0(r9) search_node->previous = the_node; ffc0ccbc: 90 8b 00 04 stw r4,4(r11) the_thread->Wait.queue = the_thread_queue; _ISR_Enable( level ); ffc0ccc0: 48 00 00 9c b ffc0cd5c <_Thread_queue_Enqueue_priority+0x168> return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; restart_reverse_search: search_priority = PRIORITY_MAXIMUM + 1; ffc0ccc4: 3c c0 00 00 lis r6,0 ffc0ccc8: 38 c6 26 c4 addi r6,r6,9924 ffc0cccc: 88 e6 00 00 lbz r7,0(r6) ffc0ccd0: 38 e7 00 01 addi r7,r7,1 static inline uint32_t ppc_interrupt_disable( void ) { uint32_t level; uint32_t mask; asm volatile ( ffc0ccd4: 7d 00 00 a6 mfmsr r8 ffc0ccd8: 7d 70 42 a6 mfsprg r11,0 ffc0ccdc: 7d 0b 58 78 andc r11,r8,r11 ffc0cce0: 7d 60 01 24 mtmsr r11 _ISR_Disable( level ); search_thread = (Thread_Control *) header->last; ffc0cce4: 81 6a 00 08 lwz r11,8(r10) while ( !_Chain_Is_head( header, (Chain_Node *)search_thread ) ) { ffc0cce8: 48 00 00 34 b ffc0cd1c <_Thread_queue_Enqueue_priority+0x128> search_priority = search_thread->current_priority; ffc0ccec: 80 eb 00 14 lwz r7,20(r11) if ( priority >= search_priority ) ffc0ccf0: 7f 80 38 40 cmplw cr7,r0,r7 ffc0ccf4: 40 9c 00 30 bge- cr7,ffc0cd24 <_Thread_queue_Enqueue_priority+0x130> static inline void ppc_interrupt_flash( uint32_t level ) { uint32_t current_level; asm volatile ( ffc0ccf8: 7d 80 00 a6 mfmsr r12 ffc0ccfc: 7d 00 01 24 mtmsr r8 ffc0cd00: 7d 80 01 24 mtmsr r12 search_priority = search_thread->current_priority; if ( priority >= search_priority ) break; #endif _ISR_Flash( level ); if ( !_States_Are_set( search_thread->current_state, block_state) ) { ffc0cd04: 81 8b 00 10 lwz r12,16(r11) ffc0cd08: 7d 3f 60 39 and. r31,r9,r12 ffc0cd0c: 40 a2 00 0c bne+ ffc0cd18 <_Thread_queue_Enqueue_priority+0x124> return level; } static inline void ppc_interrupt_enable( uint32_t level ) { asm volatile ( ffc0cd10: 7d 00 01 24 mtmsr r8 ffc0cd14: 4b ff ff b8 b ffc0cccc <_Thread_queue_Enqueue_priority+0xd8> _ISR_Enable( level ); goto restart_reverse_search; } search_thread = (Thread_Control *) ffc0cd18: 81 6b 00 04 lwz r11,4(r11) 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 ) ) { ffc0cd1c: 7f 8b 50 00 cmpw cr7,r11,r10 ffc0cd20: 40 9e ff cc bne+ cr7,ffc0ccec <_Thread_queue_Enqueue_priority+0xf8> } search_thread = (Thread_Control *) search_thread->Object.Node.previous; } if ( the_thread_queue->sync_state != ffc0cd24: 81 43 00 30 lwz r10,48(r3) 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 ) ) { ffc0cd28: 7d 09 43 78 mr r9,r8 } search_thread = (Thread_Control *) search_thread->Object.Node.previous; } if ( the_thread_queue->sync_state != ffc0cd2c: 2f 8a 00 01 cmpwi cr7,r10,1 ffc0cd30: 40 be 00 5c bne+ cr7,ffc0cd8c <_Thread_queue_Enqueue_priority+0x198> THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) goto synchronize; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; if ( priority == search_priority ) ffc0cd34: 7f 80 38 00 cmpw cr7,r0,r7 if ( the_thread_queue->sync_state != THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) goto synchronize; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; ffc0cd38: 38 00 00 00 li r0,0 ffc0cd3c: 90 03 00 30 stw r0,48(r3) if ( priority == search_priority ) ffc0cd40: 41 9e 00 28 beq- cr7,ffc0cd68 <_Thread_queue_Enqueue_priority+0x174> goto equal_priority; search_node = (Chain_Node *) search_thread; next_node = search_node->next; ffc0cd44: 81 2b 00 00 lwz r9,0(r11) the_node = (Chain_Node *) the_thread; the_node->next = next_node; the_node->previous = search_node; ffc0cd48: 91 64 00 04 stw r11,4(r4) search_node = (Chain_Node *) search_thread; next_node = search_node->next; the_node = (Chain_Node *) the_thread; the_node->next = next_node; ffc0cd4c: 91 24 00 00 stw r9,0(r4) the_node->previous = search_node; search_node->next = the_node; next_node->previous = the_node; the_thread->Wait.queue = the_thread_queue; ffc0cd50: 90 64 00 44 stw r3,68(r4) 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; ffc0cd54: 90 8b 00 00 stw r4,0(r11) next_node->previous = the_node; ffc0cd58: 90 89 00 04 stw r4,4(r9) ffc0cd5c: 7d 00 01 24 mtmsr r8 ffc0cd60: 38 60 00 01 li r3,1 the_thread->Wait.queue = the_thread_queue; _ISR_Enable( level ); return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; ffc0cd64: 48 00 00 30 b ffc0cd94 <_Thread_queue_Enqueue_priority+0x1a0> ffc0cd68: 39 6b 00 3c addi r11,r11,60 the_node->next = search_node; the_node->previous = previous_node; previous_node->next = the_node; search_node->previous = the_node; the_thread->Wait.queue = the_thread_queue; ffc0cd6c: 90 64 00 44 stw r3,68(r4) _ISR_Enable( level ); return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; equal_priority: /* add at end of priority group */ search_node = _Chain_Tail( &search_thread->Wait.Block2n ); previous_node = search_node->previous; ffc0cd70: 81 4b 00 04 lwz r10,4(r11) the_node = (Chain_Node *) the_thread; the_node->next = search_node; ffc0cd74: 91 64 00 00 stw r11,0(r4) the_node->previous = previous_node; ffc0cd78: 91 44 00 04 stw r10,4(r4) previous_node->next = the_node; ffc0cd7c: 90 8a 00 00 stw r4,0(r10) search_node->previous = the_node; ffc0cd80: 90 8b 00 04 stw r4,4(r11) ffc0cd84: 7d 20 01 24 mtmsr r9 ffc0cd88: 4b ff ff d8 b ffc0cd60 <_Thread_queue_Enqueue_priority+0x16c> * 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; ffc0cd8c: 91 25 00 00 stw r9,0(r5) return the_thread_queue->sync_state; ffc0cd90: 80 63 00 30 lwz r3,48(r3) } ffc0cd94: 83 e1 00 0c lwz r31,12(r1) ffc0cd98: 38 21 00 10 addi r1,r1,16 ffc0cd9c: 4e 80 00 20 blr =============================================================================== ffc0ce84 <_Thread_queue_Requeue>: void _Thread_queue_Requeue( Thread_queue_Control *the_thread_queue, Thread_Control *the_thread ) { ffc0ce84: 94 21 ff d8 stwu r1,-40(r1) ffc0ce88: 7c 08 02 a6 mflr r0 ffc0ce8c: 93 e1 00 24 stw r31,36(r1) /* * Just in case the thread really wasn't blocked on a thread queue * when we get here. */ if ( !the_thread_queue ) ffc0ce90: 7c 7f 1b 79 mr. r31,r3 void _Thread_queue_Requeue( Thread_queue_Control *the_thread_queue, Thread_Control *the_thread ) { ffc0ce94: 93 c1 00 20 stw r30,32(r1) ffc0ce98: 7c 9e 23 78 mr r30,r4 ffc0ce9c: 90 01 00 2c stw r0,44(r1) ffc0cea0: 93 a1 00 1c stw r29,28(r1) /* * Just in case the thread really wasn't blocked on a thread queue * when we get here. */ if ( !the_thread_queue ) ffc0cea4: 41 82 00 54 beq- ffc0cef8 <_Thread_queue_Requeue+0x74> <== NEVER TAKEN /* * If queueing by FIFO, there is nothing to do. This only applies to * priority blocking discipline. */ if ( the_thread_queue->discipline == THREAD_QUEUE_DISCIPLINE_PRIORITY ) { ffc0cea8: 80 1f 00 34 lwz r0,52(r31) ffc0ceac: 2f 80 00 01 cmpwi cr7,r0,1 ffc0ceb0: 40 be 00 48 bne+ cr7,ffc0cef8 <_Thread_queue_Requeue+0x74><== NEVER TAKEN static inline uint32_t ppc_interrupt_disable( void ) { uint32_t level; uint32_t mask; asm volatile ( ffc0ceb4: 7f a0 00 a6 mfmsr r29 ffc0ceb8: 7d 30 42 a6 mfsprg r9,0 ffc0cebc: 7f a9 48 78 andc r9,r29,r9 ffc0cec0: 7d 20 01 24 mtmsr r9 Thread_queue_Control *tq = the_thread_queue; ISR_Level level; ISR_Level level_ignored; _ISR_Disable( level ); if ( _States_Is_waiting_on_thread_queue( the_thread->current_state ) ) { ffc0cec4: 3d 60 00 03 lis r11,3 ffc0cec8: 81 24 00 10 lwz r9,16(r4) ffc0cecc: 61 6b be e0 ori r11,r11,48864 ffc0ced0: 7d 6a 48 39 and. r10,r11,r9 ffc0ced4: 41 a2 00 20 beq+ ffc0cef4 <_Thread_queue_Requeue+0x70> <== NEVER TAKEN ffc0ced8: 90 1f 00 30 stw r0,48(r31) _Thread_queue_Enter_critical_section( tq ); _Thread_queue_Extract_priority_helper( tq, the_thread, true ); ffc0cedc: 38 a0 00 01 li r5,1 ffc0cee0: 48 00 84 95 bl ffc15374 <_Thread_queue_Extract_priority_helper> (void) _Thread_queue_Enqueue_priority( tq, the_thread, &level_ignored ); ffc0cee4: 7f e3 fb 78 mr r3,r31 ffc0cee8: 7f c4 f3 78 mr r4,r30 ffc0ceec: 38 a1 00 08 addi r5,r1,8 ffc0cef0: 4b ff fd 05 bl ffc0cbf4 <_Thread_queue_Enqueue_priority> return level; } static inline void ppc_interrupt_enable( uint32_t level ) { asm volatile ( ffc0cef4: 7f a0 01 24 mtmsr r29 } _ISR_Enable( level ); } } ffc0cef8: 80 01 00 2c lwz r0,44(r1) ffc0cefc: 83 a1 00 1c lwz r29,28(r1) ffc0cf00: 7c 08 03 a6 mtlr r0 ffc0cf04: 83 c1 00 20 lwz r30,32(r1) ffc0cf08: 83 e1 00 24 lwz r31,36(r1) ffc0cf0c: 38 21 00 28 addi r1,r1,40 ffc0cf10: 4e 80 00 20 blr =============================================================================== ffc0cf14 <_Thread_queue_Timeout>: void _Thread_queue_Timeout( Objects_Id id, void *ignored __attribute__((unused)) ) { ffc0cf14: 94 21 ff e8 stwu r1,-24(r1) ffc0cf18: 7c 08 02 a6 mflr r0 Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); ffc0cf1c: 38 81 00 08 addi r4,r1,8 void _Thread_queue_Timeout( Objects_Id id, void *ignored __attribute__((unused)) ) { ffc0cf20: 90 01 00 1c stw r0,28(r1) Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); ffc0cf24: 4b ff f6 19 bl ffc0c53c <_Thread_Get> switch ( location ) { ffc0cf28: 80 01 00 08 lwz r0,8(r1) ffc0cf2c: 2f 80 00 00 cmpwi cr7,r0,0 ffc0cf30: 40 9e 00 18 bne- cr7,ffc0cf48 <_Thread_queue_Timeout+0x34><== NEVER TAKEN #if defined(RTEMS_MULTIPROCESSING) case OBJECTS_REMOTE: /* impossible */ #endif break; case OBJECTS_LOCAL: _Thread_queue_Process_timeout( the_thread ); ffc0cf34: 48 00 85 3d bl ffc15470 <_Thread_queue_Process_timeout> */ RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void ) { RTEMS_COMPILER_MEMORY_BARRIER(); _Thread_Dispatch_disable_level -= 1; ffc0cf38: 3d 20 00 00 lis r9,0 ffc0cf3c: 81 69 27 90 lwz r11,10128(r9) ffc0cf40: 38 0b ff ff addi r0,r11,-1 ffc0cf44: 90 09 27 90 stw r0,10128(r9) _Thread_Unnest_dispatch(); break; } } ffc0cf48: 80 01 00 1c lwz r0,28(r1) ffc0cf4c: 38 21 00 18 addi r1,r1,24 ffc0cf50: 7c 08 03 a6 mtlr r0 ffc0cf54: 4e 80 00 20 blr =============================================================================== ffc19d0c <_Timer_server_Body>: * @a arg points to the corresponding timer server control block. */ static rtems_task _Timer_server_Body( rtems_task_argument arg ) { ffc19d0c: 94 21 ff 98 stwu r1,-104(r1) ffc19d10: 7c 08 02 a6 mflr r0 ffc19d14: 92 01 00 28 stw r16,40(r1) Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); the_chain->permanent_null = NULL; the_chain->last = _Chain_Head(the_chain); ffc19d18: 3a 01 00 08 addi r16,r1,8 ffc19d1c: 90 01 00 6c stw r0,108(r1) RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); the_chain->permanent_null = NULL; ffc19d20: 38 00 00 00 li r0,0 ffc19d24: 93 01 00 48 stw r24,72(r1) */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; ffc19d28: 3b 01 00 0c addi r24,r1,12 ffc19d2c: 93 61 00 54 stw r27,84(r1) ffc19d30: 3b 61 00 18 addi r27,r1,24 ffc19d34: 93 c1 00 60 stw r30,96(r1) ffc19d38: 3b c1 00 14 addi r30,r1,20 ffc19d3c: 92 21 00 2c stw r17,44(r1) static void _Timer_server_Process_interval_watchdogs( Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = _Watchdog_Ticks_since_boot; ffc19d40: 3e 20 00 00 lis r17,0 ffc19d44: 3a 31 28 c0 addi r17,r17,10432 * @a arg points to the corresponding timer server control block. */ static rtems_task _Timer_server_Body( rtems_task_argument arg ) { ffc19d48: 92 41 00 30 stw r18,48(r1) static void _Timer_server_Process_tod_watchdogs( Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); ffc19d4c: 3e 40 00 00 lis r18,0 ffc19d50: 3a 52 28 88 addi r18,r18,10376 * @a arg points to the corresponding timer server control block. */ static rtems_task _Timer_server_Body( rtems_task_argument arg ) { ffc19d54: 93 21 00 4c stw r25,76(r1) ffc19d58: 3f 20 00 00 lis r25,0 ffc19d5c: 3b 39 28 68 addi r25,r25,10344 ffc19d60: 93 a1 00 5c stw r29,92(r1) RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); the_chain->permanent_null = NULL; ffc19d64: 90 01 00 18 stw r0,24(r1) */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); ffc19d68: 93 01 00 08 stw r24,8(r1) the_chain->permanent_null = NULL; ffc19d6c: 90 01 00 0c stw r0,12(r1) the_chain->last = _Chain_Head(the_chain); ffc19d70: 92 01 00 10 stw r16,16(r1) */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); ffc19d74: 93 61 00 14 stw r27,20(r1) the_chain->permanent_null = NULL; the_chain->last = _Chain_Head(the_chain); ffc19d78: 93 c1 00 1c stw r30,28(r1) ffc19d7c: 92 61 00 34 stw r19,52(r1) static void _Timer_server_Stop_interval_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog ); ffc19d80: 3a 63 00 08 addi r19,r3,8 * @a arg points to the corresponding timer server control block. */ static rtems_task _Timer_server_Body( rtems_task_argument arg ) { ffc19d84: 92 81 00 38 stw r20,56(r1) static void _Timer_server_Stop_tod_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->TOD_watchdogs.System_watchdog ); ffc19d88: 3a 83 00 40 addi r20,r3,64 * @a arg points to the corresponding timer server control block. */ static rtems_task _Timer_server_Body( rtems_task_argument arg ) { ffc19d8c: 92 a1 00 3c stw r21,60(r1) */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected( Chain_Control *the_chain ) { if ( !_Chain_Is_empty(the_chain)) ffc19d90: 3a a0 00 00 li r21,0 ffc19d94: 92 c1 00 40 stw r22,64(r1) * the active flag of the timer server is true. */ (*watchdog->routine)( watchdog->id, watchdog->user_data ); } } else { ts->active = false; ffc19d98: 3a c0 00 00 li r22,0 * @a arg points to the corresponding timer server control block. */ static rtems_task _Timer_server_Body( rtems_task_argument arg ) { ffc19d9c: 92 e1 00 44 stw r23,68(r1) _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; ffc19da0: 3a e0 00 01 li r23,1 * @a arg points to the corresponding timer server control block. */ static rtems_task _Timer_server_Body( rtems_task_argument arg ) { ffc19da4: 93 41 00 50 stw r26,80(r1) */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; watchdogs->last_snapshot = snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); ffc19da8: 3b 43 00 30 addi r26,r3,48 * @a arg points to the corresponding timer server control block. */ static rtems_task _Timer_server_Body( rtems_task_argument arg ) { ffc19dac: 93 81 00 58 stw r28,88(r1) /* * 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 ); ffc19db0: 3b 83 00 68 addi r28,r3,104 * @a arg points to the corresponding timer server control block. */ static rtems_task _Timer_server_Body( rtems_task_argument arg ) { ffc19db4: 93 e1 00 64 stw r31,100(r1) ffc19db8: 7c 7f 1b 78 mr r31,r3 { /* * 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; ffc19dbc: 92 1f 00 78 stw r16,120(r31) static void _Timer_server_Process_interval_watchdogs( Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = _Watchdog_Ticks_since_boot; ffc19dc0: 80 11 00 00 lwz r0,0(r17) */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; watchdogs->last_snapshot = snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); ffc19dc4: 7f c5 f3 78 mr r5,r30 Watchdog_Interval snapshot = _Watchdog_Ticks_since_boot; /* * We assume adequate unsigned arithmetic here. */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; ffc19dc8: 80 9f 00 3c lwz r4,60(r31) watchdogs->last_snapshot = snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); ffc19dcc: 7f 43 d3 78 mr r3,r26 /* * We assume adequate unsigned arithmetic here. */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; watchdogs->last_snapshot = snapshot; ffc19dd0: 90 1f 00 3c stw r0,60(r31) _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); ffc19dd4: 7c 84 00 50 subf r4,r4,r0 ffc19dd8: 48 00 4f 6d bl ffc1ed44 <_Watchdog_Adjust_to_chain> static void _Timer_server_Process_tod_watchdogs( Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); ffc19ddc: 83 b2 00 00 lwz r29,0(r18) Watchdog_Interval last_snapshot = watchdogs->last_snapshot; ffc19de0: 80 bf 00 74 lwz r5,116(r31) /* * 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 ) { ffc19de4: 7f 9d 28 40 cmplw cr7,r29,r5 ffc19de8: 40 bd 00 18 ble+ cr7,ffc19e00 <_Timer_server_Body+0xf4> /* * 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 ); ffc19dec: 7c 85 e8 50 subf r4,r5,r29 ffc19df0: 7f 83 e3 78 mr r3,r28 ffc19df4: 7f c5 f3 78 mr r5,r30 ffc19df8: 48 00 4f 4d bl ffc1ed44 <_Watchdog_Adjust_to_chain> ffc19dfc: 48 00 00 18 b ffc19e14 <_Timer_server_Body+0x108> } else if ( snapshot < last_snapshot ) { ffc19e00: 40 bc 00 14 bge+ cr7,ffc19e14 <_Timer_server_Body+0x108> /* * 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 ); ffc19e04: 7c bd 28 50 subf r5,r29,r5 ffc19e08: 7f 83 e3 78 mr r3,r28 ffc19e0c: 38 80 00 01 li r4,1 ffc19e10: 48 00 4e 51 bl ffc1ec60 <_Watchdog_Adjust> } watchdogs->last_snapshot = snapshot; ffc19e14: 93 bf 00 74 stw r29,116(r31) } static void _Timer_server_Process_insertions( Timer_server_Control *ts ) { while ( true ) { Timer_Control *timer = (Timer_Control *) _Chain_Get( ts->insert_chain ); ffc19e18: 80 7f 00 78 lwz r3,120(r31) ffc19e1c: 48 00 0b 79 bl ffc1a994 <_Chain_Get> if ( timer == NULL ) { ffc19e20: 7c 64 1b 79 mr. r4,r3 ffc19e24: 41 82 00 34 beq- ffc19e58 <_Timer_server_Body+0x14c> static void _Timer_server_Insert_timer( Timer_server_Control *ts, Timer_Control *timer ) { if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { ffc19e28: 80 04 00 38 lwz r0,56(r4) ffc19e2c: 2f 00 00 01 cmpwi cr6,r0,1 _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); } else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) { ffc19e30: 2f 80 00 03 cmpwi cr7,r0,3 static void _Timer_server_Insert_timer( Timer_server_Control *ts, Timer_Control *timer ) { if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { ffc19e34: 40 ba 00 10 bne+ cr6,ffc19e44 <_Timer_server_Body+0x138> _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); ffc19e38: 38 84 00 10 addi r4,r4,16 ffc19e3c: 7f 43 d3 78 mr r3,r26 ffc19e40: 48 00 00 10 b ffc19e50 <_Timer_server_Body+0x144> } else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) { ffc19e44: 40 9e ff d4 bne+ cr7,ffc19e18 <_Timer_server_Body+0x10c><== NEVER TAKEN _Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker ); ffc19e48: 38 84 00 10 addi r4,r4,16 ffc19e4c: 7f 83 e3 78 mr r3,r28 ffc19e50: 48 00 4f ad bl ffc1edfc <_Watchdog_Insert> ffc19e54: 4b ff ff c4 b ffc19e18 <_Timer_server_Body+0x10c> static inline uint32_t ppc_interrupt_disable( void ) { uint32_t level; uint32_t mask; asm volatile ( ffc19e58: 7c 00 00 a6 mfmsr r0 ffc19e5c: 7d 30 42 a6 mfsprg r9,0 ffc19e60: 7c 09 48 78 andc r9,r0,r9 ffc19e64: 7d 20 01 24 mtmsr r9 * body loop. */ _Timer_server_Process_insertions( ts ); _ISR_Disable( level ); if ( _Chain_Is_empty( insert_chain ) ) { ffc19e68: 81 21 00 08 lwz r9,8(r1) ffc19e6c: 7f 89 c0 00 cmpw cr7,r9,r24 ffc19e70: 40 be 00 1c bne+ cr7,ffc19e8c <_Timer_server_Body+0x180><== NEVER TAKEN ts->insert_chain = NULL; ffc19e74: 90 9f 00 78 stw r4,120(r31) return level; } static inline void ppc_interrupt_enable( uint32_t level ) { asm volatile ( ffc19e78: 7c 00 01 24 mtmsr r0 _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 ) ) { ffc19e7c: 80 01 00 14 lwz r0,20(r1) ffc19e80: 7f 80 d8 00 cmpw cr7,r0,r27 ffc19e84: 40 be 00 10 bne+ cr7,ffc19e94 <_Timer_server_Body+0x188> ffc19e88: 48 00 00 64 b ffc19eec <_Timer_server_Body+0x1e0> ffc19e8c: 7c 00 01 24 mtmsr r0 <== NOT EXECUTED ffc19e90: 4b ff ff 30 b ffc19dc0 <_Timer_server_Body+0xb4> <== NOT EXECUTED static inline uint32_t ppc_interrupt_disable( void ) { uint32_t level; uint32_t mask; asm volatile ( ffc19e94: 7c 00 00 a6 mfmsr r0 ffc19e98: 7d 30 42 a6 mfsprg r9,0 ffc19e9c: 7c 09 48 78 andc r9,r0,r9 ffc19ea0: 7d 20 01 24 mtmsr r9 */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); ffc19ea4: 81 21 00 14 lwz r9,20(r1) */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected( Chain_Control *the_chain ) { if ( !_Chain_Is_empty(the_chain)) ffc19ea8: 7f 09 d8 00 cmpw cr6,r9,r27 * It is essential that interrupts are disable here since an interrupt * service routine may remove a watchdog from the chain. */ _ISR_Disable( level ); watchdog = (Watchdog_Control *) _Chain_Get_unprotected( &fire_chain ); if ( watchdog != NULL ) { ffc19eac: 2f 89 00 00 cmpwi cr7,r9,0 ffc19eb0: 41 9a 00 34 beq- cr6,ffc19ee4 <_Timer_server_Body+0x1d8> { Chain_Node *return_node; Chain_Node *new_first; return_node = the_chain->first; new_first = return_node->next; ffc19eb4: 81 69 00 00 lwz r11,0(r9) the_chain->first = new_first; ffc19eb8: 91 61 00 14 stw r11,20(r1) new_first->previous = _Chain_Head(the_chain); ffc19ebc: 93 cb 00 04 stw r30,4(r11) ffc19ec0: 41 9e 00 24 beq- cr7,ffc19ee4 <_Timer_server_Body+0x1d8><== NEVER TAKEN watchdog->state = WATCHDOG_INACTIVE; ffc19ec4: 92 a9 00 08 stw r21,8(r9) return level; } static inline void ppc_interrupt_enable( uint32_t level ) { asm volatile ( ffc19ec8: 7c 00 01 24 mtmsr r0 /* * 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 ); ffc19ecc: 80 09 00 1c lwz r0,28(r9) ffc19ed0: 80 89 00 24 lwz r4,36(r9) ffc19ed4: 80 69 00 20 lwz r3,32(r9) ffc19ed8: 7c 09 03 a6 mtctr r0 ffc19edc: 4e 80 04 21 bctrl } ffc19ee0: 4b ff ff b4 b ffc19e94 <_Timer_server_Body+0x188> ffc19ee4: 7c 00 01 24 mtmsr r0 ffc19ee8: 4b ff fe d4 b ffc19dbc <_Timer_server_Body+0xb0> } else { ts->active = false; ffc19eec: 9a df 00 7c stb r22,124(r31) ffc19ef0: 81 39 00 00 lwz r9,0(r25) ffc19ef4: 38 09 00 01 addi r0,r9,1 ffc19ef8: 90 19 00 00 stw r0,0(r25) /* * Block until there is something to do. */ _Thread_Disable_dispatch(); _Thread_Set_state( ts->thread, STATES_DELAYING ); ffc19efc: 80 7f 00 00 lwz r3,0(r31) ffc19f00: 38 80 00 08 li r4,8 ffc19f04: 48 00 41 81 bl ffc1e084 <_Thread_Set_state> _Timer_server_Reset_interval_system_watchdog( ts ); ffc19f08: 7f e3 fb 78 mr r3,r31 ffc19f0c: 4b ff fd 01 bl ffc19c0c <_Timer_server_Reset_interval_system_watchdog> _Timer_server_Reset_tod_system_watchdog( ts ); ffc19f10: 7f e3 fb 78 mr r3,r31 ffc19f14: 4b ff fd 79 bl ffc19c8c <_Timer_server_Reset_tod_system_watchdog> _Thread_Enable_dispatch(); ffc19f18: 48 00 35 15 bl ffc1d42c <_Thread_Enable_dispatch> ts->active = true; ffc19f1c: 9a ff 00 7c stb r23,124(r31) static void _Timer_server_Stop_interval_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog ); ffc19f20: 7e 63 9b 78 mr r3,r19 ffc19f24: 48 00 50 31 bl ffc1ef54 <_Watchdog_Remove> static void _Timer_server_Stop_tod_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->TOD_watchdogs.System_watchdog ); ffc19f28: 7e 83 a3 78 mr r3,r20 ffc19f2c: 48 00 50 29 bl ffc1ef54 <_Watchdog_Remove> ffc19f30: 4b ff fe 8c b ffc19dbc <_Timer_server_Body+0xb0> =============================================================================== ffc0df68 <_Watchdog_Adjust>: void _Watchdog_Adjust( Chain_Control *header, Watchdog_Adjust_directions direction, Watchdog_Interval units ) { ffc0df68: 94 21 ff e0 stwu r1,-32(r1) ffc0df6c: 7c 08 02 a6 mflr r0 ffc0df70: 90 01 00 24 stw r0,36(r1) ffc0df74: 93 c1 00 18 stw r30,24(r1) ffc0df78: 7c be 2b 78 mr r30,r5 ffc0df7c: 93 e1 00 1c stw r31,28(r1) ffc0df80: 7c 7f 1b 78 mr r31,r3 ffc0df84: 93 61 00 0c stw r27,12(r1) ffc0df88: 93 81 00 10 stw r28,16(r1) ffc0df8c: 93 a1 00 14 stw r29,20(r1) static inline uint32_t ppc_interrupt_disable( void ) { uint32_t level; uint32_t mask; asm volatile ( ffc0df90: 7c 00 00 a6 mfmsr r0 ffc0df94: 7d 30 42 a6 mfsprg r9,0 ffc0df98: 7c 09 48 78 andc r9,r0,r9 ffc0df9c: 7d 20 01 24 mtmsr r9 */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); ffc0dfa0: 81 23 00 00 lwz r9,0(r3) */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; ffc0dfa4: 3b 83 00 04 addi r28,r3,4 * hence the compiler must not assume *header to remain * unmodified across that call. * * Till Straumann, 7/2003 */ if ( !_Chain_Is_empty( header ) ) { ffc0dfa8: 7f 89 e0 00 cmpw cr7,r9,r28 ffc0dfac: 41 9e 00 78 beq- cr7,ffc0e024 <_Watchdog_Adjust+0xbc> switch ( direction ) { ffc0dfb0: 2f 84 00 00 cmpwi cr7,r4,0 if ( units < _Watchdog_First( header )->delta_interval ) { _Watchdog_First( header )->delta_interval -= units; break; } else { units -= _Watchdog_First( header )->delta_interval; _Watchdog_First( header )->delta_interval = 1; ffc0dfb4: 3b 60 00 01 li r27,1 * unmodified across that call. * * Till Straumann, 7/2003 */ if ( !_Chain_Is_empty( header ) ) { switch ( direction ) { ffc0dfb8: 41 9e 00 64 beq- cr7,ffc0e01c <_Watchdog_Adjust+0xb4> ffc0dfbc: 2f 84 00 01 cmpwi cr7,r4,1 ffc0dfc0: 40 be 00 64 bne+ cr7,ffc0e024 <_Watchdog_Adjust+0xbc> <== NEVER TAKEN case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; ffc0dfc4: 81 69 00 10 lwz r11,16(r9) ffc0dfc8: 7f cb 2a 14 add r30,r11,r5 ffc0dfcc: 48 00 00 18 b ffc0dfe4 <_Watchdog_Adjust+0x7c> RTEMS_INLINE_ROUTINE Watchdog_Control *_Watchdog_First( Chain_Control *header ) { return ( (Watchdog_Control *) header->first ); ffc0dfd0: 81 3f 00 00 lwz r9,0(r31) break; case WATCHDOG_FORWARD: while ( units ) { if ( units < _Watchdog_First( header )->delta_interval ) { ffc0dfd4: 83 a9 00 10 lwz r29,16(r9) ffc0dfd8: 7f 9e e8 40 cmplw cr7,r30,r29 ffc0dfdc: 40 bc 00 10 bge+ cr7,ffc0dfec <_Watchdog_Adjust+0x84> _Watchdog_First( header )->delta_interval -= units; ffc0dfe0: 7f de e8 50 subf r30,r30,r29 ffc0dfe4: 93 c9 00 10 stw r30,16(r9) break; ffc0dfe8: 48 00 00 3c b ffc0e024 <_Watchdog_Adjust+0xbc> } else { units -= _Watchdog_First( header )->delta_interval; _Watchdog_First( header )->delta_interval = 1; ffc0dfec: 93 69 00 10 stw r27,16(r9) return level; } static inline void ppc_interrupt_enable( uint32_t level ) { asm volatile ( ffc0dff0: 7c 00 01 24 mtmsr r0 _ISR_Enable( level ); _Watchdog_Tickle( header ); ffc0dff4: 7f e3 fb 78 mr r3,r31 ffc0dff8: 48 00 02 59 bl ffc0e250 <_Watchdog_Tickle> static inline uint32_t ppc_interrupt_disable( void ) { uint32_t level; uint32_t mask; asm volatile ( ffc0dffc: 7c 00 00 a6 mfmsr r0 ffc0e000: 7d 30 42 a6 mfsprg r9,0 ffc0e004: 7c 09 48 78 andc r9,r0,r9 ffc0e008: 7d 20 01 24 mtmsr r9 _ISR_Disable( level ); if ( _Chain_Is_empty( header ) ) ffc0e00c: 81 3f 00 00 lwz r9,0(r31) while ( units ) { if ( units < _Watchdog_First( header )->delta_interval ) { _Watchdog_First( header )->delta_interval -= units; break; } else { units -= _Watchdog_First( header )->delta_interval; ffc0e010: 7f dd f0 50 subf r30,r29,r30 _Watchdog_Tickle( header ); _ISR_Disable( level ); if ( _Chain_Is_empty( header ) ) ffc0e014: 7f 89 e0 00 cmpw cr7,r9,r28 ffc0e018: 41 9e 00 0c beq- cr7,ffc0e024 <_Watchdog_Adjust+0xbc> switch ( direction ) { case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; break; case WATCHDOG_FORWARD: while ( units ) { ffc0e01c: 2f 9e 00 00 cmpwi cr7,r30,0 ffc0e020: 40 9e ff b0 bne+ cr7,ffc0dfd0 <_Watchdog_Adjust+0x68> <== ALWAYS TAKEN return level; } static inline void ppc_interrupt_enable( uint32_t level ) { asm volatile ( ffc0e024: 7c 00 01 24 mtmsr r0 } } _ISR_Enable( level ); } ffc0e028: 80 01 00 24 lwz r0,36(r1) ffc0e02c: 83 61 00 0c lwz r27,12(r1) ffc0e030: 7c 08 03 a6 mtlr r0 ffc0e034: 83 81 00 10 lwz r28,16(r1) ffc0e038: 83 a1 00 14 lwz r29,20(r1) ffc0e03c: 83 c1 00 18 lwz r30,24(r1) ffc0e040: 83 e1 00 1c lwz r31,28(r1) ffc0e044: 38 21 00 20 addi r1,r1,32 ffc0e048: 4e 80 00 20 blr =============================================================================== ffc1ed44 <_Watchdog_Adjust_to_chain>: { Watchdog_Interval units = units_arg; ISR_Level level; Watchdog_Control *first; if ( units <= 0 ) { ffc1ed44: 2c 04 00 00 cmpwi r4,0 ffc1ed48: 4d 82 00 20 beqlr static inline uint32_t ppc_interrupt_disable( void ) { uint32_t level; uint32_t mask; asm volatile ( ffc1ed4c: 7d 40 00 a6 mfmsr r10 ffc1ed50: 7c 10 42 a6 mfsprg r0,0 ffc1ed54: 7d 40 00 78 andc r0,r10,r0 ffc1ed58: 7c 00 01 24 mtmsr r0 /* * The first set happens in less than units, so take all of them * off the chain and adjust units to reflect this. */ units -= first->delta_interval; first->delta_interval = 0; ffc1ed5c: 38 c0 00 00 li r6,0 ffc1ed60: 39 03 00 04 addi r8,r3,4 ffc1ed64: 39 85 00 04 addi r12,r5,4 ffc1ed68: 48 00 00 0c b ffc1ed74 <_Watchdog_Adjust_to_chain+0x30> } _ISR_Disable( level ); while ( 1 ) { if ( units <= 0 ) { ffc1ed6c: 2f 84 00 00 cmpwi cr7,r4,0 ffc1ed70: 41 9e 00 84 beq- cr7,ffc1edf4 <_Watchdog_Adjust_to_chain+0xb0> */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); ffc1ed74: 81 63 00 00 lwz r11,0(r3) break; } if ( _Chain_Is_empty( header ) ) { ffc1ed78: 7f 8b 40 00 cmpw cr7,r11,r8 ffc1ed7c: 41 9e 00 78 beq- cr7,ffc1edf4 <_Watchdog_Adjust_to_chain+0xb0> /* * If it is longer than "units" until the first element on the chain * fires, then bump it and quit. */ if ( units < first->delta_interval ) { ffc1ed80: 80 0b 00 10 lwz r0,16(r11) ffc1ed84: 7d 69 5b 78 mr r9,r11 ffc1ed88: 7f 84 00 40 cmplw cr7,r4,r0 ffc1ed8c: 40 bc 00 10 bge+ cr7,ffc1ed9c <_Watchdog_Adjust_to_chain+0x58> first->delta_interval -= units; ffc1ed90: 7c 84 00 50 subf r4,r4,r0 ffc1ed94: 90 8b 00 10 stw r4,16(r11) break; ffc1ed98: 48 00 00 5c b ffc1edf4 <_Watchdog_Adjust_to_chain+0xb0> /* * The first set happens in less than units, so take all of them * off the chain and adjust units to reflect this. */ units -= first->delta_interval; first->delta_interval = 0; ffc1ed9c: 90 cb 00 10 stw r6,16(r11) /* * The first set happens in less than units, so take all of them * off the chain and adjust units to reflect this. */ units -= first->delta_interval; ffc1eda0: 7c 80 20 50 subf r4,r0,r4 ) { Chain_Node *next; Chain_Node *previous; next = the_node->next; ffc1eda4: 81 69 00 00 lwz r11,0(r9) previous = the_node->previous; ffc1eda8: 80 e9 00 04 lwz r7,4(r9) next->previous = previous; previous->next = next; ffc1edac: 91 67 00 00 stw r11,0(r7) Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; next->previous = previous; ffc1edb0: 90 eb 00 04 stw r7,4(r11) Chain_Node *the_node ) { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); ffc1edb4: 91 89 00 00 stw r12,0(r9) old_last_node = the_chain->last; ffc1edb8: 81 65 00 08 lwz r11,8(r5) the_chain->last = the_node; ffc1edbc: 91 25 00 08 stw r9,8(r5) old_last_node->next = the_node; the_node->previous = old_last_node; ffc1edc0: 91 69 00 04 stw r11,4(r9) 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; ffc1edc4: 91 2b 00 00 stw r9,0(r11) static inline void ppc_interrupt_flash( uint32_t level ) { uint32_t current_level; asm volatile ( ffc1edc8: 7c 00 00 a6 mfmsr r0 ffc1edcc: 7d 40 01 24 mtmsr r10 ffc1edd0: 7c 00 01 24 mtmsr r0 */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); ffc1edd4: 80 03 00 00 lwz r0,0(r3) _Chain_Extract_unprotected( &first->Node ); _Chain_Append_unprotected( to_fire, &first->Node ); _ISR_Flash( level ); if ( _Chain_Is_empty( header ) ) ffc1edd8: 7f 80 40 00 cmpw cr7,r0,r8 ffc1eddc: 7c 09 03 78 mr r9,r0 ffc1ede0: 41 be ff 8c beq- cr7,ffc1ed6c <_Watchdog_Adjust_to_chain+0x28> break; first = _Watchdog_First( header ); if ( first->delta_interval != 0 ) ffc1ede4: 80 09 00 10 lwz r0,16(r9) ffc1ede8: 2f 80 00 00 cmpwi cr7,r0,0 ffc1edec: 41 9e ff b8 beq+ cr7,ffc1eda4 <_Watchdog_Adjust_to_chain+0x60><== NEVER TAKEN ffc1edf0: 4b ff ff 7c b ffc1ed6c <_Watchdog_Adjust_to_chain+0x28> return level; } static inline void ppc_interrupt_enable( uint32_t level ) { asm volatile ( ffc1edf4: 7d 40 01 24 mtmsr r10 ffc1edf8: 4e 80 00 20 blr =============================================================================== ffc0db3c <_Watchdog_Remove>: */ Watchdog_States _Watchdog_Remove( Watchdog_Control *the_watchdog ) { ffc0db3c: 7c 69 1b 78 mr r9,r3 static inline uint32_t ppc_interrupt_disable( void ) { uint32_t level; uint32_t mask; asm volatile ( ffc0db40: 7c 00 00 a6 mfmsr r0 ffc0db44: 7d 70 42 a6 mfsprg r11,0 ffc0db48: 7c 0b 58 78 andc r11,r0,r11 ffc0db4c: 7d 60 01 24 mtmsr r11 ISR_Level level; Watchdog_States previous_state; Watchdog_Control *next_watchdog; _ISR_Disable( level ); previous_state = the_watchdog->state; ffc0db50: 80 63 00 08 lwz r3,8(r3) switch ( previous_state ) { ffc0db54: 2f 83 00 01 cmpwi cr7,r3,1 ffc0db58: 41 9e 00 18 beq- cr7,ffc0db70 <_Watchdog_Remove+0x34> ffc0db5c: 2b 83 00 01 cmplwi cr7,r3,1 ffc0db60: 41 9c 00 74 blt- cr7,ffc0dbd4 <_Watchdog_Remove+0x98> ffc0db64: 2b 83 00 03 cmplwi cr7,r3,3 ffc0db68: 41 9d 00 6c bgt- cr7,ffc0dbd4 <_Watchdog_Remove+0x98> <== NEVER TAKEN ffc0db6c: 48 00 00 10 b ffc0db7c <_Watchdog_Remove+0x40> /* * It is not actually on the chain so just change the state and * the Insert operation we interrupted will be aborted. */ the_watchdog->state = WATCHDOG_INACTIVE; ffc0db70: 39 60 00 00 li r11,0 ffc0db74: 91 69 00 08 stw r11,8(r9) break; ffc0db78: 48 00 00 5c b ffc0dbd4 <_Watchdog_Remove+0x98> RTEMS_INLINE_ROUTINE Watchdog_Control *_Watchdog_Next( Watchdog_Control *the_watchdog ) { return ( (Watchdog_Control *) the_watchdog->Node.next ); ffc0db7c: 81 69 00 00 lwz r11,0(r9) case WATCHDOG_ACTIVE: case WATCHDOG_REMOVE_IT: the_watchdog->state = WATCHDOG_INACTIVE; ffc0db80: 39 00 00 00 li r8,0 ffc0db84: 91 09 00 08 stw r8,8(r9) next_watchdog = _Watchdog_Next( the_watchdog ); if ( _Watchdog_Next(next_watchdog) ) ffc0db88: 81 4b 00 00 lwz r10,0(r11) ffc0db8c: 2f 8a 00 00 cmpwi cr7,r10,0 ffc0db90: 41 9e 00 14 beq- cr7,ffc0dba4 <_Watchdog_Remove+0x68> next_watchdog->delta_interval += the_watchdog->delta_interval; ffc0db94: 81 0b 00 10 lwz r8,16(r11) ffc0db98: 81 49 00 10 lwz r10,16(r9) ffc0db9c: 7d 48 52 14 add r10,r8,r10 ffc0dba0: 91 4b 00 10 stw r10,16(r11) if ( _Watchdog_Sync_count ) ffc0dba4: 3d 60 00 00 lis r11,0 ffc0dba8: 81 6b 27 e4 lwz r11,10212(r11) ffc0dbac: 2f 8b 00 00 cmpwi cr7,r11,0 ffc0dbb0: 41 9e 00 14 beq- cr7,ffc0dbc4 <_Watchdog_Remove+0x88> _Watchdog_Sync_level = _ISR_Nest_level; ffc0dbb4: 3d 60 00 00 lis r11,0 ffc0dbb8: 81 4b 27 b8 lwz r10,10168(r11) ffc0dbbc: 3d 60 00 00 lis r11,0 ffc0dbc0: 91 4b 27 cc stw r10,10188(r11) ) { Chain_Node *next; Chain_Node *previous; next = the_node->next; ffc0dbc4: 81 69 00 00 lwz r11,0(r9) previous = the_node->previous; ffc0dbc8: 81 49 00 04 lwz r10,4(r9) next->previous = previous; previous->next = next; ffc0dbcc: 91 6a 00 00 stw r11,0(r10) Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; next->previous = previous; ffc0dbd0: 91 4b 00 04 stw r10,4(r11) _Chain_Extract_unprotected( &the_watchdog->Node ); break; } the_watchdog->stop_time = _Watchdog_Ticks_since_boot; ffc0dbd4: 3d 60 00 00 lis r11,0 ffc0dbd8: 81 6b 27 e8 lwz r11,10216(r11) ffc0dbdc: 91 69 00 18 stw r11,24(r9) return level; } static inline void ppc_interrupt_enable( uint32_t level ) { asm volatile ( ffc0dbe0: 7c 00 01 24 mtmsr r0 _ISR_Enable( level ); return( previous_state ); } ffc0dbe4: 4e 80 00 20 blr =============================================================================== ffc0d64c <_Watchdog_Report_chain>: void _Watchdog_Report_chain( const char *name, Chain_Control *header ) { ffc0d64c: 94 21 ff e8 stwu r1,-24(r1) ffc0d650: 7c 08 02 a6 mflr r0 ffc0d654: 93 c1 00 10 stw r30,16(r1) ffc0d658: 7c 7e 1b 78 mr r30,r3 ffc0d65c: 93 e1 00 14 stw r31,20(r1) ffc0d660: 7c 9f 23 78 mr r31,r4 ffc0d664: 90 01 00 1c stw r0,28(r1) ffc0d668: 93 81 00 08 stw r28,8(r1) ffc0d66c: 93 a1 00 0c stw r29,12(r1) static inline uint32_t ppc_interrupt_disable( void ) { uint32_t level; uint32_t mask; asm volatile ( ffc0d670: 7f a0 00 a6 mfmsr r29 ffc0d674: 7c 10 42 a6 mfsprg r0,0 ffc0d678: 7f a0 00 78 andc r0,r29,r0 ffc0d67c: 7c 00 01 24 mtmsr r0 ISR_Level level; Chain_Node *node; _ISR_Disable( level ); printk( "Watchdog Chain: %s %p\n", name, header ); ffc0d680: 3c 60 ff c2 lis r3,-62 ffc0d684: 7f e5 fb 78 mr r5,r31 ffc0d688: 38 63 35 b0 addi r3,r3,13744 ffc0d68c: 7f c4 f3 78 mr r4,r30 ffc0d690: 4c c6 31 82 crclr 4*cr1+eq ffc0d694: 4b ff 8b b9 bl ffc0624c */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); ffc0d698: 83 9f 00 00 lwz r28,0(r31) */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; ffc0d69c: 3b ff 00 04 addi r31,r31,4 if ( !_Chain_Is_empty( header ) ) { ffc0d6a0: 7f 9c f8 00 cmpw cr7,r28,r31 ffc0d6a4: 41 9e 00 34 beq- cr7,ffc0d6d8 <_Watchdog_Report_chain+0x8c> node != _Chain_Tail(header) ; node = node->next ) { Watchdog_Control *watch = (Watchdog_Control *) node; _Watchdog_Report( NULL, watch ); ffc0d6a8: 7f 84 e3 78 mr r4,r28 ffc0d6ac: 38 60 00 00 li r3,0 ffc0d6b0: 48 00 00 5d bl ffc0d70c <_Watchdog_Report> _ISR_Disable( level ); printk( "Watchdog Chain: %s %p\n", name, header ); if ( !_Chain_Is_empty( header ) ) { for ( node = header->first ; node != _Chain_Tail(header) ; node = node->next ) ffc0d6b4: 83 9c 00 00 lwz r28,0(r28) Chain_Node *node; _ISR_Disable( level ); printk( "Watchdog Chain: %s %p\n", name, header ); if ( !_Chain_Is_empty( header ) ) { for ( node = header->first ; ffc0d6b8: 7f 9c f8 00 cmpw cr7,r28,r31 ffc0d6bc: 40 9e ff ec bne+ cr7,ffc0d6a8 <_Watchdog_Report_chain+0x5c><== NEVER TAKEN { Watchdog_Control *watch = (Watchdog_Control *) node; _Watchdog_Report( NULL, watch ); } printk( "== end of %s \n", name ); ffc0d6c0: 3c 60 ff c2 lis r3,-62 ffc0d6c4: 38 63 35 c7 addi r3,r3,13767 ffc0d6c8: 7f c4 f3 78 mr r4,r30 ffc0d6cc: 4c c6 31 82 crclr 4*cr1+eq ffc0d6d0: 4b ff 8b 7d bl ffc0624c ffc0d6d4: 48 00 00 14 b ffc0d6e8 <_Watchdog_Report_chain+0x9c> } else { printk( "Chain is empty\n" ); ffc0d6d8: 3c 60 ff c2 lis r3,-62 ffc0d6dc: 38 63 35 d6 addi r3,r3,13782 ffc0d6e0: 4c c6 31 82 crclr 4*cr1+eq ffc0d6e4: 4b ff 8b 69 bl ffc0624c return level; } static inline void ppc_interrupt_enable( uint32_t level ) { asm volatile ( ffc0d6e8: 7f a0 01 24 mtmsr r29 } _ISR_Enable( level ); } ffc0d6ec: 80 01 00 1c lwz r0,28(r1) ffc0d6f0: 83 81 00 08 lwz r28,8(r1) ffc0d6f4: 7c 08 03 a6 mtlr r0 ffc0d6f8: 83 a1 00 0c lwz r29,12(r1) ffc0d6fc: 83 c1 00 10 lwz r30,16(r1) ffc0d700: 83 e1 00 14 lwz r31,20(r1) ffc0d704: 38 21 00 18 addi r1,r1,24 ffc0d708: 4e 80 00 20 blr =============================================================================== ffc07e9c : int adjtime( struct timeval *delta, struct timeval *olddelta ) { ffc07e9c: 94 21 ff e0 stwu r1,-32(r1) ffc07ea0: 7c 08 02 a6 mflr r0 ffc07ea4: 93 e1 00 1c stw r31,28(r1) long adjustment; /* * Simple validations */ if ( !delta ) ffc07ea8: 7c 7f 1b 79 mr. r31,r3 int adjtime( struct timeval *delta, struct timeval *olddelta ) { ffc07eac: 93 c1 00 18 stw r30,24(r1) ffc07eb0: 7c 9e 23 78 mr r30,r4 ffc07eb4: 90 01 00 24 stw r0,36(r1) long adjustment; /* * Simple validations */ if ( !delta ) ffc07eb8: 41 82 00 18 beq- ffc07ed0 rtems_set_errno_and_return_minus_one( EINVAL ); if ( delta->tv_usec >= TOD_MICROSECONDS_PER_SECOND ) ffc07ebc: 81 3f 00 04 lwz r9,4(r31) ffc07ec0: 3c 00 00 0f lis r0,15 ffc07ec4: 60 00 42 3f ori r0,r0,16959 ffc07ec8: 7f 89 00 40 cmplw cr7,r9,r0 ffc07ecc: 40 bd 00 18 ble+ cr7,ffc07ee4 rtems_set_errno_and_return_minus_one( EINVAL ); ffc07ed0: 48 00 aa ed bl ffc129bc <__errno> ffc07ed4: 38 00 00 16 li r0,22 ffc07ed8: 90 03 00 00 stw r0,0(r3) ffc07edc: 38 60 ff ff li r3,-1 ffc07ee0: 48 00 00 fc b ffc07fdc if ( olddelta ) { ffc07ee4: 2f 84 00 00 cmpwi cr7,r4,0 ffc07ee8: 41 9e 00 10 beq- cr7,ffc07ef8 olddelta->tv_sec = 0; ffc07eec: 38 00 00 00 li r0,0 olddelta->tv_usec = 0; ffc07ef0: 90 04 00 04 stw r0,4(r4) if ( delta->tv_usec >= TOD_MICROSECONDS_PER_SECOND ) rtems_set_errno_and_return_minus_one( EINVAL ); if ( olddelta ) { olddelta->tv_sec = 0; ffc07ef4: 90 04 00 00 stw r0,0(r4) olddelta->tv_usec = 0; } /* convert delta to microseconds */ adjustment = (delta->tv_sec * TOD_MICROSECONDS_PER_SECOND); ffc07ef8: 80 1f 00 00 lwz r0,0(r31) ffc07efc: 3d 20 00 0f lis r9,15 ffc07f00: 61 29 42 40 ori r9,r9,16960 adjustment += delta->tv_usec; ffc07f04: 81 7f 00 04 lwz r11,4(r31) olddelta->tv_sec = 0; olddelta->tv_usec = 0; } /* convert delta to microseconds */ adjustment = (delta->tv_sec * TOD_MICROSECONDS_PER_SECOND); ffc07f08: 7d 29 01 d6 mullw r9,r9,r0 adjustment += delta->tv_usec; /* too small to account for */ if ( adjustment < rtems_configuration_get_microseconds_per_tick() ) ffc07f0c: 3d 40 00 00 lis r10,0 ffc07f10: 80 0a 20 ac lwz r0,8364(r10) olddelta->tv_usec = 0; } /* convert delta to microseconds */ adjustment = (delta->tv_sec * TOD_MICROSECONDS_PER_SECOND); adjustment += delta->tv_usec; ffc07f14: 7d 29 5a 14 add r9,r9,r11 /* too small to account for */ if ( adjustment < rtems_configuration_get_microseconds_per_tick() ) ffc07f18: 7f 89 00 40 cmplw cr7,r9,r0 ffc07f1c: 41 bc 00 bc blt+ cr7,ffc07fd8 rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; ffc07f20: 3d 20 00 00 lis r9,0 ffc07f24: 81 69 28 b0 lwz r11,10416(r9) ffc07f28: 38 0b 00 01 addi r0,r11,1 ffc07f2c: 90 09 28 b0 stw r0,10416(r9) * This prevents context switches while we are adjusting the TOD */ _Thread_Disable_dispatch(); _TOD_Get( &ts ); ffc07f30: 38 61 00 08 addi r3,r1,8 ffc07f34: 48 00 1c 8d bl ffc09bc0 <_TOD_Get> ts.tv_sec += delta->tv_sec; ts.tv_nsec += delta->tv_usec * TOD_NANOSECONDS_PER_MICROSECOND; ffc07f38: 81 3f 00 04 lwz r9,4(r31) ffc07f3c: 80 01 00 0c lwz r0,12(r1) /* if adjustment is too much positive */ while ( ts.tv_nsec >= TOD_NANOSECONDS_PER_SECOND ) { ffc07f40: 3d 60 3b 9a lis r11,15258 _Thread_Disable_dispatch(); _TOD_Get( &ts ); ts.tv_sec += delta->tv_sec; ts.tv_nsec += delta->tv_usec * TOD_NANOSECONDS_PER_MICROSECOND; ffc07f44: 1d 29 03 e8 mulli r9,r9,1000 ffc07f48: 81 41 00 08 lwz r10,8(r1) ffc07f4c: 7d 29 02 14 add r9,r9,r0 _Thread_Disable_dispatch(); _TOD_Get( &ts ); ts.tv_sec += delta->tv_sec; ffc07f50: 80 1f 00 00 lwz r0,0(r31) ts.tv_nsec += delta->tv_usec * TOD_NANOSECONDS_PER_MICROSECOND; /* if adjustment is too much positive */ while ( ts.tv_nsec >= TOD_NANOSECONDS_PER_SECOND ) { ffc07f54: 61 6b ca 00 ori r11,r11,51712 ffc07f58: 7d 69 5b 96 divwu r11,r9,r11 ffc07f5c: 39 6b 00 01 addi r11,r11,1 _Thread_Disable_dispatch(); _TOD_Get( &ts ); ts.tv_sec += delta->tv_sec; ts.tv_nsec += delta->tv_usec * TOD_NANOSECONDS_PER_MICROSECOND; ffc07f60: 7d 4a 02 14 add r10,r10,r0 /* if adjustment is too much positive */ while ( ts.tv_nsec >= TOD_NANOSECONDS_PER_SECOND ) { ffc07f64: 7d 69 03 a6 mtctr r11 ffc07f68: 48 00 00 08 b ffc07f70 ffc07f6c: 39 28 36 00 addi r9,r8,13824 ffc07f70: 7d 4b 53 78 mr r11,r10 ffc07f74: 3d 09 c4 65 addis r8,r9,-15259 ffc07f78: 39 4a 00 01 addi r10,r10,1 ffc07f7c: 42 00 ff f0 bdnz+ ffc07f6c 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) ) { ffc07f80: 3d 40 c4 65 lis r10,-15259 ffc07f84: 61 4a 36 00 ori r10,r10,13824 ffc07f88: 48 00 00 08 b ffc07f90 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 ) { ffc07f8c: 39 28 ca 00 addi r9,r8,-13824 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) ) { ffc07f90: 7f 89 50 40 cmplw cr7,r9,r10 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 ) { ffc07f94: 7d 60 5b 78 mr r0,r11 ffc07f98: 3d 09 3b 9b addis r8,r9,15259 ffc07f9c: 39 6b ff ff addi r11,r11,-1 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) ) { ffc07fa0: 40 9d ff ec ble+ cr7,ffc07f8c ffc07fa4: 7c 23 0b 78 mr r3,r1 ffc07fa8: 91 21 00 0c stw r9,12(r1) ffc07fac: 94 03 00 08 stwu r0,8(r3) ts.tv_nsec += TOD_NANOSECONDS_PER_SECOND; ts.tv_sec--; } _TOD_Set( &ts ); ffc07fb0: 48 00 1c ed bl ffc09c9c <_TOD_Set> _Thread_Enable_dispatch(); ffc07fb4: 48 00 32 fd bl ffc0b2b0 <_Thread_Enable_dispatch> /* set the user's output */ if ( olddelta ) ffc07fb8: 2f 9e 00 00 cmpwi cr7,r30,0 ffc07fbc: 41 9e 00 1c beq- cr7,ffc07fd8 <== NEVER TAKEN *olddelta = *delta; ffc07fc0: 81 3f 00 00 lwz r9,0(r31) ffc07fc4: 38 60 00 00 li r3,0 ffc07fc8: 81 5f 00 04 lwz r10,4(r31) ffc07fcc: 91 3e 00 00 stw r9,0(r30) ffc07fd0: 91 5e 00 04 stw r10,4(r30) ffc07fd4: 48 00 00 08 b ffc07fdc ffc07fd8: 38 60 00 00 li r3,0 return 0; } ffc07fdc: 80 01 00 24 lwz r0,36(r1) ffc07fe0: 83 c1 00 18 lwz r30,24(r1) ffc07fe4: 7c 08 03 a6 mtlr r0 ffc07fe8: 83 e1 00 1c lwz r31,28(r1) ffc07fec: 38 21 00 20 addi r1,r1,32 ffc07ff0: 4e 80 00 20 blr =============================================================================== ffc07d88 : int clock_gettime( clockid_t clock_id, struct timespec *tp ) { if ( !tp ) ffc07d88: 2c 04 00 00 cmpwi r4,0 int clock_gettime( clockid_t clock_id, struct timespec *tp ) { ffc07d8c: 94 21 ff f8 stwu r1,-8(r1) ffc07d90: 7c 08 02 a6 mflr r0 ffc07d94: 90 01 00 0c stw r0,12(r1) if ( !tp ) ffc07d98: 41 82 00 4c beq- ffc07de4 rtems_set_errno_and_return_minus_one( EINVAL ); if ( clock_id == CLOCK_REALTIME ) { ffc07d9c: 2f 83 00 01 cmpwi cr7,r3,1 ffc07da0: 40 be 00 10 bne+ cr7,ffc07db0 _TOD_Get(tp); ffc07da4: 7c 83 23 78 mr r3,r4 ffc07da8: 48 00 25 a1 bl ffc0a348 <_TOD_Get> ffc07dac: 48 00 00 1c b ffc07dc8 return 0; } #ifdef CLOCK_MONOTONIC if ( clock_id == CLOCK_MONOTONIC ) { ffc07db0: 2f 83 00 04 cmpwi cr7,r3,4 ffc07db4: 41 9e 00 0c beq- cr7,ffc07dc0 <== NEVER TAKEN return 0; } #endif #ifdef _POSIX_CPUTIME if ( clock_id == CLOCK_PROCESS_CPUTIME ) { ffc07db8: 2f 83 00 02 cmpwi cr7,r3,2 ffc07dbc: 40 be 00 14 bne+ cr7,ffc07dd0 _TOD_Get_uptime_as_timespec( tp ); ffc07dc0: 7c 83 23 78 mr r3,r4 ffc07dc4: 48 00 26 29 bl ffc0a3ec <_TOD_Get_uptime_as_timespec> ffc07dc8: 38 60 00 00 li r3,0 return 0; ffc07dcc: 48 00 00 28 b ffc07df4 } #endif #ifdef _POSIX_THREAD_CPUTIME if ( clock_id == CLOCK_THREAD_CPUTIME ) ffc07dd0: 2f 83 00 03 cmpwi cr7,r3,3 ffc07dd4: 40 be 00 10 bne+ cr7,ffc07de4 rtems_set_errno_and_return_minus_one( ENOSYS ); ffc07dd8: 48 00 b1 d5 bl ffc12fac <__errno> ffc07ddc: 38 00 00 58 li r0,88 ffc07de0: 48 00 00 0c b ffc07dec #endif rtems_set_errno_and_return_minus_one( EINVAL ); ffc07de4: 48 00 b1 c9 bl ffc12fac <__errno> ffc07de8: 38 00 00 16 li r0,22 ffc07dec: 90 03 00 00 stw r0,0(r3) ffc07df0: 38 60 ff ff li r3,-1 return 0; } ffc07df4: 80 01 00 0c lwz r0,12(r1) ffc07df8: 38 21 00 08 addi r1,r1,8 ffc07dfc: 7c 08 03 a6 mtlr r0 ffc07e00: 4e 80 00 20 blr =============================================================================== ffc07e04 : int clock_settime( clockid_t clock_id, const struct timespec *tp ) { if ( !tp ) ffc07e04: 2c 04 00 00 cmpwi r4,0 int clock_settime( clockid_t clock_id, const struct timespec *tp ) { ffc07e08: 94 21 ff f8 stwu r1,-8(r1) ffc07e0c: 7c 08 02 a6 mflr r0 ffc07e10: 90 01 00 0c stw r0,12(r1) if ( !tp ) ffc07e14: 41 82 00 60 beq- ffc07e74 <== NEVER TAKEN rtems_set_errno_and_return_minus_one( EINVAL ); if ( clock_id == CLOCK_REALTIME ) { ffc07e18: 2f 83 00 01 cmpwi cr7,r3,1 ffc07e1c: 40 be 00 3c bne+ cr7,ffc07e58 if ( tp->tv_sec < TOD_SECONDS_1970_THROUGH_1988 ) ffc07e20: 81 24 00 00 lwz r9,0(r4) ffc07e24: 3c 00 21 da lis r0,8666 ffc07e28: 60 00 e4 ff ori r0,r0,58623 ffc07e2c: 7f 89 00 40 cmplw cr7,r9,r0 ffc07e30: 40 9d 00 44 ble- cr7,ffc07e74 rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; ffc07e34: 3d 20 00 00 lis r9,0 ffc07e38: 81 69 28 00 lwz r11,10240(r9) ffc07e3c: 38 0b 00 01 addi r0,r11,1 ffc07e40: 90 09 28 00 stw r0,10240(r9) rtems_set_errno_and_return_minus_one( EINVAL ); _Thread_Disable_dispatch(); _TOD_Set( tp ); ffc07e44: 7c 83 23 78 mr r3,r4 ffc07e48: 48 00 26 1d bl ffc0a464 <_TOD_Set> _Thread_Enable_dispatch(); ffc07e4c: 48 00 3c 2d bl ffc0ba78 <_Thread_Enable_dispatch> ffc07e50: 38 60 00 00 li r3,0 rtems_set_errno_and_return_minus_one( ENOSYS ); #endif else rtems_set_errno_and_return_minus_one( EINVAL ); return 0; ffc07e54: 48 00 00 30 b ffc07e84 _Thread_Disable_dispatch(); _TOD_Set( tp ); _Thread_Enable_dispatch(); } #ifdef _POSIX_CPUTIME else if ( clock_id == CLOCK_PROCESS_CPUTIME ) ffc07e58: 2f 83 00 02 cmpwi cr7,r3,2 ffc07e5c: 41 9e 00 0c beq- cr7,ffc07e68 rtems_set_errno_and_return_minus_one( ENOSYS ); #endif #ifdef _POSIX_THREAD_CPUTIME else if ( clock_id == CLOCK_THREAD_CPUTIME ) ffc07e60: 2f 83 00 03 cmpwi cr7,r3,3 ffc07e64: 40 be 00 10 bne+ cr7,ffc07e74 rtems_set_errno_and_return_minus_one( ENOSYS ); ffc07e68: 48 00 b1 45 bl ffc12fac <__errno> ffc07e6c: 38 00 00 58 li r0,88 ffc07e70: 48 00 00 0c b ffc07e7c #endif else rtems_set_errno_and_return_minus_one( EINVAL ); ffc07e74: 48 00 b1 39 bl ffc12fac <__errno> ffc07e78: 38 00 00 16 li r0,22 ffc07e7c: 90 03 00 00 stw r0,0(r3) ffc07e80: 38 60 ff ff li r3,-1 return 0; } ffc07e84: 80 01 00 0c lwz r0,12(r1) ffc07e88: 38 21 00 08 addi r1,r1,8 ffc07e8c: 7c 08 03 a6 mtlr r0 ffc07e90: 4e 80 00 20 blr =============================================================================== ffc1d9a4 : int nanosleep( const struct timespec *rqtp, struct timespec *rmtp ) { ffc1d9a4: 94 21 ff e8 stwu r1,-24(r1) ffc1d9a8: 7d 80 00 26 mfcr r12 ffc1d9ac: 7c 08 02 a6 mflr r0 ffc1d9b0: 93 c1 00 10 stw r30,16(r1) ffc1d9b4: 7c 9e 23 78 mr r30,r4 ffc1d9b8: 93 e1 00 14 stw r31,20(r1) ffc1d9bc: 7c 7f 1b 78 mr r31,r3 ffc1d9c0: 90 01 00 1c stw r0,28(r1) ffc1d9c4: 93 a1 00 0c stw r29,12(r1) ffc1d9c8: 91 81 00 08 stw r12,8(r1) Watchdog_Interval ticks; if ( !_Timespec_Is_valid( rqtp ) ) ffc1d9cc: 48 00 01 a5 bl ffc1db70 <_Timespec_Is_valid> ffc1d9d0: 2f 83 00 00 cmpwi cr7,r3,0 ffc1d9d4: 41 9e 00 1c beq- cr7,ffc1d9f0 * 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 ) ffc1d9d8: 80 1f 00 00 lwz r0,0(r31) ffc1d9dc: 2f 80 00 00 cmpwi cr7,r0,0 ffc1d9e0: 41 9c 00 10 blt- cr7,ffc1d9f0 <== NEVER TAKEN ffc1d9e4: 80 1f 00 04 lwz r0,4(r31) ffc1d9e8: 2f 80 00 00 cmpwi cr7,r0,0 ffc1d9ec: 40 bc 00 10 bge+ cr7,ffc1d9fc <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one( EINVAL ); ffc1d9f0: 4b ff 48 0d bl ffc121fc <__errno> ffc1d9f4: 38 00 00 16 li r0,22 ffc1d9f8: 48 00 00 d4 b ffc1dacc ticks = _Timespec_To_ticks( rqtp ); ffc1d9fc: 7f e3 fb 78 mr r3,r31 ffc1da00: 4b ff 1d 51 bl ffc0f750 <_Timespec_To_ticks> ffc1da04: 2e 1e 00 00 cmpwi cr4,r30,0 * 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 ) { ffc1da08: 7c 7f 1b 79 mr. r31,r3 ffc1da0c: 3d 20 00 00 lis r9,0 ffc1da10: 40 82 00 2c bne- ffc1da3c rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; ffc1da14: 81 69 27 d0 lwz r11,10192(r9) ffc1da18: 38 0b 00 01 addi r0,r11,1 ffc1da1c: 90 09 27 d0 stw r0,10192(r9) _Thread_Disable_dispatch(); _Thread_Yield_processor(); ffc1da20: 4b fe e0 95 bl ffc0bab4 <_Thread_Yield_processor> _Thread_Enable_dispatch(); ffc1da24: 4b fe d0 d5 bl ffc0aaf8 <_Thread_Enable_dispatch> if ( rmtp ) { ffc1da28: 41 92 00 b0 beq- cr4,ffc1dad8 rmtp->tv_sec = 0; rmtp->tv_nsec = 0; ffc1da2c: 93 fe 00 04 stw r31,4(r30) ffc1da30: 38 60 00 00 li r3,0 if ( !ticks ) { _Thread_Disable_dispatch(); _Thread_Yield_processor(); _Thread_Enable_dispatch(); if ( rmtp ) { rmtp->tv_sec = 0; ffc1da34: 93 fe 00 00 stw r31,0(r30) ffc1da38: 48 00 00 a4 b ffc1dadc ffc1da3c: 81 69 27 d0 lwz r11,10192(r9) ffc1da40: 38 0b 00 01 addi r0,r11,1 ffc1da44: 90 09 27 d0 stw r0,10192(r9) /* * Block for the desired amount of time */ _Thread_Disable_dispatch(); _Thread_Set_state( ffc1da48: 3f a0 00 00 lis r29,0 ffc1da4c: 80 7d 28 10 lwz r3,10256(r29) ffc1da50: 3c 80 10 00 lis r4,4096 ffc1da54: 60 84 00 08 ori r4,r4,8 ffc1da58: 4b fe db 39 bl ffc0b590 <_Thread_Set_state> _Thread_Executing, STATES_DELAYING | STATES_INTERRUPTIBLE_BY_SIGNAL ); _Watchdog_Initialize( &_Thread_Executing->Timer, ffc1da5c: 81 3d 28 10 lwz r9,10256(r29) Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; ffc1da60: 3d 40 ff c1 lis r10,-63 _Thread_Disable_dispatch(); _Thread_Set_state( _Thread_Executing, STATES_DELAYING | STATES_INTERRUPTIBLE_BY_SIGNAL ); _Watchdog_Initialize( ffc1da64: 81 69 00 08 lwz r11,8(r9) Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; ffc1da68: 38 00 00 00 li r0,0 the_watchdog->routine = routine; ffc1da6c: 39 4a a8 bc addi r10,r10,-22340 the_watchdog->id = id; the_watchdog->user_data = user_data; ffc1da70: 90 09 00 6c stw r0,108(r9) ) { the_watchdog->initial = units; _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); ffc1da74: 3c 60 00 00 lis r3,0 Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; ffc1da78: 91 49 00 64 stw r10,100(r9) ) { the_watchdog->initial = units; _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); ffc1da7c: 38 63 2d c8 addi r3,r3,11720 ffc1da80: 38 89 00 48 addi r4,r9,72 void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; the_watchdog->id = id; ffc1da84: 91 69 00 68 stw r11,104(r9) Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; ffc1da88: 90 09 00 50 stw r0,80(r9) Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; ffc1da8c: 93 e9 00 54 stw r31,84(r9) _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); ffc1da90: 4b fe e6 c5 bl ffc0c154 <_Watchdog_Insert> _Thread_Delay_ended, _Thread_Executing->Object.id, NULL ); _Watchdog_Insert_ticks( &_Thread_Executing->Timer, ticks ); _Thread_Enable_dispatch(); ffc1da94: 4b fe d0 65 bl ffc0aaf8 <_Thread_Enable_dispatch> /* calculate time remaining */ if ( rmtp ) { ffc1da98: 41 92 00 40 beq- cr4,ffc1dad8 ticks -= _Thread_Executing->Timer.stop_time - _Thread_Executing->Timer.start_time; ffc1da9c: 81 3d 28 10 lwz r9,10256(r29) _Timespec_From_ticks( ticks, rmtp ); ffc1daa0: 7f c4 f3 78 mr r4,r30 _Thread_Enable_dispatch(); /* calculate time remaining */ if ( rmtp ) { ticks -= ffc1daa4: 80 09 00 60 lwz r0,96(r9) ffc1daa8: 81 29 00 5c lwz r9,92(r9) ffc1daac: 7c 00 48 50 subf r0,r0,r9 ffc1dab0: 7f e0 fa 14 add r31,r0,r31 _Thread_Executing->Timer.stop_time - _Thread_Executing->Timer.start_time; _Timespec_From_ticks( ticks, rmtp ); ffc1dab4: 7f e3 fb 78 mr r3,r31 ffc1dab8: 48 00 00 89 bl ffc1db40 <_Timespec_From_ticks> */ #if defined(RTEMS_POSIX_API) /* * If there is time remaining, then we were interrupted by a signal. */ if ( ticks ) ffc1dabc: 2f 9f 00 00 cmpwi cr7,r31,0 ffc1dac0: 41 be 00 18 beq+ cr7,ffc1dad8 rtems_set_errno_and_return_minus_one( EINTR ); ffc1dac4: 4b ff 47 39 bl ffc121fc <__errno> ffc1dac8: 38 00 00 04 li r0,4 ffc1dacc: 90 03 00 00 stw r0,0(r3) ffc1dad0: 38 60 ff ff li r3,-1 ffc1dad4: 48 00 00 08 b ffc1dadc ffc1dad8: 38 60 00 00 li r3,0 #endif } return 0; } ffc1dadc: 80 01 00 1c lwz r0,28(r1) ffc1dae0: 81 81 00 08 lwz r12,8(r1) ffc1dae4: 7c 08 03 a6 mtlr r0 ffc1dae8: 83 a1 00 0c lwz r29,12(r1) ffc1daec: 83 c1 00 10 lwz r30,16(r1) ffc1daf0: 7d 80 81 20 mtcrf 8,r12 ffc1daf4: 83 e1 00 14 lwz r31,20(r1) ffc1daf8: 38 21 00 18 addi r1,r1,24 ffc1dafc: 4e 80 00 20 blr =============================================================================== ffc0ceb4 : int pthread_attr_setschedpolicy( pthread_attr_t *attr, int policy ) { if ( !attr || !attr->is_initialized ) ffc0ceb4: 2c 03 00 00 cmpwi r3,0 ffc0ceb8: 41 82 00 3c beq- ffc0cef4 ffc0cebc: 80 03 00 00 lwz r0,0(r3) ffc0cec0: 2f 80 00 00 cmpwi cr7,r0,0 ffc0cec4: 41 9e 00 30 beq- cr7,ffc0cef4 return EINVAL; switch ( policy ) { ffc0cec8: 2b 84 00 04 cmplwi cr7,r4,4 ffc0cecc: 41 9d 00 14 bgt- cr7,ffc0cee0 ffc0ced0: 38 00 00 01 li r0,1 ffc0ced4: 7c 00 20 30 slw r0,r0,r4 ffc0ced8: 70 09 00 17 andi. r9,r0,23 ffc0cedc: 40 82 00 0c bne- ffc0cee8 <== ALWAYS TAKEN ffc0cee0: 38 60 00 86 li r3,134 ffc0cee4: 4e 80 00 20 blr case SCHED_OTHER: case SCHED_FIFO: case SCHED_RR: case SCHED_SPORADIC: attr->schedpolicy = policy; ffc0cee8: 90 83 00 14 stw r4,20(r3) ffc0ceec: 38 60 00 00 li r3,0 return 0; ffc0cef0: 4e 80 00 20 blr ffc0cef4: 38 60 00 16 li r3,22 default: return ENOTSUP; } } ffc0cef8: 4e 80 00 20 blr =============================================================================== ffc08520 : int pthread_barrier_init( pthread_barrier_t *barrier, const pthread_barrierattr_t *attr, unsigned int count ) { ffc08520: 94 21 ff d8 stwu r1,-40(r1) ffc08524: 7c 08 02 a6 mflr r0 ffc08528: 93 e1 00 24 stw r31,36(r1) const pthread_barrierattr_t *the_attr; /* * Error check parameters */ if ( !barrier ) ffc0852c: 7c 7f 1b 79 mr. r31,r3 int pthread_barrier_init( pthread_barrier_t *barrier, const pthread_barrierattr_t *attr, unsigned int count ) { ffc08530: 93 c1 00 20 stw r30,32(r1) ffc08534: 7c be 2b 78 mr r30,r5 ffc08538: 90 01 00 2c stw r0,44(r1) ffc0853c: 93 81 00 18 stw r28,24(r1) ffc08540: 93 a1 00 1c stw r29,28(r1) const pthread_barrierattr_t *the_attr; /* * Error check parameters */ if ( !barrier ) ffc08544: 41 82 00 a8 beq- ffc085ec return EINVAL; if ( count == 0 ) ffc08548: 2f 85 00 00 cmpwi cr7,r5,0 ffc0854c: 41 9e 00 a0 beq- cr7,ffc085ec return EINVAL; /* * If the user passed in NULL, use the default attributes */ if ( attr ) { ffc08550: 2f 84 00 00 cmpwi cr7,r4,0 ffc08554: 7c 9d 23 78 mr r29,r4 ffc08558: 40 be 00 10 bne+ cr7,ffc08568 the_attr = attr; } else { (void) pthread_barrierattr_init( &my_attr ); ffc0855c: 3b a1 00 10 addi r29,r1,16 ffc08560: 7f a3 eb 78 mr r3,r29 ffc08564: 4b ff fe cd bl ffc08430 } /* * Now start error checking the attributes that we are going to use */ if ( !the_attr->is_initialized ) ffc08568: 80 1d 00 00 lwz r0,0(r29) ffc0856c: 2f 80 00 00 cmpwi cr7,r0,0 ffc08570: 41 9e 00 7c beq- cr7,ffc085ec return EINVAL; switch ( the_attr->process_shared ) { ffc08574: 83 bd 00 04 lwz r29,4(r29) ffc08578: 2f 9d 00 00 cmpwi cr7,r29,0 ffc0857c: 40 9e 00 70 bne- cr7,ffc085ec <== NEVER TAKEN rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; ffc08580: 3d 20 00 00 lis r9,0 /* * Convert from POSIX attributes to Core Barrier attributes */ the_attributes.discipline = CORE_BARRIER_AUTOMATIC_RELEASE; the_attributes.maximum_count = count; ffc08584: 93 c1 00 0c stw r30,12(r1) ffc08588: 81 69 27 bc lwz r11,10172(r9) } /* * Convert from POSIX attributes to Core Barrier attributes */ the_attributes.discipline = CORE_BARRIER_AUTOMATIC_RELEASE; ffc0858c: 93 a1 00 08 stw r29,8(r1) ffc08590: 38 0b 00 01 addi r0,r11,1 ffc08594: 90 09 27 bc stw r0,10172(r9) * 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 *) ffc08598: 3f 80 00 00 lis r28,0 ffc0859c: 3b 9c 2f f8 addi r28,r28,12280 ffc085a0: 7f 83 e3 78 mr r3,r28 ffc085a4: 48 00 26 b1 bl ffc0ac54 <_Objects_Allocate> */ _Thread_Disable_dispatch(); /* prevents deletion */ the_barrier = _POSIX_Barrier_Allocate(); if ( !the_barrier ) { ffc085a8: 7c 7e 1b 79 mr. r30,r3 ffc085ac: 40 a2 00 10 bne+ ffc085bc _Thread_Enable_dispatch(); ffc085b0: 48 00 37 61 bl ffc0bd10 <_Thread_Enable_dispatch> ffc085b4: 38 60 00 0b li r3,11 return EAGAIN; ffc085b8: 48 00 00 38 b ffc085f0 } _CORE_barrier_Initialize( &the_barrier->Barrier, &the_attributes ); ffc085bc: 38 7e 00 10 addi r3,r30,16 ffc085c0: 38 81 00 08 addi r4,r1,8 ffc085c4: 48 00 1c 19 bl ffc0a1dc <_CORE_barrier_Initialize> #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; ffc085c8: 80 1e 00 08 lwz r0,8(r30) ffc085cc: 81 7c 00 1c lwz r11,28(r28) ffc085d0: 54 09 13 ba rlwinm r9,r0,2,14,29 ffc085d4: 7f cb 49 2e stwx r30,r11,r9 _Objects_Get_index( the_object->id ), the_object ); /* ASSERT: information->is_string == false */ the_object->name.name_u32 = name; ffc085d8: 93 be 00 0c stw r29,12(r30) ); /* * Exit the critical section and return the user an operational barrier */ *barrier = the_barrier->Object.id; ffc085dc: 90 1f 00 00 stw r0,0(r31) _Thread_Enable_dispatch(); ffc085e0: 48 00 37 31 bl ffc0bd10 <_Thread_Enable_dispatch> ffc085e4: 38 60 00 00 li r3,0 return 0; ffc085e8: 48 00 00 08 b ffc085f0 ffc085ec: 38 60 00 16 li r3,22 } ffc085f0: 80 01 00 2c lwz r0,44(r1) ffc085f4: 83 81 00 18 lwz r28,24(r1) ffc085f8: 7c 08 03 a6 mtlr r0 ffc085fc: 83 a1 00 1c lwz r29,28(r1) ffc08600: 83 c1 00 20 lwz r30,32(r1) ffc08604: 83 e1 00 24 lwz r31,36(r1) ffc08608: 38 21 00 28 addi r1,r1,40 ffc0860c: 4e 80 00 20 blr =============================================================================== ffc07b08 : void pthread_cleanup_push( void (*routine)( void * ), void *arg ) { ffc07b08: 94 21 ff f0 stwu r1,-16(r1) ffc07b0c: 7c 08 02 a6 mflr r0 ffc07b10: 93 c1 00 08 stw r30,8(r1) /* * 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 ) ffc07b14: 7c 7e 1b 79 mr. r30,r3 void pthread_cleanup_push( void (*routine)( void * ), void *arg ) { ffc07b18: 93 e1 00 0c stw r31,12(r1) ffc07b1c: 7c 9f 23 78 mr r31,r4 ffc07b20: 90 01 00 14 stw r0,20(r1) /* * 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 ) ffc07b24: 41 82 00 48 beq- ffc07b6c rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; ffc07b28: 3d 20 00 00 lis r9,0 ffc07b2c: 81 69 27 94 lwz r11,10132(r9) ffc07b30: 38 0b 00 01 addi r0,r11,1 ffc07b34: 90 09 27 94 stw r0,10132(r9) return; _Thread_Disable_dispatch(); handler = _Workspace_Allocate( sizeof( POSIX_Cancel_Handler_control ) ); ffc07b38: 38 60 00 10 li r3,16 ffc07b3c: 48 00 51 b5 bl ffc0ccf0 <_Workspace_Allocate> if ( handler ) { ffc07b40: 7c 69 1b 79 mr. r9,r3 ffc07b44: 41 82 00 24 beq- ffc07b68 <== NEVER TAKEN thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; handler_stack = &thread_support->Cancellation_Handlers; ffc07b48: 3d 60 00 00 lis r11,0 handler->routine = routine; ffc07b4c: 93 c9 00 08 stw r30,8(r9) handler->arg = arg; _Chain_Append( handler_stack, &handler->Node ); ffc07b50: 7d 24 4b 78 mr r4,r9 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; ffc07b54: 81 6b 27 d4 lwz r11,10196(r11) ffc07b58: 80 6b 01 48 lwz r3,328(r11) handler->routine = routine; handler->arg = arg; ffc07b5c: 93 e9 00 0c stw r31,12(r9) _Chain_Append( handler_stack, &handler->Node ); ffc07b60: 38 63 00 e0 addi r3,r3,224 ffc07b64: 48 00 1d 65 bl ffc098c8 <_Chain_Append> } _Thread_Enable_dispatch(); ffc07b68: 48 00 38 25 bl ffc0b38c <_Thread_Enable_dispatch> } ffc07b6c: 80 01 00 14 lwz r0,20(r1) ffc07b70: 83 c1 00 08 lwz r30,8(r1) ffc07b74: 7c 08 03 a6 mtlr r0 ffc07b78: 83 e1 00 0c lwz r31,12(r1) ffc07b7c: 38 21 00 10 addi r1,r1,16 ffc07b80: 4e 80 00 20 blr =============================================================================== ffc08fb8 : int pthread_cond_init( pthread_cond_t *cond, const pthread_condattr_t *attr ) { ffc08fb8: 94 21 ff e8 stwu r1,-24(r1) ffc08fbc: 7c 08 02 a6 mflr r0 ffc08fc0: 93 c1 00 10 stw r30,16(r1) POSIX_Condition_variables_Control *the_cond; const pthread_condattr_t *the_attr; if ( attr ) the_attr = attr; ffc08fc4: 7c 9e 23 79 mr. r30,r4 int pthread_cond_init( pthread_cond_t *cond, const pthread_condattr_t *attr ) { ffc08fc8: 93 81 00 08 stw r28,8(r1) ffc08fcc: 7c 7c 1b 78 mr r28,r3 ffc08fd0: 90 01 00 1c stw r0,28(r1) ffc08fd4: 93 a1 00 0c stw r29,12(r1) ffc08fd8: 93 e1 00 14 stw r31,20(r1) POSIX_Condition_variables_Control *the_cond; const pthread_condattr_t *the_attr; if ( attr ) the_attr = attr; ffc08fdc: 40 a2 00 0c bne+ ffc08fe8 ffc08fe0: 3f c0 00 00 lis r30,0 ffc08fe4: 3b de 27 08 addi r30,r30,9992 /* * Be careful about attributes when global!!! */ if ( the_attr->process_shared == PTHREAD_PROCESS_SHARED ) ffc08fe8: 80 1e 00 04 lwz r0,4(r30) ffc08fec: 2f 80 00 01 cmpwi cr7,r0,1 ffc08ff0: 41 9e 00 8c beq- cr7,ffc0907c <== NEVER TAKEN return EINVAL; if ( !the_attr->is_initialized ) ffc08ff4: 80 1e 00 00 lwz r0,0(r30) ffc08ff8: 2f 80 00 00 cmpwi cr7,r0,0 ffc08ffc: 41 be 00 80 beq+ cr7,ffc0907c rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; ffc09000: 3d 20 00 00 lis r9,0 ffc09004: 81 69 27 c8 lwz r11,10184(r9) ffc09008: 38 0b 00 01 addi r0,r11,1 ffc0900c: 90 09 27 c8 stw r0,10184(r9) */ RTEMS_INLINE_ROUTINE POSIX_Condition_variables_Control *_POSIX_Condition_variables_Allocate( void ) { return (POSIX_Condition_variables_Control *) ffc09010: 3f a0 00 00 lis r29,0 ffc09014: 3b bd 30 90 addi r29,r29,12432 ffc09018: 7f a3 eb 78 mr r3,r29 ffc0901c: 48 00 2e c1 bl ffc0bedc <_Objects_Allocate> _Thread_Disable_dispatch(); the_cond = _POSIX_Condition_variables_Allocate(); if ( !the_cond ) { ffc09020: 7c 7f 1b 79 mr. r31,r3 ffc09024: 40 a2 00 10 bne+ ffc09034 _Thread_Enable_dispatch(); ffc09028: 48 00 3f 71 bl ffc0cf98 <_Thread_Enable_dispatch> ffc0902c: 38 60 00 0c li r3,12 return ENOMEM; ffc09030: 48 00 00 50 b ffc09080 } the_cond->process_shared = the_attr->process_shared; ffc09034: 80 1e 00 04 lwz r0,4(r30) the_cond->Mutex = POSIX_CONDITION_VARIABLES_NO_MUTEX; ffc09038: 3b c0 00 00 li r30,0 ffc0903c: 93 df 00 14 stw r30,20(r31) /* XXX some more initialization might need to go here */ _Thread_queue_Initialize( ffc09040: 38 7f 00 18 addi r3,r31,24 ffc09044: 38 80 00 00 li r4,0 if ( !the_cond ) { _Thread_Enable_dispatch(); return ENOMEM; } the_cond->process_shared = the_attr->process_shared; ffc09048: 90 1f 00 10 stw r0,16(r31) the_cond->Mutex = POSIX_CONDITION_VARIABLES_NO_MUTEX; /* XXX some more initialization might need to go here */ _Thread_queue_Initialize( ffc0904c: 38 a0 08 00 li r5,2048 ffc09050: 38 c0 00 74 li r6,116 ffc09054: 48 00 48 dd bl ffc0d930 <_Thread_queue_Initialize> #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; ffc09058: 80 1f 00 08 lwz r0,8(r31) ffc0905c: 81 7d 00 1c lwz r11,28(r29) ffc09060: 54 09 13 ba rlwinm r9,r0,2,14,29 ffc09064: 7f eb 49 2e stwx r31,r11,r9 _Objects_Get_index( the_object->id ), the_object ); /* ASSERT: information->is_string == false */ the_object->name.name_u32 = name; ffc09068: 93 df 00 0c stw r30,12(r31) &_POSIX_Condition_variables_Information, &the_cond->Object, 0 ); *cond = the_cond->Object.id; ffc0906c: 90 1c 00 00 stw r0,0(r28) _Thread_Enable_dispatch(); ffc09070: 48 00 3f 29 bl ffc0cf98 <_Thread_Enable_dispatch> ffc09074: 38 60 00 00 li r3,0 return 0; ffc09078: 48 00 00 08 b ffc09080 ffc0907c: 38 60 00 16 li r3,22 } ffc09080: 80 01 00 1c lwz r0,28(r1) ffc09084: 83 81 00 08 lwz r28,8(r1) ffc09088: 7c 08 03 a6 mtlr r0 ffc0908c: 83 a1 00 0c lwz r29,12(r1) ffc09090: 83 c1 00 10 lwz r30,16(r1) ffc09094: 83 e1 00 14 lwz r31,20(r1) ffc09098: 38 21 00 18 addi r1,r1,24 ffc0909c: 4e 80 00 20 blr =============================================================================== ffc08dec : int pthread_condattr_destroy( pthread_condattr_t *attr ) { if ( !attr || attr->is_initialized == false ) ffc08dec: 2c 03 00 00 cmpwi r3,0 ffc08df0: 41 82 00 20 beq- ffc08e10 ffc08df4: 80 03 00 00 lwz r0,0(r3) ffc08df8: 2f 80 00 00 cmpwi cr7,r0,0 ffc08dfc: 41 9e 00 14 beq- cr7,ffc08e10 <== NEVER TAKEN return EINVAL; attr->is_initialized = false; ffc08e00: 38 00 00 00 li r0,0 ffc08e04: 90 03 00 00 stw r0,0(r3) ffc08e08: 38 60 00 00 li r3,0 return 0; ffc08e0c: 4e 80 00 20 blr ffc08e10: 38 60 00 16 li r3,22 } ffc08e14: 4e 80 00 20 blr =============================================================================== ffc080ec : pthread_t *thread, const pthread_attr_t *attr, void *(*start_routine)( void * ), void *arg ) { ffc080ec: 94 21 ff 80 stwu r1,-128(r1) ffc080f0: 7c 08 02 a6 mflr r0 ffc080f4: 93 01 00 60 stw r24,96(r1) int schedpolicy = SCHED_RR; struct sched_param schedparam; Objects_Name name; int rc; if ( !start_routine ) ffc080f8: 7c b8 2b 79 mr. r24,r5 pthread_t *thread, const pthread_attr_t *attr, void *(*start_routine)( void * ), void *arg ) { ffc080fc: 93 21 00 64 stw r25,100(r1) ffc08100: 7c d9 33 78 mr r25,r6 ffc08104: 93 41 00 68 stw r26,104(r1) ffc08108: 7c 7a 1b 78 mr r26,r3 ffc0810c: 93 c1 00 78 stw r30,120(r1) int schedpolicy = SCHED_RR; struct sched_param schedparam; Objects_Name name; int rc; if ( !start_routine ) ffc08110: 3b c0 00 0e li r30,14 pthread_t *thread, const pthread_attr_t *attr, void *(*start_routine)( void * ), void *arg ) { ffc08114: 90 01 00 84 stw r0,132(r1) ffc08118: 92 a1 00 54 stw r21,84(r1) ffc0811c: 92 c1 00 58 stw r22,88(r1) ffc08120: 92 e1 00 5c stw r23,92(r1) ffc08124: 93 61 00 6c stw r27,108(r1) ffc08128: 93 81 00 70 stw r28,112(r1) ffc0812c: 93 a1 00 74 stw r29,116(r1) ffc08130: 93 e1 00 7c stw r31,124(r1) int schedpolicy = SCHED_RR; struct sched_param schedparam; Objects_Name name; int rc; if ( !start_routine ) ffc08134: 41 82 02 80 beq- ffc083b4 return EFAULT; the_attr = (attr) ? attr : &_POSIX_Threads_Default_attributes; ffc08138: 2f 84 00 00 cmpwi cr7,r4,0 ffc0813c: 7c 9f 23 78 mr r31,r4 ffc08140: 40 be 00 0c bne+ cr7,ffc0814c ffc08144: 3f e0 ff c2 lis r31,-62 ffc08148: 3b ff f4 e4 addi r31,r31,-2844 if ( !the_attr->is_initialized ) ffc0814c: 80 1f 00 00 lwz r0,0(r31) ffc08150: 2f 80 00 00 cmpwi cr7,r0,0 ffc08154: 41 9e 02 5c beq- cr7,ffc083b0 * 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) ) ffc08158: 80 1f 00 04 lwz r0,4(r31) ffc0815c: 2f 80 00 00 cmpwi cr7,r0,0 ffc08160: 41 9e 00 18 beq- cr7,ffc08178 ffc08164: 3d 20 00 00 lis r9,0 ffc08168: 80 09 26 c8 lwz r0,9928(r9) ffc0816c: 81 3f 00 08 lwz r9,8(r31) ffc08170: 7f 89 00 40 cmplw cr7,r9,r0 ffc08174: 41 9c 02 3c blt- cr7,ffc083b0 * 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 ) { ffc08178: 80 1f 00 10 lwz r0,16(r31) ffc0817c: 2f 80 00 01 cmpwi cr7,r0,1 ffc08180: 41 9e 00 10 beq- cr7,ffc08190 ffc08184: 2f 80 00 02 cmpwi cr7,r0,2 ffc08188: 40 be 02 28 bne+ cr7,ffc083b0 ffc0818c: 48 00 00 44 b ffc081d0 case PTHREAD_INHERIT_SCHED: api = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; ffc08190: 3d 20 00 00 lis r9,0 ffc08194: 81 29 27 d8 lwz r9,10200(r9) ffc08198: 81 29 01 48 lwz r9,328(r9) schedpolicy = api->schedpolicy; schedparam = api->schedparam; ffc0819c: 81 69 00 8c lwz r11,140(r9) ffc081a0: 80 09 00 90 lwz r0,144(r9) ffc081a4: 81 09 00 84 lwz r8,132(r9) ffc081a8: 81 49 00 88 lwz r10,136(r9) * attributes structure. */ switch ( the_attr->inheritsched ) { case PTHREAD_INHERIT_SCHED: api = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; schedpolicy = api->schedpolicy; ffc081ac: 83 89 00 80 lwz r28,128(r9) schedparam = api->schedparam; ffc081b0: 91 01 00 20 stw r8,32(r1) ffc081b4: 91 41 00 24 stw r10,36(r1) ffc081b8: 91 61 00 28 stw r11,40(r1) ffc081bc: 90 01 00 2c stw r0,44(r1) ffc081c0: 80 09 00 9c lwz r0,156(r9) ffc081c4: 81 69 00 94 lwz r11,148(r9) ffc081c8: 81 29 00 98 lwz r9,152(r9) ffc081cc: 48 00 00 34 b ffc08200 break; case PTHREAD_EXPLICIT_SCHED: schedpolicy = the_attr->schedpolicy; schedparam = the_attr->schedparam; ffc081d0: 81 7f 00 1c lwz r11,28(r31) ffc081d4: 81 3f 00 20 lwz r9,32(r31) ffc081d8: 80 1f 00 24 lwz r0,36(r31) ffc081dc: 81 5f 00 18 lwz r10,24(r31) schedpolicy = api->schedpolicy; schedparam = api->schedparam; break; case PTHREAD_EXPLICIT_SCHED: schedpolicy = the_attr->schedpolicy; ffc081e0: 83 9f 00 14 lwz r28,20(r31) schedparam = the_attr->schedparam; ffc081e4: 91 41 00 20 stw r10,32(r1) ffc081e8: 91 61 00 24 stw r11,36(r1) ffc081ec: 91 21 00 28 stw r9,40(r1) ffc081f0: 90 01 00 2c stw r0,44(r1) ffc081f4: 81 7f 00 28 lwz r11,40(r31) ffc081f8: 81 3f 00 2c lwz r9,44(r31) ffc081fc: 80 1f 00 30 lwz r0,48(r31) ffc08200: 91 61 00 30 stw r11,48(r1) /* * Check the contentionscope since rtems only supports PROCESS wide * contention (i.e. no system wide contention). */ if ( the_attr->contentionscope != PTHREAD_SCOPE_PROCESS ) ffc08204: 3b c0 00 86 li r30,134 schedparam = api->schedparam; break; case PTHREAD_EXPLICIT_SCHED: schedpolicy = the_attr->schedpolicy; schedparam = the_attr->schedparam; ffc08208: 91 21 00 34 stw r9,52(r1) ffc0820c: 90 01 00 38 stw r0,56(r1) /* * Check the contentionscope since rtems only supports PROCESS wide * contention (i.e. no system wide contention). */ if ( the_attr->contentionscope != PTHREAD_SCOPE_PROCESS ) ffc08210: 80 1f 00 0c lwz r0,12(r31) ffc08214: 2f 80 00 00 cmpwi cr7,r0,0 ffc08218: 40 9e 01 9c bne- cr7,ffc083b4 return ENOTSUP; /* * Interpret the scheduling parameters. */ if ( !_POSIX_Priority_Is_valid( schedparam.sched_priority ) ) ffc0821c: 80 61 00 20 lwz r3,32(r1) ffc08220: 48 00 71 b1 bl ffc0f3d0 <_POSIX_Priority_Is_valid> ffc08224: 2f 83 00 00 cmpwi cr7,r3,0 ffc08228: 41 be 01 88 beq+ cr7,ffc083b0 <== NEVER TAKEN return EINVAL; core_priority = _POSIX_Priority_To_core( schedparam.sched_priority ); ffc0822c: 7c 24 0b 78 mr r4,r1 ffc08230: 86 e4 00 20 lwzu r23,32(r4) RTEMS_INLINE_ROUTINE Priority_Control _POSIX_Priority_To_core( int priority ) { return (Priority_Control) (POSIX_SCHEDULER_MAXIMUM_PRIORITY - priority + 1); ffc08234: 3d 20 00 00 lis r9,0 /* * Set the core scheduling policy information. */ rc = _POSIX_Thread_Translate_sched_param( ffc08238: 7f 83 e3 78 mr r3,r28 ffc0823c: 8a c9 26 cc lbz r22,9932(r9) ffc08240: 38 a1 00 18 addi r5,r1,24 ffc08244: 38 c1 00 1c addi r6,r1,28 ffc08248: 48 00 71 ad bl ffc0f3f4 <_POSIX_Thread_Translate_sched_param> schedpolicy, &schedparam, &budget_algorithm, &budget_callout ); if ( rc ) ffc0824c: 7c 7e 1b 79 mr. r30,r3 ffc08250: 40 a2 01 64 bne+ ffc083b4 #endif /* * Lock the allocator mutex for protection */ _RTEMS_Lock_allocator(); ffc08254: 3e a0 00 00 lis r21,0 ffc08258: 80 75 27 d0 lwz r3,10192(r21) * _POSIX_Threads_Allocate */ RTEMS_INLINE_ROUTINE Thread_Control *_POSIX_Threads_Allocate( void ) { return (Thread_Control *) _Objects_Allocate( &_POSIX_Threads_Information ); ffc0825c: 3f 60 00 00 lis r27,0 ffc08260: 3b 7b 2e 58 addi r27,r27,11864 ffc08264: 48 00 1c f9 bl ffc09f5c <_API_Mutex_Lock> ffc08268: 7f 63 db 78 mr r3,r27 ffc0826c: 48 00 27 b9 bl ffc0aa24 <_Objects_Allocate> * Allocate the thread control block. * * NOTE: Global threads are not currently supported. */ the_thread = _POSIX_Threads_Allocate(); if ( !the_thread ) { ffc08270: 7c 7d 1b 79 mr. r29,r3 ffc08274: 40 a2 00 0c bne+ ffc08280 _RTEMS_Unlock_allocator(); ffc08278: 80 75 27 d0 lwz r3,10192(r21) ffc0827c: 48 00 00 78 b ffc082f4 /* * Initialize the core thread for this task. */ name.name_p = NULL; /* posix threads don't have a name by default */ status = _Thread_Initialize( ffc08280: 3d 20 00 00 lis r9,0 ffc08284: 80 1f 00 08 lwz r0,8(r31) ffc08288: 80 c9 26 c8 lwz r6,9928(r9) ffc0828c: 93 c1 00 48 stw r30,72(r1) ffc08290: 54 c6 08 3c rlwinm r6,r6,1,0,30 ffc08294: 7f 86 00 40 cmplw cr7,r6,r0 ffc08298: 80 bf 00 04 lwz r5,4(r31) ffc0829c: 40 9c 00 08 bge- cr7,ffc082a4 ffc082a0: 7c 06 03 78 mr r6,r0 ffc082a4: 80 01 00 1c lwz r0,28(r1) ffc082a8: 7d 17 b0 50 subf r8,r23,r22 ffc082ac: 81 41 00 18 lwz r10,24(r1) ffc082b0: 7f 63 db 78 mr r3,r27 ffc082b4: 90 01 00 08 stw r0,8(r1) ffc082b8: 38 00 00 00 li r0,0 ffc082bc: 7f a4 eb 78 mr r4,r29 ffc082c0: 90 01 00 0c stw r0,12(r1) ffc082c4: 38 e0 00 01 li r7,1 ffc082c8: 38 01 00 48 addi r0,r1,72 ffc082cc: 39 20 00 01 li r9,1 ffc082d0: 90 01 00 10 stw r0,16(r1) ffc082d4: 48 00 39 2d bl ffc0bc00 <_Thread_Initialize> budget_callout, 0, /* isr level */ name /* posix threads don't have a name */ ); if ( !status ) { ffc082d8: 2f 83 00 00 cmpwi cr7,r3,0 ffc082dc: 40 9e 00 20 bne- cr7,ffc082fc RTEMS_INLINE_ROUTINE void _POSIX_Threads_Free ( Thread_Control *the_pthread ) { _Objects_Free( &_POSIX_Threads_Information, &the_pthread->Object ); ffc082e0: 7f 63 db 78 mr r3,r27 ffc082e4: 7f a4 eb 78 mr r4,r29 ffc082e8: 48 00 2b 29 bl ffc0ae10 <_Objects_Free> _POSIX_Threads_Free( the_thread ); _RTEMS_Unlock_allocator(); ffc082ec: 3d 20 00 00 lis r9,0 ffc082f0: 80 69 27 d0 lwz r3,10192(r9) ffc082f4: 3b c0 00 0b li r30,11 ffc082f8: 48 00 00 b0 b ffc083a8 } /* * finish initializing the per API structure */ api = the_thread->API_Extensions[ THREAD_API_POSIX ]; ffc082fc: 83 7d 01 48 lwz r27,328(r29) api->Attributes = *the_attr; ffc08300: 7f e4 fb 78 mr r4,r31 ffc08304: 38 a0 00 3c li r5,60 ffc08308: 7f 63 db 78 mr r3,r27 ffc0830c: 48 00 b6 6d bl ffc13978 api->detachstate = the_attr->detachstate; ffc08310: 80 1f 00 38 lwz r0,56(r31) api->schedpolicy = schedpolicy; ffc08314: 93 9b 00 80 stw r28,128(r27) the_thread->do_post_task_switch_extension = true; /* * POSIX threads are allocated and started in one operation. */ status = _Thread_Start( ffc08318: 7f 05 c3 78 mr r5,r24 ffc0831c: 7f 26 cb 78 mr r6,r25 * finish initializing the per API structure */ api = the_thread->API_Extensions[ THREAD_API_POSIX ]; api->Attributes = *the_attr; api->detachstate = the_attr->detachstate; ffc08320: 90 1b 00 3c stw r0,60(r27) the_thread->do_post_task_switch_extension = true; /* * POSIX threads are allocated and started in one operation. */ status = _Thread_Start( ffc08324: 7f a3 eb 78 mr r3,r29 ffc08328: 38 80 00 01 li r4,1 api = the_thread->API_Extensions[ THREAD_API_POSIX ]; api->Attributes = *the_attr; api->detachstate = the_attr->detachstate; api->schedpolicy = schedpolicy; api->schedparam = schedparam; ffc0832c: 81 61 00 24 lwz r11,36(r1) the_thread->do_post_task_switch_extension = true; /* * POSIX threads are allocated and started in one operation. */ status = _Thread_Start( ffc08330: 38 e0 00 00 li r7,0 api = the_thread->API_Extensions[ THREAD_API_POSIX ]; api->Attributes = *the_attr; api->detachstate = the_attr->detachstate; api->schedpolicy = schedpolicy; api->schedparam = schedparam; ffc08334: 81 21 00 28 lwz r9,40(r1) ffc08338: 80 01 00 2c lwz r0,44(r1) ffc0833c: 81 41 00 20 lwz r10,32(r1) ffc08340: 91 7b 00 88 stw r11,136(r27) * 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; ffc08344: 39 60 00 01 li r11,1 api = the_thread->API_Extensions[ THREAD_API_POSIX ]; api->Attributes = *the_attr; api->detachstate = the_attr->detachstate; api->schedpolicy = schedpolicy; api->schedparam = schedparam; ffc08348: 91 5b 00 84 stw r10,132(r27) ffc0834c: 91 3b 00 8c stw r9,140(r27) ffc08350: 90 1b 00 90 stw r0,144(r27) * 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; ffc08354: 99 7d 00 74 stb r11,116(r29) api = the_thread->API_Extensions[ THREAD_API_POSIX ]; api->Attributes = *the_attr; api->detachstate = the_attr->detachstate; api->schedpolicy = schedpolicy; api->schedparam = schedparam; ffc08358: 81 21 00 34 lwz r9,52(r1) ffc0835c: 80 01 00 38 lwz r0,56(r1) ffc08360: 81 61 00 30 lwz r11,48(r1) ffc08364: 91 3b 00 98 stw r9,152(r27) ffc08368: 91 7b 00 94 stw r11,148(r27) ffc0836c: 90 1b 00 9c stw r0,156(r27) the_thread->do_post_task_switch_extension = true; /* * POSIX threads are allocated and started in one operation. */ status = _Thread_Start( ffc08370: 48 00 45 49 bl ffc0c8b8 <_Thread_Start> _RTEMS_Unlock_allocator(); return EINVAL; } #endif if ( schedpolicy == SCHED_SPORADIC ) { ffc08374: 2f 9c 00 04 cmpwi cr7,r28,4 ffc08378: 40 be 00 20 bne+ cr7,ffc08398 _Watchdog_Insert_ticks( ffc0837c: 38 7b 00 8c addi r3,r27,140 ffc08380: 48 00 48 c9 bl ffc0cc48 <_Timespec_To_ticks> ) { the_watchdog->initial = units; _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); ffc08384: 38 9b 00 a4 addi r4,r27,164 Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; ffc08388: 90 7b 00 b0 stw r3,176(r27) _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); ffc0838c: 3c 60 00 00 lis r3,0 ffc08390: 38 63 2d 28 addi r3,r3,11560 ffc08394: 48 00 4e 0d bl ffc0d1a0 <_Watchdog_Insert> } /* * Return the id and indicate we successfully created the thread */ *thread = the_thread->Object.id; ffc08398: 80 1d 00 08 lwz r0,8(r29) _RTEMS_Unlock_allocator(); ffc0839c: 3d 20 00 00 lis r9,0 ffc083a0: 80 69 27 d0 lwz r3,10192(r9) } /* * Return the id and indicate we successfully created the thread */ *thread = the_thread->Object.id; ffc083a4: 90 1a 00 00 stw r0,0(r26) _RTEMS_Unlock_allocator(); ffc083a8: 48 00 1c 35 bl ffc09fdc <_API_Mutex_Unlock> return 0; ffc083ac: 48 00 00 08 b ffc083b4 ffc083b0: 3b c0 00 16 li r30,22 } ffc083b4: 80 01 00 84 lwz r0,132(r1) ffc083b8: 7f c3 f3 78 mr r3,r30 ffc083bc: 82 a1 00 54 lwz r21,84(r1) ffc083c0: 7c 08 03 a6 mtlr r0 ffc083c4: 82 c1 00 58 lwz r22,88(r1) ffc083c8: 82 e1 00 5c lwz r23,92(r1) ffc083cc: 83 01 00 60 lwz r24,96(r1) ffc083d0: 83 21 00 64 lwz r25,100(r1) ffc083d4: 83 41 00 68 lwz r26,104(r1) ffc083d8: 83 61 00 6c lwz r27,108(r1) ffc083dc: 83 81 00 70 lwz r28,112(r1) ffc083e0: 83 a1 00 74 lwz r29,116(r1) ffc083e4: 83 c1 00 78 lwz r30,120(r1) ffc083e8: 83 e1 00 7c lwz r31,124(r1) ffc083ec: 38 21 00 80 addi r1,r1,128 ffc083f0: 4e 80 00 20 blr =============================================================================== ffc076b8 : int pthread_mutexattr_gettype( const pthread_mutexattr_t *attr, int *type ) { if ( !attr ) ffc076b8: 2c 03 00 00 cmpwi r3,0 ffc076bc: 41 82 00 28 beq- ffc076e4 return EINVAL; if ( !attr->is_initialized ) ffc076c0: 80 03 00 00 lwz r0,0(r3) ffc076c4: 2f 80 00 00 cmpwi cr7,r0,0 ffc076c8: 41 9e 00 1c beq- cr7,ffc076e4 return EINVAL; if ( !type ) ffc076cc: 2f 84 00 00 cmpwi cr7,r4,0 ffc076d0: 41 9e 00 14 beq- cr7,ffc076e4 <== NEVER TAKEN return EINVAL; *type = attr->type; ffc076d4: 80 03 00 10 lwz r0,16(r3) ffc076d8: 38 60 00 00 li r3,0 ffc076dc: 90 04 00 00 stw r0,0(r4) return 0; ffc076e0: 4e 80 00 20 blr ffc076e4: 38 60 00 16 li r3,22 } ffc076e8: 4e 80 00 20 blr =============================================================================== ffc0a544 : int pthread_mutexattr_setpshared( pthread_mutexattr_t *attr, int pshared ) { if ( !attr || !attr->is_initialized ) ffc0a544: 2c 03 00 00 cmpwi r3,0 ffc0a548: 41 82 00 24 beq- ffc0a56c ffc0a54c: 80 03 00 00 lwz r0,0(r3) ffc0a550: 2f 80 00 00 cmpwi cr7,r0,0 ffc0a554: 41 9e 00 18 beq- cr7,ffc0a56c return EINVAL; switch ( pshared ) { ffc0a558: 2b 84 00 01 cmplwi cr7,r4,1 ffc0a55c: 41 9d 00 10 bgt- cr7,ffc0a56c <== NEVER TAKEN case PTHREAD_PROCESS_SHARED: case PTHREAD_PROCESS_PRIVATE: attr->process_shared = pshared; ffc0a560: 90 83 00 04 stw r4,4(r3) ffc0a564: 38 60 00 00 li r3,0 return 0; ffc0a568: 4e 80 00 20 blr ffc0a56c: 38 60 00 16 li r3,22 default: return EINVAL; } } ffc0a570: 4e 80 00 20 blr =============================================================================== ffc07738 : int pthread_mutexattr_settype( pthread_mutexattr_t *attr, int type ) { if ( !attr || !attr->is_initialized ) ffc07738: 2c 03 00 00 cmpwi r3,0 ffc0773c: 41 82 00 24 beq- ffc07760 ffc07740: 80 03 00 00 lwz r0,0(r3) ffc07744: 2f 80 00 00 cmpwi cr7,r0,0 ffc07748: 41 9e 00 18 beq- cr7,ffc07760 <== NEVER TAKEN return EINVAL; switch ( type ) { ffc0774c: 2b 84 00 03 cmplwi cr7,r4,3 ffc07750: 41 9d 00 10 bgt- cr7,ffc07760 case PTHREAD_MUTEX_NORMAL: case PTHREAD_MUTEX_RECURSIVE: case PTHREAD_MUTEX_ERRORCHECK: case PTHREAD_MUTEX_DEFAULT: attr->type = type; ffc07754: 90 83 00 10 stw r4,16(r3) ffc07758: 38 60 00 00 li r3,0 return 0; ffc0775c: 4e 80 00 20 blr ffc07760: 38 60 00 16 li r3,22 default: return EINVAL; } } ffc07764: 4e 80 00 20 blr =============================================================================== ffc0892c : int pthread_once( pthread_once_t *once_control, void (*init_routine)(void) ) { ffc0892c: 94 21 ff e0 stwu r1,-32(r1) ffc08930: 7c 08 02 a6 mflr r0 ffc08934: 93 e1 00 1c stw r31,28(r1) if ( !once_control || !init_routine ) ffc08938: 7c 7f 1b 79 mr. r31,r3 int pthread_once( pthread_once_t *once_control, void (*init_routine)(void) ) { ffc0893c: 93 c1 00 18 stw r30,24(r1) ffc08940: 7c 9e 23 78 mr r30,r4 ffc08944: 90 01 00 24 stw r0,36(r1) if ( !once_control || !init_routine ) ffc08948: 41 82 00 64 beq- ffc089ac ffc0894c: 2f 84 00 00 cmpwi cr7,r4,0 ffc08950: 41 9e 00 5c beq- cr7,ffc089ac return EINVAL; if ( !once_control->init_executed ) { ffc08954: 80 1f 00 04 lwz r0,4(r31) ffc08958: 38 60 00 00 li r3,0 ffc0895c: 2f 80 00 00 cmpwi cr7,r0,0 ffc08960: 40 be 00 50 bne+ cr7,ffc089b0 rtems_mode saveMode; rtems_task_mode(RTEMS_NO_PREEMPT, RTEMS_PREEMPT_MASK, &saveMode); ffc08964: 38 60 01 00 li r3,256 ffc08968: 38 80 01 00 li r4,256 ffc0896c: 38 a1 00 08 addi r5,r1,8 ffc08970: 48 00 0d 9d bl ffc0970c if ( !once_control->init_executed ) { ffc08974: 80 1f 00 04 lwz r0,4(r31) ffc08978: 2f 80 00 00 cmpwi cr7,r0,0 ffc0897c: 40 be 00 18 bne+ cr7,ffc08994 <== NEVER TAKEN once_control->is_initialized = true; ffc08980: 38 00 00 01 li r0,1 once_control->init_executed = true; (*init_routine)(); ffc08984: 7f c9 03 a6 mtctr r30 if ( !once_control->init_executed ) { rtems_mode saveMode; rtems_task_mode(RTEMS_NO_PREEMPT, RTEMS_PREEMPT_MASK, &saveMode); if ( !once_control->init_executed ) { once_control->is_initialized = true; once_control->init_executed = true; ffc08988: 90 1f 00 04 stw r0,4(r31) if ( !once_control->init_executed ) { rtems_mode saveMode; rtems_task_mode(RTEMS_NO_PREEMPT, RTEMS_PREEMPT_MASK, &saveMode); if ( !once_control->init_executed ) { once_control->is_initialized = true; ffc0898c: 90 1f 00 00 stw r0,0(r31) once_control->init_executed = true; (*init_routine)(); ffc08990: 4e 80 04 21 bctrl } rtems_task_mode(saveMode, RTEMS_PREEMPT_MASK, &saveMode); ffc08994: 7c 25 0b 78 mr r5,r1 ffc08998: 84 65 00 08 lwzu r3,8(r5) ffc0899c: 38 80 01 00 li r4,256 ffc089a0: 48 00 0d 6d bl ffc0970c ffc089a4: 38 60 00 00 li r3,0 ffc089a8: 48 00 00 08 b ffc089b0 ffc089ac: 38 60 00 16 li r3,22 } return 0; } ffc089b0: 80 01 00 24 lwz r0,36(r1) ffc089b4: 83 c1 00 18 lwz r30,24(r1) ffc089b8: 7c 08 03 a6 mtlr r0 ffc089bc: 83 e1 00 1c lwz r31,28(r1) ffc089c0: 38 21 00 20 addi r1,r1,32 ffc089c4: 4e 80 00 20 blr =============================================================================== ffc09288 : int pthread_rwlock_init( pthread_rwlock_t *rwlock, const pthread_rwlockattr_t *attr ) { ffc09288: 94 21 ff d8 stwu r1,-40(r1) ffc0928c: 7c 08 02 a6 mflr r0 ffc09290: 93 81 00 18 stw r28,24(r1) const pthread_rwlockattr_t *the_attr; /* * Error check parameters */ if ( !rwlock ) ffc09294: 7c 7c 1b 79 mr. r28,r3 int pthread_rwlock_init( pthread_rwlock_t *rwlock, const pthread_rwlockattr_t *attr ) { ffc09298: 90 01 00 2c stw r0,44(r1) ffc0929c: 93 a1 00 1c stw r29,28(r1) ffc092a0: 93 c1 00 20 stw r30,32(r1) ffc092a4: 93 e1 00 24 stw r31,36(r1) const pthread_rwlockattr_t *the_attr; /* * Error check parameters */ if ( !rwlock ) ffc092a8: 41 82 00 98 beq- ffc09340 return EINVAL; /* * If the user passed in NULL, use the default attributes */ if ( attr ) { ffc092ac: 2f 84 00 00 cmpwi cr7,r4,0 ffc092b0: 7c 9f 23 78 mr r31,r4 ffc092b4: 40 be 00 10 bne+ cr7,ffc092c4 the_attr = attr; } else { (void) pthread_rwlockattr_init( &default_attr ); ffc092b8: 3b e1 00 0c addi r31,r1,12 ffc092bc: 7f e3 fb 78 mr r3,r31 ffc092c0: 48 00 0b ed bl ffc09eac } /* * Now start error checking the attributes that we are going to use */ if ( !the_attr->is_initialized ) ffc092c4: 80 1f 00 00 lwz r0,0(r31) ffc092c8: 2f 80 00 00 cmpwi cr7,r0,0 ffc092cc: 41 9e 00 74 beq- cr7,ffc09340 <== NEVER TAKEN return EINVAL; switch ( the_attr->process_shared ) { ffc092d0: 83 df 00 04 lwz r30,4(r31) ffc092d4: 2f 9e 00 00 cmpwi cr7,r30,0 ffc092d8: 40 9e 00 68 bne- cr7,ffc09340 <== NEVER TAKEN rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; ffc092dc: 3d 20 00 00 lis r9,0 ffc092e0: 81 69 27 bc lwz r11,10172(r9) ffc092e4: 38 0b 00 01 addi r0,r11,1 ffc092e8: 90 09 27 bc stw r0,10172(r9) * 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 *) ffc092ec: 3f a0 00 00 lis r29,0 ffc092f0: 3b bd 2e 38 addi r29,r29,11832 ffc092f4: 7f a3 eb 78 mr r3,r29 ffc092f8: 48 00 2e 55 bl ffc0c14c <_Objects_Allocate> */ _Thread_Disable_dispatch(); /* prevents deletion */ the_rwlock = _POSIX_RWLock_Allocate(); if ( !the_rwlock ) { ffc092fc: 7c 7f 1b 79 mr. r31,r3 ffc09300: 40 a2 00 10 bne+ ffc09310 _Thread_Enable_dispatch(); ffc09304: 48 00 3f 05 bl ffc0d208 <_Thread_Enable_dispatch> ffc09308: 38 60 00 0b li r3,11 return EAGAIN; ffc0930c: 48 00 00 38 b ffc09344 } _CORE_RWLock_Initialize( &the_rwlock->RWLock, &the_attributes ); ffc09310: 38 7f 00 10 addi r3,r31,16 ffc09314: 38 81 00 08 addi r4,r1,8 ffc09318: 48 00 24 41 bl ffc0b758 <_CORE_RWLock_Initialize> #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; ffc0931c: 80 1f 00 08 lwz r0,8(r31) ffc09320: 81 7d 00 1c lwz r11,28(r29) ffc09324: 54 09 13 ba rlwinm r9,r0,2,14,29 ffc09328: 7f eb 49 2e stwx r31,r11,r9 _Objects_Get_index( the_object->id ), the_object ); /* ASSERT: information->is_string == false */ the_object->name.name_u32 = name; ffc0932c: 93 df 00 0c stw r30,12(r31) &_POSIX_RWLock_Information, &the_rwlock->Object, 0 ); *rwlock = the_rwlock->Object.id; ffc09330: 90 1c 00 00 stw r0,0(r28) _Thread_Enable_dispatch(); ffc09334: 48 00 3e d5 bl ffc0d208 <_Thread_Enable_dispatch> ffc09338: 38 60 00 00 li r3,0 return 0; ffc0933c: 48 00 00 08 b ffc09344 ffc09340: 38 60 00 16 li r3,22 } ffc09344: 80 01 00 2c lwz r0,44(r1) ffc09348: 83 81 00 18 lwz r28,24(r1) ffc0934c: 7c 08 03 a6 mtlr r0 ffc09350: 83 a1 00 1c lwz r29,28(r1) ffc09354: 83 c1 00 20 lwz r30,32(r1) ffc09358: 83 e1 00 24 lwz r31,36(r1) ffc0935c: 38 21 00 28 addi r1,r1,40 ffc09360: 4e 80 00 20 blr =============================================================================== ffc093e4 : int pthread_rwlock_timedrdlock( pthread_rwlock_t *rwlock, const struct timespec *abstime ) { ffc093e4: 94 21 ff d8 stwu r1,-40(r1) ffc093e8: 7c 08 02 a6 mflr r0 ffc093ec: 93 a1 00 1c stw r29,28(r1) Objects_Locations location; Watchdog_Interval ticks; bool do_wait = true; POSIX_Absolute_timeout_conversion_results_t status; if ( !rwlock ) ffc093f0: 7c 7d 1b 79 mr. r29,r3 int pthread_rwlock_timedrdlock( pthread_rwlock_t *rwlock, const struct timespec *abstime ) { ffc093f4: 90 01 00 2c stw r0,44(r1) ffc093f8: 93 c1 00 20 stw r30,32(r1) ffc093fc: 93 e1 00 24 stw r31,36(r1) Objects_Locations location; Watchdog_Interval ticks; bool do_wait = true; POSIX_Absolute_timeout_conversion_results_t status; if ( !rwlock ) ffc09400: 41 82 00 a0 beq- ffc094a0 * * 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 ); ffc09404: 7c 83 23 78 mr r3,r4 ffc09408: 38 81 00 0c addi r4,r1,12 ffc0940c: 48 00 76 11 bl ffc10a1c <_POSIX_Absolute_timeout_to_ticks> ffc09410: 80 9d 00 00 lwz r4,0(r29) ffc09414: 7c 7e 1b 78 mr r30,r3 ffc09418: 3c 60 00 00 lis r3,0 ffc0941c: 38 63 2e 38 addi r3,r3,11832 ffc09420: 38 a1 00 08 addi r5,r1,8 ffc09424: 48 00 32 d5 bl ffc0c6f8 <_Objects_Get> if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE ) do_wait = false; the_rwlock = _POSIX_RWLock_Get( rwlock, &location ); switch ( location ) { ffc09428: 80 01 00 08 lwz r0,8(r1) ffc0942c: 2f 80 00 00 cmpwi cr7,r0,0 ffc09430: 40 9e 00 70 bne- cr7,ffc094a0 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, ffc09434: 6b df 00 03 xori r31,r30,3 case OBJECTS_LOCAL: _CORE_RWLock_Obtain_for_reading( ffc09438: 80 9d 00 00 lwz r4,0(r29) ffc0943c: 7f ff 00 34 cntlzw r31,r31 ffc09440: 80 c1 00 0c lwz r6,12(r1) ffc09444: 57 ff d9 7e rlwinm r31,r31,27,5,31 ffc09448: 38 63 00 10 addi r3,r3,16 ffc0944c: 7f e5 fb 78 mr r5,r31 ffc09450: 38 e0 00 00 li r7,0 ffc09454: 48 00 23 45 bl ffc0b798 <_CORE_RWLock_Obtain_for_reading> do_wait, ticks, NULL ); _Thread_Enable_dispatch(); ffc09458: 48 00 3d b1 bl ffc0d208 <_Thread_Enable_dispatch> if ( !do_wait ) { ffc0945c: 2f 9f 00 00 cmpwi cr7,r31,0 ffc09460: 40 9e 00 2c bne- cr7,ffc0948c if ( _Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE ) { ffc09464: 3d 20 00 00 lis r9,0 ffc09468: 81 29 27 fc lwz r9,10236(r9) ffc0946c: 80 09 00 34 lwz r0,52(r9) ffc09470: 2f 80 00 02 cmpwi cr7,r0,2 ffc09474: 40 be 00 18 bne+ cr7,ffc0948c switch (status) { ffc09478: 2f 9e 00 00 cmpwi cr7,r30,0 ffc0947c: 41 9e 00 24 beq- cr7,ffc094a0 <== NEVER TAKEN ffc09480: 2b 9e 00 02 cmplwi cr7,r30,2 ffc09484: 38 60 00 74 li r3,116 ffc09488: 40 9d 00 1c ble- cr7,ffc094a4 <== ALWAYS TAKEN break; } } } return _POSIX_RWLock_Translate_core_RWLock_return_code( ffc0948c: 3d 20 00 00 lis r9,0 ffc09490: 81 29 27 fc lwz r9,10236(r9) ffc09494: 80 69 00 34 lwz r3,52(r9) ffc09498: 48 00 01 05 bl ffc0959c <_POSIX_RWLock_Translate_core_RWLock_return_code> ffc0949c: 48 00 00 08 b ffc094a4 ffc094a0: 38 60 00 16 li r3,22 case OBJECTS_ERROR: break; } return EINVAL; } ffc094a4: 80 01 00 2c lwz r0,44(r1) ffc094a8: 83 a1 00 1c lwz r29,28(r1) ffc094ac: 7c 08 03 a6 mtlr r0 ffc094b0: 83 c1 00 20 lwz r30,32(r1) ffc094b4: 83 e1 00 24 lwz r31,36(r1) ffc094b8: 38 21 00 28 addi r1,r1,40 ffc094bc: 4e 80 00 20 blr =============================================================================== ffc094c0 : int pthread_rwlock_timedwrlock( pthread_rwlock_t *rwlock, const struct timespec *abstime ) { ffc094c0: 94 21 ff d8 stwu r1,-40(r1) ffc094c4: 7c 08 02 a6 mflr r0 ffc094c8: 93 a1 00 1c stw r29,28(r1) Objects_Locations location; Watchdog_Interval ticks; bool do_wait = true; POSIX_Absolute_timeout_conversion_results_t status; if ( !rwlock ) ffc094cc: 7c 7d 1b 79 mr. r29,r3 int pthread_rwlock_timedwrlock( pthread_rwlock_t *rwlock, const struct timespec *abstime ) { ffc094d0: 90 01 00 2c stw r0,44(r1) ffc094d4: 93 c1 00 20 stw r30,32(r1) ffc094d8: 93 e1 00 24 stw r31,36(r1) Objects_Locations location; Watchdog_Interval ticks; bool do_wait = true; POSIX_Absolute_timeout_conversion_results_t status; if ( !rwlock ) ffc094dc: 41 82 00 a0 beq- ffc0957c * * 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 ); ffc094e0: 7c 83 23 78 mr r3,r4 ffc094e4: 38 81 00 0c addi r4,r1,12 ffc094e8: 48 00 75 35 bl ffc10a1c <_POSIX_Absolute_timeout_to_ticks> ffc094ec: 80 9d 00 00 lwz r4,0(r29) ffc094f0: 7c 7e 1b 78 mr r30,r3 ffc094f4: 3c 60 00 00 lis r3,0 ffc094f8: 38 63 2e 38 addi r3,r3,11832 ffc094fc: 38 a1 00 08 addi r5,r1,8 ffc09500: 48 00 31 f9 bl ffc0c6f8 <_Objects_Get> if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE ) do_wait = false; the_rwlock = _POSIX_RWLock_Get( rwlock, &location ); switch ( location ) { ffc09504: 80 01 00 08 lwz r0,8(r1) ffc09508: 2f 80 00 00 cmpwi cr7,r0,0 ffc0950c: 40 9e 00 70 bne- cr7,ffc0957c (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, ffc09510: 6b df 00 03 xori r31,r30,3 case OBJECTS_LOCAL: _CORE_RWLock_Obtain_for_writing( ffc09514: 80 9d 00 00 lwz r4,0(r29) ffc09518: 7f ff 00 34 cntlzw r31,r31 ffc0951c: 80 c1 00 0c lwz r6,12(r1) ffc09520: 57 ff d9 7e rlwinm r31,r31,27,5,31 ffc09524: 38 63 00 10 addi r3,r3,16 ffc09528: 7f e5 fb 78 mr r5,r31 ffc0952c: 38 e0 00 00 li r7,0 ffc09530: 48 00 23 7d bl ffc0b8ac <_CORE_RWLock_Obtain_for_writing> do_wait, ticks, NULL ); _Thread_Enable_dispatch(); ffc09534: 48 00 3c d5 bl ffc0d208 <_Thread_Enable_dispatch> if ( !do_wait && ffc09538: 2f 9f 00 00 cmpwi cr7,r31,0 ffc0953c: 40 9e 00 2c bne- cr7,ffc09568 (_Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE) ) { ffc09540: 3d 20 00 00 lis r9,0 ffc09544: 81 29 27 fc lwz r9,10236(r9) ffc09548: 80 09 00 34 lwz r0,52(r9) ffc0954c: 2f 80 00 02 cmpwi cr7,r0,2 ffc09550: 40 be 00 18 bne+ cr7,ffc09568 switch (status) { ffc09554: 2f 9e 00 00 cmpwi cr7,r30,0 ffc09558: 41 9e 00 24 beq- cr7,ffc0957c <== NEVER TAKEN ffc0955c: 2b 9e 00 02 cmplwi cr7,r30,2 ffc09560: 38 60 00 74 li r3,116 ffc09564: 40 9d 00 1c ble- cr7,ffc09580 <== ALWAYS TAKEN case POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE: break; } } return _POSIX_RWLock_Translate_core_RWLock_return_code( ffc09568: 3d 20 00 00 lis r9,0 ffc0956c: 81 29 27 fc lwz r9,10236(r9) ffc09570: 80 69 00 34 lwz r3,52(r9) ffc09574: 48 00 00 29 bl ffc0959c <_POSIX_RWLock_Translate_core_RWLock_return_code> ffc09578: 48 00 00 08 b ffc09580 ffc0957c: 38 60 00 16 li r3,22 case OBJECTS_ERROR: break; } return EINVAL; } ffc09580: 80 01 00 2c lwz r0,44(r1) ffc09584: 83 a1 00 1c lwz r29,28(r1) ffc09588: 7c 08 03 a6 mtlr r0 ffc0958c: 83 c1 00 20 lwz r30,32(r1) ffc09590: 83 e1 00 24 lwz r31,36(r1) ffc09594: 38 21 00 28 addi r1,r1,40 ffc09598: 4e 80 00 20 blr =============================================================================== ffc09ed0 : int pthread_rwlockattr_setpshared( pthread_rwlockattr_t *attr, int pshared ) { if ( !attr ) ffc09ed0: 2c 03 00 00 cmpwi r3,0 ffc09ed4: 41 82 00 24 beq- ffc09ef8 return EINVAL; if ( !attr->is_initialized ) ffc09ed8: 80 03 00 00 lwz r0,0(r3) ffc09edc: 2f 80 00 00 cmpwi cr7,r0,0 ffc09ee0: 41 9e 00 18 beq- cr7,ffc09ef8 return EINVAL; switch ( pshared ) { ffc09ee4: 2b 84 00 01 cmplwi cr7,r4,1 ffc09ee8: 41 9d 00 10 bgt- cr7,ffc09ef8 <== NEVER TAKEN case PTHREAD_PROCESS_SHARED: case PTHREAD_PROCESS_PRIVATE: attr->process_shared = pshared; ffc09eec: 90 83 00 04 stw r4,4(r3) ffc09ef0: 38 60 00 00 li r3,0 return 0; ffc09ef4: 4e 80 00 20 blr ffc09ef8: 38 60 00 16 li r3,22 default: return EINVAL; } } ffc09efc: 4e 80 00 20 blr =============================================================================== ffc0b530 : int pthread_setschedparam( pthread_t thread, int policy, struct sched_param *param ) { ffc0b530: 94 21 ff d0 stwu r1,-48(r1) ffc0b534: 7c 08 02 a6 mflr r0 ffc0b538: 93 e1 00 2c stw r31,44(r1) int rc; /* * Check all the parameters */ if ( !param ) ffc0b53c: 7c bf 2b 79 mr. r31,r5 int pthread_setschedparam( pthread_t thread, int policy, struct sched_param *param ) { ffc0b540: 93 81 00 20 stw r28,32(r1) int rc; /* * Check all the parameters */ if ( !param ) ffc0b544: 3b 80 00 16 li r28,22 int pthread_setschedparam( pthread_t thread, int policy, struct sched_param *param ) { ffc0b548: 93 a1 00 24 stw r29,36(r1) ffc0b54c: 7c 7d 1b 78 mr r29,r3 ffc0b550: 93 c1 00 28 stw r30,40(r1) ffc0b554: 7c 9e 23 78 mr r30,r4 ffc0b558: 90 01 00 34 stw r0,52(r1) ffc0b55c: 93 61 00 1c stw r27,28(r1) int rc; /* * Check all the parameters */ if ( !param ) ffc0b560: 41 82 01 18 beq- ffc0b678 return EINVAL; rc = _POSIX_Thread_Translate_sched_param( ffc0b564: 7c 83 23 78 mr r3,r4 ffc0b568: 38 a1 00 08 addi r5,r1,8 ffc0b56c: 7f e4 fb 78 mr r4,r31 ffc0b570: 38 c1 00 0c addi r6,r1,12 ffc0b574: 48 00 6a 29 bl ffc11f9c <_POSIX_Thread_Translate_sched_param> policy, param, &budget_algorithm, &budget_callout ); if ( rc ) ffc0b578: 7c 7c 1b 79 mr. r28,r3 ffc0b57c: 40 82 00 fc bne- ffc0b678 ffc0b580: 3c 60 00 00 lis r3,0 ffc0b584: 38 63 2e d8 addi r3,r3,11992 ffc0b588: 7f a4 eb 78 mr r4,r29 ffc0b58c: 38 a1 00 10 addi r5,r1,16 ffc0b590: 48 00 25 bd bl ffc0db4c <_Objects_Get> /* * Actually change the scheduling policy and parameters */ the_thread = _POSIX_Threads_Get( thread, &location ); switch ( location ) { ffc0b594: 80 01 00 10 lwz r0,16(r1) ffc0b598: 7c 7b 1b 78 mr r27,r3 ffc0b59c: 2f 80 00 00 cmpwi cr7,r0,0 ffc0b5a0: 41 9e 00 0c beq- cr7,ffc0b5ac ffc0b5a4: 3b 80 00 03 li r28,3 ffc0b5a8: 48 00 00 d0 b ffc0b678 case OBJECTS_LOCAL: api = the_thread->API_Extensions[ THREAD_API_POSIX ]; ffc0b5ac: 83 a3 01 48 lwz r29,328(r3) if ( api->schedpolicy == SCHED_SPORADIC ) ffc0b5b0: 80 1d 00 80 lwz r0,128(r29) ffc0b5b4: 2f 80 00 04 cmpwi cr7,r0,4 ffc0b5b8: 40 be 00 0c bne+ cr7,ffc0b5c4 (void) _Watchdog_Remove( &api->Sporadic_timer ); ffc0b5bc: 38 7d 00 a4 addi r3,r29,164 ffc0b5c0: 48 00 49 95 bl ffc0ff54 <_Watchdog_Remove> api->schedpolicy = policy; ffc0b5c4: 93 dd 00 80 stw r30,128(r29) api->schedparam = *param; the_thread->budget_algorithm = budget_algorithm; the_thread->budget_callout = budget_callout; switch ( api->schedpolicy ) { ffc0b5c8: 2f 9e 00 00 cmpwi cr7,r30,0 if ( api->schedpolicy == SCHED_SPORADIC ) (void) _Watchdog_Remove( &api->Sporadic_timer ); api->schedpolicy = policy; api->schedparam = *param; ffc0b5cc: 81 5f 00 04 lwz r10,4(r31) ffc0b5d0: 81 7f 00 08 lwz r11,8(r31) ffc0b5d4: 81 3f 00 0c lwz r9,12(r31) ffc0b5d8: 80 1f 00 00 lwz r0,0(r31) ffc0b5dc: 91 5d 00 88 stw r10,136(r29) ffc0b5e0: 91 7d 00 8c stw r11,140(r29) ffc0b5e4: 91 3d 00 90 stw r9,144(r29) ffc0b5e8: 90 1d 00 84 stw r0,132(r29) ffc0b5ec: 81 3f 00 18 lwz r9,24(r31) ffc0b5f0: 81 5f 00 10 lwz r10,16(r31) ffc0b5f4: 81 7f 00 14 lwz r11,20(r31) ffc0b5f8: 91 3d 00 9c stw r9,156(r29) the_thread->budget_algorithm = budget_algorithm; ffc0b5fc: 81 21 00 08 lwz r9,8(r1) if ( api->schedpolicy == SCHED_SPORADIC ) (void) _Watchdog_Remove( &api->Sporadic_timer ); api->schedpolicy = policy; api->schedparam = *param; ffc0b600: 91 5d 00 94 stw r10,148(r29) the_thread->budget_algorithm = budget_algorithm; ffc0b604: 91 3b 00 7c stw r9,124(r27) the_thread->budget_callout = budget_callout; ffc0b608: 81 21 00 0c lwz r9,12(r1) if ( api->schedpolicy == SCHED_SPORADIC ) (void) _Watchdog_Remove( &api->Sporadic_timer ); api->schedpolicy = policy; api->schedparam = *param; ffc0b60c: 91 7d 00 98 stw r11,152(r29) the_thread->budget_algorithm = budget_algorithm; the_thread->budget_callout = budget_callout; ffc0b610: 91 3b 00 80 stw r9,128(r27) switch ( api->schedpolicy ) { ffc0b614: 41 9c 00 60 blt- cr7,ffc0b674 <== NEVER TAKEN ffc0b618: 2f 9e 00 02 cmpwi cr7,r30,2 ffc0b61c: 40 9d 00 10 ble- cr7,ffc0b62c ffc0b620: 2f 9e 00 04 cmpwi cr7,r30,4 ffc0b624: 40 be 00 50 bne+ cr7,ffc0b674 <== NEVER TAKEN ffc0b628: 48 00 00 34 b ffc0b65c ffc0b62c: 3d 20 00 00 lis r9,0 ffc0b630: 88 89 27 0c lbz r4,9996(r9) case SCHED_OTHER: case SCHED_FIFO: case SCHED_RR: the_thread->cpu_time_budget = _Thread_Ticks_per_timeslice; ffc0b634: 3d 60 00 00 lis r11,0 ffc0b638: 81 3d 00 84 lwz r9,132(r29) the_thread->real_priority = _POSIX_Priority_To_core( api->schedparam.sched_priority ); _Thread_Change_priority( ffc0b63c: 7f 63 db 78 mr r3,r27 switch ( api->schedpolicy ) { case SCHED_OTHER: case SCHED_FIFO: case SCHED_RR: the_thread->cpu_time_budget = _Thread_Ticks_per_timeslice; ffc0b640: 80 0b 28 08 lwz r0,10248(r11) the_thread->real_priority = _POSIX_Priority_To_core( api->schedparam.sched_priority ); _Thread_Change_priority( ffc0b644: 38 a0 00 01 li r5,1 ffc0b648: 7c 89 20 50 subf r4,r9,r4 switch ( api->schedpolicy ) { case SCHED_OTHER: case SCHED_FIFO: case SCHED_RR: the_thread->cpu_time_budget = _Thread_Ticks_per_timeslice; ffc0b64c: 90 1b 00 78 stw r0,120(r27) the_thread->real_priority = ffc0b650: 90 9b 00 18 stw r4,24(r27) _POSIX_Priority_To_core( api->schedparam.sched_priority ); _Thread_Change_priority( ffc0b654: 48 00 29 81 bl ffc0dfd4 <_Thread_Change_priority> the_thread, the_thread->real_priority, true ); break; ffc0b658: 48 00 00 1c b ffc0b674 case SCHED_SPORADIC: api->ss_high_priority = api->schedparam.sched_priority; ffc0b65c: 90 1d 00 a0 stw r0,160(r29) _Watchdog_Remove( &api->Sporadic_timer ); ffc0b660: 38 7d 00 a4 addi r3,r29,164 ffc0b664: 48 00 48 f1 bl ffc0ff54 <_Watchdog_Remove> _POSIX_Threads_Sporadic_budget_TSR( 0, the_thread ); ffc0b668: 7f 64 db 78 mr r4,r27 ffc0b66c: 38 60 00 00 li r3,0 ffc0b670: 4b ff fe 1d bl ffc0b48c <_POSIX_Threads_Sporadic_budget_TSR> break; } _Thread_Enable_dispatch(); ffc0b674: 48 00 2f e9 bl ffc0e65c <_Thread_Enable_dispatch> case OBJECTS_ERROR: break; } return ESRCH; } ffc0b678: 80 01 00 34 lwz r0,52(r1) ffc0b67c: 7f 83 e3 78 mr r3,r28 ffc0b680: 83 61 00 1c lwz r27,28(r1) ffc0b684: 7c 08 03 a6 mtlr r0 ffc0b688: 83 81 00 20 lwz r28,32(r1) ffc0b68c: 83 a1 00 24 lwz r29,36(r1) ffc0b690: 83 c1 00 28 lwz r30,40(r1) ffc0b694: 83 e1 00 2c lwz r31,44(r1) ffc0b698: 38 21 00 30 addi r1,r1,48 ffc0b69c: 4e 80 00 20 blr =============================================================================== ffc084d4 : * * 18.2.2 Setting Cancelability State, P1003.1c/Draft 10, p. 183 */ void pthread_testcancel( void ) { ffc084d4: 94 21 ff f0 stwu r1,-16(r1) ffc084d8: 7c 08 02 a6 mflr r0 * 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() ) ffc084dc: 3d 20 00 00 lis r9,0 * * 18.2.2 Setting Cancelability State, P1003.1c/Draft 10, p. 183 */ void pthread_testcancel( void ) { ffc084e0: 90 01 00 14 stw r0,20(r1) * 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() ) ffc084e4: 80 09 27 bc lwz r0,10172(r9) * * 18.2.2 Setting Cancelability State, P1003.1c/Draft 10, p. 183 */ void pthread_testcancel( void ) { ffc084e8: 93 e1 00 0c stw r31,12(r1) * 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() ) ffc084ec: 2f 80 00 00 cmpwi cr7,r0,0 ffc084f0: 40 9e 00 58 bne- cr7,ffc08548 <== NEVER TAKEN ffc084f4: 3d 20 00 00 lis r9,0 ffc084f8: 81 49 27 94 lwz r10,10132(r9) return; thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; ffc084fc: 3d 60 00 00 lis r11,0 ffc08500: 81 6b 27 d4 lwz r11,10196(r11) ffc08504: 38 0a 00 01 addi r0,r10,1 ffc08508: 90 09 27 94 stw r0,10132(r9) ffc0850c: 81 2b 01 48 lwz r9,328(r11) _Thread_Disable_dispatch(); if ( thread_support->cancelability_state == PTHREAD_CANCEL_ENABLE && ffc08510: 80 09 00 d4 lwz r0,212(r9) ffc08514: 3b e0 00 00 li r31,0 ffc08518: 2f 80 00 00 cmpwi cr7,r0,0 ffc0851c: 40 9e 00 10 bne- cr7,ffc0852c <== NEVER TAKEN /* 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)); ffc08520: 80 09 00 dc lwz r0,220(r9) ffc08524: 31 20 ff ff addic r9,r0,-1 ffc08528: 7f e9 01 10 subfe r31,r9,r0 thread_support->cancelation_requested ) cancel = true; _Thread_Enable_dispatch(); ffc0852c: 48 00 2e 61 bl ffc0b38c <_Thread_Enable_dispatch> if ( cancel ) ffc08530: 2f 9f 00 00 cmpwi cr7,r31,0 ffc08534: 41 be 00 14 beq+ cr7,ffc08548 _POSIX_Thread_Exit( _Thread_Executing, PTHREAD_CANCELED ); ffc08538: 3d 20 00 00 lis r9,0 ffc0853c: 80 69 27 d4 lwz r3,10196(r9) ffc08540: 38 80 ff ff li r4,-1 ffc08544: 48 00 69 21 bl ffc0ee64 <_POSIX_Thread_Exit> } ffc08548: 80 01 00 14 lwz r0,20(r1) ffc0854c: 83 e1 00 0c lwz r31,12(r1) ffc08550: 38 21 00 10 addi r1,r1,16 ffc08554: 7c 08 03 a6 mtlr r0 ffc08558: 4e 80 00 20 blr =============================================================================== ffc0a410 : rtems_status_code rtems_io_register_driver( rtems_device_major_number major, const rtems_driver_address_table *driver_table, rtems_device_major_number *registered_major ) { ffc0a410: 94 21 ff f0 stwu r1,-16(r1) ffc0a414: 7c 08 02 a6 mflr r0 rtems_device_major_number major_limit = _IO_Number_of_drivers; if ( rtems_interrupt_is_in_progress() ) ffc0a418: 3d 20 00 00 lis r9,0 rtems_status_code rtems_io_register_driver( rtems_device_major_number major, const rtems_driver_address_table *driver_table, rtems_device_major_number *registered_major ) { ffc0a41c: 90 01 00 14 stw r0,20(r1) rtems_device_major_number major_limit = _IO_Number_of_drivers; if ( rtems_interrupt_is_in_progress() ) ffc0a420: 80 09 27 b8 lwz r0,10168(r9) rtems_device_major_number major, const rtems_driver_address_table *driver_table, rtems_device_major_number *registered_major ) { rtems_device_major_number major_limit = _IO_Number_of_drivers; ffc0a424: 3d 20 00 00 lis r9,0 rtems_status_code rtems_io_register_driver( rtems_device_major_number major, const rtems_driver_address_table *driver_table, rtems_device_major_number *registered_major ) { ffc0a428: 93 e1 00 0c stw r31,12(r1) ffc0a42c: 7c 7f 1b 78 mr r31,r3 rtems_device_major_number major_limit = _IO_Number_of_drivers; if ( rtems_interrupt_is_in_progress() ) ffc0a430: 2f 80 00 00 cmpwi cr7,r0,0 ffc0a434: 38 60 00 12 li r3,18 rtems_device_major_number major, const rtems_driver_address_table *driver_table, rtems_device_major_number *registered_major ) { rtems_device_major_number major_limit = _IO_Number_of_drivers; ffc0a438: 80 09 28 08 lwz r0,10248(r9) if ( rtems_interrupt_is_in_progress() ) ffc0a43c: 40 9e 01 40 bne- cr7,ffc0a57c return RTEMS_CALLED_FROM_ISR; if ( registered_major == NULL ) ffc0a440: 2f 85 00 00 cmpwi cr7,r5,0 ffc0a444: 41 9e 01 34 beq- cr7,ffc0a578 return RTEMS_INVALID_ADDRESS; /* Set it to an invalid value */ *registered_major = major_limit; if ( driver_table == NULL ) ffc0a448: 2f 84 00 00 cmpwi cr7,r4,0 if ( registered_major == NULL ) return RTEMS_INVALID_ADDRESS; /* Set it to an invalid value */ *registered_major = major_limit; ffc0a44c: 90 05 00 00 stw r0,0(r5) if ( driver_table == NULL ) ffc0a450: 41 9e 01 28 beq- cr7,ffc0a578 static inline bool rtems_io_is_empty_table( const rtems_driver_address_table *table ) { return table->initialization_entry == NULL && table->open_entry == NULL; ffc0a454: 81 24 00 00 lwz r9,0(r4) ffc0a458: 2f 89 00 00 cmpwi cr7,r9,0 ffc0a45c: 40 be 01 34 bne+ cr7,ffc0a590 ffc0a460: 81 24 00 04 lwz r9,4(r4) ffc0a464: 2f 89 00 00 cmpwi cr7,r9,0 ffc0a468: 40 be 01 28 bne+ cr7,ffc0a590 ffc0a46c: 48 00 01 0c b ffc0a578 rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; ffc0a470: 3d 20 00 00 lis r9,0 ffc0a474: 81 69 27 90 lwz r11,10128(r9) ffc0a478: 38 0b 00 01 addi r0,r11,1 ffc0a47c: 90 09 27 90 stw r0,10128(r9) if ( major >= major_limit ) return RTEMS_INVALID_NUMBER; _Thread_Disable_dispatch(); if ( major == 0 ) { ffc0a480: 2f 9f 00 00 cmpwi cr7,r31,0 ffc0a484: 3d 20 00 00 lis r9,0 ffc0a488: 40 9e 00 58 bne- cr7,ffc0a4e0 static rtems_status_code rtems_io_obtain_major_number( rtems_device_major_number *major ) { rtems_device_major_number n = _IO_Number_of_drivers; ffc0a48c: 3d 60 00 00 lis r11,0 ffc0a490: 81 29 28 0c lwz r9,10252(r9) ffc0a494: 81 6b 28 08 lwz r11,10248(r11) ffc0a498: 2f 8b 00 00 cmpwi cr7,r11,0 ffc0a49c: 38 0b 00 01 addi r0,r11,1 ffc0a4a0: 40 be 00 28 bne+ cr7,ffc0a4c8 <== ALWAYS TAKEN ffc0a4a4: 38 00 00 01 li r0,1 <== NOT EXECUTED ffc0a4a8: 48 00 00 20 b ffc0a4c8 <== NOT EXECUTED static inline bool rtems_io_is_empty_table( const rtems_driver_address_table *table ) { return table->initialization_entry == NULL && table->open_entry == NULL; ffc0a4ac: 81 49 00 00 lwz r10,0(r9) ffc0a4b0: 2f 8a 00 00 cmpwi cr7,r10,0 ffc0a4b4: 40 be 00 ec bne+ cr7,ffc0a5a0 ffc0a4b8: 81 49 00 04 lwz r10,4(r9) ffc0a4bc: 2f 8a 00 00 cmpwi cr7,r10,0 ffc0a4c0: 40 be 00 e0 bne+ cr7,ffc0a5a0 ffc0a4c4: 48 00 00 0c b ffc0a4d0 rtems_device_major_number n = _IO_Number_of_drivers; rtems_device_major_number m = 0; /* major is error checked by caller */ for ( m = 0; m < n; ++m ) { ffc0a4c8: 34 00 ff ff addic. r0,r0,-1 ffc0a4cc: 40 82 ff e0 bne+ ffc0a4ac } /* Assigns invalid value in case of failure */ *major = m; if ( m != n ) ffc0a4d0: 7f 9f 58 00 cmpw cr7,r31,r11 if ( rtems_io_is_empty_table( table ) ) break; } /* Assigns invalid value in case of failure */ *major = m; ffc0a4d4: 93 e5 00 00 stw r31,0(r5) if ( m != n ) ffc0a4d8: 40 be 00 48 bne+ cr7,ffc0a520 ffc0a4dc: 48 00 00 d0 b ffc0a5ac _Thread_Enable_dispatch(); return sc; } major = *registered_major; } else { rtems_driver_address_table *const table = _IO_Driver_address_table + major; ffc0a4e0: 1c 1f 00 18 mulli r0,r31,24 ffc0a4e4: 81 29 28 0c lwz r9,10252(r9) static inline bool rtems_io_is_empty_table( const rtems_driver_address_table *table ) { return table->initialization_entry == NULL && table->open_entry == NULL; ffc0a4e8: 7d 69 00 2e lwzx r11,r9,r0 _Thread_Enable_dispatch(); return sc; } major = *registered_major; } else { rtems_driver_address_table *const table = _IO_Driver_address_table + major; ffc0a4ec: 7d 29 02 14 add r9,r9,r0 static inline bool rtems_io_is_empty_table( const rtems_driver_address_table *table ) { return table->initialization_entry == NULL && table->open_entry == NULL; ffc0a4f0: 38 00 00 00 li r0,0 ffc0a4f4: 2f 8b 00 00 cmpwi cr7,r11,0 ffc0a4f8: 40 be 00 10 bne+ cr7,ffc0a508 ffc0a4fc: 80 09 00 04 lwz r0,4(r9) ffc0a500: 7c 00 00 34 cntlzw r0,r0 ffc0a504: 54 00 d9 7e rlwinm r0,r0,27,5,31 } major = *registered_major; } else { rtems_driver_address_table *const table = _IO_Driver_address_table + major; if ( !rtems_io_is_empty_table( table ) ) { ffc0a508: 2f 80 00 00 cmpwi cr7,r0,0 ffc0a50c: 40 9e 00 10 bne- cr7,ffc0a51c _Thread_Enable_dispatch(); ffc0a510: 48 00 20 0d bl ffc0c51c <_Thread_Enable_dispatch> ffc0a514: 38 60 00 0c li r3,12 return RTEMS_RESOURCE_IN_USE; ffc0a518: 48 00 00 64 b ffc0a57c } *registered_major = major; ffc0a51c: 93 e5 00 00 stw r31,0(r5) } _IO_Driver_address_table [major] = *driver_table; ffc0a520: 3d 20 00 00 lis r9,0 ffc0a524: 80 c4 00 00 lwz r6,0(r4) ffc0a528: 81 69 28 0c lwz r11,10252(r9) ffc0a52c: 1c 1f 00 18 mulli r0,r31,24 ffc0a530: 80 e4 00 04 lwz r7,4(r4) ffc0a534: 81 04 00 08 lwz r8,8(r4) ffc0a538: 7d 2b 02 14 add r9,r11,r0 ffc0a53c: 81 44 00 0c lwz r10,12(r4) ffc0a540: 7c cb 01 2e stwx r6,r11,r0 ffc0a544: 90 e9 00 04 stw r7,4(r9) ffc0a548: 91 09 00 08 stw r8,8(r9) ffc0a54c: 91 49 00 0c stw r10,12(r9) ffc0a550: 81 64 00 14 lwz r11,20(r4) ffc0a554: 80 04 00 10 lwz r0,16(r4) ffc0a558: 91 69 00 14 stw r11,20(r9) ffc0a55c: 90 09 00 10 stw r0,16(r9) _Thread_Enable_dispatch(); ffc0a560: 48 00 1f bd bl ffc0c51c <_Thread_Enable_dispatch> return rtems_io_initialize( major, 0, NULL ); ffc0a564: 7f e3 fb 78 mr r3,r31 ffc0a568: 38 80 00 00 li r4,0 ffc0a56c: 38 a0 00 00 li r5,0 ffc0a570: 48 00 a2 69 bl ffc147d8 ffc0a574: 48 00 00 08 b ffc0a57c ffc0a578: 38 60 00 09 li r3,9 } ffc0a57c: 80 01 00 14 lwz r0,20(r1) ffc0a580: 83 e1 00 0c lwz r31,12(r1) ffc0a584: 38 21 00 10 addi r1,r1,16 ffc0a588: 7c 08 03 a6 mtlr r0 ffc0a58c: 4e 80 00 20 blr return RTEMS_INVALID_ADDRESS; if ( rtems_io_is_empty_table( driver_table ) ) return RTEMS_INVALID_ADDRESS; if ( major >= major_limit ) ffc0a590: 7f 9f 00 40 cmplw cr7,r31,r0 ffc0a594: 38 60 00 0a li r3,10 ffc0a598: 41 9c fe d8 blt+ cr7,ffc0a470 ffc0a59c: 4b ff ff e0 b ffc0a57c rtems_device_major_number n = _IO_Number_of_drivers; rtems_device_major_number m = 0; /* major is error checked by caller */ for ( m = 0; m < n; ++m ) { ffc0a5a0: 3b ff 00 01 addi r31,r31,1 ffc0a5a4: 39 29 00 18 addi r9,r9,24 ffc0a5a8: 4b ff ff 20 b ffc0a4c8 if ( major == 0 ) { rtems_status_code sc = rtems_io_obtain_major_number( registered_major ); if ( sc != RTEMS_SUCCESSFUL ) { _Thread_Enable_dispatch(); ffc0a5ac: 48 00 1f 71 bl ffc0c51c <_Thread_Enable_dispatch> ffc0a5b0: 38 60 00 05 li r3,5 return sc; ffc0a5b4: 4b ff ff c8 b ffc0a57c =============================================================================== ffc0b4ec : #include #include void rtems_iterate_over_all_threads(rtems_per_thread_routine routine) { ffc0b4ec: 94 21 ff e0 stwu r1,-32(r1) ffc0b4f0: 7c 08 02 a6 mflr r0 ffc0b4f4: 93 61 00 0c stw r27,12(r1) uint32_t i; uint32_t api_index; Thread_Control *the_thread; Objects_Information *information; if ( !routine ) ffc0b4f8: 7c 7b 1b 79 mr. r27,r3 #include #include void rtems_iterate_over_all_threads(rtems_per_thread_routine routine) { ffc0b4fc: 90 01 00 24 stw r0,36(r1) ffc0b500: 93 81 00 10 stw r28,16(r1) ffc0b504: 93 a1 00 14 stw r29,20(r1) ffc0b508: 93 c1 00 18 stw r30,24(r1) ffc0b50c: 93 e1 00 1c stw r31,28(r1) uint32_t i; uint32_t api_index; Thread_Control *the_thread; Objects_Information *information; if ( !routine ) ffc0b510: 41 82 00 68 beq- ffc0b578 <== NEVER TAKEN ffc0b514: 3f e0 00 01 lis r31,1 ffc0b518: 3b ff aa 44 addi r31,r31,-21948 #endif #include #include void rtems_iterate_over_all_threads(rtems_per_thread_routine routine) ffc0b51c: 3b 9f 00 10 addi r28,r31,16 if ( !routine ) return; for ( api_index = 1 ; api_index <= OBJECTS_APIS_LAST ; api_index++ ) { if ( !_Objects_Information_table[ api_index ] ) ffc0b520: 81 3f 00 00 lwz r9,0(r31) ffc0b524: 2f 89 00 00 cmpwi cr7,r9,0 ffc0b528: 41 9e 00 44 beq- cr7,ffc0b56c continue; information = _Objects_Information_table[ api_index ][ 1 ]; ffc0b52c: 83 a9 00 04 lwz r29,4(r9) if ( !information ) ffc0b530: 3b c0 00 01 li r30,1 ffc0b534: 2f 9d 00 00 cmpwi cr7,r29,0 ffc0b538: 40 be 00 20 bne+ cr7,ffc0b558 ffc0b53c: 48 00 00 30 b ffc0b56c continue; for ( i=1 ; i <= information->maximum ; i++ ) { the_thread = (Thread_Control *)information->local_table[ i ]; ffc0b540: 81 7d 00 1c lwz r11,28(r29) ffc0b544: 7c 6b 48 2e lwzx r3,r11,r9 if ( !the_thread ) ffc0b548: 2f 83 00 00 cmpwi cr7,r3,0 ffc0b54c: 41 9e 00 0c beq- cr7,ffc0b558 <== NEVER TAKEN continue; (*routine)(the_thread); ffc0b550: 7f 69 03 a6 mtctr r27 ffc0b554: 4e 80 04 21 bctrl information = _Objects_Information_table[ api_index ][ 1 ]; if ( !information ) continue; for ( i=1 ; i <= information->maximum ; i++ ) { ffc0b558: a0 1d 00 10 lhz r0,16(r29) the_thread = (Thread_Control *)information->local_table[ i ]; ffc0b55c: 57 c9 10 3a rlwinm r9,r30,2,0,29 information = _Objects_Information_table[ api_index ][ 1 ]; if ( !information ) continue; for ( i=1 ; i <= information->maximum ; i++ ) { ffc0b560: 7f 9e 00 40 cmplw cr7,r30,r0 ffc0b564: 3b de 00 01 addi r30,r30,1 ffc0b568: 40 9d ff d8 ble+ cr7,ffc0b540 ffc0b56c: 3b ff 00 04 addi r31,r31,4 Objects_Information *information; if ( !routine ) return; for ( api_index = 1 ; api_index <= OBJECTS_APIS_LAST ; api_index++ ) { ffc0b570: 7f 9f e0 00 cmpw cr7,r31,r28 ffc0b574: 40 9e ff ac bne+ cr7,ffc0b520 (*routine)(the_thread); } } } ffc0b578: 80 01 00 24 lwz r0,36(r1) ffc0b57c: 83 61 00 0c lwz r27,12(r1) ffc0b580: 7c 08 03 a6 mtlr r0 ffc0b584: 83 81 00 10 lwz r28,16(r1) ffc0b588: 83 a1 00 14 lwz r29,20(r1) ffc0b58c: 83 c1 00 18 lwz r30,24(r1) ffc0b590: 83 e1 00 1c lwz r31,28(r1) ffc0b594: 38 21 00 20 addi r1,r1,32 ffc0b598: 4e 80 00 20 blr =============================================================================== ffc16c0c : uint32_t length, uint32_t buffer_size, rtems_attribute attribute_set, rtems_id *id ) { ffc16c0c: 94 21 ff d0 stwu r1,-48(r1) ffc16c10: 7c 08 02 a6 mflr r0 ffc16c14: 93 e1 00 2c stw r31,44(r1) register Partition_Control *the_partition; if ( !rtems_is_name_valid( name ) ) ffc16c18: 7c 7f 1b 79 mr. r31,r3 ffc16c1c: 38 60 00 03 li r3,3 uint32_t length, uint32_t buffer_size, rtems_attribute attribute_set, rtems_id *id ) { ffc16c20: 93 41 00 18 stw r26,24(r1) ffc16c24: 7c fa 3b 78 mr r26,r7 ffc16c28: 93 81 00 20 stw r28,32(r1) ffc16c2c: 7d 1c 43 78 mr r28,r8 ffc16c30: 93 c1 00 28 stw r30,40(r1) ffc16c34: 7c be 2b 78 mr r30,r5 ffc16c38: 90 01 00 34 stw r0,52(r1) ffc16c3c: 93 21 00 14 stw r25,20(r1) ffc16c40: 93 61 00 1c stw r27,28(r1) ffc16c44: 93 a1 00 24 stw r29,36(r1) register Partition_Control *the_partition; if ( !rtems_is_name_valid( name ) ) ffc16c48: 41 82 00 d0 beq- ffc16d18 return RTEMS_INVALID_NAME; if ( !starting_address ) ffc16c4c: 2f 84 00 00 cmpwi cr7,r4,0 ffc16c50: 41 9e 00 bc beq- cr7,ffc16d0c return RTEMS_INVALID_ADDRESS; if ( !id ) ffc16c54: 2f 88 00 00 cmpwi cr7,r8,0 ffc16c58: 41 9e 00 b4 beq- cr7,ffc16d0c <== NEVER TAKEN return RTEMS_INVALID_ADDRESS; if ( length == 0 || buffer_size == 0 || length < buffer_size || ffc16c5c: 2f 85 00 00 cmpwi cr7,r5,0 ffc16c60: 41 9e 00 b4 beq- cr7,ffc16d14 ffc16c64: 2f 86 00 00 cmpwi cr7,r6,0 ffc16c68: 41 9e 00 ac beq- cr7,ffc16d14 ffc16c6c: 7f 85 30 40 cmplw cr7,r5,r6 ffc16c70: 41 9c 00 a4 blt- cr7,ffc16d14 ffc16c74: 70 c0 00 07 andi. r0,r6,7 ffc16c78: 40 82 00 9c bne- ffc16d14 !_Partition_Is_buffer_size_aligned( buffer_size ) ) return RTEMS_INVALID_SIZE; if ( !_Addresses_Is_aligned( starting_address ) ) ffc16c7c: 70 99 00 07 andi. r25,r4,7 ffc16c80: 40 a2 00 8c bne+ ffc16d0c ffc16c84: 3d 20 00 00 lis r9,0 ffc16c88: 81 69 28 68 lwz r11,10344(r9) ffc16c8c: 38 0b 00 01 addi r0,r11,1 ffc16c90: 90 09 28 68 stw r0,10344(r9) * 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 ); ffc16c94: 3f 60 00 00 lis r27,0 ffc16c98: 90 81 00 08 stw r4,8(r1) ffc16c9c: 3b 7b 6e ec addi r27,r27,28396 ffc16ca0: 7f 63 db 78 mr r3,r27 ffc16ca4: 90 c1 00 0c stw r6,12(r1) ffc16ca8: 48 00 55 c9 bl ffc1c270 <_Objects_Allocate> _Thread_Disable_dispatch(); /* prevents deletion */ the_partition = _Partition_Allocate(); if ( !the_partition ) { ffc16cac: 7c 7d 1b 79 mr. r29,r3 ffc16cb0: 80 81 00 08 lwz r4,8(r1) ffc16cb4: 80 c1 00 0c lwz r6,12(r1) ffc16cb8: 40 a2 00 10 bne+ ffc16cc8 _Thread_Enable_dispatch(); ffc16cbc: 48 00 67 71 bl ffc1d42c <_Thread_Enable_dispatch> ffc16cc0: 38 60 00 05 li r3,5 return RTEMS_TOO_MANY; ffc16cc4: 48 00 00 54 b ffc16d18 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, ffc16cc8: 7c be 33 96 divwu r5,r30,r6 _Thread_Enable_dispatch(); return RTEMS_TOO_MANY; } #endif the_partition->starting_address = starting_address; ffc16ccc: 90 9d 00 10 stw r4,16(r29) the_partition->length = length; the_partition->buffer_size = buffer_size; ffc16cd0: 90 dd 00 18 stw r6,24(r29) the_partition->attribute_set = attribute_set; ffc16cd4: 93 5d 00 1c stw r26,28(r29) the_partition->number_of_used_blocks = 0; ffc16cd8: 93 3d 00 20 stw r25,32(r29) return RTEMS_TOO_MANY; } #endif the_partition->starting_address = starting_address; the_partition->length = length; ffc16cdc: 93 dd 00 14 stw r30,20(r29) 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, ffc16ce0: 38 7d 00 24 addi r3,r29,36 ffc16ce4: 48 00 3c f1 bl ffc1a9d4 <_Chain_Initialize> ffc16ce8: 80 1d 00 08 lwz r0,8(r29) ffc16cec: 81 7b 00 1c lwz r11,28(r27) ffc16cf0: 54 09 13 ba rlwinm r9,r0,2,14,29 information, _Objects_Get_index( the_object->id ), the_object ); the_object->name = name; ffc16cf4: 93 fd 00 0c stw r31,12(r29) #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; ffc16cf8: 7f ab 49 2e stwx r29,r11,r9 &_Partition_Information, &the_partition->Object, (Objects_Name) name ); *id = the_partition->Object.id; ffc16cfc: 90 1c 00 00 stw r0,0(r28) name, 0 /* Not used */ ); #endif _Thread_Enable_dispatch(); ffc16d00: 48 00 67 2d bl ffc1d42c <_Thread_Enable_dispatch> ffc16d04: 38 60 00 00 li r3,0 return RTEMS_SUCCESSFUL; ffc16d08: 48 00 00 10 b ffc16d18 ffc16d0c: 38 60 00 09 li r3,9 ffc16d10: 48 00 00 08 b ffc16d18 ffc16d14: 38 60 00 08 li r3,8 } ffc16d18: 80 01 00 34 lwz r0,52(r1) ffc16d1c: 83 21 00 14 lwz r25,20(r1) ffc16d20: 7c 08 03 a6 mtlr r0 ffc16d24: 83 41 00 18 lwz r26,24(r1) ffc16d28: 83 61 00 1c lwz r27,28(r1) ffc16d2c: 83 81 00 20 lwz r28,32(r1) ffc16d30: 83 a1 00 24 lwz r29,36(r1) ffc16d34: 83 c1 00 28 lwz r30,40(r1) ffc16d38: 83 e1 00 2c lwz r31,44(r1) ffc16d3c: 38 21 00 30 addi r1,r1,48 ffc16d40: 4e 80 00 20 blr =============================================================================== ffc16ebc : rtems_status_code rtems_partition_return_buffer( rtems_id id, void *buffer ) { ffc16ebc: 94 21 ff e0 stwu r1,-32(r1) ffc16ec0: 7c 08 02 a6 mflr r0 ffc16ec4: 90 01 00 24 stw r0,36(r1) ffc16ec8: 7c 60 1b 78 mr r0,r3 RTEMS_INLINE_ROUTINE Partition_Control *_Partition_Get ( Objects_Id id, Objects_Locations *location ) { return (Partition_Control *) ffc16ecc: 3c 60 00 00 lis r3,0 ffc16ed0: 93 e1 00 1c stw r31,28(r1) ffc16ed4: 38 63 6e ec addi r3,r3,28396 ffc16ed8: 7c 9f 23 78 mr r31,r4 ffc16edc: 38 a1 00 08 addi r5,r1,8 ffc16ee0: 93 c1 00 18 stw r30,24(r1) ffc16ee4: 7c 04 03 78 mr r4,r0 ffc16ee8: 48 00 59 7d bl ffc1c864 <_Objects_Get> register Partition_Control *the_partition; Objects_Locations location; the_partition = _Partition_Get( id, &location ); switch ( location ) { ffc16eec: 80 01 00 08 lwz r0,8(r1) ffc16ef0: 7c 7e 1b 78 mr r30,r3 ffc16ef4: 2f 80 00 00 cmpwi cr7,r0,0 ffc16ef8: 38 60 00 04 li r3,4 ffc16efc: 40 9e 00 58 bne- cr7,ffc16f54 ) { void *starting; void *ending; starting = the_partition->starting_address; ffc16f00: 80 1e 00 10 lwz r0,16(r30) ending = _Addresses_Add_offset( starting, the_partition->length ); ffc16f04: 81 3e 00 14 lwz r9,20(r30) const void *address, const void *base, const void *limit ) { return (address >= base && address <= limit); ffc16f08: 7f 9f 00 40 cmplw cr7,r31,r0 ffc16f0c: 41 9c 00 60 blt- cr7,ffc16f6c ffc16f10: 7d 20 4a 14 add r9,r0,r9 ffc16f14: 7f 9f 48 40 cmplw cr7,r31,r9 ffc16f18: 41 9d 00 54 bgt- cr7,ffc16f6c <== NEVER TAKEN return ( ffc16f1c: 81 3e 00 18 lwz r9,24(r30) ffc16f20: 7c 00 f8 50 subf r0,r0,r31 ffc16f24: 7d 60 4b 96 divwu r11,r0,r9 ffc16f28: 7d 2b 49 d6 mullw r9,r11,r9 ffc16f2c: 7f 80 48 00 cmpw cr7,r0,r9 ffc16f30: 40 9e 00 3c bne- cr7,ffc16f6c RTEMS_INLINE_ROUTINE void _Partition_Free_buffer ( Partition_Control *the_partition, Chain_Node *the_buffer ) { _Chain_Append( &the_partition->Memory, the_buffer ); ffc16f34: 38 7e 00 24 addi r3,r30,36 ffc16f38: 7f e4 fb 78 mr r4,r31 ffc16f3c: 48 00 3a 29 bl ffc1a964 <_Chain_Append> case OBJECTS_LOCAL: if ( _Partition_Is_buffer_valid( buffer, the_partition ) ) { _Partition_Free_buffer( the_partition, buffer ); the_partition->number_of_used_blocks -= 1; ffc16f40: 81 3e 00 20 lwz r9,32(r30) ffc16f44: 38 09 ff ff addi r0,r9,-1 ffc16f48: 90 1e 00 20 stw r0,32(r30) _Thread_Enable_dispatch(); ffc16f4c: 48 00 64 e1 bl ffc1d42c <_Thread_Enable_dispatch> ffc16f50: 38 60 00 00 li r3,0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } ffc16f54: 80 01 00 24 lwz r0,36(r1) ffc16f58: 83 c1 00 18 lwz r30,24(r1) ffc16f5c: 7c 08 03 a6 mtlr r0 ffc16f60: 83 e1 00 1c lwz r31,28(r1) ffc16f64: 38 21 00 20 addi r1,r1,32 ffc16f68: 4e 80 00 20 blr _Partition_Free_buffer( the_partition, buffer ); the_partition->number_of_used_blocks -= 1; _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } _Thread_Enable_dispatch(); ffc16f6c: 48 00 64 c1 bl ffc1d42c <_Thread_Enable_dispatch> ffc16f70: 38 60 00 09 li r3,9 return RTEMS_INVALID_ADDRESS; ffc16f74: 4b ff ff e0 b ffc16f54 =============================================================================== ffc092d8 : rtems_status_code rtems_rate_monotonic_period( rtems_id id, rtems_interval length ) { ffc092d8: 94 21 ff d8 stwu r1,-40(r1) ffc092dc: 7c 08 02 a6 mflr r0 ffc092e0: 93 c1 00 20 stw r30,32(r1) ffc092e4: 7c 7e 1b 78 mr r30,r3 RTEMS_INLINE_ROUTINE Rate_monotonic_Control *_Rate_monotonic_Get ( Objects_Id id, Objects_Locations *location ) { return (Rate_monotonic_Control *) ffc092e8: 3c 60 00 00 lis r3,0 ffc092ec: 93 e1 00 24 stw r31,36(r1) ffc092f0: 38 63 2c 64 addi r3,r3,11364 ffc092f4: 7c 9f 23 78 mr r31,r4 ffc092f8: 38 a1 00 08 addi r5,r1,8 ffc092fc: 90 01 00 2c stw r0,44(r1) ffc09300: 7f c4 f3 78 mr r4,r30 ffc09304: 93 a1 00 1c stw r29,28(r1) ffc09308: 93 81 00 18 stw r28,24(r1) ffc0930c: 48 00 29 19 bl ffc0bc24 <_Objects_Get> ffc09310: 7c 7d 1b 78 mr r29,r3 rtems_rate_monotonic_period_states local_state; ISR_Level level; the_period = _Rate_monotonic_Get( id, &location ); switch ( location ) { ffc09314: 80 01 00 08 lwz r0,8(r1) ffc09318: 2f 80 00 00 cmpwi cr7,r0,0 ffc0931c: 40 9e 01 70 bne- cr7,ffc0948c case OBJECTS_LOCAL: if ( !_Thread_Is_executing( the_period->owner ) ) { ffc09320: 3d 20 00 00 lis r9,0 ffc09324: 80 09 28 34 lwz r0,10292(r9) ffc09328: 81 23 00 40 lwz r9,64(r3) ffc0932c: 7f 89 00 00 cmpw cr7,r9,r0 ffc09330: 41 9e 00 10 beq- cr7,ffc09340 _Thread_Enable_dispatch(); ffc09334: 48 00 34 01 bl ffc0c734 <_Thread_Enable_dispatch> ffc09338: 3b c0 00 17 li r30,23 return RTEMS_NOT_OWNER_OF_RESOURCE; ffc0933c: 48 00 01 54 b ffc09490 } if ( length == RTEMS_PERIOD_STATUS ) { ffc09340: 2f 9f 00 00 cmpwi cr7,r31,0 ffc09344: 40 be 00 28 bne+ cr7,ffc0936c switch ( the_period->state ) { ffc09348: 80 03 00 38 lwz r0,56(r3) ffc0934c: 3b c0 00 00 li r30,0 ffc09350: 2b 80 00 04 cmplwi cr7,r0,4 ffc09354: 41 9d 01 30 bgt- cr7,ffc09484 <== NEVER TAKEN ffc09358: 3d 20 ff c2 lis r9,-62 ffc0935c: 54 00 10 3a rlwinm r0,r0,2,0,29 ffc09360: 39 29 33 b4 addi r9,r9,13236 ffc09364: 7f c9 00 2e lwzx r30,r9,r0 ffc09368: 48 00 01 1c b ffc09484 static inline uint32_t ppc_interrupt_disable( void ) { uint32_t level; uint32_t mask; asm volatile ( ffc0936c: 7f 80 00 a6 mfmsr r28 ffc09370: 7c 10 42 a6 mfsprg r0,0 ffc09374: 7f 80 00 78 andc r0,r28,r0 ffc09378: 7c 00 01 24 mtmsr r0 _Thread_Enable_dispatch(); return( return_value ); } _ISR_Disable( level ); switch ( the_period->state ) { ffc0937c: 80 03 00 38 lwz r0,56(r3) ffc09380: 2f 80 00 02 cmpwi cr7,r0,2 ffc09384: 41 9e 00 60 beq- cr7,ffc093e4 ffc09388: 2f 80 00 04 cmpwi cr7,r0,4 ffc0938c: 41 9e 00 cc beq- cr7,ffc09458 ffc09390: 2f 80 00 00 cmpwi cr7,r0,0 ffc09394: 40 9e 00 f8 bne- cr7,ffc0948c <== NEVER TAKEN return level; } static inline void ppc_interrupt_enable( uint32_t level ) { asm volatile ( ffc09398: 7f 80 01 24 mtmsr r28 _ISR_Enable( level ); /* * Baseline statistics information for the beginning of a period. */ _Rate_monotonic_Initiate_statistics( the_period ); ffc0939c: 4b ff fc 99 bl ffc09034 <_Rate_monotonic_Initiate_statistics> the_period->state = RATE_MONOTONIC_ACTIVE; ffc093a0: 39 20 00 02 li r9,2 ffc093a4: 91 3d 00 38 stw r9,56(r29) Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; ffc093a8: 3d 20 ff c1 lis r9,-63 Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; ffc093ac: 38 00 00 00 li r0,0 the_watchdog->routine = routine; ffc093b0: 39 29 98 44 addi r9,r9,-26556 the_watchdog->id = id; ffc093b4: 93 dd 00 30 stw r30,48(r29) ) { the_watchdog->initial = units; _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); ffc093b8: 3c 60 00 00 lis r3,0 Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; ffc093bc: 91 3d 00 2c stw r9,44(r29) ) { the_watchdog->initial = units; _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); ffc093c0: 38 63 2e 68 addi r3,r3,11880 ffc093c4: 38 9d 00 10 addi r4,r29,16 ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; the_watchdog->id = id; the_watchdog->user_data = user_data; ffc093c8: 90 1d 00 34 stw r0,52(r29) ); the_period->next_length = length; _Watchdog_Insert_ticks( &the_period->Timer, length ); _Thread_Enable_dispatch(); ffc093cc: 3b c0 00 00 li r30,0 Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; ffc093d0: 93 fd 00 1c stw r31,28(r29) Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; ffc093d4: 90 1d 00 18 stw r0,24(r29) _Rate_monotonic_Timeout, id, NULL ); the_period->next_length = length; ffc093d8: 93 fd 00 3c stw r31,60(r29) ) { the_watchdog->initial = units; _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); ffc093dc: 48 00 4a 41 bl ffc0de1c <_Watchdog_Insert> ffc093e0: 48 00 00 a4 b ffc09484 case RATE_MONOTONIC_ACTIVE: /* * Update statistics from the concluding period. */ _Rate_monotonic_Update_statistics( the_period ); ffc093e4: 4b ff fd d9 bl ffc091bc <_Rate_monotonic_Update_statistics> /* * This tells the _Rate_monotonic_Timeout that this task is * in the process of blocking on the period and that we * may be changing the length of the next period. */ the_period->state = RATE_MONOTONIC_OWNER_IS_BLOCKING; ffc093e8: 38 00 00 01 li r0,1 the_period->next_length = length; ffc093ec: 93 fd 00 3c stw r31,60(r29) /* * 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; ffc093f0: 90 1d 00 38 stw r0,56(r29) ffc093f4: 7f 80 01 24 mtmsr r28 the_period->next_length = length; _ISR_Enable( level ); _Thread_Executing->Wait.id = the_period->Object.id; ffc093f8: 3d 20 00 00 lis r9,0 ffc093fc: 80 1d 00 08 lwz r0,8(r29) ffc09400: 81 29 28 34 lwz r9,10292(r9) _Thread_Set_state( _Thread_Executing, STATES_WAITING_FOR_PERIOD ); ffc09404: 38 80 40 00 li r4,16384 the_period->state = RATE_MONOTONIC_OWNER_IS_BLOCKING; the_period->next_length = length; _ISR_Enable( level ); _Thread_Executing->Wait.id = the_period->Object.id; ffc09408: 90 09 00 20 stw r0,32(r9) _Thread_Set_state( _Thread_Executing, STATES_WAITING_FOR_PERIOD ); ffc0940c: 7d 23 4b 78 mr r3,r9 ffc09410: 48 00 3e 09 bl ffc0d218 <_Thread_Set_state> static inline uint32_t ppc_interrupt_disable( void ) { uint32_t level; uint32_t mask; asm volatile ( ffc09414: 7d 20 00 a6 mfmsr r9 ffc09418: 7c 10 42 a6 mfsprg r0,0 ffc0941c: 7d 20 00 78 andc r0,r9,r0 ffc09420: 7c 00 01 24 mtmsr r0 * Did the watchdog timer expire while we were actually blocking * on it? */ _ISR_Disable( level ); local_state = the_period->state; the_period->state = RATE_MONOTONIC_ACTIVE; ffc09424: 39 60 00 02 li r11,2 /* * Did the watchdog timer expire while we were actually blocking * on it? */ _ISR_Disable( level ); local_state = the_period->state; ffc09428: 80 1d 00 38 lwz r0,56(r29) the_period->state = RATE_MONOTONIC_ACTIVE; ffc0942c: 91 7d 00 38 stw r11,56(r29) return level; } static inline void ppc_interrupt_enable( uint32_t level ) { asm volatile ( ffc09430: 7d 20 01 24 mtmsr r9 /* * 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 ) ffc09434: 2f 80 00 03 cmpwi cr7,r0,3 ffc09438: 40 be 00 14 bne+ cr7,ffc0944c <== ALWAYS TAKEN _Thread_Clear_state( _Thread_Executing, STATES_WAITING_FOR_PERIOD ); ffc0943c: 3d 20 00 00 lis r9,0 <== NOT EXECUTED ffc09440: 80 69 28 34 lwz r3,10292(r9) <== NOT EXECUTED ffc09444: 38 80 40 00 li r4,16384 <== NOT EXECUTED ffc09448: 48 00 2e 09 bl ffc0c250 <_Thread_Clear_state> <== NOT EXECUTED _Thread_Enable_dispatch(); ffc0944c: 48 00 32 e9 bl ffc0c734 <_Thread_Enable_dispatch> ffc09450: 3b c0 00 00 li r30,0 return RTEMS_SUCCESSFUL; ffc09454: 48 00 00 3c b ffc09490 case RATE_MONOTONIC_EXPIRED: /* * Update statistics from the concluding period */ _Rate_monotonic_Update_statistics( the_period ); ffc09458: 4b ff fd 65 bl ffc091bc <_Rate_monotonic_Update_statistics> ffc0945c: 7f 80 01 24 mtmsr r28 _ISR_Enable( level ); the_period->state = RATE_MONOTONIC_ACTIVE; ffc09460: 38 00 00 02 li r0,2 Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; ffc09464: 93 fd 00 1c stw r31,28(r29) _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); ffc09468: 3c 60 00 00 lis r3,0 ffc0946c: 90 1d 00 38 stw r0,56(r29) ffc09470: 38 63 2e 68 addi r3,r3,11880 ffc09474: 38 9d 00 10 addi r4,r29,16 the_period->next_length = length; ffc09478: 93 fd 00 3c stw r31,60(r29) _Watchdog_Insert_ticks( &the_period->Timer, length ); _Thread_Enable_dispatch(); ffc0947c: 3b c0 00 06 li r30,6 ffc09480: 48 00 49 9d bl ffc0de1c <_Watchdog_Insert> ffc09484: 48 00 32 b1 bl ffc0c734 <_Thread_Enable_dispatch> return RTEMS_TIMEOUT; ffc09488: 48 00 00 08 b ffc09490 ffc0948c: 3b c0 00 04 li r30,4 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } ffc09490: 80 01 00 2c lwz r0,44(r1) ffc09494: 7f c3 f3 78 mr r3,r30 ffc09498: 83 81 00 18 lwz r28,24(r1) ffc0949c: 7c 08 03 a6 mtlr r0 ffc094a0: 83 a1 00 1c lwz r29,28(r1) ffc094a4: 83 c1 00 20 lwz r30,32(r1) ffc094a8: 83 e1 00 24 lwz r31,36(r1) ffc094ac: 38 21 00 28 addi r1,r1,40 ffc094b0: 4e 80 00 20 blr =============================================================================== ffc094b4 : */ void rtems_rate_monotonic_report_statistics_with_plugin( void *context, rtems_printk_plugin_t print ) { ffc094b4: 94 21 ff 58 stwu r1,-168(r1) ffc094b8: 7c 08 02 a6 mflr r0 ffc094bc: 90 01 00 ac stw r0,172(r1) rtems_id id; rtems_rate_monotonic_period_statistics the_stats; rtems_rate_monotonic_period_status the_status; char name[5]; if ( !print ) ffc094c0: 7c 80 23 79 mr. r0,r4 */ void rtems_rate_monotonic_report_statistics_with_plugin( void *context, rtems_printk_plugin_t print ) { ffc094c4: 93 e1 00 a4 stw r31,164(r1) ffc094c8: 7c 7f 1b 78 mr r31,r3 ffc094cc: 92 41 00 70 stw r18,112(r1) ffc094d0: 92 61 00 74 stw r19,116(r1) ffc094d4: 92 81 00 78 stw r20,120(r1) ffc094d8: 92 a1 00 7c stw r21,124(r1) ffc094dc: 92 c1 00 80 stw r22,128(r1) ffc094e0: 92 e1 00 84 stw r23,132(r1) ffc094e4: 93 01 00 88 stw r24,136(r1) ffc094e8: 93 21 00 8c stw r25,140(r1) ffc094ec: 93 41 00 90 stw r26,144(r1) ffc094f0: 93 61 00 94 stw r27,148(r1) ffc094f4: 93 81 00 98 stw r28,152(r1) ffc094f8: 93 a1 00 9c stw r29,156(r1) ffc094fc: 93 c1 00 a0 stw r30,160(r1) rtems_id id; rtems_rate_monotonic_period_statistics the_stats; rtems_rate_monotonic_period_status the_status; char name[5]; if ( !print ) ffc09500: 90 01 00 68 stw r0,104(r1) ffc09504: 41 82 02 00 beq- ffc09704 <== NEVER TAKEN return; (*print)( context, "Period information by period\n" ); ffc09508: 3c 80 ff c2 lis r4,-62 ffc0950c: 7c 09 03 a6 mtctr r0 ffc09510: 38 84 33 c8 addi r4,r4,13256 rtems_object_get_name( the_status.owner, sizeof(name), name ); /* * Print part of report line that is not dependent on granularity */ (*print)( context, ffc09514: 3f 00 ff c2 lis r24,-62 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, ffc09518: 3f 20 ff c2 lis r25,-62 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, ffc0951c: 3f 40 ff c2 lis r26,-62 char name[5]; if ( !print ) return; (*print)( context, "Period information by period\n" ); ffc09520: 4c c6 31 82 crclr 4*cr1+eq ffc09524: 4e 80 04 21 bctrl #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ (*print)( context, "--- CPU times are in seconds ---\n" ); ffc09528: 80 01 00 68 lwz r0,104(r1) ffc0952c: 3c 80 ff c2 lis r4,-62 ffc09530: 7c 09 03 a6 mtctr r0 ffc09534: 38 84 33 e6 addi r4,r4,13286 ffc09538: 7f e3 fb 78 mr r3,r31 /* * If the count is zero, don't print statistics */ if (the_stats.count == 0) { (*print)( context, "\n" ); ffc0953c: 3e 40 ff c2 lis r18,-62 * 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 ); ffc09540: 3a 61 00 30 addi r19,r1,48 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 ); ffc09544: 3a 81 00 18 addi r20,r1,24 if ( !print ) return; (*print)( context, "Period information by period\n" ); #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ (*print)( context, "--- CPU times are in seconds ---\n" ); ffc09548: 4c c6 31 82 crclr 4*cr1+eq ffc0954c: 4e 80 04 21 bctrl (*print)( context, "--- Wall times are in seconds ---\n" ); ffc09550: 80 01 00 68 lwz r0,104(r1) ffc09554: 3c 80 ff c2 lis r4,-62 ffc09558: 7c 09 03 a6 mtctr r0 ffc0955c: 38 84 34 08 addi r4,r4,13320 ffc09560: 7f e3 fb 78 mr r3,r31 #if defined(RTEMS_DEBUG) if ( status != RTEMS_SUCCESSFUL ) continue; #endif rtems_object_get_name( the_status.owner, sizeof(name), name ); ffc09564: 3b 61 00 08 addi r27,r1,8 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 ); ffc09568: 3a a1 00 48 addi r21,r1,72 ffc0956c: 3b 81 00 10 addi r28,r1,16 return; (*print)( context, "Period information by period\n" ); #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ (*print)( context, "--- CPU times are in seconds ---\n" ); (*print)( context, "--- Wall times are in seconds ---\n" ); ffc09570: 4c c6 31 82 crclr 4*cr1+eq ffc09574: 4e 80 04 21 bctrl Be sure to test the various cases. (*print)( context,"\ 1234567890123456789012345678901234567890123456789012345678901234567890123456789\ \n"); */ (*print)( context, " ID OWNER COUNT MISSED " ffc09578: 80 01 00 68 lwz r0,104(r1) ffc0957c: 3c 80 ff c2 lis r4,-62 ffc09580: 7c 09 03 a6 mtctr r0 ffc09584: 38 84 34 2b addi r4,r4,13355 ffc09588: 7f e3 fb 78 mr r3,r31 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, ffc0958c: 3b a0 03 e8 li r29,1000 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); ffc09590: 3a c1 00 60 addi r22,r1,96 rtems_object_get_name( the_status.owner, sizeof(name), name ); /* * Print part of report line that is not dependent on granularity */ (*print)( context, ffc09594: 3b 18 34 c2 addi r24,r24,13506 Be sure to test the various cases. (*print)( context,"\ 1234567890123456789012345678901234567890123456789012345678901234567890123456789\ \n"); */ (*print)( context, " ID OWNER COUNT MISSED " ffc09598: 4c c6 31 82 crclr 4*cr1+eq ffc0959c: 4e 80 04 21 bctrl #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ " " #endif " WALL TIME\n" ); (*print)( context, " " ffc095a0: 80 01 00 68 lwz r0,104(r1) ffc095a4: 3c 80 ff c2 lis r4,-62 ffc095a8: 38 84 34 76 addi r4,r4,13430 ffc095ac: 7c 09 03 a6 mtctr r0 ffc095b0: 7f e3 fb 78 mr r3,r31 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, ffc095b4: 3b 39 34 d9 addi r25,r25,13529 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, ffc095b8: 3b 5a 34 f8 addi r26,r26,13560 /* * If the count is zero, don't print statistics */ if (the_stats.count == 0) { (*print)( context, "\n" ); ffc095bc: 3a 52 33 96 addi r18,r18,13206 #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ " " #endif " WALL TIME\n" ); (*print)( context, " " ffc095c0: 4c c6 31 82 crclr 4*cr1+eq ffc095c4: 4e 80 04 21 bctrl /* * 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 ; ffc095c8: 3d 20 00 00 lis r9,0 ffc095cc: 39 29 2c 64 addi r9,r9,11364 ffc095d0: 7d 37 4b 78 mr r23,r9 ffc095d4: 83 c9 00 08 lwz r30,8(r9) ffc095d8: 48 00 01 18 b ffc096f0 id <= _Rate_monotonic_Information.maximum_id ; id++ ) { status = rtems_rate_monotonic_get_statistics( id, &the_stats ); ffc095dc: 48 00 6f dd bl ffc105b8 if ( status != RTEMS_SUCCESSFUL ) ffc095e0: 2f 83 00 00 cmpwi cr7,r3,0 ffc095e4: 40 be 01 08 bne+ cr7,ffc096ec continue; /* If the above passed, so should this but check it anyway */ status = rtems_rate_monotonic_get_status( id, &the_status ); ffc095e8: 7e 84 a3 78 mr r4,r20 ffc095ec: 7f c3 f3 78 mr r3,r30 ffc095f0: 48 00 70 99 bl ffc10688 #if defined(RTEMS_DEBUG) if ( status != RTEMS_SUCCESSFUL ) continue; #endif rtems_object_get_name( the_status.owner, sizeof(name), name ); ffc095f4: 80 61 00 18 lwz r3,24(r1) ffc095f8: 7f 65 db 78 mr r5,r27 ffc095fc: 38 80 00 05 li r4,5 ffc09600: 48 00 03 0d bl ffc0990c /* * Print part of report line that is not dependent on granularity */ (*print)( context, ffc09604: 80 01 00 68 lwz r0,104(r1) ffc09608: 7f 04 c3 78 mr r4,r24 ffc0960c: 80 e1 00 30 lwz r7,48(r1) ffc09610: 7f c5 f3 78 mr r5,r30 ffc09614: 7c 09 03 a6 mtctr r0 ffc09618: 7f e3 fb 78 mr r3,r31 ffc0961c: 81 01 00 34 lwz r8,52(r1) ffc09620: 7f 66 db 78 mr r6,r27 ffc09624: 4c c6 31 82 crclr 4*cr1+eq ffc09628: 4e 80 04 21 bctrl ); /* * If the count is zero, don't print statistics */ if (the_stats.count == 0) { ffc0962c: 80 01 00 30 lwz r0,48(r1) 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 ); ffc09630: 7e a3 ab 78 mr r3,r21 ); /* * If the count is zero, don't print statistics */ if (the_stats.count == 0) { ffc09634: 2f 80 00 00 cmpwi cr7,r0,0 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 ); ffc09638: 7f 85 e3 78 mr r5,r28 /* * If the count is zero, don't print statistics */ if (the_stats.count == 0) { (*print)( context, "\n" ); ffc0963c: 7e 44 93 78 mr r4,r18 ); /* * If the count is zero, don't print statistics */ if (the_stats.count == 0) { ffc09640: 40 9e 00 1c bne- cr7,ffc0965c (*print)( context, "\n" ); ffc09644: 80 01 00 68 lwz r0,104(r1) ffc09648: 7f e3 fb 78 mr r3,r31 ffc0964c: 7c 09 03 a6 mtctr r0 ffc09650: 4c c6 31 82 crclr 4*cr1+eq ffc09654: 4e 80 04 21 bctrl continue; ffc09658: 48 00 00 94 b ffc096ec 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 ); ffc0965c: 7c 04 03 78 mr r4,r0 ffc09660: 48 00 41 d5 bl ffc0d834 <_Timespec_Divide_by_integer> (*print)( context, ffc09664: 80 01 00 68 lwz r0,104(r1) ffc09668: 80 c1 00 3c lwz r6,60(r1) ffc0966c: 7f 24 cb 78 mr r4,r25 ffc09670: 81 01 00 44 lwz r8,68(r1) ffc09674: 7c 09 03 a6 mtctr r0 ffc09678: 81 41 00 14 lwz r10,20(r1) ffc0967c: 7c c6 eb d6 divw r6,r6,r29 ffc09680: 80 e1 00 40 lwz r7,64(r1) ffc09684: 81 21 00 10 lwz r9,16(r1) ffc09688: 80 a1 00 38 lwz r5,56(r1) ffc0968c: 7d 08 eb d6 divw r8,r8,r29 ffc09690: 7d 4a eb d6 divw r10,r10,r29 ffc09694: 7f e3 fb 78 mr r3,r31 ffc09698: 4c c6 31 82 crclr 4*cr1+eq ffc0969c: 4e 80 04 21 bctrl 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); ffc096a0: 80 81 00 30 lwz r4,48(r1) ffc096a4: 7e c3 b3 78 mr r3,r22 ffc096a8: 7f 85 e3 78 mr r5,r28 ffc096ac: 48 00 41 89 bl ffc0d834 <_Timespec_Divide_by_integer> (*print)( context, ffc096b0: 80 c1 00 54 lwz r6,84(r1) ffc096b4: 81 01 00 5c lwz r8,92(r1) ffc096b8: 7f e3 fb 78 mr r3,r31 ffc096bc: 81 41 00 14 lwz r10,20(r1) ffc096c0: 7c c6 eb d6 divw r6,r6,r29 ffc096c4: 80 01 00 68 lwz r0,104(r1) ffc096c8: 80 a1 00 50 lwz r5,80(r1) ffc096cc: 80 e1 00 58 lwz r7,88(r1) ffc096d0: 7c 09 03 a6 mtctr r0 ffc096d4: 81 21 00 10 lwz r9,16(r1) ffc096d8: 7d 08 eb d6 divw r8,r8,r29 ffc096dc: 7d 4a eb d6 divw r10,r10,r29 ffc096e0: 7f 44 d3 78 mr r4,r26 ffc096e4: 4c c6 31 82 crclr 4*cr1+eq ffc096e8: 4e 80 04 21 bctrl * 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++ ) { ffc096ec: 3b de 00 01 addi r30,r30,1 /* * Cycle through all possible ids and try to report on each one. If it * is a period that is inactive, we just get an error back. No big deal. */ for ( id=_Rate_monotonic_Information.minimum_id ; ffc096f0: 80 17 00 0c lwz r0,12(r23) id <= _Rate_monotonic_Information.maximum_id ; id++ ) { status = rtems_rate_monotonic_get_statistics( id, &the_stats ); ffc096f4: 7f c3 f3 78 mr r3,r30 ffc096f8: 7e 64 9b 78 mr r4,r19 /* * 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 ; ffc096fc: 7f 9e 00 40 cmplw cr7,r30,r0 ffc09700: 40 9d fe dc ble+ cr7,ffc095dc the_stats.min_wall_time, the_stats.max_wall_time, ival_wall, fval_wall ); #endif } } } ffc09704: 80 01 00 ac lwz r0,172(r1) ffc09708: 82 41 00 70 lwz r18,112(r1) ffc0970c: 7c 08 03 a6 mtlr r0 ffc09710: 82 61 00 74 lwz r19,116(r1) ffc09714: 82 81 00 78 lwz r20,120(r1) ffc09718: 82 a1 00 7c lwz r21,124(r1) ffc0971c: 82 c1 00 80 lwz r22,128(r1) ffc09720: 82 e1 00 84 lwz r23,132(r1) ffc09724: 83 01 00 88 lwz r24,136(r1) ffc09728: 83 21 00 8c lwz r25,140(r1) ffc0972c: 83 41 00 90 lwz r26,144(r1) ffc09730: 83 61 00 94 lwz r27,148(r1) ffc09734: 83 81 00 98 lwz r28,152(r1) ffc09738: 83 a1 00 9c lwz r29,156(r1) ffc0973c: 83 c1 00 a0 lwz r30,160(r1) ffc09740: 83 e1 00 a4 lwz r31,164(r1) ffc09744: 38 21 00 a8 addi r1,r1,168 ffc09748: 4e 80 00 20 blr =============================================================================== ffc186fc : rtems_status_code rtems_signal_send( rtems_id id, rtems_signal_set signal_set ) { ffc186fc: 94 21 ff e0 stwu r1,-32(r1) ffc18700: 7c 08 02 a6 mflr r0 ffc18704: 93 e1 00 1c stw r31,28(r1) register Thread_Control *the_thread; Objects_Locations location; RTEMS_API_Control *api; ASR_Information *asr; if ( !signal_set ) ffc18708: 7c 9f 23 79 mr. r31,r4 rtems_status_code rtems_signal_send( rtems_id id, rtems_signal_set signal_set ) { ffc1870c: 90 01 00 24 stw r0,36(r1) register Thread_Control *the_thread; Objects_Locations location; RTEMS_API_Control *api; ASR_Information *asr; if ( !signal_set ) ffc18710: 38 00 00 0a li r0,10 ffc18714: 41 82 00 c0 beq- ffc187d4 return RTEMS_INVALID_NUMBER; the_thread = _Thread_Get( id, &location ); ffc18718: 38 81 00 08 addi r4,r1,8 ffc1871c: 48 00 4d 7d bl ffc1d498 <_Thread_Get> switch ( location ) { ffc18720: 81 21 00 08 lwz r9,8(r1) ffc18724: 38 00 00 04 li r0,4 ffc18728: 2f 89 00 00 cmpwi cr7,r9,0 ffc1872c: 40 9e 00 a8 bne- cr7,ffc187d4 case OBJECTS_LOCAL: api = the_thread->API_Extensions[ THREAD_API_RTEMS ]; ffc18730: 81 23 01 44 lwz r9,324(r3) asr = &api->Signal; ffc18734: 80 09 00 0c lwz r0,12(r9) ffc18738: 2f 80 00 00 cmpwi cr7,r0,0 ffc1873c: 41 9e 00 90 beq- cr7,ffc187cc if ( ! _ASR_Is_null_handler( asr->handler ) ) { if ( asr->is_enabled ) { ffc18740: 88 09 00 08 lbz r0,8(r9) ffc18744: 2f 80 00 00 cmpwi cr7,r0,0 ffc18748: 41 9e 00 58 beq- cr7,ffc187a0 static inline uint32_t ppc_interrupt_disable( void ) { uint32_t level; uint32_t mask; asm volatile ( ffc1874c: 7c 00 00 a6 mfmsr r0 ffc18750: 7d 70 42 a6 mfsprg r11,0 ffc18754: 7c 0b 58 78 andc r11,r0,r11 ffc18758: 7d 60 01 24 mtmsr r11 ) { ISR_Level _level; _ISR_Disable( _level ); *signal_set |= signals; ffc1875c: 81 69 00 14 lwz r11,20(r9) ffc18760: 7d 7f fb 78 or r31,r11,r31 ffc18764: 93 e9 00 14 stw r31,20(r9) return level; } static inline void ppc_interrupt_enable( uint32_t level ) { asm volatile ( ffc18768: 7c 00 01 24 mtmsr r0 _ASR_Post_signals( signal_set, &asr->signals_posted ); the_thread->do_post_task_switch_extension = true; if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) ffc1876c: 3d 20 00 00 lis r9,0 ffc18770: 81 29 28 90 lwz r9,10384(r9) 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; ffc18774: 38 00 00 01 li r0,1 ffc18778: 98 03 00 74 stb r0,116(r3) if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) ffc1877c: 2f 89 00 00 cmpwi cr7,r9,0 ffc18780: 41 9e 00 40 beq- cr7,ffc187c0 ffc18784: 3d 20 00 00 lis r9,0 ffc18788: 81 29 28 a8 lwz r9,10408(r9) ffc1878c: 7f 83 48 00 cmpw cr7,r3,r9 ffc18790: 40 be 00 30 bne+ cr7,ffc187c0 <== NEVER TAKEN _ISR_Signals_to_thread_executing = true; ffc18794: 3d 20 00 00 lis r9,0 ffc18798: 98 09 28 c4 stb r0,10436(r9) ffc1879c: 48 00 00 24 b ffc187c0 static inline uint32_t ppc_interrupt_disable( void ) { uint32_t level; uint32_t mask; asm volatile ( ffc187a0: 7c 00 00 a6 mfmsr r0 ffc187a4: 7d 70 42 a6 mfsprg r11,0 ffc187a8: 7c 0b 58 78 andc r11,r0,r11 ffc187ac: 7d 60 01 24 mtmsr r11 ffc187b0: 81 69 00 18 lwz r11,24(r9) ffc187b4: 7d 7f fb 78 or r31,r11,r31 ffc187b8: 93 e9 00 18 stw r31,24(r9) return level; } static inline void ppc_interrupt_enable( uint32_t level ) { asm volatile ( ffc187bc: 7c 00 01 24 mtmsr r0 } else { _ASR_Post_signals( signal_set, &asr->signals_pending ); } _Thread_Enable_dispatch(); ffc187c0: 48 00 4c 6d bl ffc1d42c <_Thread_Enable_dispatch> ffc187c4: 38 00 00 00 li r0,0 return RTEMS_SUCCESSFUL; ffc187c8: 48 00 00 0c b ffc187d4 } _Thread_Enable_dispatch(); ffc187cc: 48 00 4c 61 bl ffc1d42c <_Thread_Enable_dispatch> ffc187d0: 38 00 00 0b li r0,11 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } ffc187d4: 7c 03 03 78 mr r3,r0 ffc187d8: 80 01 00 24 lwz r0,36(r1) ffc187dc: 83 e1 00 1c lwz r31,28(r1) ffc187e0: 38 21 00 20 addi r1,r1,32 ffc187e4: 7c 08 03 a6 mtlr r0 ffc187e8: 4e 80 00 20 blr =============================================================================== ffc142b0 : ASR_Information *asr; bool is_asr_enabled = false; bool needs_asr_dispatching = false; rtems_mode old_mode; if ( !previous_mode_set ) ffc142b0: 2c 05 00 00 cmpwi r5,0 rtems_status_code rtems_task_mode( rtems_mode mode_set, rtems_mode mask, rtems_mode *previous_mode_set ) { ffc142b4: 94 21 ff f0 stwu r1,-16(r1) ffc142b8: 7c 08 02 a6 mflr r0 ffc142bc: 93 e1 00 0c stw r31,12(r1) ffc142c0: 90 01 00 14 stw r0,20(r1) ASR_Information *asr; bool is_asr_enabled = false; bool needs_asr_dispatching = false; rtems_mode old_mode; if ( !previous_mode_set ) ffc142c4: 38 00 00 09 li r0,9 ffc142c8: 41 82 01 5c beq- ffc14424 return RTEMS_INVALID_ADDRESS; executing = _Thread_Executing; ffc142cc: 3d 20 00 00 lis r9,0 ffc142d0: 81 29 27 d0 lwz r9,10192(r9) api = executing->API_Extensions[ THREAD_API_RTEMS ]; asr = &api->Signal; old_mode = (executing->is_preemptible) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT; if ( executing->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_NONE ) ffc142d4: 80 09 00 7c lwz r0,124(r9) executing = _Thread_Executing; api = executing->API_Extensions[ THREAD_API_RTEMS ]; asr = &api->Signal; old_mode = (executing->is_preemptible) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT; ffc142d8: 89 49 00 75 lbz r10,117(r9) if ( executing->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_NONE ) ffc142dc: 2f 80 00 00 cmpwi cr7,r0,0 if ( !previous_mode_set ) return RTEMS_INVALID_ADDRESS; executing = _Thread_Executing; api = executing->API_Extensions[ THREAD_API_RTEMS ]; ffc142e0: 81 69 01 44 lwz r11,324(r9) asr = &api->Signal; old_mode = (executing->is_preemptible) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT; ffc142e4: 7d 4a 00 34 cntlzw r10,r10 ffc142e8: 55 4a d9 7e rlwinm r10,r10,27,5,31 ffc142ec: 55 4a 40 2e rlwinm r10,r10,8,0,23 if ( executing->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_NONE ) ffc142f0: 41 9e 00 08 beq- cr7,ffc142f8 old_mode |= RTEMS_NO_TIMESLICE; else old_mode |= RTEMS_TIMESLICE; ffc142f4: 61 4a 02 00 ori r10,r10,512 if ( !previous_mode_set ) return RTEMS_INVALID_ADDRESS; executing = _Thread_Executing; api = executing->API_Extensions[ THREAD_API_RTEMS ]; asr = &api->Signal; ffc142f8: 89 0b 00 08 lbz r8,8(r11) #ifndef ASM static inline uint32_t _CPU_ISR_Get_level( void ) { register unsigned int msr; _CPU_MSR_GET(msr); ffc142fc: 38 00 00 00 li r0,0 ffc14300: 7d 08 00 34 cntlzw r8,r8 ffc14304: 55 08 d9 7e rlwinm r8,r8,27,5,31 ffc14308: 55 08 50 2a rlwinm r8,r8,10,0,21 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; ffc1430c: 7d 0a 53 78 or r10,r8,r10 ffc14310: 7c 00 00 a6 mfmsr r0 /* * These are generic thread scheduling characteristics. */ if ( mask & RTEMS_PREEMPT_MASK ) ffc14314: 70 88 01 00 andi. r8,r4,256 old_mode |= RTEMS_TIMESLICE; old_mode |= (asr->is_enabled) ? RTEMS_ASR : RTEMS_NO_ASR; old_mode |= _ISR_Get_level(); *previous_mode_set = old_mode; ffc14318: 68 00 80 00 xori r0,r0,32768 ffc1431c: 54 00 8f fe rlwinm r0,r0,17,31,31 ffc14320: 7d 4a 03 78 or r10,r10,r0 ffc14324: 91 45 00 00 stw r10,0(r5) /* * These are generic thread scheduling characteristics. */ if ( mask & RTEMS_PREEMPT_MASK ) ffc14328: 41 82 00 10 beq- ffc14338 executing->is_preemptible = _Modes_Is_preempt(mode_set) ? true : false; ffc1432c: 68 60 01 00 xori r0,r3,256 ffc14330: 54 00 c7 fe rlwinm r0,r0,24,31,31 ffc14334: 98 09 00 75 stb r0,117(r9) if ( mask & RTEMS_TIMESLICE_MASK ) { ffc14338: 70 8a 02 00 andi. r10,r4,512 ffc1433c: 41 82 00 28 beq- ffc14364 if ( _Modes_Is_timeslice(mode_set) ) { ffc14340: 70 60 02 00 andi. r0,r3,512 ffc14344: 41 82 00 1c beq- ffc14360 executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE; executing->cpu_time_budget = _Thread_Ticks_per_timeslice; ffc14348: 3d 40 00 00 lis r10,0 ffc1434c: 80 0a 27 88 lwz r0,10120(r10) 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; ffc14350: 39 40 00 01 li r10,1 ffc14354: 91 49 00 7c stw r10,124(r9) executing->cpu_time_budget = _Thread_Ticks_per_timeslice; ffc14358: 90 09 00 78 stw r0,120(r9) ffc1435c: 48 00 00 08 b ffc14364 } else executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE; ffc14360: 90 09 00 7c stw r0,124(r9) /* * Set the new interrupt level */ if ( mask & RTEMS_INTERRUPT_MASK ) ffc14364: 70 80 00 01 andi. r0,r4,1 ffc14368: 41 82 00 2c beq- ffc14394 } static inline void _CPU_ISR_Set_level( uint32_t level ) { register unsigned int msr; _CPU_MSR_GET(msr); ffc1436c: 38 00 00 00 li r0,0 ffc14370: 7c 00 00 a6 mfmsr r0 if (!(level & CPU_MODES_INTERRUPT_MASK)) { ffc14374: 70 68 00 01 andi. r8,r3,1 ffc14378: 40 82 00 10 bne- ffc14388 static inline uint32_t ppc_interrupt_get_disable_mask( void ) { uint32_t mask; asm volatile ( ffc1437c: 7d 50 42 a6 mfsprg r10,0 msr |= ppc_interrupt_get_disable_mask(); ffc14380: 7d 40 03 78 or r0,r10,r0 ffc14384: 48 00 00 0c b ffc14390 ffc14388: 7d 50 42 a6 mfsprg r10,0 } else { msr &= ~ppc_interrupt_get_disable_mask(); ffc1438c: 7c 00 50 78 andc r0,r0,r10 } _CPU_MSR_SET(msr); ffc14390: 7c 00 01 24 mtmsr r0 */ is_asr_enabled = false; needs_asr_dispatching = false; if ( mask & RTEMS_ASR_MASK ) { ffc14394: 70 8a 04 00 andi. r10,r4,1024 ffc14398: 41 82 00 5c beq- ffc143f4 * Output: * *previous_mode_set - previous mode set * always return RTEMS_SUCCESSFUL; */ rtems_status_code rtems_task_mode( ffc1439c: 68 63 04 00 xori r3,r3,1024 if ( !previous_mode_set ) return RTEMS_INVALID_ADDRESS; executing = _Thread_Executing; api = executing->API_Extensions[ THREAD_API_RTEMS ]; asr = &api->Signal; ffc143a0: 88 0b 00 08 lbz r0,8(r11) * Output: * *previous_mode_set - previous mode set * always return RTEMS_SUCCESSFUL; */ rtems_status_code rtems_task_mode( ffc143a4: 54 63 b7 fe rlwinm r3,r3,22,31,31 if ( !previous_mode_set ) return RTEMS_INVALID_ADDRESS; executing = _Thread_Executing; api = executing->API_Extensions[ THREAD_API_RTEMS ]; asr = &api->Signal; ffc143a8: 7f 80 18 00 cmpw cr7,r0,r3 ffc143ac: 41 9e 00 48 beq- cr7,ffc143f4 needs_asr_dispatching = false; if ( mask & RTEMS_ASR_MASK ) { is_asr_enabled = _Modes_Is_asr_disabled( mode_set ) ? false : true; if ( is_asr_enabled != asr->is_enabled ) { asr->is_enabled = is_asr_enabled; ffc143b0: 98 6b 00 08 stb r3,8(r11) static inline uint32_t ppc_interrupt_disable( void ) { uint32_t level; uint32_t mask; asm volatile ( ffc143b4: 7c 00 00 a6 mfmsr r0 ffc143b8: 7d 50 42 a6 mfsprg r10,0 ffc143bc: 7c 0a 50 78 andc r10,r0,r10 ffc143c0: 7d 40 01 24 mtmsr r10 { rtems_signal_set _signals; ISR_Level _level; _ISR_Disable( _level ); _signals = information->signals_pending; ffc143c4: 81 0b 00 18 lwz r8,24(r11) information->signals_pending = information->signals_posted; ffc143c8: 81 4b 00 14 lwz r10,20(r11) information->signals_posted = _signals; ffc143cc: 91 0b 00 14 stw r8,20(r11) rtems_signal_set _signals; ISR_Level _level; _ISR_Disable( _level ); _signals = information->signals_pending; information->signals_pending = information->signals_posted; ffc143d0: 91 4b 00 18 stw r10,24(r11) return level; } static inline void ppc_interrupt_enable( uint32_t level ) { asm volatile ( ffc143d4: 7c 00 01 24 mtmsr r0 if ( !previous_mode_set ) return RTEMS_INVALID_ADDRESS; executing = _Thread_Executing; api = executing->API_Extensions[ THREAD_API_RTEMS ]; asr = &api->Signal; ffc143d8: 80 0b 00 14 lwz r0,20(r11) ffc143dc: 2f 80 00 00 cmpwi cr7,r0,0 ffc143e0: 41 9e 00 14 beq- cr7,ffc143f4 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; ffc143e4: 38 00 00 01 li r0,1 ffc143e8: 98 09 00 74 stb r0,116(r9) ffc143ec: 3b e0 00 01 li r31,1 ffc143f0: 48 00 00 08 b ffc143f8 ffc143f4: 3b e0 00 00 li r31,0 } } } if ( _System_state_Is_up( _System_state_Get() ) ) ffc143f8: 3d 20 00 00 lis r9,0 ffc143fc: 80 09 27 f4 lwz r0,10228(r9) ffc14400: 2f 80 00 03 cmpwi cr7,r0,3 ffc14404: 40 be 00 1c bne+ cr7,ffc14420 <== NEVER TAKEN if ( _Thread_Evaluate_mode() || needs_asr_dispatching ) ffc14408: 48 00 0d 61 bl ffc15168 <_Thread_Evaluate_mode> ffc1440c: 2f 83 00 00 cmpwi cr7,r3,0 ffc14410: 40 9e 00 0c bne- cr7,ffc1441c ffc14414: 2f 9f 00 00 cmpwi cr7,r31,0 ffc14418: 41 9e 00 08 beq- cr7,ffc14420 _Thread_Dispatch(); ffc1441c: 4b ff 7f 11 bl ffc0c32c <_Thread_Dispatch> ffc14420: 38 00 00 00 li r0,0 return RTEMS_SUCCESSFUL; } ffc14424: 7c 03 03 78 mr r3,r0 ffc14428: 80 01 00 14 lwz r0,20(r1) ffc1442c: 83 e1 00 0c lwz r31,12(r1) ffc14430: 38 21 00 10 addi r1,r1,16 ffc14434: 7c 08 03 a6 mtlr r0 ffc14438: 4e 80 00 20 blr =============================================================================== ffc0dce8 : rtems_status_code rtems_task_set_priority( rtems_id id, rtems_task_priority new_priority, rtems_task_priority *old_priority ) { ffc0dce8: 94 21 ff e0 stwu r1,-32(r1) ffc0dcec: 7c 08 02 a6 mflr r0 ffc0dcf0: 93 e1 00 1c stw r31,28(r1) register Thread_Control *the_thread; Objects_Locations location; if ( new_priority != RTEMS_CURRENT_PRIORITY && ffc0dcf4: 7c 9f 23 79 mr. r31,r4 rtems_status_code rtems_task_set_priority( rtems_id id, rtems_task_priority new_priority, rtems_task_priority *old_priority ) { ffc0dcf8: 93 c1 00 18 stw r30,24(r1) ffc0dcfc: 7c be 2b 78 mr r30,r5 ffc0dd00: 90 01 00 24 stw r0,36(r1) register Thread_Control *the_thread; Objects_Locations location; if ( new_priority != RTEMS_CURRENT_PRIORITY && ffc0dd04: 41 82 00 18 beq- ffc0dd1c ffc0dd08: 3d 20 00 00 lis r9,0 ffc0dd0c: 89 29 26 e4 lbz r9,9956(r9) ffc0dd10: 38 00 00 13 li r0,19 ffc0dd14: 7f 9f 48 40 cmplw cr7,r31,r9 ffc0dd18: 41 9d 00 68 bgt- cr7,ffc0dd80 !_RTEMS_tasks_Priority_is_valid( new_priority ) ) return RTEMS_INVALID_PRIORITY; if ( !old_priority ) ffc0dd1c: 2f 9e 00 00 cmpwi cr7,r30,0 ffc0dd20: 38 00 00 09 li r0,9 ffc0dd24: 41 9e 00 5c beq- cr7,ffc0dd80 return RTEMS_INVALID_ADDRESS; the_thread = _Thread_Get( id, &location ); ffc0dd28: 38 81 00 08 addi r4,r1,8 ffc0dd2c: 48 00 26 99 bl ffc103c4 <_Thread_Get> switch ( location ) { ffc0dd30: 81 21 00 08 lwz r9,8(r1) ffc0dd34: 38 00 00 04 li r0,4 ffc0dd38: 2f 89 00 00 cmpwi cr7,r9,0 ffc0dd3c: 40 9e 00 44 bne- cr7,ffc0dd80 case OBJECTS_LOCAL: /* XXX need helper to "convert" from core priority */ *old_priority = the_thread->current_priority; if ( new_priority != RTEMS_CURRENT_PRIORITY ) { ffc0dd40: 2f 9f 00 00 cmpwi cr7,r31,0 the_thread = _Thread_Get( id, &location ); switch ( location ) { case OBJECTS_LOCAL: /* XXX need helper to "convert" from core priority */ *old_priority = the_thread->current_priority; ffc0dd44: 80 03 00 14 lwz r0,20(r3) ffc0dd48: 90 1e 00 00 stw r0,0(r30) if ( new_priority != RTEMS_CURRENT_PRIORITY ) { ffc0dd4c: 41 9e 00 2c beq- cr7,ffc0dd78 the_thread->real_priority = new_priority; if ( the_thread->resource_count == 0 || ffc0dd50: 80 03 00 1c lwz r0,28(r3) case OBJECTS_LOCAL: /* XXX need helper to "convert" from core priority */ *old_priority = the_thread->current_priority; if ( new_priority != RTEMS_CURRENT_PRIORITY ) { the_thread->real_priority = new_priority; ffc0dd54: 93 e3 00 18 stw r31,24(r3) if ( the_thread->resource_count == 0 || ffc0dd58: 2f 80 00 00 cmpwi cr7,r0,0 ffc0dd5c: 41 9e 00 10 beq- cr7,ffc0dd6c the_thread->current_priority > new_priority ) ffc0dd60: 80 03 00 14 lwz r0,20(r3) ffc0dd64: 7f 80 f8 40 cmplw cr7,r0,r31 ffc0dd68: 40 9d 00 10 ble- cr7,ffc0dd78 <== ALWAYS TAKEN _Thread_Change_priority( the_thread, new_priority, false ); ffc0dd6c: 7f e4 fb 78 mr r4,r31 ffc0dd70: 38 a0 00 00 li r5,0 ffc0dd74: 48 00 1f 5d bl ffc0fcd0 <_Thread_Change_priority> } _Thread_Enable_dispatch(); ffc0dd78: 48 00 25 e1 bl ffc10358 <_Thread_Enable_dispatch> ffc0dd7c: 38 00 00 00 li r0,0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } ffc0dd80: 7c 03 03 78 mr r3,r0 ffc0dd84: 80 01 00 24 lwz r0,36(r1) ffc0dd88: 83 c1 00 18 lwz r30,24(r1) ffc0dd8c: 7c 08 03 a6 mtlr r0 ffc0dd90: 83 e1 00 1c lwz r31,28(r1) ffc0dd94: 38 21 00 20 addi r1,r1,32 ffc0dd98: 4e 80 00 20 blr =============================================================================== ffc192a4 : */ rtems_status_code rtems_timer_cancel( rtems_id id ) { ffc192a4: 94 21 ff e8 stwu r1,-24(r1) ffc192a8: 7c 08 02 a6 mflr r0 ffc192ac: 7c 64 1b 78 mr r4,r3 RTEMS_INLINE_ROUTINE Timer_Control *_Timer_Get ( Objects_Id id, Objects_Locations *location ) { return (Timer_Control *) ffc192b0: 3c 60 00 00 lis r3,0 ffc192b4: 90 01 00 1c stw r0,28(r1) ffc192b8: 38 63 79 6c addi r3,r3,31084 ffc192bc: 38 a1 00 08 addi r5,r1,8 ffc192c0: 48 00 35 a5 bl ffc1c864 <_Objects_Get> Timer_Control *the_timer; Objects_Locations location; the_timer = _Timer_Get( id, &location ); switch ( location ) { ffc192c4: 81 21 00 08 lwz r9,8(r1) ffc192c8: 38 00 00 04 li r0,4 ffc192cc: 2f 89 00 00 cmpwi cr7,r9,0 ffc192d0: 40 9e 00 20 bne- cr7,ffc192f0 case OBJECTS_LOCAL: if ( !_Timer_Is_dormant_class( the_timer->the_class ) ) ffc192d4: 80 03 00 38 lwz r0,56(r3) ffc192d8: 2f 80 00 04 cmpwi cr7,r0,4 ffc192dc: 41 9e 00 0c beq- cr7,ffc192e8 <== NEVER TAKEN (void) _Watchdog_Remove( &the_timer->Ticker ); ffc192e0: 38 63 00 10 addi r3,r3,16 ffc192e4: 48 00 5c 71 bl ffc1ef54 <_Watchdog_Remove> _Thread_Enable_dispatch(); ffc192e8: 48 00 41 45 bl ffc1d42c <_Thread_Enable_dispatch> ffc192ec: 38 00 00 00 li r0,0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } ffc192f0: 7c 03 03 78 mr r3,r0 ffc192f4: 80 01 00 1c lwz r0,28(r1) ffc192f8: 38 21 00 18 addi r1,r1,24 ffc192fc: 7c 08 03 a6 mtlr r0 ffc19300: 4e 80 00 20 blr =============================================================================== ffc19914 : rtems_id id, rtems_time_of_day *wall_time, rtems_timer_service_routine_entry routine, void *user_data ) { ffc19914: 94 21 ff c8 stwu r1,-56(r1) Timer_Control *the_timer; Objects_Locations location; rtems_interval seconds; Timer_server_Control *timer_server = _Timer_server; ffc19918: 3d 20 00 00 lis r9,0 rtems_id id, rtems_time_of_day *wall_time, rtems_timer_service_routine_entry routine, void *user_data ) { ffc1991c: 7c 08 02 a6 mflr r0 ffc19920: 93 e1 00 34 stw r31,52(r1) Timer_Control *the_timer; Objects_Locations location; rtems_interval seconds; Timer_server_Control *timer_server = _Timer_server; ffc19924: 83 e9 28 ec lwz r31,10476(r9) rtems_id id, rtems_time_of_day *wall_time, rtems_timer_service_routine_entry routine, void *user_data ) { ffc19928: 93 41 00 20 stw r26,32(r1) ffc1992c: 7c da 33 78 mr r26,r6 Timer_Control *the_timer; Objects_Locations location; rtems_interval seconds; Timer_server_Control *timer_server = _Timer_server; if ( !timer_server ) ffc19930: 2f 9f 00 00 cmpwi cr7,r31,0 rtems_id id, rtems_time_of_day *wall_time, rtems_timer_service_routine_entry routine, void *user_data ) { ffc19934: 93 81 00 28 stw r28,40(r1) ffc19938: 7c 9c 23 78 mr r28,r4 ffc1993c: 93 a1 00 2c stw r29,44(r1) ffc19940: 7c 7d 1b 78 mr r29,r3 Timer_Control *the_timer; Objects_Locations location; rtems_interval seconds; Timer_server_Control *timer_server = _Timer_server; if ( !timer_server ) ffc19944: 38 60 00 0e li r3,14 rtems_id id, rtems_time_of_day *wall_time, rtems_timer_service_routine_entry routine, void *user_data ) { ffc19948: 93 c1 00 30 stw r30,48(r1) ffc1994c: 7c be 2b 78 mr r30,r5 ffc19950: 90 01 00 3c stw r0,60(r1) ffc19954: 93 01 00 18 stw r24,24(r1) ffc19958: 93 21 00 1c stw r25,28(r1) ffc1995c: 93 61 00 24 stw r27,36(r1) Timer_Control *the_timer; Objects_Locations location; rtems_interval seconds; Timer_server_Control *timer_server = _Timer_server; if ( !timer_server ) ffc19960: 41 9e 00 c8 beq- cr7,ffc19a28 return RTEMS_INCORRECT_STATE; if ( !_TOD_Is_set ) ffc19964: 3d 20 00 00 lis r9,0 ffc19968: 88 09 28 70 lbz r0,10352(r9) ffc1996c: 38 60 00 0b li r3,11 ffc19970: 2f 80 00 00 cmpwi cr7,r0,0 ffc19974: 41 9e 00 b4 beq- cr7,ffc19a28 <== NEVER TAKEN return RTEMS_NOT_DEFINED; if ( !routine ) ffc19978: 2f 85 00 00 cmpwi cr7,r5,0 ffc1997c: 38 60 00 09 li r3,9 ffc19980: 41 9e 00 a8 beq- cr7,ffc19a28 return RTEMS_INVALID_ADDRESS; if ( !_TOD_Validate( wall_time ) ) ffc19984: 7c 83 23 78 mr r3,r4 ffc19988: 4b ff c5 75 bl ffc15efc <_TOD_Validate> ffc1998c: 2f 83 00 00 cmpwi cr7,r3,0 ffc19990: 41 9e 00 94 beq- cr7,ffc19a24 return RTEMS_INVALID_CLOCK; seconds = _TOD_To_seconds( wall_time ); ffc19994: 7f 83 e3 78 mr r3,r28 if ( seconds <= _TOD_Seconds_since_epoch() ) ffc19998: 3f 60 00 00 lis r27,0 return RTEMS_INVALID_ADDRESS; if ( !_TOD_Validate( wall_time ) ) return RTEMS_INVALID_CLOCK; seconds = _TOD_To_seconds( wall_time ); ffc1999c: 4b ff c4 d5 bl ffc15e70 <_TOD_To_seconds> if ( seconds <= _TOD_Seconds_since_epoch() ) ffc199a0: 80 1b 28 88 lwz r0,10376(r27) return RTEMS_INVALID_ADDRESS; if ( !_TOD_Validate( wall_time ) ) return RTEMS_INVALID_CLOCK; seconds = _TOD_To_seconds( wall_time ); ffc199a4: 7c 7c 1b 78 mr r28,r3 if ( seconds <= _TOD_Seconds_since_epoch() ) ffc199a8: 7f 83 00 40 cmplw cr7,r3,r0 ffc199ac: 40 9d 00 78 ble- cr7,ffc19a24 ffc199b0: 3c 60 00 00 lis r3,0 ffc199b4: 38 63 79 6c addi r3,r3,31084 ffc199b8: 7f a4 eb 78 mr r4,r29 ffc199bc: 38 a1 00 08 addi r5,r1,8 ffc199c0: 48 00 2e a5 bl ffc1c864 <_Objects_Get> return RTEMS_INVALID_CLOCK; the_timer = _Timer_Get( id, &location ); switch ( location ) { ffc199c4: 83 01 00 08 lwz r24,8(r1) ffc199c8: 7c 79 1b 78 mr r25,r3 ffc199cc: 2f 98 00 00 cmpwi cr7,r24,0 ffc199d0: 38 60 00 04 li r3,4 ffc199d4: 40 9e 00 54 bne- cr7,ffc19a28 case OBJECTS_LOCAL: (void) _Watchdog_Remove( &the_timer->Ticker ); ffc199d8: 38 79 00 10 addi r3,r25,16 ffc199dc: 48 00 55 79 bl ffc1ef54 <_Watchdog_Remove> void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; the_watchdog->id = id; ffc199e0: 93 b9 00 30 stw r29,48(r25) the_timer->the_class = TIMER_TIME_OF_DAY_ON_TASK; ffc199e4: 39 20 00 03 li r9,3 _Watchdog_Initialize( &the_timer->Ticker, routine, id, user_data ); the_timer->Ticker.initial = seconds - _TOD_Seconds_since_epoch(); ffc199e8: 80 1b 28 88 lwz r0,10376(r27) (*timer_server->schedule_operation)( timer_server, the_timer ); ffc199ec: 7f e3 fb 78 mr r3,r31 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; ffc199f0: 91 39 00 38 stw r9,56(r25) _Watchdog_Initialize( &the_timer->Ticker, routine, id, user_data ); the_timer->Ticker.initial = seconds - _TOD_Seconds_since_epoch(); (*timer_server->schedule_operation)( timer_server, the_timer ); ffc199f4: 7f 24 cb 78 mr r4,r25 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(); ffc199f8: 7f 80 e0 50 subf r28,r0,r28 (*timer_server->schedule_operation)( timer_server, the_timer ); ffc199fc: 80 1f 00 04 lwz r0,4(r31) Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; ffc19a00: 93 19 00 18 stw r24,24(r25) ffc19a04: 7c 09 03 a6 mtctr r0 the_watchdog->routine = routine; ffc19a08: 93 d9 00 2c stw r30,44(r25) the_watchdog->id = id; the_watchdog->user_data = user_data; ffc19a0c: 93 59 00 34 stw r26,52(r25) 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(); ffc19a10: 93 99 00 1c stw r28,28(r25) (*timer_server->schedule_operation)( timer_server, the_timer ); ffc19a14: 4e 80 04 21 bctrl _Thread_Enable_dispatch(); ffc19a18: 48 00 3a 15 bl ffc1d42c <_Thread_Enable_dispatch> ffc19a1c: 38 60 00 00 li r3,0 return RTEMS_SUCCESSFUL; ffc19a20: 48 00 00 08 b ffc19a28 ffc19a24: 38 60 00 14 li r3,20 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } ffc19a28: 80 01 00 3c lwz r0,60(r1) ffc19a2c: 83 01 00 18 lwz r24,24(r1) ffc19a30: 7c 08 03 a6 mtlr r0 ffc19a34: 83 21 00 1c lwz r25,28(r1) ffc19a38: 83 41 00 20 lwz r26,32(r1) ffc19a3c: 83 61 00 24 lwz r27,36(r1) ffc19a40: 83 81 00 28 lwz r28,40(r1) ffc19a44: 83 a1 00 2c lwz r29,44(r1) ffc19a48: 83 c1 00 30 lwz r30,48(r1) ffc19a4c: 83 e1 00 34 lwz r31,52(r1) ffc19a50: 38 21 00 38 addi r1,r1,56 ffc19a54: 4e 80 00 20 blr =============================================================================== ffc089d8 : int sched_get_priority_max( int policy ) { switch ( policy ) { ffc089d8: 2b 83 00 04 cmplwi cr7,r3,4 #include int sched_get_priority_max( int policy ) { ffc089dc: 94 21 ff f8 stwu r1,-8(r1) ffc089e0: 7c 08 02 a6 mflr r0 ffc089e4: 90 01 00 0c stw r0,12(r1) switch ( policy ) { ffc089e8: 41 9d 00 14 bgt- cr7,ffc089fc ffc089ec: 38 00 00 01 li r0,1 ffc089f0: 7c 03 18 30 slw r3,r0,r3 ffc089f4: 70 60 00 17 andi. r0,r3,23 ffc089f8: 40 82 00 18 bne- ffc08a10 <== ALWAYS TAKEN case SCHED_RR: case SCHED_SPORADIC: break; default: rtems_set_errno_and_return_minus_one( EINVAL ); ffc089fc: 48 00 a3 95 bl ffc12d90 <__errno> ffc08a00: 38 00 00 16 li r0,22 ffc08a04: 90 03 00 00 stw r0,0(r3) ffc08a08: 38 60 ff ff li r3,-1 ffc08a0c: 48 00 00 10 b ffc08a1c } return POSIX_SCHEDULER_MAXIMUM_PRIORITY; ffc08a10: 3d 20 00 00 lis r9,0 ffc08a14: 88 69 26 cc lbz r3,9932(r9) ffc08a18: 38 63 ff ff addi r3,r3,-1 } ffc08a1c: 80 01 00 0c lwz r0,12(r1) ffc08a20: 38 21 00 08 addi r1,r1,8 ffc08a24: 7c 08 03 a6 mtlr r0 ffc08a28: 4e 80 00 20 blr =============================================================================== ffc08a2c : int sched_get_priority_min( int policy ) { switch ( policy ) { ffc08a2c: 2b 83 00 04 cmplwi cr7,r3,4 #include int sched_get_priority_min( int policy ) { ffc08a30: 94 21 ff f8 stwu r1,-8(r1) ffc08a34: 7c 08 02 a6 mflr r0 ffc08a38: 90 01 00 0c stw r0,12(r1) switch ( policy ) { ffc08a3c: 41 9d 00 18 bgt- cr7,ffc08a54 ffc08a40: 38 00 00 01 li r0,1 ffc08a44: 7c 03 18 30 slw r3,r0,r3 ffc08a48: 70 60 00 17 andi. r0,r3,23 ffc08a4c: 38 60 00 01 li r3,1 ffc08a50: 40 82 00 14 bne- ffc08a64 <== ALWAYS TAKEN case SCHED_RR: case SCHED_SPORADIC: break; default: rtems_set_errno_and_return_minus_one( EINVAL ); ffc08a54: 48 00 a3 3d bl ffc12d90 <__errno> ffc08a58: 38 00 00 16 li r0,22 ffc08a5c: 90 03 00 00 stw r0,0(r3) ffc08a60: 38 60 ff ff li r3,-1 } return POSIX_SCHEDULER_MINIMUM_PRIORITY; } ffc08a64: 80 01 00 0c lwz r0,12(r1) ffc08a68: 38 21 00 08 addi r1,r1,8 ffc08a6c: 7c 08 03 a6 mtlr r0 ffc08a70: 4e 80 00 20 blr =============================================================================== ffc08a74 : int sched_rr_get_interval( pid_t pid, struct timespec *interval ) { ffc08a74: 94 21 ff e8 stwu r1,-24(r1) ffc08a78: 7c 08 02 a6 mflr r0 ffc08a7c: 93 e1 00 14 stw r31,20(r1) /* * Only supported for the "calling process" (i.e. this node). */ if ( pid && pid != getpid() ) ffc08a80: 7c 7f 1b 79 mr. r31,r3 int sched_rr_get_interval( pid_t pid, struct timespec *interval ) { ffc08a84: 90 01 00 1c stw r0,28(r1) /* * Only supported for the "calling process" (i.e. this node). */ if ( pid && pid != getpid() ) ffc08a88: 41 a2 00 24 beq+ ffc08aac <== NEVER TAKEN ffc08a8c: 90 81 00 08 stw r4,8(r1) ffc08a90: 4b ff c2 5d bl ffc04cec ffc08a94: 7f 9f 18 00 cmpw cr7,r31,r3 ffc08a98: 80 81 00 08 lwz r4,8(r1) ffc08a9c: 41 be 00 10 beq+ cr7,ffc08aac rtems_set_errno_and_return_minus_one( ESRCH ); ffc08aa0: 48 00 a2 f1 bl ffc12d90 <__errno> ffc08aa4: 38 00 00 03 li r0,3 ffc08aa8: 48 00 00 14 b ffc08abc if ( !interval ) ffc08aac: 2f 84 00 00 cmpwi cr7,r4,0 ffc08ab0: 40 be 00 18 bne+ cr7,ffc08ac8 rtems_set_errno_and_return_minus_one( EINVAL ); ffc08ab4: 48 00 a2 dd bl ffc12d90 <__errno> ffc08ab8: 38 00 00 16 li r0,22 ffc08abc: 90 03 00 00 stw r0,0(r3) ffc08ac0: 38 60 ff ff li r3,-1 ffc08ac4: 48 00 00 14 b ffc08ad8 _Timespec_From_ticks( _Thread_Ticks_per_timeslice, interval ); ffc08ac8: 3d 20 00 00 lis r9,0 ffc08acc: 80 69 27 90 lwz r3,10128(r9) ffc08ad0: 48 00 41 11 bl ffc0cbe0 <_Timespec_From_ticks> ffc08ad4: 38 60 00 00 li r3,0 return 0; } ffc08ad8: 80 01 00 1c lwz r0,28(r1) ffc08adc: 83 e1 00 14 lwz r31,20(r1) ffc08ae0: 38 21 00 18 addi r1,r1,24 ffc08ae4: 7c 08 03 a6 mtlr r0 ffc08ae8: 4e 80 00 20 blr =============================================================================== ffc0b368 : rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; ffc0b368: 3d 20 00 00 lis r9,0 int oflag, ... /* mode_t mode, */ /* unsigned int value */ ) { ffc0b36c: 94 21 ff b8 stwu r1,-72(r1) ffc0b370: 7c 08 02 a6 mflr r0 ffc0b374: 81 69 27 90 lwz r11,10128(r9) ffc0b378: 93 c1 00 40 stw r30,64(r1) ffc0b37c: 7c 9e 23 78 mr r30,r4 ffc0b380: 39 6b 00 01 addi r11,r11,1 ffc0b384: 93 e1 00 44 stw r31,68(r1) ffc0b388: 7c 7f 1b 78 mr r31,r3 ffc0b38c: 90 01 00 4c stw r0,76(r1) ffc0b390: 93 61 00 34 stw r27,52(r1) ffc0b394: 93 81 00 38 stw r28,56(r1) ffc0b398: 93 a1 00 3c stw r29,60(r1) ffc0b39c: 90 a1 00 28 stw r5,40(r1) ffc0b3a0: 91 69 27 90 stw r11,10128(r9) ffc0b3a4: 90 c1 00 2c stw r6,44(r1) POSIX_Semaphore_Control *the_semaphore; Objects_Locations location; _Thread_Disable_dispatch(); if ( oflag & O_CREAT ) { ffc0b3a8: 70 9c 02 00 andi. r28,r4,512 ffc0b3ac: 40 82 00 0c bne- ffc0b3b8 ffc0b3b0: 3b a0 00 00 li r29,0 ffc0b3b4: 48 00 00 20 b ffc0b3d4 va_start(arg, oflag); ffc0b3b8: 38 01 00 50 addi r0,r1,80 mode = (mode_t) va_arg( arg, unsigned int ); value = va_arg( arg, unsigned int ); ffc0b3bc: 83 a1 00 2c lwz r29,44(r1) Objects_Locations location; _Thread_Disable_dispatch(); if ( oflag & O_CREAT ) { va_start(arg, oflag); ffc0b3c0: 90 01 00 18 stw r0,24(r1) ffc0b3c4: 38 01 00 20 addi r0,r1,32 ffc0b3c8: 90 01 00 1c stw r0,28(r1) mode = (mode_t) va_arg( arg, unsigned int ); value = va_arg( arg, unsigned int ); ffc0b3cc: 38 00 00 04 li r0,4 ffc0b3d0: 98 01 00 14 stb r0,20(r1) va_end(arg); } status = _POSIX_Semaphore_Name_to_id( name, &the_semaphore_id ); ffc0b3d4: 7f e3 fb 78 mr r3,r31 ffc0b3d8: 38 81 00 08 addi r4,r1,8 ffc0b3dc: 48 00 72 05 bl ffc125e0 <_POSIX_Semaphore_Name_to_id> * 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 ) { ffc0b3e0: 7c 7b 1b 79 mr. r27,r3 ffc0b3e4: 41 82 00 24 beq- ffc0b408 /* * 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) ) ) { ffc0b3e8: 2f 9b 00 02 cmpwi cr7,r27,2 ffc0b3ec: 40 9e 00 0c bne- cr7,ffc0b3f8 <== NEVER TAKEN ffc0b3f0: 2f 9c 00 00 cmpwi cr7,r28,0 ffc0b3f4: 40 9e 00 68 bne- cr7,ffc0b45c _Thread_Enable_dispatch(); ffc0b3f8: 48 00 31 b1 bl ffc0e5a8 <_Thread_Enable_dispatch> rtems_set_errno_and_return_minus_one_cast( status, sem_t * ); ffc0b3fc: 48 00 b3 39 bl ffc16734 <__errno> ffc0b400: 93 63 00 00 stw r27,0(r3) ffc0b404: 48 00 00 20 b ffc0b424 /* * Check for existence with creation. */ if ( (oflag & (O_CREAT | O_EXCL)) == (O_CREAT | O_EXCL) ) { ffc0b408: 73 de 0a 00 andi. r30,r30,2560 ffc0b40c: 2f 9e 0a 00 cmpwi cr7,r30,2560 ffc0b410: 40 be 00 1c bne+ cr7,ffc0b42c _Thread_Enable_dispatch(); ffc0b414: 48 00 31 95 bl ffc0e5a8 <_Thread_Enable_dispatch> rtems_set_errno_and_return_minus_one_cast( EEXIST, sem_t * ); ffc0b418: 48 00 b3 1d bl ffc16734 <__errno> ffc0b41c: 38 00 00 11 li r0,17 ffc0b420: 90 03 00 00 stw r0,0(r3) ffc0b424: 38 60 ff ff li r3,-1 ffc0b428: 48 00 00 64 b ffc0b48c ffc0b42c: 80 81 00 08 lwz r4,8(r1) ffc0b430: 3c 60 00 00 lis r3,0 ffc0b434: 38 a1 00 10 addi r5,r1,16 ffc0b438: 38 63 30 d8 addi r3,r3,12504 ffc0b43c: 48 00 25 f1 bl ffc0da2c <_Objects_Get> } the_semaphore = _POSIX_Semaphore_Get( &the_semaphore_id, &location ); the_semaphore->open_count += 1; ffc0b440: 81 23 00 18 lwz r9,24(r3) 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 ); ffc0b444: 90 61 00 0c stw r3,12(r1) the_semaphore->open_count += 1; ffc0b448: 38 09 00 01 addi r0,r9,1 ffc0b44c: 90 03 00 18 stw r0,24(r3) _Thread_Enable_dispatch(); ffc0b450: 48 00 31 59 bl ffc0e5a8 <_Thread_Enable_dispatch> _Thread_Enable_dispatch(); ffc0b454: 48 00 31 55 bl ffc0e5a8 <_Thread_Enable_dispatch> goto return_id; ffc0b458: 48 00 00 2c b ffc0b484 /* * 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( ffc0b45c: 7f a5 eb 78 mr r5,r29 ffc0b460: 7f e3 fb 78 mr r3,r31 ffc0b464: 38 80 00 00 li r4,0 ffc0b468: 38 c1 00 0c addi r6,r1,12 ffc0b46c: 48 00 6f c9 bl ffc12434 <_POSIX_Semaphore_Create_support> ffc0b470: 7c 7f 1b 78 mr r31,r3 /* * errno was set by Create_support, so don't set it again. */ _Thread_Enable_dispatch(); ffc0b474: 48 00 31 35 bl ffc0e5a8 <_Thread_Enable_dispatch> if ( status == -1 ) ffc0b478: 2f 9f ff ff cmpwi cr7,r31,-1 ffc0b47c: 38 60 ff ff li r3,-1 ffc0b480: 41 9e 00 0c beq- cr7,ffc0b48c 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; ffc0b484: 80 61 00 0c lwz r3,12(r1) ffc0b488: 38 63 00 08 addi r3,r3,8 #endif return id; } ffc0b48c: 80 01 00 4c lwz r0,76(r1) ffc0b490: 83 61 00 34 lwz r27,52(r1) ffc0b494: 7c 08 03 a6 mtlr r0 ffc0b498: 83 81 00 38 lwz r28,56(r1) ffc0b49c: 83 a1 00 3c lwz r29,60(r1) ffc0b4a0: 83 c1 00 40 lwz r30,64(r1) ffc0b4a4: 83 e1 00 44 lwz r31,68(r1) ffc0b4a8: 38 21 00 48 addi r1,r1,72 ffc0b4ac: 4e 80 00 20 blr =============================================================================== ffc08890 : struct sigaction *oact ) { ISR_Level level; if ( oact ) ffc08890: 2c 05 00 00 cmpwi r5,0 int sigaction( int sig, const struct sigaction *act, struct sigaction *oact ) { ffc08894: 94 21 ff e8 stwu r1,-24(r1) ffc08898: 7c 08 02 a6 mflr r0 ffc0889c: 93 c1 00 10 stw r30,16(r1) ffc088a0: 7c 9e 23 78 mr r30,r4 ffc088a4: 90 01 00 1c stw r0,28(r1) ffc088a8: 93 81 00 08 stw r28,8(r1) ffc088ac: 93 a1 00 0c stw r29,12(r1) ffc088b0: 93 e1 00 14 stw r31,20(r1) ISR_Level level; if ( oact ) ffc088b4: 41 82 00 2c beq- ffc088e0 *oact = _POSIX_signals_Vectors[ sig ]; ffc088b8: 1c 03 00 0c mulli r0,r3,12 ffc088bc: 3d 60 00 00 lis r11,0 ffc088c0: 39 6b 31 b0 addi r11,r11,12720 ffc088c4: 7d 2b 02 14 add r9,r11,r0 ffc088c8: 7d 6b 00 2e lwzx r11,r11,r0 ffc088cc: 81 49 00 08 lwz r10,8(r9) ffc088d0: 80 09 00 04 lwz r0,4(r9) ffc088d4: 91 45 00 08 stw r10,8(r5) ffc088d8: 91 65 00 00 stw r11,0(r5) ffc088dc: 90 05 00 04 stw r0,4(r5) if ( !sig ) ffc088e0: 2f 83 00 00 cmpwi cr7,r3,0 ffc088e4: 41 9e 00 18 beq- cr7,ffc088fc rtems_set_errno_and_return_minus_one( EINVAL ); if ( !is_valid_signo(sig) ) ffc088e8: 38 03 ff ff addi r0,r3,-1 ffc088ec: 2b 80 00 1f cmplwi cr7,r0,31 ffc088f0: 41 9d 00 0c bgt- cr7,ffc088fc * * NOTE: Solaris documentation claims to "silently enforce" this which * contradicts the POSIX specification. */ if ( sig == SIGKILL ) ffc088f4: 2f 83 00 09 cmpwi cr7,r3,9 ffc088f8: 40 be 00 18 bne+ cr7,ffc08910 rtems_set_errno_and_return_minus_one( EINVAL ); ffc088fc: 48 00 a6 b1 bl ffc12fac <__errno> ffc08900: 38 00 00 16 li r0,22 ffc08904: 90 03 00 00 stw r0,0(r3) ffc08908: 38 00 ff ff li r0,-1 ffc0890c: 48 00 00 7c b ffc08988 /* * Evaluate the new action structure and set the global signal vector * appropriately. */ if ( act ) { ffc08910: 2f 9e 00 00 cmpwi cr7,r30,0 ffc08914: 38 00 00 00 li r0,0 ffc08918: 41 9e 00 70 beq- cr7,ffc08988 <== NEVER TAKEN static inline uint32_t ppc_interrupt_disable( void ) { uint32_t level; uint32_t mask; asm volatile ( ffc0891c: 7f 80 00 a6 mfmsr r28 ffc08920: 7c 10 42 a6 mfsprg r0,0 ffc08924: 7f 80 00 78 andc r0,r28,r0 ffc08928: 7c 00 01 24 mtmsr r0 * Unless the user is installing the default signal actions, then * we can just copy the provided sigaction structure into the vectors. */ _ISR_Disable( level ); if ( act->sa_handler == SIG_DFL ) { ffc0892c: 80 1e 00 08 lwz r0,8(r30) ffc08930: 3f a0 00 00 lis r29,0 ffc08934: 3b bd 31 b0 addi r29,r29,12720 ffc08938: 2f 80 00 00 cmpwi cr7,r0,0 ffc0893c: 1f e3 00 0c mulli r31,r3,12 ffc08940: 40 be 00 20 bne+ cr7,ffc08960 _POSIX_signals_Vectors[ sig ] = _POSIX_signals_Default_vectors[ sig ]; ffc08944: 3d 60 ff c2 lis r11,-62 ffc08948: 39 6b 07 80 addi r11,r11,1920 ffc0894c: 7d 2b fa 14 add r9,r11,r31 ffc08950: 7d 4b f8 2e lwzx r10,r11,r31 ffc08954: 80 09 00 04 lwz r0,4(r9) ffc08958: 81 69 00 08 lwz r11,8(r9) ffc0895c: 48 00 00 14 b ffc08970 } else { _POSIX_signals_Clear_process_signals( sig ); ffc08960: 48 00 68 9d bl ffc0f1fc <_POSIX_signals_Clear_process_signals> _POSIX_signals_Vectors[ sig ] = *act; ffc08964: 81 7e 00 08 lwz r11,8(r30) ffc08968: 81 5e 00 00 lwz r10,0(r30) ffc0896c: 80 1e 00 04 lwz r0,4(r30) ffc08970: 7d 3d fa 14 add r9,r29,r31 ffc08974: 7d 5d f9 2e stwx r10,r29,r31 ffc08978: 91 69 00 08 stw r11,8(r9) ffc0897c: 90 09 00 04 stw r0,4(r9) return level; } static inline void ppc_interrupt_enable( uint32_t level ) { asm volatile ( ffc08980: 7f 80 01 24 mtmsr r28 ffc08984: 38 00 00 00 li r0,0 * + If we are now ignoring a signal that was previously pending, * we clear the pending signal indicator. */ return 0; } ffc08988: 7c 03 03 78 mr r3,r0 ffc0898c: 80 01 00 1c lwz r0,28(r1) ffc08990: 83 81 00 08 lwz r28,8(r1) ffc08994: 7c 08 03 a6 mtlr r0 ffc08998: 83 a1 00 0c lwz r29,12(r1) ffc0899c: 83 c1 00 10 lwz r30,16(r1) ffc089a0: 83 e1 00 14 lwz r31,20(r1) ffc089a4: 38 21 00 18 addi r1,r1,24 ffc089a8: 4e 80 00 20 blr =============================================================================== ffc0b214 : #include int sigsuspend( const sigset_t *sigmask ) { ffc0b214: 94 21 ff e0 stwu r1,-32(r1) ffc0b218: 7c 08 02 a6 mflr r0 ffc0b21c: 7c 64 1b 78 mr r4,r3 ffc0b220: 93 e1 00 1c stw r31,28(r1) int status; POSIX_API_Control *api; api = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; status = sigprocmask( SIG_BLOCK, sigmask, &saved_signals_blocked ); ffc0b224: 3b e1 00 08 addi r31,r1,8 ffc0b228: 7f e5 fb 78 mr r5,r31 #include int sigsuspend( const sigset_t *sigmask ) { ffc0b22c: 93 c1 00 18 stw r30,24(r1) int status; POSIX_API_Control *api; api = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; status = sigprocmask( SIG_BLOCK, sigmask, &saved_signals_blocked ); ffc0b230: 38 60 00 01 li r3,1 (void) sigfillset( &all_signals ); ffc0b234: 3b c1 00 0c addi r30,r1,12 #include int sigsuspend( const sigset_t *sigmask ) { ffc0b238: 90 01 00 24 stw r0,36(r1) int status; POSIX_API_Control *api; api = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; status = sigprocmask( SIG_BLOCK, sigmask, &saved_signals_blocked ); ffc0b23c: 4b ff ff 99 bl ffc0b1d4 (void) sigfillset( &all_signals ); ffc0b240: 7f c3 f3 78 mr r3,r30 ffc0b244: 4b ff fe 89 bl ffc0b0cc status = sigtimedwait( &all_signals, NULL, NULL ); ffc0b248: 7f c3 f3 78 mr r3,r30 ffc0b24c: 38 80 00 00 li r4,0 ffc0b250: 38 a0 00 00 li r5,0 ffc0b254: 48 00 00 a1 bl ffc0b2f4 (void) sigprocmask( SIG_SETMASK, &saved_signals_blocked, NULL ); ffc0b258: 7f e4 fb 78 mr r4,r31 status = sigprocmask( SIG_BLOCK, sigmask, &saved_signals_blocked ); (void) sigfillset( &all_signals ); status = sigtimedwait( &all_signals, NULL, NULL ); ffc0b25c: 7c 7e 1b 78 mr r30,r3 (void) sigprocmask( SIG_SETMASK, &saved_signals_blocked, NULL ); ffc0b260: 38 a0 00 00 li r5,0 ffc0b264: 38 60 00 00 li r3,0 ffc0b268: 4b ff ff 6d bl ffc0b1d4 /* * sigtimedwait() returns the signal number while sigsuspend() * is supposed to return -1 and EINTR when a signal is caught. */ if ( status != -1 ) ffc0b26c: 2f 9e ff ff cmpwi cr7,r30,-1 ffc0b270: 41 be 00 10 beq+ cr7,ffc0b280 <== NEVER TAKEN rtems_set_errno_and_return_minus_one( EINTR ); ffc0b274: 48 00 a3 61 bl ffc155d4 <__errno> ffc0b278: 38 00 00 04 li r0,4 ffc0b27c: 90 03 00 00 stw r0,0(r3) return status; } ffc0b280: 80 01 00 24 lwz r0,36(r1) ffc0b284: 38 60 ff ff li r3,-1 ffc0b288: 83 c1 00 18 lwz r30,24(r1) ffc0b28c: 7c 08 03 a6 mtlr r0 ffc0b290: 83 e1 00 1c lwz r31,28(r1) ffc0b294: 38 21 00 20 addi r1,r1,32 ffc0b298: 4e 80 00 20 blr =============================================================================== ffc08e44 : int sigtimedwait( const sigset_t *set, siginfo_t *info, const struct timespec *timeout ) { ffc08e44: 94 21 ff d8 stwu r1,-40(r1) ffc08e48: 7c 08 02 a6 mflr r0 ffc08e4c: 93 c1 00 20 stw r30,32(r1) ISR_Level level; /* * Error check parameters before disabling interrupts. */ if ( !set ) ffc08e50: 7c 7e 1b 79 mr. r30,r3 int sigtimedwait( const sigset_t *set, siginfo_t *info, const struct timespec *timeout ) { ffc08e54: 93 a1 00 1c stw r29,28(r1) ffc08e58: 7c 9d 23 78 mr r29,r4 ffc08e5c: 93 e1 00 24 stw r31,36(r1) ffc08e60: 7c bf 2b 78 mr r31,r5 ffc08e64: 90 01 00 2c stw r0,44(r1) ffc08e68: 93 81 00 18 stw r28,24(r1) ISR_Level level; /* * Error check parameters before disabling interrupts. */ if ( !set ) ffc08e6c: 41 82 00 2c beq- ffc08e98 /* NOTE: This is very specifically a RELATIVE not ABSOLUTE time * in the Open Group specification. */ interval = 0; if ( timeout ) { ffc08e70: 2f 85 00 00 cmpwi cr7,r5,0 ffc08e74: 41 9e 00 38 beq- cr7,ffc08eac if ( !_Timespec_Is_valid( timeout ) ) ffc08e78: 7c a3 2b 78 mr r3,r5 ffc08e7c: 48 00 42 01 bl ffc0d07c <_Timespec_Is_valid> ffc08e80: 2f 83 00 00 cmpwi cr7,r3,0 ffc08e84: 41 9e 00 14 beq- cr7,ffc08e98 rtems_set_errno_and_return_minus_one( EINVAL ); interval = _Timespec_To_ticks( timeout ); ffc08e88: 7f e3 fb 78 mr r3,r31 ffc08e8c: 48 00 42 65 bl ffc0d0f0 <_Timespec_To_ticks> if ( !interval ) ffc08e90: 7c 64 1b 79 mr. r4,r3 ffc08e94: 40 a2 00 1c bne+ ffc08eb0 <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one( EINVAL ); ffc08e98: 48 00 a5 59 bl ffc133f0 <__errno> ffc08e9c: 38 00 00 16 li r0,22 ffc08ea0: 90 03 00 00 stw r0,0(r3) ffc08ea4: 3b c0 ff ff li r30,-1 ffc08ea8: 48 00 01 54 b ffc08ffc ffc08eac: 38 80 00 00 li r4,0 /* * Initialize local variables. */ the_info = ( info ) ? info : &signal_information; ffc08eb0: 2f 9d 00 00 cmpwi cr7,r29,0 ffc08eb4: 3b e1 00 08 addi r31,r1,8 ffc08eb8: 41 9e 00 08 beq- cr7,ffc08ec0 ffc08ebc: 7f bf eb 78 mr r31,r29 the_thread = _Thread_Executing; ffc08ec0: 3d 20 00 00 lis r9,0 ffc08ec4: 81 29 28 40 lwz r9,10304(r9) api = the_thread->API_Extensions[ THREAD_API_POSIX ]; ffc08ec8: 83 89 01 48 lwz r28,328(r9) static inline uint32_t ppc_interrupt_disable( void ) { uint32_t level; uint32_t mask; asm volatile ( ffc08ecc: 7f a0 00 a6 mfmsr r29 ffc08ed0: 7c 10 42 a6 mfsprg r0,0 ffc08ed4: 7f a0 00 78 andc r0,r29,r0 ffc08ed8: 7c 00 01 24 mtmsr r0 */ /* API signals pending? */ _ISR_Disable( level ); if ( *set & api->signals_pending ) { ffc08edc: 80 1e 00 00 lwz r0,0(r30) ffc08ee0: 80 7c 00 d0 lwz r3,208(r28) ffc08ee4: 7c 0b 18 39 and. r11,r0,r3 ffc08ee8: 41 a2 00 3c beq+ ffc08f24 /* XXX real info later */ the_info->si_signo = _POSIX_signals_Get_highest( api->signals_pending ); ffc08eec: 4b ff ff 01 bl ffc08dec <_POSIX_signals_Get_highest> _POSIX_signals_Clear_signals( ffc08ef0: 7f e5 fb 78 mr r5,r31 /* 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 ); ffc08ef4: 90 7f 00 00 stw r3,0(r31) ffc08ef8: 7c 64 1b 78 mr r4,r3 _POSIX_signals_Clear_signals( ffc08efc: 38 c0 00 00 li r6,0 ffc08f00: 7f 83 e3 78 mr r3,r28 ffc08f04: 38 e0 00 00 li r7,0 ffc08f08: 48 00 6b 49 bl ffc0fa50 <_POSIX_signals_Clear_signals> return level; } static inline void ppc_interrupt_enable( uint32_t level ) { asm volatile ( ffc08f0c: 7f a0 01 24 mtmsr r29 false, false ); _ISR_Enable( level ); the_info->si_code = SI_USER; ffc08f10: 38 00 00 01 li r0,1 ffc08f14: 90 1f 00 04 stw r0,4(r31) the_info->si_value.sival_int = 0; ffc08f18: 38 00 00 00 li r0,0 ffc08f1c: 90 1f 00 08 stw r0,8(r31) ffc08f20: 48 00 00 d8 b ffc08ff8 return the_info->si_signo; } /* Process pending signals? */ if ( *set & _POSIX_signals_Pending ) { ffc08f24: 3d 60 00 00 lis r11,0 ffc08f28: 80 6b 28 74 lwz r3,10356(r11) ffc08f2c: 7c 0b 18 39 and. r11,r0,r3 ffc08f30: 41 a2 00 40 beq+ ffc08f70 signo = _POSIX_signals_Get_highest( _POSIX_signals_Pending ); ffc08f34: 4b ff fe b9 bl ffc08dec <_POSIX_signals_Get_highest> _POSIX_signals_Clear_signals( api, signo, the_info, true, false ); ffc08f38: 7f e5 fb 78 mr r5,r31 } /* Process pending signals? */ if ( *set & _POSIX_signals_Pending ) { signo = _POSIX_signals_Get_highest( _POSIX_signals_Pending ); ffc08f3c: 7c 7e 1b 78 mr r30,r3 _POSIX_signals_Clear_signals( api, signo, the_info, true, false ); ffc08f40: 7f c4 f3 78 mr r4,r30 ffc08f44: 7f 83 e3 78 mr r3,r28 ffc08f48: 38 c0 00 01 li r6,1 ffc08f4c: 38 e0 00 00 li r7,0 ffc08f50: 48 00 6b 01 bl ffc0fa50 <_POSIX_signals_Clear_signals> ffc08f54: 7f a0 01 24 mtmsr r29 _ISR_Enable( level ); the_info->si_signo = signo; the_info->si_code = SI_USER; the_info->si_value.sival_int = 0; ffc08f58: 38 00 00 00 li r0,0 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; ffc08f5c: 93 df 00 00 stw r30,0(r31) the_info->si_code = SI_USER; the_info->si_value.sival_int = 0; ffc08f60: 90 1f 00 08 stw r0,8(r31) 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; the_info->si_code = SI_USER; ffc08f64: 38 00 00 01 li r0,1 ffc08f68: 90 1f 00 04 stw r0,4(r31) the_info->si_value.sival_int = 0; return signo; ffc08f6c: 48 00 00 90 b ffc08ffc ffc08f70: 3d 60 00 00 lis r11,0 ffc08f74: 81 4b 28 00 lwz r10,10240(r11) ffc08f78: 38 0a 00 01 addi r0,r10,1 ffc08f7c: 90 0b 28 00 stw r0,10240(r11) } the_info->si_signo = -1; ffc08f80: 38 00 ff ff li r0,-1 ffc08f84: 90 1f 00 00 stw r0,0(r31) _Thread_Disable_dispatch(); the_thread->Wait.queue = &_POSIX_signals_Wait_queue; the_thread->Wait.return_code = EINTR; ffc08f88: 38 00 00 04 li r0,4 the_thread->Wait.option = *set; the_thread->Wait.return_argument = the_info; ffc08f8c: 93 e9 00 28 stw r31,40(r9) } the_info->si_signo = -1; _Thread_Disable_dispatch(); the_thread->Wait.queue = &_POSIX_signals_Wait_queue; ffc08f90: 3d 60 00 00 lis r11,0 the_thread->Wait.return_code = EINTR; ffc08f94: 90 09 00 34 stw r0,52(r9) } the_info->si_signo = -1; _Thread_Disable_dispatch(); the_thread->Wait.queue = &_POSIX_signals_Wait_queue; ffc08f98: 39 6b 33 3c addi r11,r11,13116 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; ffc08f9c: 39 40 00 01 li r10,1 the_thread->Wait.return_code = EINTR; the_thread->Wait.option = *set; ffc08fa0: 80 1e 00 00 lwz r0,0(r30) ffc08fa4: 91 4b 00 30 stw r10,48(r11) ffc08fa8: 90 09 00 30 stw r0,48(r9) } the_info->si_signo = -1; _Thread_Disable_dispatch(); the_thread->Wait.queue = &_POSIX_signals_Wait_queue; ffc08fac: 91 69 00 44 stw r11,68(r9) ffc08fb0: 7f a0 01 24 mtmsr r29 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 ); _Thread_queue_Enqueue( &_POSIX_signals_Wait_queue, interval ); ffc08fb4: 3c a0 ff c1 lis r5,-63 ffc08fb8: 3c 60 00 00 lis r3,0 ffc08fbc: 38 a5 c9 c0 addi r5,r5,-13888 ffc08fc0: 38 63 33 3c addi r3,r3,13116 ffc08fc4: 48 00 36 05 bl ffc0c5c8 <_Thread_queue_Enqueue_with_handler> _Thread_Enable_dispatch(); ffc08fc8: 48 00 30 01 bl ffc0bfc8 <_Thread_Enable_dispatch> /* * 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 ); ffc08fcc: 80 9f 00 00 lwz r4,0(r31) ffc08fd0: 7f e5 fb 78 mr r5,r31 ffc08fd4: 38 c0 00 00 li r6,0 ffc08fd8: 38 e0 00 00 li r7,0 ffc08fdc: 7f 83 e3 78 mr r3,r28 ffc08fe0: 48 00 6a 71 bl ffc0fa50 <_POSIX_signals_Clear_signals> errno = _Thread_Executing->Wait.return_code; ffc08fe4: 48 00 a4 0d bl ffc133f0 <__errno> ffc08fe8: 3d 20 00 00 lis r9,0 ffc08fec: 81 29 28 40 lwz r9,10304(r9) ffc08ff0: 80 09 00 34 lwz r0,52(r9) ffc08ff4: 90 03 00 00 stw r0,0(r3) return the_info->si_signo; ffc08ff8: 83 df 00 00 lwz r30,0(r31) } ffc08ffc: 80 01 00 2c lwz r0,44(r1) ffc09000: 7f c3 f3 78 mr r3,r30 ffc09004: 83 81 00 18 lwz r28,24(r1) ffc09008: 7c 08 03 a6 mtlr r0 ffc0900c: 83 a1 00 1c lwz r29,28(r1) ffc09010: 83 c1 00 20 lwz r30,32(r1) ffc09014: 83 e1 00 24 lwz r31,36(r1) ffc09018: 38 21 00 28 addi r1,r1,40 ffc0901c: 4e 80 00 20 blr =============================================================================== ffc0b4f4 : int sigwait( const sigset_t *set, int *sig ) { ffc0b4f4: 94 21 ff f0 stwu r1,-16(r1) ffc0b4f8: 7c 08 02 a6 mflr r0 int status; status = sigtimedwait( set, NULL, NULL ); ffc0b4fc: 38 a0 00 00 li r5,0 int sigwait( const sigset_t *set, int *sig ) { ffc0b500: 93 e1 00 0c stw r31,12(r1) ffc0b504: 7c 9f 23 78 mr r31,r4 int status; status = sigtimedwait( set, NULL, NULL ); ffc0b508: 38 80 00 00 li r4,0 int sigwait( const sigset_t *set, int *sig ) { ffc0b50c: 90 01 00 14 stw r0,20(r1) int status; status = sigtimedwait( set, NULL, NULL ); ffc0b510: 4b ff fd e5 bl ffc0b2f4 if ( status != -1 ) { ffc0b514: 2f 83 ff ff cmpwi cr7,r3,-1 ffc0b518: 41 9e 00 18 beq- cr7,ffc0b530 if ( sig ) ffc0b51c: 2f 9f 00 00 cmpwi cr7,r31,0 ffc0b520: 38 00 00 00 li r0,0 ffc0b524: 41 9e 00 14 beq- cr7,ffc0b538 <== NEVER TAKEN *sig = status; ffc0b528: 90 7f 00 00 stw r3,0(r31) ffc0b52c: 48 00 00 0c b ffc0b538 return 0; } return errno; ffc0b530: 48 00 a0 a5 bl ffc155d4 <__errno> ffc0b534: 80 03 00 00 lwz r0,0(r3) } ffc0b538: 7c 03 03 78 mr r3,r0 ffc0b53c: 80 01 00 14 lwz r0,20(r1) ffc0b540: 83 e1 00 0c lwz r31,12(r1) ffc0b544: 38 21 00 10 addi r1,r1,16 ffc0b548: 7c 08 03 a6 mtlr r0 ffc0b54c: 4e 80 00 20 blr =============================================================================== ffc07e08 : timer_t *timerid ) { POSIX_Timer_Control *ptimer; if ( clock_id != CLOCK_REALTIME ) ffc07e08: 2f 83 00 01 cmpwi cr7,r3,1 int timer_create( clockid_t clock_id, struct sigevent *evp, timer_t *timerid ) { ffc07e0c: 94 21 ff f0 stwu r1,-16(r1) ffc07e10: 7c 08 02 a6 mflr r0 ffc07e14: 93 c1 00 08 stw r30,8(r1) ffc07e18: 7c be 2b 78 mr r30,r5 ffc07e1c: 93 e1 00 0c stw r31,12(r1) ffc07e20: 7c 9f 23 78 mr r31,r4 ffc07e24: 90 01 00 14 stw r0,20(r1) POSIX_Timer_Control *ptimer; if ( clock_id != CLOCK_REALTIME ) ffc07e28: 40 9e 00 3c bne- cr7,ffc07e64 rtems_set_errno_and_return_minus_one( EINVAL ); if ( !timerid ) ffc07e2c: 2f 85 00 00 cmpwi cr7,r5,0 ffc07e30: 41 9e 00 34 beq- cr7,ffc07e64 /* * The data of the structure evp are checked in order to verify if they * are coherent. */ if (evp != NULL) { ffc07e34: 2f 84 00 00 cmpwi cr7,r4,0 ffc07e38: 41 9e 00 38 beq- cr7,ffc07e70 /* The structure has data */ if ( ( evp->sigev_notify != SIGEV_NONE ) && ffc07e3c: 81 24 00 00 lwz r9,0(r4) ffc07e40: 38 09 ff ff addi r0,r9,-1 ffc07e44: 2b 80 00 01 cmplwi cr7,r0,1 ffc07e48: 41 9d 00 1c bgt- cr7,ffc07e64 <== NEVER TAKEN ( 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 ) ffc07e4c: 81 24 00 04 lwz r9,4(r4) ffc07e50: 2f 89 00 00 cmpwi cr7,r9,0 ffc07e54: 41 9e 00 10 beq- cr7,ffc07e64 <== NEVER TAKEN rtems_set_errno_and_return_minus_one( EINVAL ); if ( !is_valid_signo(evp->sigev_signo) ) ffc07e58: 39 29 ff ff addi r9,r9,-1 ffc07e5c: 2b 89 00 1f cmplwi cr7,r9,31 ffc07e60: 40 bd 00 10 ble+ cr7,ffc07e70 <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one( EINVAL ); ffc07e64: 48 00 ac 85 bl ffc12ae8 <__errno> ffc07e68: 38 00 00 16 li r0,22 ffc07e6c: 48 00 00 34 b ffc07ea0 rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; ffc07e70: 3d 20 00 00 lis r9,0 ffc07e74: 81 69 27 dc lwz r11,10204(r9) ffc07e78: 38 0b 00 01 addi r0,r11,1 ffc07e7c: 90 09 27 dc stw r0,10204(r9) * 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 ); ffc07e80: 3c 60 00 00 lis r3,0 ffc07e84: 38 63 2f 78 addi r3,r3,12152 ffc07e88: 48 00 24 5d bl ffc0a2e4 <_Objects_Allocate> /* * Allocate a timer */ ptimer = _POSIX_Timer_Allocate(); if ( !ptimer ) { ffc07e8c: 2c 03 00 00 cmpwi r3,0 ffc07e90: 40 a2 00 1c bne+ ffc07eac _Thread_Enable_dispatch(); ffc07e94: 48 00 35 0d bl ffc0b3a0 <_Thread_Enable_dispatch> rtems_set_errno_and_return_minus_one( EAGAIN ); ffc07e98: 48 00 ac 51 bl ffc12ae8 <__errno> ffc07e9c: 38 00 00 0b li r0,11 ffc07ea0: 90 03 00 00 stw r0,0(r3) ffc07ea4: 38 60 ff ff li r3,-1 ffc07ea8: 48 00 00 88 b ffc07f30 } /* The data of the created timer are stored to use them later */ ptimer->state = POSIX_TIMER_STATE_CREATE_NEW; ffc07eac: 38 00 00 02 li r0,2 ffc07eb0: 98 03 00 3c stb r0,60(r3) ptimer->thread_id = _Thread_Executing->Object.id; ffc07eb4: 3d 20 00 00 lis r9,0 if ( evp != NULL ) { ffc07eb8: 2f 9f 00 00 cmpwi cr7,r31,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; ffc07ebc: 81 29 28 1c lwz r9,10268(r9) ffc07ec0: 80 09 00 08 lwz r0,8(r9) ffc07ec4: 90 03 00 38 stw r0,56(r3) if ( evp != NULL ) { ffc07ec8: 41 9e 00 1c beq- cr7,ffc07ee4 ptimer->inf.sigev_notify = evp->sigev_notify; ptimer->inf.sigev_signo = evp->sigev_signo; ptimer->inf.sigev_value = evp->sigev_value; ffc07ecc: 80 1f 00 08 lwz r0,8(r31) ptimer->state = POSIX_TIMER_STATE_CREATE_NEW; ptimer->thread_id = _Thread_Executing->Object.id; if ( evp != NULL ) { ptimer->inf.sigev_notify = evp->sigev_notify; ffc07ed0: 81 7f 00 00 lwz r11,0(r31) ptimer->inf.sigev_signo = evp->sigev_signo; ffc07ed4: 81 3f 00 04 lwz r9,4(r31) ptimer->state = POSIX_TIMER_STATE_CREATE_NEW; ptimer->thread_id = _Thread_Executing->Object.id; if ( evp != NULL ) { ptimer->inf.sigev_notify = evp->sigev_notify; ffc07ed8: 91 63 00 40 stw r11,64(r3) ptimer->inf.sigev_signo = evp->sigev_signo; ffc07edc: 91 23 00 44 stw r9,68(r3) ptimer->inf.sigev_value = evp->sigev_value; ffc07ee0: 90 03 00 48 stw r0,72(r3) #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; ffc07ee4: 81 23 00 08 lwz r9,8(r3) ffc07ee8: 3d 60 00 00 lis r11,0 ffc07eec: 81 4b 2f 94 lwz r10,12180(r11) } ptimer->overrun = 0; ffc07ef0: 38 00 00 00 li r0,0 ffc07ef4: 55 2b 13 ba rlwinm r11,r9,2,14,29 ffc07ef8: 90 03 00 68 stw r0,104(r3) ffc07efc: 7c 6a 59 2e stwx r3,r10,r11 ptimer->timer_data.it_value.tv_sec = 0; ffc07f00: 90 03 00 5c stw r0,92(r3) _Objects_Get_index( the_object->id ), the_object ); /* ASSERT: information->is_string == false */ the_object->name.name_u32 = name; ffc07f04: 90 03 00 0c stw r0,12(r3) ptimer->timer_data.it_value.tv_nsec = 0; ffc07f08: 90 03 00 60 stw r0,96(r3) ptimer->timer_data.it_interval.tv_sec = 0; ffc07f0c: 90 03 00 54 stw r0,84(r3) ptimer->timer_data.it_interval.tv_nsec = 0; ffc07f10: 90 03 00 58 stw r0,88(r3) void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; the_watchdog->id = id; ffc07f14: 90 03 00 30 stw r0,48(r3) Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; ffc07f18: 90 03 00 18 stw r0,24(r3) the_watchdog->routine = routine; ffc07f1c: 90 03 00 2c stw r0,44(r3) the_watchdog->id = id; the_watchdog->user_data = user_data; ffc07f20: 90 03 00 34 stw r0,52(r3) _Watchdog_Initialize( &ptimer->Timer, NULL, 0, NULL ); _Objects_Open_u32(&_POSIX_Timer_Information, &ptimer->Object, 0); *timerid = ptimer->Object.id; ffc07f24: 91 3e 00 00 stw r9,0(r30) _Thread_Enable_dispatch(); ffc07f28: 48 00 34 79 bl ffc0b3a0 <_Thread_Enable_dispatch> ffc07f2c: 38 60 00 00 li r3,0 return 0; } ffc07f30: 80 01 00 14 lwz r0,20(r1) ffc07f34: 83 c1 00 08 lwz r30,8(r1) ffc07f38: 7c 08 03 a6 mtlr r0 ffc07f3c: 83 e1 00 0c lwz r31,12(r1) ffc07f40: 38 21 00 10 addi r1,r1,16 ffc07f44: 4e 80 00 20 blr =============================================================================== ffc07f48 : timer_t timerid, int flags, const struct itimerspec *value, struct itimerspec *ovalue ) { ffc07f48: 94 21 ff c0 stwu r1,-64(r1) ffc07f4c: 7c 08 02 a6 mflr r0 ffc07f50: 93 a1 00 34 stw r29,52(r1) Objects_Locations location; bool activated; uint32_t initial_period; struct itimerspec normalize; if ( !value ) ffc07f54: 7c bd 2b 79 mr. r29,r5 timer_t timerid, int flags, const struct itimerspec *value, struct itimerspec *ovalue ) { ffc07f58: 93 c1 00 38 stw r30,56(r1) ffc07f5c: 7c de 33 78 mr r30,r6 ffc07f60: 93 e1 00 3c stw r31,60(r1) ffc07f64: 7c 7f 1b 78 mr r31,r3 ffc07f68: 90 01 00 44 stw r0,68(r1) ffc07f6c: 93 61 00 2c stw r27,44(r1) ffc07f70: 93 81 00 30 stw r28,48(r1) Objects_Locations location; bool activated; uint32_t initial_period; struct itimerspec normalize; if ( !value ) ffc07f74: 41 82 01 c4 beq- ffc08138 <== NEVER TAKEN 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 ) || ffc07f78: 81 3d 00 0c lwz r9,12(r29) ffc07f7c: 3c 00 3b 9a lis r0,15258 ffc07f80: 60 00 c9 ff ori r0,r0,51711 ffc07f84: 7f 89 00 40 cmplw cr7,r9,r0 ffc07f88: 41 9d 01 b0 bgt- cr7,ffc08138 ( value->it_value.tv_nsec < 0 ) || ( value->it_interval.tv_nsec >= TOD_NANOSECONDS_PER_SECOND) || ffc07f8c: 81 3d 00 04 lwz r9,4(r29) ffc07f90: 7f 89 00 40 cmplw cr7,r9,r0 ffc07f94: 41 9d 01 a4 bgt- cr7,ffc08138 <== NEVER TAKEN ( 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 ) { ffc07f98: 2f 84 00 04 cmpwi cr7,r4,4 ffc07f9c: 41 9e 00 0c beq- cr7,ffc07fa8 ffc07fa0: 2f 84 00 00 cmpwi cr7,r4,0 ffc07fa4: 40 9e 01 94 bne- cr7,ffc08138 } normalize = *value; /* Convert absolute to relative time */ if (flags == TIMER_ABSTIME) { ffc07fa8: 2f 84 00 04 cmpwi cr7,r4,4 if ( flags != TIMER_ABSTIME && flags != POSIX_TIMER_RELATIVE ) { rtems_set_errno_and_return_minus_one( EINVAL ); } normalize = *value; ffc07fac: 81 5d 00 00 lwz r10,0(r29) ffc07fb0: 81 7d 00 04 lwz r11,4(r29) ffc07fb4: 81 3d 00 08 lwz r9,8(r29) ffc07fb8: 80 1d 00 0c lwz r0,12(r29) ffc07fbc: 91 41 00 14 stw r10,20(r1) ffc07fc0: 91 61 00 18 stw r11,24(r1) ffc07fc4: 91 21 00 1c stw r9,28(r1) ffc07fc8: 90 01 00 20 stw r0,32(r1) /* Convert absolute to relative time */ if (flags == TIMER_ABSTIME) { ffc07fcc: 40 be 00 38 bne+ cr7,ffc08004 struct timespec now; _TOD_Get( &now ); ffc07fd0: 3b 81 00 0c addi r28,r1,12 ffc07fd4: 7f 83 e3 78 mr r3,r28 /* Check for seconds in the past */ if ( _Timespec_Greater_than( &now, &normalize.it_value ) ) ffc07fd8: 3b 61 00 1c addi r27,r1,28 normalize = *value; /* Convert absolute to relative time */ if (flags == TIMER_ABSTIME) { struct timespec now; _TOD_Get( &now ); ffc07fdc: 48 00 1d 69 bl ffc09d44 <_TOD_Get> /* Check for seconds in the past */ if ( _Timespec_Greater_than( &now, &normalize.it_value ) ) ffc07fe0: 7f 83 e3 78 mr r3,r28 ffc07fe4: 7f 64 db 78 mr r4,r27 ffc07fe8: 48 00 44 6d bl ffc0c454 <_Timespec_Greater_than> ffc07fec: 2f 83 00 00 cmpwi cr7,r3,0 ffc07ff0: 40 9e 01 48 bne- cr7,ffc08138 rtems_set_errno_and_return_minus_one( EINVAL ); _Timespec_Subtract( &now, &normalize.it_value, &normalize.it_value ); ffc07ff4: 7f 64 db 78 mr r4,r27 ffc07ff8: 7f 83 e3 78 mr r3,r28 ffc07ffc: 7f 65 db 78 mr r5,r27 ffc08000: 48 00 44 91 bl ffc0c490 <_Timespec_Subtract> RTEMS_INLINE_ROUTINE POSIX_Timer_Control *_POSIX_Timer_Get ( timer_t id, Objects_Locations *location ) { return (POSIX_Timer_Control *) ffc08004: 3c 60 00 00 lis r3,0 ffc08008: 7f e4 fb 78 mr r4,r31 ffc0800c: 38 63 2f 78 addi r3,r3,12152 ffc08010: 38 a1 00 08 addi r5,r1,8 ffc08014: 48 00 28 7d bl ffc0a890 <_Objects_Get> * something with the structure of times of the timer: to stop, start * or start it again */ ptimer = _POSIX_Timer_Get( timerid, &location ); switch ( location ) { ffc08018: 80 01 00 08 lwz r0,8(r1) ffc0801c: 7c 7f 1b 78 mr r31,r3 ffc08020: 2f 80 00 00 cmpwi cr7,r0,0 ffc08024: 40 9e 01 14 bne- cr7,ffc08138 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 ) { ffc08028: 80 01 00 1c lwz r0,28(r1) ffc0802c: 2f 80 00 00 cmpwi cr7,r0,0 ffc08030: 40 9e 00 6c bne- cr7,ffc0809c ffc08034: 80 01 00 20 lwz r0,32(r1) ffc08038: 2f 80 00 00 cmpwi cr7,r0,0 ffc0803c: 40 be 00 60 bne+ cr7,ffc0809c /* Stop the timer */ (void) _Watchdog_Remove( &ptimer->Timer ); ffc08040: 38 63 00 10 addi r3,r3,16 ffc08044: 48 00 4a dd bl ffc0cb20 <_Watchdog_Remove> /* The old data of the timer are returned */ if ( ovalue ) ffc08048: 2f 9e 00 00 cmpwi cr7,r30,0 ffc0804c: 41 9e 00 24 beq- cr7,ffc08070 *ovalue = ptimer->timer_data; ffc08050: 81 5f 00 54 lwz r10,84(r31) ffc08054: 81 3f 00 58 lwz r9,88(r31) ffc08058: 80 1f 00 5c lwz r0,92(r31) ffc0805c: 81 7f 00 60 lwz r11,96(r31) ffc08060: 91 5e 00 00 stw r10,0(r30) ffc08064: 91 7e 00 0c stw r11,12(r30) ffc08068: 91 3e 00 04 stw r9,4(r30) ffc0806c: 90 1e 00 08 stw r0,8(r30) /* The new data are set */ ptimer->timer_data = normalize; ffc08070: 81 41 00 14 lwz r10,20(r1) /* Indicates that the timer is created and stopped */ ptimer->state = POSIX_TIMER_STATE_CREATE_STOP; ffc08074: 39 00 00 04 li r8,4 (void) _Watchdog_Remove( &ptimer->Timer ); /* The old data of the timer are returned */ if ( ovalue ) *ovalue = ptimer->timer_data; /* The new data are set */ ptimer->timer_data = normalize; ffc08078: 81 61 00 18 lwz r11,24(r1) ffc0807c: 81 21 00 1c lwz r9,28(r1) ffc08080: 80 01 00 20 lwz r0,32(r1) /* Indicates that the timer is created and stopped */ ptimer->state = POSIX_TIMER_STATE_CREATE_STOP; ffc08084: 99 1f 00 3c stb r8,60(r31) (void) _Watchdog_Remove( &ptimer->Timer ); /* The old data of the timer are returned */ if ( ovalue ) *ovalue = ptimer->timer_data; /* The new data are set */ ptimer->timer_data = normalize; ffc08088: 91 5f 00 54 stw r10,84(r31) ffc0808c: 91 7f 00 58 stw r11,88(r31) ffc08090: 91 3f 00 5c stw r9,92(r31) ffc08094: 90 1f 00 60 stw r0,96(r31) ffc08098: 48 00 00 94 b ffc0812c _Thread_Enable_dispatch(); return 0; } /* Convert from seconds and nanoseconds to ticks */ ptimer->ticks = _Timespec_To_ticks( &value->it_interval ); ffc0809c: 7f a3 eb 78 mr r3,r29 ffc080a0: 48 00 44 29 bl ffc0c4c8 <_Timespec_To_ticks> ffc080a4: 90 7f 00 64 stw r3,100(r31) initial_period = _Timespec_To_ticks( &normalize.it_value ); ffc080a8: 38 61 00 1c addi r3,r1,28 ffc080ac: 48 00 44 1d bl ffc0c4c8 <_Timespec_To_ticks> activated = _POSIX_Timer_Insert_helper( ffc080b0: 80 bf 00 08 lwz r5,8(r31) ffc080b4: 3c c0 ff c1 lis r6,-63 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 ); ffc080b8: 7c 64 1b 78 mr r4,r3 activated = _POSIX_Timer_Insert_helper( ffc080bc: 38 c6 81 6c addi r6,r6,-32404 ffc080c0: 38 7f 00 10 addi r3,r31,16 ffc080c4: 7f e7 fb 78 mr r7,r31 ffc080c8: 48 00 6f fd bl ffc0f0c4 <_POSIX_Timer_Insert_helper> initial_period, ptimer->Object.id, _POSIX_Timer_TSR, ptimer ); if ( !activated ) { ffc080cc: 2f 83 00 00 cmpwi cr7,r3,0 ffc080d0: 41 9e 00 5c beq- cr7,ffc0812c /* * The timer has been started and is running. So we return the * old ones in "ovalue" */ if ( ovalue ) ffc080d4: 2f 9e 00 00 cmpwi cr7,r30,0 ffc080d8: 41 9e 00 24 beq- cr7,ffc080fc *ovalue = ptimer->timer_data; ffc080dc: 81 5f 00 54 lwz r10,84(r31) ffc080e0: 81 3f 00 58 lwz r9,88(r31) ffc080e4: 80 1f 00 5c lwz r0,92(r31) ffc080e8: 81 7f 00 60 lwz r11,96(r31) ffc080ec: 91 5e 00 00 stw r10,0(r30) ffc080f0: 91 7e 00 0c stw r11,12(r30) ffc080f4: 91 3e 00 04 stw r9,4(r30) ffc080f8: 90 1e 00 08 stw r0,8(r30) ptimer->timer_data = normalize; ffc080fc: 80 01 00 20 lwz r0,32(r1) /* Indicate that the time is running */ ptimer->state = POSIX_TIMER_STATE_CREATE_RUN; _TOD_Get( &ptimer->time ); ffc08100: 38 7f 00 6c addi r3,r31,108 * The timer has been started and is running. So we return the * old ones in "ovalue" */ if ( ovalue ) *ovalue = ptimer->timer_data; ptimer->timer_data = normalize; ffc08104: 81 61 00 18 lwz r11,24(r1) ffc08108: 81 21 00 1c lwz r9,28(r1) ffc0810c: 81 41 00 14 lwz r10,20(r1) ffc08110: 90 1f 00 60 stw r0,96(r31) /* Indicate that the time is running */ ptimer->state = POSIX_TIMER_STATE_CREATE_RUN; ffc08114: 38 00 00 03 li r0,3 * The timer has been started and is running. So we return the * old ones in "ovalue" */ if ( ovalue ) *ovalue = ptimer->timer_data; ptimer->timer_data = normalize; ffc08118: 91 5f 00 54 stw r10,84(r31) ffc0811c: 91 7f 00 58 stw r11,88(r31) ffc08120: 91 3f 00 5c stw r9,92(r31) /* Indicate that the time is running */ ptimer->state = POSIX_TIMER_STATE_CREATE_RUN; ffc08124: 98 1f 00 3c stb r0,60(r31) _TOD_Get( &ptimer->time ); ffc08128: 48 00 1c 1d bl ffc09d44 <_TOD_Get> _Thread_Enable_dispatch(); ffc0812c: 48 00 32 75 bl ffc0b3a0 <_Thread_Enable_dispatch> ffc08130: 38 60 00 00 li r3,0 return 0; ffc08134: 48 00 00 14 b ffc08148 #endif case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( EINVAL ); ffc08138: 48 00 a9 b1 bl ffc12ae8 <__errno> ffc0813c: 38 00 00 16 li r0,22 ffc08140: 90 03 00 00 stw r0,0(r3) ffc08144: 38 60 ff ff li r3,-1 } ffc08148: 80 01 00 44 lwz r0,68(r1) ffc0814c: 83 61 00 2c lwz r27,44(r1) ffc08150: 7c 08 03 a6 mtlr r0 ffc08154: 83 81 00 30 lwz r28,48(r1) ffc08158: 83 a1 00 34 lwz r29,52(r1) ffc0815c: 83 c1 00 38 lwz r30,56(r1) ffc08160: 83 e1 00 3c lwz r31,60(r1) ffc08164: 38 21 00 40 addi r1,r1,64 ffc08168: 4e 80 00 20 blr =============================================================================== ffc07c5c : useconds_t ualarm( useconds_t useconds, useconds_t interval ) { ffc07c5c: 94 21 ff d8 stwu r1,-40(r1) ffc07c60: 7c 08 02 a6 mflr r0 ffc07c64: 93 a1 00 1c stw r29,28(r1) /* * Initialize the timer used to implement alarm(). */ if ( !the_timer->routine ) { ffc07c68: 3f a0 00 00 lis r29,0 ffc07c6c: 3b bd 35 44 addi r29,r29,13636 useconds_t ualarm( useconds_t useconds, useconds_t interval ) { ffc07c70: 90 01 00 2c stw r0,44(r1) /* * Initialize the timer used to implement alarm(). */ if ( !the_timer->routine ) { ffc07c74: 80 1d 00 1c lwz r0,28(r29) useconds_t ualarm( useconds_t useconds, useconds_t interval ) { ffc07c78: 93 c1 00 20 stw r30,32(r1) ffc07c7c: 7c 7e 1b 78 mr r30,r3 /* * Initialize the timer used to implement alarm(). */ if ( !the_timer->routine ) { ffc07c80: 2f 80 00 00 cmpwi cr7,r0,0 useconds_t ualarm( useconds_t useconds, useconds_t interval ) { ffc07c84: 93 e1 00 24 stw r31,36(r1) /* * Initialize the timer used to implement alarm(). */ if ( !the_timer->routine ) { ffc07c88: 40 be 00 24 bne+ cr7,ffc07cac Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; ffc07c8c: 3d 20 ff c0 lis r9,-64 the_watchdog->id = id; the_watchdog->user_data = user_data; ffc07c90: 90 1d 00 24 stw r0,36(r29) Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; ffc07c94: 39 29 7d 74 addi r9,r9,32116 the_watchdog->id = id; the_watchdog->user_data = user_data; ffc07c98: 3b e0 00 00 li r31,0 Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; ffc07c9c: 91 3d 00 1c stw r9,28(r29) Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; ffc07ca0: 90 1d 00 08 stw r0,8(r29) the_watchdog->routine = routine; the_watchdog->id = id; ffc07ca4: 90 1d 00 20 stw r0,32(r29) ffc07ca8: 48 00 00 58 b ffc07d00 _Watchdog_Initialize( the_timer, _POSIX_signals_Ualarm_TSR, 0, NULL ); } else { Watchdog_States state; state = _Watchdog_Remove( the_timer ); ffc07cac: 7f a3 eb 78 mr r3,r29 ffc07cb0: 48 00 48 31 bl ffc0c4e0 <_Watchdog_Remove> if ( (state == WATCHDOG_ACTIVE) || (state == WATCHDOG_REMOVE_IT) ) { ffc07cb4: 3b e0 00 00 li r31,0 ffc07cb8: 38 63 ff fe addi r3,r3,-2 ffc07cbc: 2b 83 00 01 cmplwi cr7,r3,1 ffc07cc0: 41 bd 00 40 bgt+ cr7,ffc07d00 <== NEVER TAKEN * 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); ffc07cc4: 81 3d 00 0c lwz r9,12(r29) /* remaining is now in ticks */ _Timespec_From_ticks( ticks, &tp ); ffc07cc8: 38 81 00 08 addi r4,r1,8 * 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); ffc07ccc: 80 7d 00 14 lwz r3,20(r29) /* remaining is now in ticks */ _Timespec_From_ticks( ticks, &tp ); ffc07cd0: 80 1d 00 18 lwz r0,24(r29) * 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); ffc07cd4: 7c 63 4a 14 add r3,r3,r9 /* remaining is now in ticks */ _Timespec_From_ticks( ticks, &tp ); ffc07cd8: 7c 60 18 50 subf r3,r0,r3 ffc07cdc: 48 00 40 61 bl ffc0bd3c <_Timespec_From_ticks> remaining = tp.tv_sec * TOD_MICROSECONDS_PER_SECOND; remaining += tp.tv_nsec / 1000; ffc07ce0: 83 e1 00 0c lwz r31,12(r1) ffc07ce4: 38 00 03 e8 li r0,1000 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; ffc07ce8: 81 21 00 08 lwz r9,8(r1) remaining += tp.tv_nsec / 1000; ffc07cec: 7c 1f 03 d6 divw r0,r31,r0 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; ffc07cf0: 3f e0 00 0f lis r31,15 ffc07cf4: 63 ff 42 40 ori r31,r31,16960 ffc07cf8: 7f ff 49 d6 mullw r31,r31,r9 remaining += tp.tv_nsec / 1000; ffc07cfc: 7f e0 fa 14 add r31,r0,r31 /* * 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 ) { ffc07d00: 2f 9e 00 00 cmpwi cr7,r30,0 ffc07d04: 41 be 00 50 beq+ cr7,ffc07d54 Watchdog_Interval ticks; tp.tv_sec = useconds / TOD_MICROSECONDS_PER_SECOND; ffc07d08: 3d 20 00 0f lis r9,15 ffc07d0c: 61 29 42 40 ori r9,r9,16960 ffc07d10: 7c 1e 4b 96 divwu r0,r30,r9 tp.tv_nsec = (useconds % TOD_MICROSECONDS_PER_SECOND) * 1000; ffc07d14: 7d 20 49 d6 mullw r9,r0,r9 * 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; ffc07d18: 90 01 00 08 stw r0,8(r1) tp.tv_nsec = (useconds % TOD_MICROSECONDS_PER_SECOND) * 1000; ticks = _Timespec_To_ticks( &tp ); ffc07d1c: 3b a1 00 08 addi r29,r1,8 */ if ( useconds ) { Watchdog_Interval ticks; tp.tv_sec = useconds / TOD_MICROSECONDS_PER_SECOND; tp.tv_nsec = (useconds % TOD_MICROSECONDS_PER_SECOND) * 1000; ffc07d20: 7f c9 f0 50 subf r30,r9,r30 ffc07d24: 1f de 03 e8 mulli r30,r30,1000 ticks = _Timespec_To_ticks( &tp ); ffc07d28: 7f a3 eb 78 mr r3,r29 */ if ( useconds ) { Watchdog_Interval ticks; tp.tv_sec = useconds / TOD_MICROSECONDS_PER_SECOND; tp.tv_nsec = (useconds % TOD_MICROSECONDS_PER_SECOND) * 1000; ffc07d2c: 93 c1 00 0c stw r30,12(r1) ticks = _Timespec_To_ticks( &tp ); ffc07d30: 48 00 40 75 bl ffc0bda4 <_Timespec_To_ticks> if ( ticks == 0 ) ticks = 1; _Watchdog_Insert_ticks( the_timer, _Timespec_To_ticks( &tp ) ); ffc07d34: 7f a3 eb 78 mr r3,r29 ffc07d38: 48 00 40 6d bl ffc0bda4 <_Timespec_To_ticks> Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; ffc07d3c: 3c 80 00 00 lis r4,0 ffc07d40: 38 84 35 44 addi r4,r4,13636 ffc07d44: 90 64 00 0c stw r3,12(r4) _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); ffc07d48: 3c 60 00 00 lis r3,0 ffc07d4c: 38 63 2d a8 addi r3,r3,11688 ffc07d50: 48 00 46 39 bl ffc0c388 <_Watchdog_Insert> } return remaining; } ffc07d54: 80 01 00 2c lwz r0,44(r1) ffc07d58: 7f e3 fb 78 mr r3,r31 ffc07d5c: 83 a1 00 1c lwz r29,28(r1) ffc07d60: 7c 08 03 a6 mtlr r0 ffc07d64: 83 c1 00 20 lwz r30,32(r1) ffc07d68: 83 e1 00 24 lwz r31,36(r1) ffc07d6c: 38 21 00 28 addi r1,r1,40 ffc07d70: 4e 80 00 20 blr