=============================================================================== 08006030 <_CORE_RWLock_Release>: */ CORE_RWLock_Status _CORE_RWLock_Release( CORE_RWLock_Control *the_rwlock ) { 8006030: 37 9c ff f4 addi sp,sp,-12 8006034: 5b 8b 00 0c sw (sp+12),r11 8006038: 5b 8c 00 08 sw (sp+8),r12 800603c: 5b 9d 00 04 sw (sp+4),ra 8006040: b8 20 58 00 mv r11,r1 ISR_Level level; Thread_Control *executing = _Thread_Executing; 8006044: 78 01 08 01 mvhi r1,0x801 8006048: 38 21 8d 38 ori r1,r1,0x8d38 800604c: 28 22 00 0c lw r2,(r1+12) * Otherwise, we have to block. * If locked for reading and no waiters, then OK to read. * If any thread is waiting, then we wait. */ _ISR_Disable( level ); 8006050: 90 00 08 00 rcsr r1,IE 8006054: 34 03 ff fe mvi r3,-2 8006058: a0 23 18 00 and r3,r1,r3 800605c: d0 03 00 00 wcsr IE,r3 if ( the_rwlock->current_state == CORE_RWLOCK_UNLOCKED){ 8006060: 29 63 00 44 lw r3,(r11+68) 8006064: 5c 60 00 05 bne r3,r0,8006078 <_CORE_RWLock_Release+0x48> _ISR_Enable( level ); 8006068: d0 01 00 00 wcsr IE,r1 executing->Wait.return_code = CORE_RWLOCK_UNAVAILABLE; 800606c: 34 01 00 02 mvi r1,2 8006070: 58 41 00 34 sw (r2+52),r1 return CORE_RWLOCK_SUCCESSFUL; 8006074: e0 00 00 26 bi 800610c <_CORE_RWLock_Release+0xdc> } if ( the_rwlock->current_state == CORE_RWLOCK_LOCKED_FOR_READING ) { 8006078: 34 04 00 01 mvi r4,1 800607c: 5c 64 00 07 bne r3,r4,8006098 <_CORE_RWLock_Release+0x68> the_rwlock->number_of_readers -= 1; 8006080: 29 63 00 48 lw r3,(r11+72) 8006084: 34 63 ff ff addi r3,r3,-1 8006088: 59 63 00 48 sw (r11+72),r3 if ( the_rwlock->number_of_readers != 0 ) { 800608c: 44 60 00 03 be r3,r0,8006098 <_CORE_RWLock_Release+0x68> /* must be unlocked again */ _ISR_Enable( level ); 8006090: d0 01 00 00 wcsr IE,r1 return CORE_RWLOCK_SUCCESSFUL; 8006094: e0 00 00 1e bi 800610c <_CORE_RWLock_Release+0xdc> } } /* CORE_RWLOCK_LOCKED_FOR_WRITING or READING with readers */ executing->Wait.return_code = CORE_RWLOCK_SUCCESSFUL; 8006098: 58 40 00 34 sw (r2+52),r0 /* * Implicitly transition to "unlocked" and find another thread interested * in obtaining this rwlock. */ the_rwlock->current_state = CORE_RWLOCK_UNLOCKED; 800609c: 59 60 00 44 sw (r11+68),r0 _ISR_Enable( level ); 80060a0: d0 01 00 00 wcsr IE,r1 next = _Thread_queue_Dequeue( &the_rwlock->Wait_queue ); 80060a4: b9 60 08 00 mv r1,r11 80060a8: f8 00 07 a9 calli 8007f4c <_Thread_queue_Dequeue> if ( next ) { 80060ac: 44 20 00 18 be r1,r0,800610c <_CORE_RWLock_Release+0xdc> if ( next->Wait.option == CORE_RWLOCK_THREAD_WAITING_FOR_WRITE ) { 80060b0: 28 22 00 30 lw r2,(r1+48) 80060b4: 34 01 00 01 mvi r1,1 80060b8: 5c 41 00 04 bne r2,r1,80060c8 <_CORE_RWLock_Release+0x98> the_rwlock->current_state = CORE_RWLOCK_LOCKED_FOR_WRITING; 80060bc: 34 01 00 02 mvi r1,2 80060c0: 59 61 00 44 sw (r11+68),r1 return CORE_RWLOCK_SUCCESSFUL; 80060c4: e0 00 00 12 bi 800610c <_CORE_RWLock_Release+0xdc> } /* * Must be CORE_RWLOCK_THREAD_WAITING_FOR_READING */ the_rwlock->number_of_readers += 1; 80060c8: 29 62 00 48 lw r2,(r11+72) the_rwlock->current_state = CORE_RWLOCK_LOCKED_FOR_READING; 80060cc: 59 61 00 44 sw (r11+68),r1 /* * Now see if more readers can be let go. */ while ( 1 ) { next = _Thread_queue_First( &the_rwlock->Wait_queue ); if ( !next || 80060d0: 34 0c 00 01 mvi r12,1 } /* * Must be CORE_RWLOCK_THREAD_WAITING_FOR_READING */ the_rwlock->number_of_readers += 1; 80060d4: 34 42 00 01 addi r2,r2,1 80060d8: 59 62 00 48 sw (r11+72),r2 /* * Now see if more readers can be let go. */ while ( 1 ) { next = _Thread_queue_First( &the_rwlock->Wait_queue ); 80060dc: b9 60 08 00 mv r1,r11 80060e0: f8 00 09 22 calli 8008568 <_Thread_queue_First> 80060e4: b8 20 10 00 mv r2,r1 if ( !next || 80060e8: 44 20 00 09 be r1,r0,800610c <_CORE_RWLock_Release+0xdc> 80060ec: 28 21 00 30 lw r1,(r1+48) 80060f0: 44 2c 00 07 be r1,r12,800610c <_CORE_RWLock_Release+0xdc> <== NEVER TAKEN next->Wait.option == CORE_RWLOCK_THREAD_WAITING_FOR_WRITE ) return CORE_RWLOCK_SUCCESSFUL; the_rwlock->number_of_readers += 1; 80060f4: 29 61 00 48 lw r1,(r11+72) 80060f8: 34 21 00 01 addi r1,r1,1 80060fc: 59 61 00 48 sw (r11+72),r1 _Thread_queue_Extract( &the_rwlock->Wait_queue, next ); 8006100: b9 60 08 00 mv r1,r11 8006104: f8 00 08 cf calli 8008440 <_Thread_queue_Extract> } 8006108: e3 ff ff f5 bi 80060dc <_CORE_RWLock_Release+0xac> } /* indentation is to match _ISR_Disable at top */ return CORE_RWLOCK_SUCCESSFUL; } 800610c: 34 01 00 00 mvi r1,0 8006110: 2b 9d 00 04 lw ra,(sp+4) 8006114: 2b 8b 00 0c lw r11,(sp+12) 8006118: 2b 8c 00 08 lw r12,(sp+8) 800611c: 37 9c 00 0c addi sp,sp,12 8006120: c3 a0 00 00 ret =============================================================================== 08006124 <_CORE_RWLock_Timeout>: void _CORE_RWLock_Timeout( Objects_Id id, void *ignored ) { 8006124: 37 9c ff f8 addi sp,sp,-8 8006128: 5b 9d 00 04 sw (sp+4),ra Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); 800612c: 37 82 00 08 addi r2,sp,8 8006130: f8 00 06 9a calli 8007b98 <_Thread_Get> switch ( location ) { 8006134: 2b 82 00 08 lw r2,(sp+8) 8006138: 5c 40 00 07 bne r2,r0,8006154 <_CORE_RWLock_Timeout+0x30> <== NEVER TAKEN #if defined(RTEMS_MULTIPROCESSING) case OBJECTS_REMOTE: /* impossible */ #endif break; case OBJECTS_LOCAL: _Thread_queue_Process_timeout( the_thread ); 800613c: f8 00 09 65 calli 80086d0 <_Thread_queue_Process_timeout> */ RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void ) { RTEMS_COMPILER_MEMORY_BARRIER(); _Thread_Dispatch_disable_level -= 1; 8006140: 78 01 08 01 mvhi r1,0x801 8006144: 38 21 88 68 ori r1,r1,0x8868 8006148: 28 22 00 00 lw r2,(r1+0) 800614c: 34 42 ff ff addi r2,r2,-1 8006150: 58 22 00 00 sw (r1+0),r2 _Thread_Unnest_dispatch(); break; } } 8006154: 2b 9d 00 04 lw ra,(sp+4) 8006158: 37 9c 00 08 addi sp,sp,8 800615c: c3 a0 00 00 ret =============================================================================== 08015640 <_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 ) { 8015640: 37 9c ff e4 addi sp,sp,-28 8015644: 5b 8b 00 1c sw (sp+28),r11 8015648: 5b 8c 00 18 sw (sp+24),r12 801564c: 5b 8d 00 14 sw (sp+20),r13 8015650: 5b 8e 00 10 sw (sp+16),r14 8015654: 5b 8f 00 0c sw (sp+12),r15 8015658: 5b 90 00 08 sw (sp+8),r16 801565c: 5b 9d 00 04 sw (sp+4),ra 8015660: b8 40 80 00 mv r16,r2 Thread_Control *the_thread; uint32_t number_broadcasted; Thread_Wait_information *waitp; if ( size > the_message_queue->maximum_message_size ) { 8015664: 28 22 00 4c lw r2,(r1+76) Objects_Id id __attribute__((unused)), CORE_message_queue_API_mp_support_callout api_message_queue_mp_support __attribute__((unused)), #endif uint32_t *count ) { 8015668: b8 20 58 00 mv r11,r1 801566c: b8 60 68 00 mv r13,r3 8015670: b8 c0 78 00 mv r15,r6 Thread_Control *the_thread; uint32_t number_broadcasted; Thread_Wait_information *waitp; if ( size > the_message_queue->maximum_message_size ) { return CORE_MESSAGE_QUEUE_STATUS_INVALID_SIZE; 8015674: 34 01 00 01 mvi r1,1 { Thread_Control *the_thread; uint32_t number_broadcasted; Thread_Wait_information *waitp; if ( size > the_message_queue->maximum_message_size ) { 8015678: 54 62 00 13 bgu r3,r2,80156c4 <_CORE_message_queue_Broadcast+0x84><== 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 ) { 801567c: 29 61 00 48 lw r1,(r11+72) 8015680: 34 0c 00 00 mvi r12,0 8015684: 44 20 00 0a be r1,r0,80156ac <_CORE_message_queue_Broadcast+0x6c> *count = 0; 8015688: 58 c0 00 00 sw (r6+0),r0 801568c: e0 00 00 0d bi 80156c0 <_CORE_message_queue_Broadcast+0x80> const void *source, void *destination, size_t size ) { memcpy(destination, source, size); 8015690: 29 c1 00 2c lw r1,(r14+44) 8015694: ba 00 10 00 mv r2,r16 8015698: b9 a0 18 00 mv r3,r13 801569c: f8 00 2a 69 calli 8020040 buffer, waitp->return_argument_second.mutable_object, size ); *(size_t *) the_thread->Wait.return_argument = size; 80156a0: 29 c1 00 28 lw r1,(r14+40) */ number_broadcasted = 0; while ((the_thread = _Thread_queue_Dequeue(&the_message_queue->Wait_queue))) { waitp = &the_thread->Wait; number_broadcasted += 1; 80156a4: 35 8c 00 01 addi r12,r12,1 buffer, waitp->return_argument_second.mutable_object, size ); *(size_t *) the_thread->Wait.return_argument = size; 80156a8: 58 2d 00 00 sw (r1+0),r13 /* * There must be no pending messages if there is a thread waiting to * receive a message. */ number_broadcasted = 0; while ((the_thread = 80156ac: b9 60 08 00 mv r1,r11 80156b0: f8 00 0d 4c calli 8018be0 <_Thread_queue_Dequeue> 80156b4: b8 20 70 00 mv r14,r1 80156b8: 5c 20 ff f6 bne r1,r0,8015690 <_CORE_message_queue_Broadcast+0x50> if ( !_Objects_Is_local_id( the_thread->Object.id ) ) (*api_message_queue_mp_support) ( the_thread, id ); #endif } *count = number_broadcasted; 80156bc: 59 ec 00 00 sw (r15+0),r12 return CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL; 80156c0: 34 01 00 00 mvi r1,0 } 80156c4: 2b 9d 00 04 lw ra,(sp+4) 80156c8: 2b 8b 00 1c lw r11,(sp+28) 80156cc: 2b 8c 00 18 lw r12,(sp+24) 80156d0: 2b 8d 00 14 lw r13,(sp+20) 80156d4: 2b 8e 00 10 lw r14,(sp+16) 80156d8: 2b 8f 00 0c lw r15,(sp+12) 80156dc: 2b 90 00 08 lw r16,(sp+8) 80156e0: 37 9c 00 1c addi sp,sp,28 80156e4: c3 a0 00 00 ret =============================================================================== 0800da98 <_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 ) { 800da98: 37 9c ff e4 addi sp,sp,-28 800da9c: 5b 8b 00 1c sw (sp+28),r11 800daa0: 5b 8c 00 18 sw (sp+24),r12 800daa4: 5b 8d 00 14 sw (sp+20),r13 800daa8: 5b 8e 00 10 sw (sp+16),r14 800daac: 5b 8f 00 0c sw (sp+12),r15 800dab0: 5b 90 00 08 sw (sp+8),r16 800dab4: 5b 9d 00 04 sw (sp+4),ra 800dab8: b8 20 58 00 mv r11,r1 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; 800dabc: 58 20 00 48 sw (r1+72),r0 the_message_queue->maximum_message_size = maximum_message_size; 800dac0: 58 24 00 4c sw (r1+76),r4 CORE_message_queue_Control *the_message_queue, CORE_message_queue_Notify_Handler the_handler, void *the_argument ) { the_message_queue->notify_handler = the_handler; 800dac4: 58 20 00 60 sw (r1+96),r0 the_message_queue->notify_argument = the_argument; 800dac8: 58 20 00 64 sw (r1+100),r0 ) { size_t message_buffering_required; size_t allocated_message_size; the_message_queue->maximum_pending_messages = maximum_pending_messages; 800dacc: 59 63 00 44 sw (r11+68),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)) { 800dad0: 20 81 00 03 andi r1,r4,0x3 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 ) { 800dad4: b8 40 80 00 mv r16,r2 800dad8: b8 60 70 00 mv r14,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)) { 800dadc: b8 80 60 00 mv r12,r4 800dae0: 44 20 00 06 be r1,r0,800daf8 <_CORE_message_queue_Initialize+0x60> allocated_message_size += sizeof(uint32_t); 800dae4: 34 8c 00 04 addi r12,r4,4 allocated_message_size &= ~(sizeof(uint32_t) - 1); 800dae8: 34 01 ff fc mvi r1,-4 800daec: a1 81 60 00 and r12,r12,r1 } if (allocated_message_size < maximum_message_size) return false; 800daf0: 34 0d 00 00 mvi r13,0 if (allocated_message_size & (sizeof(uint32_t) - 1)) { allocated_message_size += sizeof(uint32_t); allocated_message_size &= ~(sizeof(uint32_t) - 1); } if (allocated_message_size < maximum_message_size) 800daf4: 54 8c 00 1c bgu r4,r12,800db64 <_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)); 800daf8: 35 8f 00 14 addi r15,r12,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 * 800dafc: b9 e0 08 00 mv r1,r15 800db00: b9 c0 10 00 mv r2,r14 800db04: f8 00 5d 23 calli 8024f90 <__mulsi3> (allocated_message_size + sizeof(CORE_message_queue_Buffer_control)); if (message_buffering_required < allocated_message_size) return false; 800db08: 34 0d 00 00 mvi r13,0 * check for overflow on the multiplication. */ message_buffering_required = (size_t) maximum_pending_messages * (allocated_message_size + sizeof(CORE_message_queue_Buffer_control)); if (message_buffering_required < allocated_message_size) 800db0c: 55 81 00 16 bgu r12,r1,800db64 <_CORE_message_queue_Initialize+0xcc><== NEVER TAKEN /* * Attempt to allocate the message memory */ the_message_queue->message_buffers = (CORE_message_queue_Buffer *) _Workspace_Allocate( message_buffering_required ); 800db10: f8 00 0e 9c calli 8011580 <_Workspace_Allocate> return false; /* * Attempt to allocate the message memory */ the_message_queue->message_buffers = (CORE_message_queue_Buffer *) 800db14: 59 61 00 5c sw (r11+92),r1 _Workspace_Allocate( message_buffering_required ); 800db18: b8 20 28 00 mv r5,r1 if (the_message_queue->message_buffers == 0) 800db1c: 44 20 00 12 be r1,r0,800db64 <_CORE_message_queue_Initialize+0xcc> /* * Initialize the pool of inactive messages, pending messages, * and set of waiting threads. */ _Chain_Initialize ( 800db20: b8 a0 10 00 mv r2,r5 800db24: 35 61 00 68 addi r1,r11,104 800db28: b9 c0 18 00 mv r3,r14 800db2c: b9 e0 20 00 mv r4,r15 800db30: f8 00 19 e5 calli 80142c4 <_Chain_Initialize> RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); 800db34: 35 61 00 54 addi r1,r11,84 head->next = tail; 800db38: 59 61 00 50 sw (r11+80),r1 */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); 800db3c: 35 61 00 50 addi r1,r11,80 Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; head->previous = NULL; tail->previous = head; 800db40: 59 61 00 58 sw (r11+88),r1 { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; head->previous = NULL; 800db44: 59 60 00 54 sw (r11+84),r0 allocated_message_size + sizeof( CORE_message_queue_Buffer_control ) ); _Chain_Initialize_empty( &the_message_queue->Pending_messages ); _Thread_queue_Initialize( 800db48: 2a 02 00 00 lw r2,(r16+0) 800db4c: b9 60 08 00 mv r1,r11 800db50: 34 03 00 80 mvi r3,128 800db54: 64 42 00 01 cmpei r2,r2,1 800db58: 34 04 00 06 mvi r4,6 800db5c: f8 00 0b 5b calli 80108c8 <_Thread_queue_Initialize> THREAD_QUEUE_DISCIPLINE_PRIORITY : THREAD_QUEUE_DISCIPLINE_FIFO, STATES_WAITING_FOR_MESSAGE, CORE_MESSAGE_QUEUE_STATUS_TIMEOUT ); return true; 800db60: 34 0d 00 01 mvi r13,1 } 800db64: b9 a0 08 00 mv r1,r13 800db68: 2b 9d 00 04 lw ra,(sp+4) 800db6c: 2b 8b 00 1c lw r11,(sp+28) 800db70: 2b 8c 00 18 lw r12,(sp+24) 800db74: 2b 8d 00 14 lw r13,(sp+20) 800db78: 2b 8e 00 10 lw r14,(sp+16) 800db7c: 2b 8f 00 0c lw r15,(sp+12) 800db80: 2b 90 00 08 lw r16,(sp+8) 800db84: 37 9c 00 1c addi sp,sp,28 800db88: c3 a0 00 00 ret =============================================================================== 0800db8c <_CORE_message_queue_Seize>: void *buffer, size_t *size_p, bool wait, Watchdog_Interval timeout ) { 800db8c: 37 9c ff f0 addi sp,sp,-16 800db90: 5b 8b 00 10 sw (sp+16),r11 800db94: 5b 8c 00 0c sw (sp+12),r12 800db98: 5b 8d 00 08 sw (sp+8),r13 800db9c: 5b 9d 00 04 sw (sp+4),ra ISR_Level level; CORE_message_queue_Buffer_control *the_message; Thread_Control *executing; executing = _Thread_Executing; 800dba0: 78 07 08 02 mvhi r7,0x802 800dba4: 38 e7 8f 10 ori r7,r7,0x8f10 800dba8: 28 e7 00 0c lw r7,(r7+12) void *buffer, size_t *size_p, bool wait, Watchdog_Interval timeout ) { 800dbac: b8 20 58 00 mv r11,r1 800dbb0: 20 a5 00 ff andi r5,r5,0xff 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; 800dbb4: 58 e0 00 34 sw (r7+52),r0 void *buffer, size_t *size_p, bool wait, Watchdog_Interval timeout ) { 800dbb8: b8 60 08 00 mv r1,r3 CORE_message_queue_Buffer_control *the_message; Thread_Control *executing; executing = _Thread_Executing; executing->Wait.return_code = CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL; _ISR_Disable( level ); 800dbbc: 90 00 40 00 rcsr r8,IE 800dbc0: 34 03 ff fe mvi r3,-2 800dbc4: a1 03 18 00 and r3,r8,r3 800dbc8: d0 03 00 00 wcsr IE,r3 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 ); } 800dbcc: 29 6c 00 50 lw r12,(r11+80) RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 800dbd0: 35 63 00 54 addi r3,r11,84 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected( Chain_Control *the_chain ) { if ( !_Chain_Is_empty(the_chain)) 800dbd4: 45 83 00 07 be r12,r3,800dbf0 <_CORE_message_queue_Seize+0x64> Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *old_first = head->next; Chain_Node *new_first = old_first->next; 800dbd8: 29 83 00 00 lw r3,(r12+0) */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_first_unprotected( Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); 800dbdc: 35 69 00 50 addi r9,r11,80 Chain_Node *old_first = head->next; Chain_Node *new_first = old_first->next; head->next = new_first; 800dbe0: 59 63 00 50 sw (r11+80),r3 new_first->previous = head; 800dbe4: 58 69 00 04 sw (r3+4),r9 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 ) { 800dbe8: 5d 80 00 04 bne r12,r0,800dbf8 <_CORE_message_queue_Seize+0x6c><== ALWAYS TAKEN 800dbec: e0 00 00 25 bi 800dc80 <_CORE_message_queue_Seize+0xf4> <== NOT EXECUTED ) { if ( !_Chain_Is_empty(the_chain)) return _Chain_Get_first_unprotected(the_chain); else return NULL; 800dbf0: 34 0c 00 00 mvi r12,0 800dbf4: e0 00 00 23 bi 800dc80 <_CORE_message_queue_Seize+0xf4> the_message_queue->number_of_pending_messages -= 1; 800dbf8: 29 62 00 48 lw r2,(r11+72) 800dbfc: 34 42 ff ff addi r2,r2,-1 800dc00: 59 62 00 48 sw (r11+72),r2 _ISR_Enable( level ); 800dc04: d0 08 00 00 wcsr IE,r8 *size_p = the_message->Contents.size; 800dc08: 29 83 00 0c lw r3,(r12+12) _Thread_Executing->Wait.count = 800dc0c: 78 02 08 02 mvhi r2,0x802 800dc10: 38 42 8f 10 ori r2,r2,0x8f10 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; 800dc14: 58 83 00 00 sw (r4+0),r3 _Thread_Executing->Wait.count = 800dc18: 29 84 00 08 lw r4,(r12+8) 800dc1c: 28 42 00 0c lw r2,(r2+12) _CORE_message_queue_Get_message_priority( the_message ); _CORE_message_queue_Copy_buffer( the_message->Contents.buffer, 800dc20: 35 8d 00 10 addi r13,r12,16 if ( the_message != NULL ) { the_message_queue->number_of_pending_messages -= 1; _ISR_Enable( level ); *size_p = the_message->Contents.size; _Thread_Executing->Wait.count = 800dc24: 58 44 00 24 sw (r2+36),r4 const void *source, void *destination, size_t size ) { memcpy(destination, source, size); 800dc28: b9 a0 10 00 mv r2,r13 800dc2c: f8 00 27 97 calli 8017a88 * 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 ); 800dc30: b9 60 08 00 mv r1,r11 800dc34: f8 00 09 c7 calli 8010350 <_Thread_queue_Dequeue> 800dc38: b8 20 20 00 mv r4,r1 if ( !the_thread ) { 800dc3c: 5c 20 00 05 bne r1,r0,800dc50 <_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 ); 800dc40: 35 61 00 68 addi r1,r11,104 800dc44: b9 80 10 00 mv r2,r12 800dc48: fb ff ff 64 calli 800d9d8 <_Chain_Append> _CORE_message_queue_Free_message_buffer( the_message_queue, the_message ); return; 800dc4c: e0 00 00 1e bi 800dcc4 <_CORE_message_queue_Seize+0x138> CORE_message_queue_Buffer_control *the_message, int priority ) { #if defined(RTEMS_SCORE_COREMSG_ENABLE_MESSAGE_PRIORITY) the_message->priority = priority; 800dc50: 28 21 00 24 lw r1,(r1+36) */ _CORE_message_queue_Set_message_priority( the_message, the_thread->Wait.count ); the_message->Contents.size = (size_t) the_thread->Wait.option; 800dc54: 28 83 00 30 lw r3,(r4+48) const void *source, void *destination, size_t size ) { memcpy(destination, source, size); 800dc58: 28 82 00 2c lw r2,(r4+44) CORE_message_queue_Buffer_control *the_message, int priority ) { #if defined(RTEMS_SCORE_COREMSG_ENABLE_MESSAGE_PRIORITY) the_message->priority = priority; 800dc5c: 59 81 00 08 sw (r12+8),r1 800dc60: 59 83 00 0c sw (r12+12),r3 const void *source, void *destination, size_t size ) { memcpy(destination, source, size); 800dc64: b9 a0 08 00 mv r1,r13 800dc68: f8 00 27 88 calli 8017a88 the_thread->Wait.return_argument_second.immutable_object, the_message->Contents.buffer, the_message->Contents.size ); _CORE_message_queue_Insert_message( 800dc6c: 29 83 00 08 lw r3,(r12+8) 800dc70: b9 60 08 00 mv r1,r11 800dc74: b9 80 10 00 mv r2,r12 800dc78: f8 00 19 a0 calli 80142f8 <_CORE_message_queue_Insert_message> the_message_queue, the_message, _CORE_message_queue_Get_message_priority( the_message ) ); return; 800dc7c: e0 00 00 12 bi 800dcc4 <_CORE_message_queue_Seize+0x138> } #endif } if ( !wait ) { 800dc80: 5c ac 00 05 bne r5,r12,800dc94 <_CORE_message_queue_Seize+0x108> _ISR_Enable( level ); 800dc84: d0 08 00 00 wcsr IE,r8 executing->Wait.return_code = CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED_NOWAIT; 800dc88: 34 01 00 04 mvi r1,4 800dc8c: 58 e1 00 34 sw (r7+52),r1 return; 800dc90: e0 00 00 0d bi 800dcc4 <_CORE_message_queue_Seize+0x138> 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; 800dc94: 34 03 00 01 mvi r3,1 800dc98: 59 63 00 30 sw (r11+48),r3 } _Thread_queue_Enter_critical_section( &the_message_queue->Wait_queue ); executing->Wait.queue = &the_message_queue->Wait_queue; 800dc9c: 58 eb 00 44 sw (r7+68),r11 executing->Wait.id = id; 800dca0: 58 e2 00 20 sw (r7+32),r2 executing->Wait.return_argument_second.mutable_object = buffer; 800dca4: 58 e1 00 2c sw (r7+44),r1 executing->Wait.return_argument = size_p; 800dca8: 58 e4 00 28 sw (r7+40),r4 /* Wait.count will be filled in with the message priority */ _ISR_Enable( level ); 800dcac: d0 08 00 00 wcsr IE,r8 _Thread_queue_Enqueue( &the_message_queue->Wait_queue, timeout ); 800dcb0: 78 03 08 01 mvhi r3,0x801 800dcb4: b9 60 08 00 mv r1,r11 800dcb8: b8 c0 10 00 mv r2,r6 800dcbc: 38 63 0a 08 ori r3,r3,0xa08 800dcc0: f8 00 0a 17 calli 801051c <_Thread_queue_Enqueue_with_handler> } 800dcc4: 2b 9d 00 04 lw ra,(sp+4) 800dcc8: 2b 8b 00 10 lw r11,(sp+16) 800dccc: 2b 8c 00 0c lw r12,(sp+12) 800dcd0: 2b 8d 00 08 lw r13,(sp+8) 800dcd4: 37 9c 00 10 addi sp,sp,16 800dcd8: c3 a0 00 00 ret =============================================================================== 08004d10 <_CORE_mutex_Seize>: Objects_Id _id, bool _wait, Watchdog_Interval _timeout, ISR_Level _level ) { 8004d10: 37 9c ff e8 addi sp,sp,-24 8004d14: 5b 8b 00 14 sw (sp+20),r11 8004d18: 5b 8c 00 10 sw (sp+16),r12 8004d1c: 5b 8d 00 0c sw (sp+12),r13 8004d20: 5b 8e 00 08 sw (sp+8),r14 8004d24: 5b 9d 00 04 sw (sp+4),ra 8004d28: b8 20 58 00 mv r11,r1 _CORE_mutex_Seize_body( _the_mutex, _id, _wait, _timeout, _level ); 8004d2c: 78 01 08 01 mvhi r1,0x801 8004d30: 38 21 99 20 ori r1,r1,0x9920 8004d34: 28 21 00 00 lw r1,(r1+0) Objects_Id _id, bool _wait, Watchdog_Interval _timeout, ISR_Level _level ) { 8004d38: 5b 85 00 18 sw (sp+24),r5 8004d3c: b8 40 70 00 mv r14,r2 8004d40: b8 80 68 00 mv r13,r4 8004d44: 20 6c 00 ff andi r12,r3,0xff _CORE_mutex_Seize_body( _the_mutex, _id, _wait, _timeout, _level ); 8004d48: 44 20 00 0b be r1,r0,8004d74 <_CORE_mutex_Seize+0x64> 8004d4c: 45 80 00 0a be r12,r0,8004d74 <_CORE_mutex_Seize+0x64> <== NEVER TAKEN 8004d50: 78 01 08 01 mvhi r1,0x801 8004d54: 38 21 9a 98 ori r1,r1,0x9a98 8004d58: 28 21 00 00 lw r1,(r1+0) 8004d5c: 34 02 00 01 mvi r2,1 8004d60: 50 41 00 05 bgeu r2,r1,8004d74 <_CORE_mutex_Seize+0x64> 8004d64: 34 01 00 00 mvi r1,0 8004d68: 34 02 00 00 mvi r2,0 8004d6c: 34 03 00 12 mvi r3,18 8004d70: f8 00 02 0c calli 80055a0 <_Internal_error_Occurred> 8004d74: b9 60 08 00 mv r1,r11 8004d78: 37 82 00 18 addi r2,sp,24 8004d7c: f8 00 25 f0 calli 800e53c <_CORE_mutex_Seize_interrupt_trylock> 8004d80: 44 20 00 19 be r1,r0,8004de4 <_CORE_mutex_Seize+0xd4> 8004d84: 78 01 08 01 mvhi r1,0x801 8004d88: 38 21 9d f0 ori r1,r1,0x9df0 8004d8c: 5d 80 00 07 bne r12,r0,8004da8 <_CORE_mutex_Seize+0x98> 8004d90: 2b 82 00 18 lw r2,(sp+24) 8004d94: d0 02 00 00 wcsr IE,r2 8004d98: 28 21 00 0c lw r1,(r1+12) 8004d9c: 34 02 00 01 mvi r2,1 8004da0: 58 22 00 34 sw (r1+52),r2 8004da4: e0 00 00 10 bi 8004de4 <_CORE_mutex_Seize+0xd4> 8004da8: 28 21 00 0c lw r1,(r1+12) 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; 8004dac: 34 02 00 01 mvi r2,1 8004db0: 59 62 00 30 sw (r11+48),r2 8004db4: 58 2b 00 44 sw (r1+68),r11 8004db8: 58 2e 00 20 sw (r1+32),r14 rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 8004dbc: 78 01 08 01 mvhi r1,0x801 8004dc0: 38 21 99 20 ori r1,r1,0x9920 8004dc4: 28 22 00 00 lw r2,(r1+0) 8004dc8: 34 42 00 01 addi r2,r2,1 8004dcc: 58 22 00 00 sw (r1+0),r2 8004dd0: 2b 81 00 18 lw r1,(sp+24) 8004dd4: d0 01 00 00 wcsr IE,r1 8004dd8: b9 60 08 00 mv r1,r11 8004ddc: b9 a0 10 00 mv r2,r13 8004de0: fb ff ff ab calli 8004c8c <_CORE_mutex_Seize_interrupt_blocking> } 8004de4: 2b 9d 00 04 lw ra,(sp+4) 8004de8: 2b 8b 00 14 lw r11,(sp+20) 8004dec: 2b 8c 00 10 lw r12,(sp+16) 8004df0: 2b 8d 00 0c lw r13,(sp+12) 8004df4: 2b 8e 00 08 lw r14,(sp+8) 8004df8: 37 9c 00 18 addi sp,sp,24 8004dfc: c3 a0 00 00 ret =============================================================================== 08004f78 <_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 ) { 8004f78: 37 9c ff f8 addi sp,sp,-8 8004f7c: 5b 8b 00 08 sw (sp+8),r11 8004f80: 5b 9d 00 04 sw (sp+4),ra 8004f84: b8 20 58 00 mv r11,r1 ISR_Level level; CORE_semaphore_Status status; status = CORE_SEMAPHORE_STATUS_SUCCESSFUL; if ( (the_thread = _Thread_queue_Dequeue(&the_semaphore->Wait_queue)) ) { 8004f88: f8 00 07 66 calli 8006d20 <_Thread_queue_Dequeue> { Thread_Control *the_thread; ISR_Level level; CORE_semaphore_Status status; status = CORE_SEMAPHORE_STATUS_SUCCESSFUL; 8004f8c: 34 02 00 00 mvi r2,0 if ( (the_thread = _Thread_queue_Dequeue(&the_semaphore->Wait_queue)) ) { 8004f90: 5c 20 00 0d bne r1,r0,8004fc4 <_CORE_semaphore_Surrender+0x4c> if ( !_Objects_Is_local_id( the_thread->Object.id ) ) (*api_semaphore_mp_support) ( the_thread, id ); #endif } else { _ISR_Disable( level ); 8004f94: 90 00 08 00 rcsr r1,IE 8004f98: 34 02 ff fe mvi r2,-2 8004f9c: a0 22 10 00 and r2,r1,r2 8004fa0: d0 02 00 00 wcsr IE,r2 if ( the_semaphore->count < the_semaphore->Attributes.maximum_count ) 8004fa4: 29 63 00 48 lw r3,(r11+72) 8004fa8: 29 64 00 40 lw r4,(r11+64) the_semaphore->count += 1; else status = CORE_SEMAPHORE_MAXIMUM_COUNT_EXCEEDED; 8004fac: 34 02 00 04 mvi r2,4 (*api_semaphore_mp_support) ( the_thread, id ); #endif } else { _ISR_Disable( level ); if ( the_semaphore->count < the_semaphore->Attributes.maximum_count ) 8004fb0: 50 64 00 04 bgeu r3,r4,8004fc0 <_CORE_semaphore_Surrender+0x48><== NEVER TAKEN the_semaphore->count += 1; 8004fb4: 34 63 00 01 addi r3,r3,1 8004fb8: 59 63 00 48 sw (r11+72),r3 { Thread_Control *the_thread; ISR_Level level; CORE_semaphore_Status status; status = CORE_SEMAPHORE_STATUS_SUCCESSFUL; 8004fbc: 34 02 00 00 mvi r2,0 _ISR_Disable( level ); if ( the_semaphore->count < the_semaphore->Attributes.maximum_count ) the_semaphore->count += 1; else status = CORE_SEMAPHORE_MAXIMUM_COUNT_EXCEEDED; _ISR_Enable( level ); 8004fc0: d0 01 00 00 wcsr IE,r1 } return status; } 8004fc4: b8 40 08 00 mv r1,r2 8004fc8: 2b 9d 00 04 lw ra,(sp+4) 8004fcc: 2b 8b 00 08 lw r11,(sp+8) 8004fd0: 37 9c 00 08 addi sp,sp,8 8004fd4: c3 a0 00 00 ret =============================================================================== 0800d938 <_Event_Surrender>: */ void _Event_Surrender( Thread_Control *the_thread ) { 800d938: 37 9c ff f8 addi sp,sp,-8 800d93c: 5b 8b 00 08 sw (sp+8),r11 800d940: 5b 9d 00 04 sw (sp+4),ra 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 ]; 800d944: 28 24 01 1c lw r4,(r1+284) option_set = (rtems_option) the_thread->Wait.option; 800d948: 28 28 00 30 lw r8,(r1+48) */ void _Event_Surrender( Thread_Control *the_thread ) { 800d94c: b8 20 58 00 mv r11,r1 api = the_thread->API_Extensions[ THREAD_API_RTEMS ]; option_set = (rtems_option) the_thread->Wait.option; _ISR_Disable( level ); 800d950: 90 00 08 00 rcsr r1,IE 800d954: 34 07 ff fe mvi r7,-2 800d958: a0 27 38 00 and r7,r1,r7 800d95c: d0 07 00 00 wcsr IE,r7 pending_events = api->pending_events; 800d960: 28 85 00 00 lw r5,(r4+0) event_condition = (rtems_event_set) the_thread->Wait.count; 800d964: 29 66 00 24 lw r6,(r11+36) RTEMS_INLINE_ROUTINE rtems_event_set _Event_sets_Get( rtems_event_set the_event_set, rtems_event_set the_event_condition ) { return ( the_event_set & the_event_condition ); 800d968: a0 c5 10 00 and r2,r6,r5 seized_events = _Event_sets_Get( pending_events, event_condition ); /* * No events were seized in this operation */ if ( _Event_sets_Is_empty( seized_events ) ) { 800d96c: 5c 40 00 03 bne r2,r0,800d978 <_Event_Surrender+0x40> _ISR_Enable( level ); 800d970: d0 01 00 00 wcsr IE,r1 return; 800d974: e0 00 00 3d bi 800da68 <_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() && 800d978: 78 03 08 01 mvhi r3,0x801 800d97c: 38 63 9d f0 ori r3,r3,0x9df0 800d980: 28 69 00 08 lw r9,(r3+8) 800d984: 45 20 00 1a be r9,r0,800d9ec <_Event_Surrender+0xb4> 800d988: 28 63 00 0c lw r3,(r3+12) 800d98c: 5d 63 00 18 bne r11,r3,800d9ec <_Event_Surrender+0xb4> _Thread_Is_executing( the_thread ) && ((_Event_Sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || 800d990: 78 03 08 01 mvhi r3,0x801 800d994: 38 63 a2 e8 ori r3,r3,0xa2e8 800d998: 28 6a 00 00 lw r10,(r3+0) /* * If we are in an ISR and sending to the current thread, then * we have a critical section issue to deal with. */ if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) && 800d99c: 34 09 00 02 mvi r9,2 800d9a0: 45 49 00 04 be r10,r9,800d9b0 <_Event_Surrender+0x78> <== NEVER TAKEN ((_Event_Sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || (_Event_Sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED)) ) { 800d9a4: 28 69 00 00 lw r9,(r3+0) * If we are in an ISR and sending to the current thread, then * we have a critical section issue to deal with. */ if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) && ((_Event_Sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || 800d9a8: 34 03 00 01 mvi r3,1 800d9ac: 5d 23 00 10 bne r9,r3,800d9ec <_Event_Surrender+0xb4> (_Event_Sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED)) ) { if ( seized_events == event_condition || _Options_Is_any(option_set) ) { 800d9b0: 44 46 00 03 be r2,r6,800d9bc <_Event_Surrender+0x84> */ RTEMS_INLINE_ROUTINE bool _Options_Is_any ( rtems_option option_set ) { return (option_set & RTEMS_EVENT_ANY) ? true : false; 800d9b4: 21 08 00 02 andi r8,r8,0x2 800d9b8: 45 00 00 0b be r8,r0,800d9e4 <_Event_Surrender+0xac> <== NEVER TAKEN RTEMS_INLINE_ROUTINE rtems_event_set _Event_sets_Clear( rtems_event_set the_event_set, rtems_event_set the_mask ) { return ( the_event_set & ~(the_mask) ); 800d9bc: a4 40 18 00 not r3,r2 800d9c0: a0 65 28 00 and r5,r3,r5 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; 800d9c4: 29 63 00 28 lw r3,(r11+40) 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 ); 800d9c8: 58 85 00 00 sw (r4+0),r5 the_thread->Wait.count = 0; 800d9cc: 59 60 00 24 sw (r11+36),r0 *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 800d9d0: 58 62 00 00 sw (r3+0),r2 _Event_Sync_state = THREAD_BLOCKING_OPERATION_SATISFIED; 800d9d4: 78 02 08 01 mvhi r2,0x801 800d9d8: 38 42 a2 e8 ori r2,r2,0xa2e8 800d9dc: 34 03 00 03 mvi r3,3 800d9e0: 58 43 00 00 sw (r2+0),r3 } _ISR_Enable( level ); 800d9e4: d0 01 00 00 wcsr IE,r1 return; 800d9e8: e0 00 00 20 bi 800da68 <_Event_Surrender+0x130> */ RTEMS_INLINE_ROUTINE bool _States_Is_waiting_for_event ( States_Control the_states ) { return (the_states & STATES_WAITING_FOR_EVENT); 800d9ec: 29 63 00 10 lw r3,(r11+16) 800d9f0: 20 63 01 00 andi r3,r3,0x100 } /* * Otherwise, this is a normal send to another thread */ if ( _States_Is_waiting_for_event( the_thread->current_state ) ) { 800d9f4: 44 60 00 1c be r3,r0,800da64 <_Event_Surrender+0x12c> if ( seized_events == event_condition || _Options_Is_any( option_set ) ) { 800d9f8: 44 46 00 03 be r2,r6,800da04 <_Event_Surrender+0xcc> 800d9fc: 21 08 00 02 andi r8,r8,0x2 800da00: 45 00 00 19 be r8,r0,800da64 <_Event_Surrender+0x12c> <== NEVER TAKEN 800da04: a4 40 18 00 not r3,r2 800da08: a0 65 28 00 and r5,r3,r5 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; 800da0c: 29 63 00 28 lw r3,(r11+40) /* * 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 ); 800da10: 58 85 00 00 sw (r4+0),r5 the_thread->Wait.count = 0; 800da14: 59 60 00 24 sw (r11+36),r0 *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 800da18: 58 62 00 00 sw (r3+0),r2 _ISR_Flash( level ); 800da1c: d0 01 00 00 wcsr IE,r1 800da20: d0 07 00 00 wcsr IE,r7 if ( !_Watchdog_Is_active( &the_thread->Timer ) ) { 800da24: 29 63 00 50 lw r3,(r11+80) 800da28: 34 02 00 02 mvi r2,2 800da2c: 44 62 00 03 be r3,r2,800da38 <_Event_Surrender+0x100> _ISR_Enable( level ); 800da30: d0 01 00 00 wcsr IE,r1 800da34: e0 00 00 06 bi 800da4c <_Event_Surrender+0x114> RTEMS_INLINE_ROUTINE void _Watchdog_Deactivate( Watchdog_Control *the_watchdog ) { the_watchdog->state = WATCHDOG_REMOVE_IT; 800da38: 34 02 00 03 mvi r2,3 800da3c: 59 62 00 50 sw (r11+80),r2 _Thread_Unblock( the_thread ); } else { _Watchdog_Deactivate( &the_thread->Timer ); _ISR_Enable( level ); 800da40: d0 01 00 00 wcsr IE,r1 (void) _Watchdog_Remove( &the_thread->Timer ); 800da44: 35 61 00 48 addi r1,r11,72 800da48: fb ff e8 73 calli 8007c14 <_Watchdog_Remove> RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 800da4c: 78 03 08 01 mvhi r3,0x801 800da50: 38 63 80 9c ori r3,r3,0x809c 800da54: 28 62 00 00 lw r2,(r3+0) 800da58: b9 60 08 00 mv r1,r11 800da5c: f8 00 05 70 calli 800f01c <_Thread_Clear_state> 800da60: e0 00 00 02 bi 800da68 <_Event_Surrender+0x130> _Thread_Unblock( the_thread ); } return; } } _ISR_Enable( level ); 800da64: d0 01 00 00 wcsr IE,r1 } 800da68: 2b 9d 00 04 lw ra,(sp+4) 800da6c: 2b 8b 00 08 lw r11,(sp+8) 800da70: 37 9c 00 08 addi sp,sp,8 800da74: c3 a0 00 00 ret =============================================================================== 0800da78 <_Event_Timeout>: void _Event_Timeout( Objects_Id id, void *ignored ) { 800da78: 37 9c ff f8 addi sp,sp,-8 800da7c: 5b 9d 00 04 sw (sp+4),ra Thread_Control *the_thread; Objects_Locations location; ISR_Level level; the_thread = _Thread_Get( id, &location ); 800da80: 37 82 00 08 addi r2,sp,8 800da84: fb ff e3 ba calli 800696c <_Thread_Get> switch ( location ) { 800da88: 2b 82 00 08 lw r2,(sp+8) 800da8c: 5c 40 00 1d bne r2,r0,800db00 <_Event_Timeout+0x88> <== NEVER TAKEN * * If it is not satisfied, then it is "nothing happened" and * this is the "timeout" transition. After a request is satisfied, * a timeout is not allowed to occur. */ _ISR_Disable( level ); 800da90: 90 00 18 00 rcsr r3,IE 800da94: 34 02 ff fe mvi r2,-2 800da98: a0 62 10 00 and r2,r3,r2 800da9c: d0 02 00 00 wcsr IE,r2 RTEMS_INLINE_ROUTINE bool _Thread_Is_executing ( const Thread_Control *the_thread ) { return ( the_thread == _Thread_Executing ); 800daa0: 78 02 08 01 mvhi r2,0x801 800daa4: 38 42 9d f0 ori r2,r2,0x9df0 return; } #endif the_thread->Wait.count = 0; if ( _Thread_Is_executing( the_thread ) ) { 800daa8: 28 42 00 0c lw r2,(r2+12) _ISR_Enable( level ); return; } #endif the_thread->Wait.count = 0; 800daac: 58 20 00 24 sw (r1+36),r0 if ( _Thread_Is_executing( the_thread ) ) { 800dab0: 5c 22 00 08 bne r1,r2,800dad0 <_Event_Timeout+0x58> if ( _Event_Sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) 800dab4: 78 02 08 01 mvhi r2,0x801 800dab8: 38 42 a2 e8 ori r2,r2,0xa2e8 800dabc: 28 45 00 00 lw r5,(r2+0) 800dac0: 34 04 00 01 mvi r4,1 800dac4: 5c a4 00 03 bne r5,r4,800dad0 <_Event_Timeout+0x58> <== ALWAYS TAKEN _Event_Sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT; 800dac8: 34 04 00 02 mvi r4,2 <== NOT EXECUTED 800dacc: 58 44 00 00 sw (r2+0),r4 <== NOT EXECUTED } the_thread->Wait.return_code = RTEMS_TIMEOUT; 800dad0: 34 02 00 06 mvi r2,6 800dad4: 58 22 00 34 sw (r1+52),r2 _ISR_Enable( level ); 800dad8: d0 03 00 00 wcsr IE,r3 RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 800dadc: 78 03 08 01 mvhi r3,0x801 800dae0: 38 63 80 9c ori r3,r3,0x809c 800dae4: 28 62 00 00 lw r2,(r3+0) 800dae8: f8 00 05 4d calli 800f01c <_Thread_Clear_state> */ RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void ) { RTEMS_COMPILER_MEMORY_BARRIER(); _Thread_Dispatch_disable_level -= 1; 800daec: 78 01 08 01 mvhi r1,0x801 800daf0: 38 21 99 20 ori r1,r1,0x9920 800daf4: 28 22 00 00 lw r2,(r1+0) 800daf8: 34 42 ff ff addi r2,r2,-1 800dafc: 58 22 00 00 sw (r1+0),r2 case OBJECTS_REMOTE: /* impossible */ #endif case OBJECTS_ERROR: break; } } 800db00: 2b 9d 00 04 lw ra,(sp+4) 800db04: 37 9c 00 08 addi sp,sp,8 800db08: c3 a0 00 00 ret =============================================================================== 08009e30 <_Heap_Extend>: Heap_Control *heap, void *extend_area_begin_ptr, uintptr_t extend_area_size, uintptr_t *extended_size_ptr ) { 8009e30: 37 9c ff b8 addi sp,sp,-72 8009e34: 5b 8b 00 40 sw (sp+64),r11 8009e38: 5b 8c 00 3c sw (sp+60),r12 8009e3c: 5b 8d 00 38 sw (sp+56),r13 8009e40: 5b 8e 00 34 sw (sp+52),r14 8009e44: 5b 8f 00 30 sw (sp+48),r15 8009e48: 5b 90 00 2c sw (sp+44),r16 8009e4c: 5b 91 00 28 sw (sp+40),r17 8009e50: 5b 92 00 24 sw (sp+36),r18 8009e54: 5b 93 00 20 sw (sp+32),r19 8009e58: 5b 94 00 1c sw (sp+28),r20 8009e5c: 5b 95 00 18 sw (sp+24),r21 8009e60: 5b 96 00 14 sw (sp+20),r22 8009e64: 5b 97 00 10 sw (sp+16),r23 8009e68: 5b 98 00 0c sw (sp+12),r24 8009e6c: 5b 99 00 08 sw (sp+8),r25 8009e70: 5b 9d 00 04 sw (sp+4),ra 8009e74: b8 40 70 00 mv r14,r2 Heap_Block *start_block = first_block; Heap_Block *merge_below_block = NULL; Heap_Block *merge_above_block = NULL; Heap_Block *link_below_block = NULL; Heap_Block *link_above_block = NULL; Heap_Block *extend_first_block = NULL; 8009e78: 5b 80 00 48 sw (sp+72),r0 Heap_Block *extend_last_block = NULL; 8009e7c: 5b 80 00 44 sw (sp+68),r0 uintptr_t const page_size = heap->page_size; uintptr_t const min_block_size = heap->min_block_size; uintptr_t const extend_area_begin = (uintptr_t) extend_area_begin_ptr; uintptr_t const extend_area_end = extend_area_begin + extend_area_size; 8009e80: b5 c3 68 00 add r13,r14,r3 Heap_Control *heap, void *extend_area_begin_ptr, uintptr_t extend_area_size, uintptr_t *extended_size_ptr ) { 8009e84: b8 80 a0 00 mv r20,r4 8009e88: b8 20 58 00 mv r11,r1 8009e8c: b8 60 10 00 mv r2,r3 Heap_Statistics *const stats = &heap->stats; Heap_Block *const first_block = heap->first_block; 8009e90: 28 35 00 20 lw r21,(r1+32) Heap_Block *merge_above_block = NULL; Heap_Block *link_below_block = NULL; Heap_Block *link_above_block = NULL; Heap_Block *extend_first_block = NULL; Heap_Block *extend_last_block = NULL; uintptr_t const page_size = heap->page_size; 8009e94: 28 36 00 10 lw r22,(r1+16) uintptr_t const min_block_size = heap->min_block_size; 8009e98: 28 24 00 14 lw r4,(r1+20) uintptr_t const extend_area_begin = (uintptr_t) extend_area_begin_ptr; uintptr_t const extend_area_end = extend_area_begin + extend_area_size; uintptr_t const free_size = stats->free_size; 8009e9c: 28 37 00 30 lw r23,(r1+48) uintptr_t extend_first_block_size = 0; uintptr_t extended_size = 0; bool extend_area_ok = false; if ( extend_area_end < extend_area_begin ) { return false; 8009ea0: 34 0c 00 00 mvi r12,0 uintptr_t const free_size = stats->free_size; uintptr_t extend_first_block_size = 0; uintptr_t extended_size = 0; bool extend_area_ok = false; if ( extend_area_end < extend_area_begin ) { 8009ea4: 55 cd 00 8e bgu r14,r13,800a0dc <_Heap_Extend+0x2ac> return false; } extend_area_ok = _Heap_Get_first_and_last_block( 8009ea8: b9 c0 08 00 mv r1,r14 8009eac: ba c0 18 00 mv r3,r22 8009eb0: 37 85 00 48 addi r5,sp,72 8009eb4: 37 86 00 44 addi r6,sp,68 8009eb8: fb ff e8 34 calli 8003f88 <_Heap_Get_first_and_last_block> page_size, min_block_size, &extend_first_block, &extend_last_block ); if (!extend_area_ok ) { 8009ebc: 44 20 00 88 be r1,r0,800a0dc <_Heap_Extend+0x2ac> 8009ec0: ba a0 78 00 mv r15,r21 8009ec4: 34 11 00 00 mvi r17,0 8009ec8: 34 13 00 00 mvi r19,0 8009ecc: 34 10 00 00 mvi r16,0 return false; } do { uintptr_t const sub_area_begin = (start_block != first_block) ? (uintptr_t) start_block : heap->area_begin; 8009ed0: 29 61 00 18 lw r1,(r11+24) - 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; 8009ed4: 34 18 ff fe mvi r24,-2 8009ed8: e0 00 00 02 bi 8009ee0 <_Heap_Extend+0xb0> 8009edc: b9 e0 08 00 mv r1,r15 uintptr_t const sub_area_end = start_block->prev_size; 8009ee0: 29 f2 00 00 lw r18,(r15+0) Heap_Block *const end_block = _Heap_Block_of_alloc_area( sub_area_end, page_size ); if ( sub_area_end > extend_area_begin && extend_area_end > sub_area_begin 8009ee4: f5 a1 18 00 cmpgu r3,r13,r1 8009ee8: f6 4e 10 00 cmpgu r2,r18,r14 (uintptr_t) start_block : heap->area_begin; uintptr_t const sub_area_end = start_block->prev_size; Heap_Block *const end_block = _Heap_Block_of_alloc_area( sub_area_end, page_size ); if ( 8009eec: a0 62 10 00 and r2,r3,r2 8009ef0: 5c 40 00 7a bne r2,r0,800a0d8 <_Heap_Extend+0x2a8> sub_area_end > extend_area_begin && extend_area_end > sub_area_begin ) { return false; } if ( extend_area_end == sub_area_begin ) { 8009ef4: 45 a1 00 03 be r13,r1,8009f00 <_Heap_Extend+0xd0> merge_below_block = start_block; } else if ( extend_area_end < sub_area_end ) { 8009ef8: 56 4d 00 04 bgu r18,r13,8009f08 <_Heap_Extend+0xd8> 8009efc: e0 00 00 04 bi 8009f0c <_Heap_Extend+0xdc> sub_area_end > extend_area_begin && extend_area_end > sub_area_begin ) { return false; } if ( extend_area_end == sub_area_begin ) { 8009f00: b9 e0 80 00 mv r16,r15 8009f04: e0 00 00 02 bi 8009f0c <_Heap_Extend+0xdc> merge_below_block = start_block; } else if ( extend_area_end < sub_area_end ) { 8009f08: b9 e0 98 00 mv r19,r15 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 8009f0c: ba 40 08 00 mv r1,r18 8009f10: ba c0 10 00 mv r2,r22 8009f14: 36 59 ff f8 addi r25,r18,-8 8009f18: f8 00 20 ed calli 80122cc <__umodsi3> uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) - HEAP_BLOCK_HEADER_SIZE); 8009f1c: cb 21 08 00 sub r1,r25,r1 link_below_block = start_block; } if ( sub_area_end == extend_area_begin ) { 8009f20: 5d d2 00 04 bne r14,r18,8009f30 <_Heap_Extend+0x100> start_block->prev_size = extend_area_end; 8009f24: 59 ed 00 00 sw (r15+0),r13 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 ) 8009f28: b8 20 60 00 mv r12,r1 8009f2c: e0 00 00 04 bi 8009f3c <_Heap_Extend+0x10c> merge_above_block = end_block; } else if ( sub_area_end < extend_area_begin ) { 8009f30: 55 d2 00 02 bgu r14,r18,8009f38 <_Heap_Extend+0x108> 8009f34: e0 00 00 02 bi 8009f3c <_Heap_Extend+0x10c> 8009f38: b8 20 88 00 mv r17,r1 - 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; 8009f3c: 28 2f 00 04 lw r15,(r1+4) 8009f40: a3 0f 78 00 and r15,r24,r15 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 8009f44: b4 2f 78 00 add r15,r1,r15 link_above_block = end_block; } start_block = _Heap_Block_at( end_block, _Heap_Block_size( end_block ) ); } while ( start_block != first_block ); 8009f48: 5d f5 ff e5 bne r15,r21,8009edc <_Heap_Extend+0xac> if ( extend_area_begin < heap->area_begin ) { 8009f4c: 29 61 00 18 lw r1,(r11+24) 8009f50: 51 c1 00 03 bgeu r14,r1,8009f5c <_Heap_Extend+0x12c> heap->area_begin = extend_area_begin; 8009f54: 59 6e 00 18 sw (r11+24),r14 8009f58: e0 00 00 04 bi 8009f68 <_Heap_Extend+0x138> } else if ( heap->area_end < extend_area_end ) { 8009f5c: 29 61 00 1c lw r1,(r11+28) 8009f60: 50 2d 00 02 bgeu r1,r13,8009f68 <_Heap_Extend+0x138> heap->area_end = extend_area_end; 8009f64: 59 6d 00 1c sw (r11+28),r13 } extend_first_block_size = (uintptr_t) extend_last_block - (uintptr_t) extend_first_block; 8009f68: 2b 81 00 44 lw r1,(sp+68) 8009f6c: 2b 82 00 48 lw r2,(sp+72) heap->area_begin = extend_area_begin; } else if ( heap->area_end < extend_area_end ) { heap->area_end = extend_area_end; } extend_first_block_size = 8009f70: c8 22 18 00 sub r3,r1,r2 (uintptr_t) extend_last_block - (uintptr_t) extend_first_block; extend_first_block->prev_size = extend_area_end; 8009f74: 58 4d 00 00 sw (r2+0),r13 extend_first_block->size_and_flag = extend_first_block_size | HEAP_PREV_BLOCK_USED; 8009f78: 38 64 00 01 ori r4,r3,0x1 _Heap_Protection_block_initialize( heap, extend_first_block ); extend_last_block->prev_size = extend_first_block_size; 8009f7c: 58 23 00 00 sw (r1+0),r3 extend_last_block->size_and_flag = 0; _Heap_Protection_block_initialize( heap, extend_last_block ); if ( (uintptr_t) extend_first_block < (uintptr_t) heap->first_block ) { 8009f80: 29 63 00 20 lw r3,(r11+32) extend_first_block_size = (uintptr_t) extend_last_block - (uintptr_t) extend_first_block; extend_first_block->prev_size = extend_area_end; extend_first_block->size_and_flag = 8009f84: 58 44 00 04 sw (r2+4),r4 extend_first_block_size | HEAP_PREV_BLOCK_USED; _Heap_Protection_block_initialize( heap, extend_first_block ); extend_last_block->prev_size = extend_first_block_size; extend_last_block->size_and_flag = 0; 8009f88: 58 20 00 04 sw (r1+4),r0 _Heap_Protection_block_initialize( heap, extend_last_block ); if ( (uintptr_t) extend_first_block < (uintptr_t) heap->first_block ) { 8009f8c: 50 43 00 03 bgeu r2,r3,8009f98 <_Heap_Extend+0x168> heap->first_block = extend_first_block; 8009f90: 59 62 00 20 sw (r11+32),r2 8009f94: e0 00 00 04 bi 8009fa4 <_Heap_Extend+0x174> } else if ( (uintptr_t) extend_last_block > (uintptr_t) heap->last_block ) { 8009f98: 29 62 00 24 lw r2,(r11+36) 8009f9c: 50 41 00 02 bgeu r2,r1,8009fa4 <_Heap_Extend+0x174> heap->last_block = extend_last_block; 8009fa0: 59 61 00 24 sw (r11+36),r1 } if ( merge_below_block != NULL ) { 8009fa4: 46 00 00 12 be r16,r0,8009fec <_Heap_Extend+0x1bc> Heap_Control *heap, uintptr_t extend_area_begin, Heap_Block *first_block ) { uintptr_t const page_size = heap->page_size; 8009fa8: 29 6f 00 10 lw r15,(r11+16) uintptr_t const new_first_block_alloc_begin = _Heap_Align_up( extend_area_begin + HEAP_BLOCK_HEADER_SIZE, page_size ); 8009fac: 35 ce 00 08 addi r14,r14,8 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_up( uintptr_t value, uintptr_t alignment ) { uintptr_t remainder = value % alignment; 8009fb0: b9 c0 08 00 mv r1,r14 8009fb4: b9 e0 10 00 mv r2,r15 8009fb8: f8 00 20 c5 calli 80122cc <__umodsi3> if ( remainder != 0 ) { 8009fbc: 44 20 00 03 be r1,r0,8009fc8 <_Heap_Extend+0x198> <== ALWAYS TAKEN return value - remainder + alignment; 8009fc0: b5 cf 70 00 add r14,r14,r15 <== NOT EXECUTED 8009fc4: c9 c1 70 00 sub r14,r14,r1 <== NOT EXECUTED uintptr_t const first_block_begin = (uintptr_t) first_block; uintptr_t const new_first_block_size = first_block_begin - new_first_block_begin; Heap_Block *const new_first_block = (Heap_Block *) new_first_block_begin; new_first_block->prev_size = first_block->prev_size; 8009fc8: 2a 01 00 00 lw r1,(r16+0) ) { uintptr_t const page_size = heap->page_size; uintptr_t const new_first_block_alloc_begin = _Heap_Align_up( extend_area_begin + HEAP_BLOCK_HEADER_SIZE, page_size ); uintptr_t const new_first_block_begin = 8009fcc: 35 c2 ff f8 addi r2,r14,-8 uintptr_t const first_block_begin = (uintptr_t) first_block; uintptr_t const new_first_block_size = first_block_begin - new_first_block_begin; Heap_Block *const new_first_block = (Heap_Block *) new_first_block_begin; new_first_block->prev_size = first_block->prev_size; 8009fd0: 59 c1 ff f8 sw (r14+-8),r1 uintptr_t const new_first_block_alloc_begin = _Heap_Align_up( extend_area_begin + HEAP_BLOCK_HEADER_SIZE, page_size ); uintptr_t const new_first_block_begin = new_first_block_alloc_begin - HEAP_BLOCK_HEADER_SIZE; uintptr_t const first_block_begin = (uintptr_t) first_block; uintptr_t const new_first_block_size = 8009fd4: ca 02 08 00 sub r1,r16,r2 first_block_begin - new_first_block_begin; Heap_Block *const new_first_block = (Heap_Block *) new_first_block_begin; new_first_block->prev_size = first_block->prev_size; new_first_block->size_and_flag = new_first_block_size | HEAP_PREV_BLOCK_USED; 8009fd8: 38 21 00 01 ori r1,r1,0x1 8009fdc: 58 41 00 04 sw (r2+4),r1 _Heap_Free_block( heap, new_first_block ); 8009fe0: b9 60 08 00 mv r1,r11 8009fe4: fb ff ff 86 calli 8009dfc <_Heap_Free_block> 8009fe8: e0 00 00 06 bi 800a000 <_Heap_Extend+0x1d0> heap->last_block = extend_last_block; } if ( merge_below_block != NULL ) { _Heap_Merge_below( heap, extend_area_begin, merge_below_block ); } else if ( link_below_block != NULL ) { 8009fec: 46 70 00 05 be r19,r16,800a000 <_Heap_Extend+0x1d0> _Heap_Link_below( 8009ff0: 2b 81 00 44 lw r1,(sp+68) { uintptr_t const last_block_begin = (uintptr_t) last_block; uintptr_t const link_begin = (uintptr_t) link; last_block->size_and_flag = (link_begin - last_block_begin) | HEAP_PREV_BLOCK_USED; 8009ff4: ca 61 98 00 sub r19,r19,r1 8009ff8: 3a 73 00 01 ori r19,r19,0x1 ) { uintptr_t const last_block_begin = (uintptr_t) last_block; uintptr_t const link_begin = (uintptr_t) link; last_block->size_and_flag = 8009ffc: 58 33 00 04 sw (r1+4),r19 link_below_block, extend_last_block ); } if ( merge_above_block != NULL ) { 800a000: 45 80 00 14 be r12,r0,800a050 <_Heap_Extend+0x220> RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 800a004: 29 62 00 10 lw r2,(r11+16) ) { uintptr_t const page_size = heap->page_size; uintptr_t const last_block_begin = (uintptr_t) last_block; uintptr_t const last_block_new_size = _Heap_Align_down( extend_area_end - last_block_begin - HEAP_BLOCK_HEADER_SIZE, 800a008: 35 ad ff f8 addi r13,r13,-8 uintptr_t extend_area_end ) { uintptr_t const page_size = heap->page_size; uintptr_t const last_block_begin = (uintptr_t) last_block; uintptr_t const last_block_new_size = _Heap_Align_down( 800a00c: c9 ac 68 00 sub r13,r13,r12 800a010: b9 a0 08 00 mv r1,r13 800a014: f8 00 20 ae calli 80122cc <__umodsi3> ); Heap_Block *const new_last_block = _Heap_Block_at( last_block, last_block_new_size ); new_last_block->size_and_flag = (last_block->size_and_flag - last_block_new_size) 800a018: 29 83 00 04 lw r3,(r12+4) 800a01c: c9 a1 08 00 sub r1,r13,r1 page_size ); Heap_Block *const new_last_block = _Heap_Block_at( last_block, last_block_new_size ); new_last_block->size_and_flag = 800a020: b4 2c 10 00 add r2,r1,r12 (last_block->size_and_flag - last_block_new_size) 800a024: c8 61 18 00 sub r3,r3,r1 | HEAP_PREV_BLOCK_USED; 800a028: 38 63 00 01 ori r3,r3,0x1 page_size ); Heap_Block *const new_last_block = _Heap_Block_at( last_block, last_block_new_size ); new_last_block->size_and_flag = 800a02c: 58 43 00 04 sw (r2+4),r3 RTEMS_INLINE_ROUTINE void _Heap_Block_set_size( Heap_Block *block, uintptr_t size ) { uintptr_t flag = block->size_and_flag & HEAP_PREV_BLOCK_USED; 800a030: 29 82 00 04 lw r2,(r12+4) 800a034: 20 42 00 01 andi r2,r2,0x1 block->size_and_flag = size | flag; 800a038: b8 22 08 00 or r1,r1,r2 800a03c: 59 81 00 04 sw (r12+4),r1 (last_block->size_and_flag - last_block_new_size) | HEAP_PREV_BLOCK_USED; _Heap_Block_set_size( last_block, last_block_new_size ); _Heap_Free_block( heap, last_block ); 800a040: b9 80 10 00 mv r2,r12 800a044: b9 60 08 00 mv r1,r11 800a048: fb ff ff 6d calli 8009dfc <_Heap_Free_block> 800a04c: e0 00 00 0c bi 800a07c <_Heap_Extend+0x24c> ); } if ( merge_above_block != NULL ) { _Heap_Merge_above( heap, merge_above_block, extend_area_end ); } else if ( link_above_block != NULL ) { 800a050: 46 2c 00 0b be r17,r12,800a07c <_Heap_Extend+0x24c> RTEMS_INLINE_ROUTINE void _Heap_Block_set_size( Heap_Block *block, uintptr_t size ) { uintptr_t flag = block->size_and_flag & HEAP_PREV_BLOCK_USED; 800a054: 2a 21 00 04 lw r1,(r17+4) ) { uintptr_t const link_begin = (uintptr_t) link; uintptr_t const first_block_begin = (uintptr_t) first_block; _Heap_Block_set_size( link, first_block_begin - link_begin ); 800a058: 2b 83 00 48 lw r3,(sp+72) } if ( merge_above_block != NULL ) { _Heap_Merge_above( heap, merge_above_block, extend_area_end ); } else if ( link_above_block != NULL ) { _Heap_Link_above( 800a05c: 2b 82 00 44 lw r2,(sp+68) 800a060: 20 21 00 01 andi r1,r1,0x1 ) { uintptr_t const link_begin = (uintptr_t) link; uintptr_t const first_block_begin = (uintptr_t) first_block; _Heap_Block_set_size( link, first_block_begin - link_begin ); 800a064: c8 71 18 00 sub r3,r3,r17 block->size_and_flag = size | flag; 800a068: b8 61 08 00 or r1,r3,r1 800a06c: 5a 21 00 04 sw (r17+4),r1 last_block->size_and_flag |= HEAP_PREV_BLOCK_USED; 800a070: 28 41 00 04 lw r1,(r2+4) 800a074: 38 21 00 01 ori r1,r1,0x1 800a078: 58 41 00 04 sw (r2+4),r1 extend_first_block, extend_last_block ); } if ( merge_below_block == NULL && merge_above_block == NULL ) { 800a07c: 65 8c 00 00 cmpei r12,r12,0 800a080: 66 10 00 00 cmpei r16,r16,0 800a084: a1 90 60 00 and r12,r12,r16 800a088: 45 80 00 04 be r12,r0,800a098 <_Heap_Extend+0x268> _Heap_Free_block( heap, extend_first_block ); 800a08c: 2b 82 00 48 lw r2,(sp+72) 800a090: b9 60 08 00 mv r1,r11 800a094: fb ff ff 5a calli 8009dfc <_Heap_Free_block> */ RTEMS_INLINE_ROUTINE void _Heap_Set_last_block_size( Heap_Control *heap ) { _Heap_Block_set_size( heap->last_block, (uintptr_t) heap->first_block - (uintptr_t) heap->last_block 800a098: 29 61 00 24 lw r1,(r11+36) * This feature will be used to terminate the scattered heap area list. See * also _Heap_Extend(). */ RTEMS_INLINE_ROUTINE void _Heap_Set_last_block_size( Heap_Control *heap ) { _Heap_Block_set_size( 800a09c: 29 63 00 20 lw r3,(r11+32) stats->size += extended_size; if ( extended_size_ptr != NULL ) *extended_size_ptr = extended_size; return true; 800a0a0: 34 0c 00 01 mvi r12,1 RTEMS_INLINE_ROUTINE void _Heap_Block_set_size( Heap_Block *block, uintptr_t size ) { uintptr_t flag = block->size_and_flag & HEAP_PREV_BLOCK_USED; 800a0a4: 28 22 00 04 lw r2,(r1+4) * This feature will be used to terminate the scattered heap area list. See * also _Heap_Extend(). */ RTEMS_INLINE_ROUTINE void _Heap_Set_last_block_size( Heap_Control *heap ) { _Heap_Block_set_size( 800a0a8: c8 61 18 00 sub r3,r3,r1 RTEMS_INLINE_ROUTINE void _Heap_Block_set_size( Heap_Block *block, uintptr_t size ) { uintptr_t flag = block->size_and_flag & HEAP_PREV_BLOCK_USED; 800a0ac: 20 42 00 01 andi r2,r2,0x1 block->size_and_flag = size | flag; 800a0b0: b8 62 10 00 or r2,r3,r2 800a0b4: 58 22 00 04 sw (r1+4),r2 _Heap_Free_block( heap, extend_first_block ); } _Heap_Set_last_block_size( heap ); extended_size = stats->free_size - free_size; 800a0b8: 29 61 00 30 lw r1,(r11+48) /* Statistics */ stats->size += extended_size; 800a0bc: 29 62 00 2c lw r2,(r11+44) _Heap_Free_block( heap, extend_first_block ); } _Heap_Set_last_block_size( heap ); extended_size = stats->free_size - free_size; 800a0c0: c8 37 08 00 sub r1,r1,r23 /* Statistics */ stats->size += extended_size; 800a0c4: b4 41 10 00 add r2,r2,r1 800a0c8: 59 62 00 2c sw (r11+44),r2 if ( extended_size_ptr != NULL ) 800a0cc: 46 80 00 04 be r20,r0,800a0dc <_Heap_Extend+0x2ac> <== NEVER TAKEN *extended_size_ptr = extended_size; 800a0d0: 5a 81 00 00 sw (r20+0),r1 800a0d4: e0 00 00 02 bi 800a0dc <_Heap_Extend+0x2ac> _Heap_Block_of_alloc_area( sub_area_end, page_size ); if ( sub_area_end > extend_area_begin && extend_area_end > sub_area_begin ) { return false; 800a0d8: 34 0c 00 00 mvi r12,0 if ( extended_size_ptr != NULL ) *extended_size_ptr = extended_size; return true; } 800a0dc: b9 80 08 00 mv r1,r12 800a0e0: 2b 9d 00 04 lw ra,(sp+4) 800a0e4: 2b 8b 00 40 lw r11,(sp+64) 800a0e8: 2b 8c 00 3c lw r12,(sp+60) 800a0ec: 2b 8d 00 38 lw r13,(sp+56) 800a0f0: 2b 8e 00 34 lw r14,(sp+52) 800a0f4: 2b 8f 00 30 lw r15,(sp+48) 800a0f8: 2b 90 00 2c lw r16,(sp+44) 800a0fc: 2b 91 00 28 lw r17,(sp+40) 800a100: 2b 92 00 24 lw r18,(sp+36) 800a104: 2b 93 00 20 lw r19,(sp+32) 800a108: 2b 94 00 1c lw r20,(sp+28) 800a10c: 2b 95 00 18 lw r21,(sp+24) 800a110: 2b 96 00 14 lw r22,(sp+20) 800a114: 2b 97 00 10 lw r23,(sp+16) 800a118: 2b 98 00 0c lw r24,(sp+12) 800a11c: 2b 99 00 08 lw r25,(sp+8) 800a120: 37 9c 00 48 addi sp,sp,72 800a124: c3 a0 00 00 ret =============================================================================== 0800e920 <_Heap_Free>: return do_free; } #endif bool _Heap_Free( Heap_Control *heap, void *alloc_begin_ptr ) { 800e920: 37 9c ff f4 addi sp,sp,-12 800e924: 5b 8b 00 0c sw (sp+12),r11 800e928: 5b 8c 00 08 sw (sp+8),r12 800e92c: 5b 9d 00 04 sw (sp+4),ra 800e930: b8 20 58 00 mv r11,r1 800e934: 34 4c ff f8 addi r12,r2,-8 800e938: b8 40 08 00 mv r1,r2 800e93c: 29 62 00 10 lw r2,(r11+16) 800e940: f8 00 22 23 calli 80171cc <__umodsi3> 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 800e944: 29 67 00 20 lw r7,(r11+32) uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) - HEAP_BLOCK_HEADER_SIZE); 800e948: c9 81 18 00 sub r3,r12,r1 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; 800e94c: 34 01 00 00 mvi r1,0 800e950: 54 e3 00 03 bgu r7,r3,800e95c <_Heap_Free+0x3c> 800e954: 29 61 00 24 lw r1,(r11+36) 800e958: f0 23 08 00 cmpgeu r1,r1,r3 uintptr_t next_block_size = 0; bool next_is_free = false; _Heap_Protection_block_check( heap, block ); if ( !_Heap_Is_block_in_heap( heap, block ) ) { 800e95c: b8 20 10 00 mv r2,r1 return false; 800e960: 34 01 00 00 mvi r1,0 uintptr_t next_block_size = 0; bool next_is_free = false; _Heap_Protection_block_check( heap, block ); if ( !_Heap_Is_block_in_heap( heap, block ) ) { 800e964: 44 40 00 66 be r2,r0,800eafc <_Heap_Free+0x1dc> --stats->used_blocks; ++stats->frees; stats->free_size += block_size; return( true ); } 800e968: 28 66 00 04 lw r6,(r3+4) - 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; 800e96c: 34 04 ff fe mvi r4,-2 800e970: a0 c4 20 00 and r4,r6,r4 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 800e974: b4 64 10 00 add r2,r3,r4 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; 800e978: 54 e2 00 03 bgu r7,r2,800e984 <_Heap_Free+0x64> <== NEVER TAKEN 800e97c: 29 61 00 24 lw r1,(r11+36) 800e980: f0 22 08 00 cmpgeu r1,r1,r2 block_size = _Heap_Block_size( block ); next_block = _Heap_Block_at( block, block_size ); _Heap_Protection_block_check( heap, next_block ); if ( !_Heap_Is_block_in_heap( heap, next_block ) ) { 800e984: b8 20 28 00 mv r5,r1 _HAssert( false ); return false; 800e988: 34 01 00 00 mvi r1,0 block_size = _Heap_Block_size( block ); next_block = _Heap_Block_at( block, block_size ); _Heap_Protection_block_check( heap, next_block ); if ( !_Heap_Is_block_in_heap( heap, next_block ) ) { 800e98c: 44 a0 00 5c be r5,r0,800eafc <_Heap_Free+0x1dc> <== NEVER TAKEN --stats->used_blocks; ++stats->frees; stats->free_size += block_size; return( true ); } 800e990: 28 45 00 04 lw r5,(r2+4) 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; 800e994: 20 a8 00 01 andi r8,r5,0x1 if ( !_Heap_Is_block_in_heap( heap, next_block ) ) { _HAssert( false ); return false; } if ( !_Heap_Is_prev_used( next_block ) ) { 800e998: 45 00 00 59 be r8,r0,800eafc <_Heap_Free+0x1dc> <== NEVER TAKEN if ( !_Heap_Protection_determine_block_free( heap, block ) ) { return true; } next_block_size = _Heap_Block_size( next_block ); next_is_free = next_block != heap->last_block 800e99c: 29 69 00 24 lw r9,(r11+36) - 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; 800e9a0: 34 01 ff fe mvi r1,-2 800e9a4: a0 a1 28 00 and r5,r5,r1 && !_Heap_Is_prev_used( _Heap_Block_at( next_block, next_block_size )); 800e9a8: 34 08 00 00 mvi r8,0 800e9ac: 45 22 00 05 be r9,r2,800e9c0 <_Heap_Free+0xa0> --stats->used_blocks; ++stats->frees; stats->free_size += block_size; return( true ); } 800e9b0: b4 45 08 00 add r1,r2,r5 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; 800e9b4: 28 28 00 04 lw r8,(r1+4) 800e9b8: 21 08 00 01 andi r8,r8,0x1 return do_free; } #endif bool _Heap_Free( Heap_Control *heap, void *alloc_begin_ptr ) 800e9bc: 65 08 00 00 cmpei r8,r8,0 800e9c0: 20 c6 00 01 andi r6,r6,0x1 if ( !_Heap_Protection_determine_block_free( heap, block ) ) { return true; } next_block_size = _Heap_Block_size( next_block ); next_is_free = next_block != heap->last_block 800e9c4: 21 08 00 ff andi r8,r8,0xff && !_Heap_Is_prev_used( _Heap_Block_at( next_block, next_block_size )); if ( !_Heap_Is_prev_used( block ) ) { 800e9c8: 5c c0 00 24 bne r6,r0,800ea58 <_Heap_Free+0x138> uintptr_t const prev_size = block->prev_size; 800e9cc: 28 66 00 00 lw r6,(r3+0) 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; 800e9d0: 34 01 00 00 mvi r1,0 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 800e9d4: c8 66 18 00 sub r3,r3,r6 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; 800e9d8: 54 e3 00 02 bgu r7,r3,800e9e0 <_Heap_Free+0xc0> <== NEVER TAKEN 800e9dc: f1 23 08 00 cmpgeu r1,r9,r3 Heap_Block * const prev_block = _Heap_Block_at( block, -prev_size ); if ( !_Heap_Is_block_in_heap( heap, prev_block ) ) { 800e9e0: b8 20 38 00 mv r7,r1 _HAssert( false ); return( false ); 800e9e4: 34 01 00 00 mvi r1,0 if ( !_Heap_Is_prev_used( block ) ) { uintptr_t const prev_size = block->prev_size; Heap_Block * const prev_block = _Heap_Block_at( block, -prev_size ); if ( !_Heap_Is_block_in_heap( heap, prev_block ) ) { 800e9e8: 44 e0 00 45 be r7,r0,800eafc <_Heap_Free+0x1dc> <== 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; 800e9ec: 28 67 00 04 lw r7,(r3+4) 800e9f0: 20 e7 00 01 andi r7,r7,0x1 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) ) { 800e9f4: 44 e0 00 42 be r7,r0,800eafc <_Heap_Free+0x1dc> <== NEVER TAKEN _HAssert( false ); return( false ); } if ( next_is_free ) { /* coalesce both */ 800e9f8: 45 00 00 0f be r8,r0,800ea34 <_Heap_Free+0x114> return _Heap_Free_list_tail(heap)->prev; } RTEMS_INLINE_ROUTINE void _Heap_Free_list_remove( Heap_Block *block ) { Heap_Block *next = block->next; 800e9fc: 28 41 00 08 lw r1,(r2+8) Heap_Block *prev = block->prev; 800ea00: 28 42 00 0c lw r2,(r2+12) uintptr_t const size = block_size + prev_size + next_block_size; 800ea04: b4 85 28 00 add r5,r4,r5 800ea08: b4 a6 30 00 add r6,r5,r6 prev->next = next; 800ea0c: 58 41 00 08 sw (r2+8),r1 next->prev = prev; 800ea10: 58 22 00 0c sw (r1+12),r2 _Heap_Free_list_remove( next_block ); stats->free_blocks -= 1; 800ea14: 29 61 00 38 lw r1,(r11+56) 800ea18: 34 21 ff ff addi r1,r1,-1 800ea1c: 59 61 00 38 sw (r11+56),r1 prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 800ea20: 38 c1 00 01 ori r1,r6,0x1 800ea24: 58 61 00 04 sw (r3+4),r1 next_block = _Heap_Block_at( prev_block, size ); _HAssert(!_Heap_Is_prev_used( next_block)); next_block->prev_size = size; 800ea28: b4 66 18 00 add r3,r3,r6 800ea2c: 58 66 00 00 sw (r3+0),r6 800ea30: e0 00 00 29 bi 800ead4 <_Heap_Free+0x1b4> } else { /* coalesce prev */ uintptr_t const size = block_size + prev_size; 800ea34: b4 86 30 00 add r6,r4,r6 prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 800ea38: 38 c1 00 01 ori r1,r6,0x1 800ea3c: 58 61 00 04 sw (r3+4),r1 next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 800ea40: 28 43 00 04 lw r3,(r2+4) 800ea44: 34 01 ff fe mvi r1,-2 next_block->prev_size = size; 800ea48: 58 46 00 00 sw (r2+0),r6 _HAssert(!_Heap_Is_prev_used( next_block)); next_block->prev_size = size; } else { /* coalesce prev */ uintptr_t const size = block_size + prev_size; prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 800ea4c: a0 61 08 00 and r1,r3,r1 800ea50: 58 41 00 04 sw (r2+4),r1 800ea54: e0 00 00 20 bi 800ead4 <_Heap_Free+0x1b4> next_block->prev_size = size; } } else if ( next_is_free ) { /* coalesce next */ 800ea58: 45 00 00 0d be r8,r0,800ea8c <_Heap_Free+0x16c> uintptr_t const size = block_size + next_block_size; 800ea5c: b4 a4 08 00 add r1,r5,r4 RTEMS_INLINE_ROUTINE void _Heap_Free_list_replace( Heap_Block *old_block, Heap_Block *new_block ) { Heap_Block *next = old_block->next; 800ea60: 28 45 00 08 lw r5,(r2+8) Heap_Block *prev = old_block->prev; 800ea64: 28 42 00 0c lw r2,(r2+12) new_block->next = next; 800ea68: 58 65 00 08 sw (r3+8),r5 new_block->prev = prev; 800ea6c: 58 62 00 0c sw (r3+12),r2 next->prev = new_block; prev->next = new_block; 800ea70: 58 43 00 08 sw (r2+8),r3 _Heap_Free_list_replace( next_block, block ); block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 800ea74: 38 22 00 01 ori r2,r1,0x1 Heap_Block *prev = old_block->prev; new_block->next = next; new_block->prev = prev; next->prev = new_block; 800ea78: 58 a3 00 0c sw (r5+12),r3 800ea7c: 58 62 00 04 sw (r3+4),r2 next_block = _Heap_Block_at( block, size ); next_block->prev_size = size; 800ea80: b4 61 18 00 add r3,r3,r1 800ea84: 58 61 00 00 sw (r3+0),r1 800ea88: e0 00 00 13 bi 800ead4 <_Heap_Free+0x1b4> RTEMS_INLINE_ROUTINE void _Heap_Free_list_insert_after( Heap_Block *block_before, Heap_Block *new_block ) { Heap_Block *next = block_before->next; 800ea8c: 29 61 00 08 lw r1,(r11+8) new_block->next = next; new_block->prev = block_before; 800ea90: 58 6b 00 0c sw (r3+12),r11 /* Add 'block' to the head of the free blocks list as it tends to produce less fragmentation than adding to the tail. */ _Heap_Free_list_insert_after( _Heap_Free_list_head( heap), block ); block->size_and_flag = block_size | HEAP_PREV_BLOCK_USED; next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; next_block->prev_size = block_size; 800ea94: 58 44 00 00 sw (r2+0),r4 Heap_Block *new_block ) { Heap_Block *next = block_before->next; new_block->next = next; 800ea98: 58 61 00 08 sw (r3+8),r1 new_block->prev = block_before; block_before->next = new_block; next->prev = new_block; 800ea9c: 58 23 00 0c sw (r1+12),r3 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; 800eaa0: 38 81 00 01 ori r1,r4,0x1 800eaa4: 58 61 00 04 sw (r3+4),r1 { Heap_Block *next = block_before->next; new_block->next = next; new_block->prev = block_before; block_before->next = new_block; 800eaa8: 59 63 00 08 sw (r11+8),r3 next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 800eaac: 28 43 00 04 lw r3,(r2+4) 800eab0: 34 01 ff fe mvi r1,-2 800eab4: a0 61 08 00 and r1,r3,r1 800eab8: 58 41 00 04 sw (r2+4),r1 next_block->prev_size = block_size; /* Statistics */ ++stats->free_blocks; 800eabc: 29 61 00 38 lw r1,(r11+56) if ( stats->max_free_blocks < stats->free_blocks ) { 800eac0: 29 62 00 3c lw r2,(r11+60) 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; 800eac4: 34 21 00 01 addi r1,r1,1 800eac8: 59 61 00 38 sw (r11+56),r1 if ( stats->max_free_blocks < stats->free_blocks ) { 800eacc: 50 41 00 02 bgeu r2,r1,800ead4 <_Heap_Free+0x1b4> stats->max_free_blocks = stats->free_blocks; 800ead0: 59 61 00 3c sw (r11+60),r1 } } /* Statistics */ --stats->used_blocks; 800ead4: 29 61 00 40 lw r1,(r11+64) 800ead8: 34 21 ff ff addi r1,r1,-1 800eadc: 59 61 00 40 sw (r11+64),r1 ++stats->frees; 800eae0: 29 61 00 50 lw r1,(r11+80) 800eae4: 34 21 00 01 addi r1,r1,1 800eae8: 59 61 00 50 sw (r11+80),r1 stats->free_size += block_size; 800eaec: 29 61 00 30 lw r1,(r11+48) 800eaf0: b4 24 20 00 add r4,r1,r4 800eaf4: 59 64 00 30 sw (r11+48),r4 return( true ); 800eaf8: 34 01 00 01 mvi r1,1 } 800eafc: 2b 9d 00 04 lw ra,(sp+4) 800eb00: 2b 8b 00 0c lw r11,(sp+12) 800eb04: 2b 8c 00 08 lw r12,(sp+8) 800eb08: 37 9c 00 0c addi sp,sp,12 800eb0c: c3 a0 00 00 ret =============================================================================== 0800eb10 <_Heap_Resize_block>: void *alloc_begin_ptr, uintptr_t new_alloc_size, uintptr_t *old_size, uintptr_t *new_size ) { 800eb10: 37 9c ff e4 addi sp,sp,-28 800eb14: 5b 8b 00 1c sw (sp+28),r11 800eb18: 5b 8c 00 18 sw (sp+24),r12 800eb1c: 5b 8d 00 14 sw (sp+20),r13 800eb20: 5b 8e 00 10 sw (sp+16),r14 800eb24: 5b 8f 00 0c sw (sp+12),r15 800eb28: 5b 90 00 08 sw (sp+8),r16 800eb2c: 5b 9d 00 04 sw (sp+4),ra 800eb30: b8 20 58 00 mv r11,r1 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 800eb34: 34 50 ff f8 addi r16,r2,-8 800eb38: b8 40 08 00 mv r1,r2 800eb3c: b8 40 60 00 mv r12,r2 800eb40: 29 62 00 10 lw r2,(r11+16) 800eb44: b8 80 78 00 mv r15,r4 800eb48: b8 a0 68 00 mv r13,r5 800eb4c: b8 60 70 00 mv r14,r3 800eb50: f8 00 21 9f calli 80171cc <__umodsi3> 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; 800eb54: 29 62 00 20 lw r2,(r11+32) uintptr_t const alloc_begin = (uintptr_t) alloc_begin_ptr; Heap_Block *const block = _Heap_Block_of_alloc_area( alloc_begin, page_size ); *old_size = 0; 800eb58: 59 e0 00 00 sw (r15+0),r0 uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) - HEAP_BLOCK_HEADER_SIZE); 800eb5c: ca 01 30 00 sub r6,r16,r1 *new_size = 0; 800eb60: 59 a0 00 00 sw (r13+0),r0 new_alloc_size, old_size, new_size ); } else { return HEAP_RESIZE_FATAL_ERROR; 800eb64: 34 01 00 02 mvi r1,2 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; 800eb68: 54 46 00 38 bgu r2,r6,800ec48 <_Heap_Resize_block+0x138> 800eb6c: 29 62 00 24 lw r2,(r11+36) 800eb70: 54 c2 00 36 bgu r6,r2,800ec48 <_Heap_Resize_block+0x138> <== NEVER TAKEN - 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; 800eb74: 28 c2 00 04 lw r2,(r6+4) 800eb78: 34 01 ff fe mvi r1,-2 800eb7c: a0 22 10 00 and r2,r1,r2 { Heap_Statistics *const stats = &heap->stats; uintptr_t const block_begin = (uintptr_t) block; uintptr_t block_size = _Heap_Block_size( block ); uintptr_t block_end = block_begin + block_size; 800eb80: b4 c2 38 00 add r7,r6,r2 800eb84: 28 e8 00 04 lw r8,(r7+4) uintptr_t alloc_size = block_end - alloc_begin + HEAP_ALLOC_BONUS; 800eb88: c8 ec 48 00 sub r9,r7,r12 800eb8c: 35 29 00 04 addi r9,r9,4 800eb90: a0 28 40 00 and r8,r1,r8 new_size ); } else { return HEAP_RESIZE_FATAL_ERROR; } } 800eb94: b4 e8 08 00 add r1,r7,r8 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; 800eb98: 28 23 00 04 lw r3,(r1+4) bool next_block_is_free = _Heap_Is_free( next_block );; _HAssert( _Heap_Is_block_in_heap( heap, next_block ) ); _HAssert( _Heap_Is_prev_used( next_block ) ); *old_size = alloc_size; 800eb9c: 59 e9 00 00 sw (r15+0),r9 800eba0: 20 63 00 01 andi r3,r3,0x1 RTEMS_INLINE_ROUTINE bool _Heap_Is_free( const Heap_Block *block ) { return !_Heap_Is_used( block ); 800eba4: 18 63 00 01 xori r3,r3,0x1 if ( next_block_is_free ) { 800eba8: 44 60 00 03 be r3,r0,800ebb4 <_Heap_Resize_block+0xa4> block_size += next_block_size; 800ebac: b4 48 10 00 add r2,r2,r8 alloc_size += next_block_size; 800ebb0: b5 28 48 00 add r9,r9,r8 } if ( new_alloc_size > alloc_size ) { return HEAP_RESIZE_UNSATISFIED; 800ebb4: 34 01 00 01 mvi r1,1 if ( next_block_is_free ) { block_size += next_block_size; alloc_size += next_block_size; } if ( new_alloc_size > alloc_size ) { 800ebb8: 55 c9 00 24 bgu r14,r9,800ec48 <_Heap_Resize_block+0x138> return HEAP_RESIZE_UNSATISFIED; } if ( next_block_is_free ) { 800ebbc: 44 60 00 13 be r3,r0,800ec08 <_Heap_Resize_block+0xf8> RTEMS_INLINE_ROUTINE void _Heap_Block_set_size( Heap_Block *block, uintptr_t size ) { uintptr_t flag = block->size_and_flag & HEAP_PREV_BLOCK_USED; 800ebc0: 28 c1 00 04 lw r1,(r6+4) } RTEMS_INLINE_ROUTINE void _Heap_Free_list_remove( Heap_Block *block ) { Heap_Block *next = block->next; Heap_Block *prev = block->prev; 800ebc4: 28 e3 00 0c lw r3,(r7+12) RTEMS_INLINE_ROUTINE void _Heap_Block_set_size( Heap_Block *block, uintptr_t size ) { uintptr_t flag = block->size_and_flag & HEAP_PREV_BLOCK_USED; 800ebc8: 20 21 00 01 andi r1,r1,0x1 block->size_and_flag = size | flag; 800ebcc: b8 41 08 00 or r1,r2,r1 800ebd0: 58 c1 00 04 sw (r6+4),r1 return _Heap_Free_list_tail(heap)->prev; } RTEMS_INLINE_ROUTINE void _Heap_Free_list_remove( Heap_Block *block ) { Heap_Block *next = block->next; 800ebd4: 28 e1 00 08 lw r1,(r7+8) RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 800ebd8: b4 46 10 00 add r2,r2,r6 RTEMS_INLINE_ROUTINE void _Heap_Free_list_remove( Heap_Block *block ) { Heap_Block *next = block->next; Heap_Block *prev = block->prev; prev->next = next; 800ebdc: 58 61 00 08 sw (r3+8),r1 next->prev = prev; 800ebe0: 58 23 00 0c sw (r1+12),r3 _Heap_Block_set_size( block, block_size ); _Heap_Free_list_remove( next_block ); next_block = _Heap_Block_at( block, block_size ); next_block->size_and_flag |= HEAP_PREV_BLOCK_USED; 800ebe4: 28 41 00 04 lw r1,(r2+4) 800ebe8: 38 21 00 01 ori r1,r1,0x1 800ebec: 58 41 00 04 sw (r2+4),r1 /* Statistics */ --stats->free_blocks; 800ebf0: 29 61 00 38 lw r1,(r11+56) 800ebf4: 34 21 ff ff addi r1,r1,-1 800ebf8: 59 61 00 38 sw (r11+56),r1 stats->free_size -= next_block_size; 800ebfc: 29 61 00 30 lw r1,(r11+48) 800ec00: c8 28 40 00 sub r8,r1,r8 800ec04: 59 68 00 30 sw (r11+48),r8 } block = _Heap_Block_allocate( heap, block, alloc_begin, new_alloc_size ); 800ec08: b9 80 18 00 mv r3,r12 800ec0c: b8 c0 10 00 mv r2,r6 800ec10: b9 60 08 00 mv r1,r11 800ec14: b9 c0 20 00 mv r4,r14 800ec18: fb ff da 06 calli 8005430 <_Heap_Block_allocate> - 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; 800ec1c: 28 23 00 04 lw r3,(r1+4) 800ec20: 34 02 ff fe mvi r2,-2 800ec24: a0 43 10 00 and r2,r2,r3 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 800ec28: 34 42 00 04 addi r2,r2,4 block_size = _Heap_Block_size( block ); next_block = _Heap_Block_at( block, block_size ); *new_size = (uintptr_t) next_block - alloc_begin + HEAP_ALLOC_BONUS; 800ec2c: c8 4c 60 00 sub r12,r2,r12 800ec30: b4 2c 08 00 add r1,r1,r12 800ec34: 59 a1 00 00 sw (r13+0),r1 /* Statistics */ ++stats->resizes; 800ec38: 29 61 00 54 lw r1,(r11+84) 800ec3c: 34 21 00 01 addi r1,r1,1 800ec40: 59 61 00 54 sw (r11+84),r1 return HEAP_RESIZE_SUCCESSFUL; 800ec44: 34 01 00 00 mvi r1,0 new_size ); } else { return HEAP_RESIZE_FATAL_ERROR; } } 800ec48: 2b 9d 00 04 lw ra,(sp+4) 800ec4c: 2b 8b 00 1c lw r11,(sp+28) 800ec50: 2b 8c 00 18 lw r12,(sp+24) 800ec54: 2b 8d 00 14 lw r13,(sp+20) 800ec58: 2b 8e 00 10 lw r14,(sp+16) 800ec5c: 2b 8f 00 0c lw r15,(sp+12) 800ec60: 2b 90 00 08 lw r16,(sp+8) 800ec64: 37 9c 00 1c addi sp,sp,28 800ec68: c3 a0 00 00 ret =============================================================================== 0800ec6c <_Heap_Size_of_alloc_area>: bool _Heap_Size_of_alloc_area( Heap_Control *heap, void *alloc_begin_ptr, uintptr_t *alloc_size ) { 800ec6c: 37 9c ff ec addi sp,sp,-20 800ec70: 5b 8b 00 14 sw (sp+20),r11 800ec74: 5b 8c 00 10 sw (sp+16),r12 800ec78: 5b 8d 00 0c sw (sp+12),r13 800ec7c: 5b 8e 00 08 sw (sp+8),r14 800ec80: 5b 9d 00 04 sw (sp+4),ra 800ec84: b8 20 58 00 mv r11,r1 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 800ec88: 34 4e ff f8 addi r14,r2,-8 800ec8c: b8 40 08 00 mv r1,r2 800ec90: b8 40 60 00 mv r12,r2 800ec94: 29 62 00 10 lw r2,(r11+16) 800ec98: b8 60 68 00 mv r13,r3 800ec9c: f8 00 21 4c calli 80171cc <__umodsi3> 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 800eca0: 29 62 00 20 lw r2,(r11+32) uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) - HEAP_BLOCK_HEADER_SIZE); 800eca4: c9 c1 20 00 sub r4,r14,r1 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; 800eca8: 34 01 00 00 mvi r1,0 800ecac: 54 44 00 03 bgu r2,r4,800ecb8 <_Heap_Size_of_alloc_area+0x4c> 800ecb0: 29 61 00 24 lw r1,(r11+36) 800ecb4: f0 24 08 00 cmpgeu r1,r1,r4 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 ) ) { 800ecb8: b8 20 18 00 mv r3,r1 return false; 800ecbc: 34 01 00 00 mvi r1,0 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 ) ) { 800ecc0: 44 60 00 13 be r3,r0,800ed0c <_Heap_Size_of_alloc_area+0xa0> - 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; 800ecc4: 28 83 00 04 lw r3,(r4+4) 800ecc8: 34 01 ff fe mvi r1,-2 800eccc: a0 23 08 00 and r1,r1,r3 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 800ecd0: b4 81 20 00 add r4,r4,r1 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; 800ecd4: 34 01 00 00 mvi r1,0 800ecd8: 54 44 00 03 bgu r2,r4,800ece4 <_Heap_Size_of_alloc_area+0x78><== NEVER TAKEN 800ecdc: 29 61 00 24 lw r1,(r11+36) 800ece0: f0 24 08 00 cmpgeu r1,r1,r4 } block_size = _Heap_Block_size( block ); next_block = _Heap_Block_at( block, block_size ); if ( 800ece4: b8 20 10 00 mv r2,r1 !_Heap_Is_block_in_heap( heap, next_block ) || !_Heap_Is_prev_used( next_block ) ) { return false; 800ece8: 34 01 00 00 mvi r1,0 } block_size = _Heap_Block_size( block ); next_block = _Heap_Block_at( block, block_size ); if ( 800ecec: 44 40 00 08 be r2,r0,800ed0c <_Heap_Size_of_alloc_area+0xa0><== 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; 800ecf0: 28 82 00 04 lw r2,(r4+4) 800ecf4: 20 42 00 01 andi r2,r2,0x1 !_Heap_Is_block_in_heap( heap, next_block ) || !_Heap_Is_prev_used( next_block ) 800ecf8: 44 40 00 05 be r2,r0,800ed0c <_Heap_Size_of_alloc_area+0xa0><== NEVER TAKEN ) { return false; } *alloc_size = (uintptr_t) next_block + HEAP_ALLOC_BONUS - alloc_begin; 800ecfc: c8 8c 20 00 sub r4,r4,r12 800ed00: 34 84 00 04 addi r4,r4,4 800ed04: 59 a4 00 00 sw (r13+0),r4 return true; 800ed08: 34 01 00 01 mvi r1,1 } 800ed0c: 2b 9d 00 04 lw ra,(sp+4) 800ed10: 2b 8b 00 14 lw r11,(sp+20) 800ed14: 2b 8c 00 10 lw r12,(sp+16) 800ed18: 2b 8d 00 0c lw r13,(sp+12) 800ed1c: 2b 8e 00 08 lw r14,(sp+8) 800ed20: 37 9c 00 14 addi sp,sp,20 800ed24: c3 a0 00 00 ret =============================================================================== 08004c00 <_Heap_Walk>: bool _Heap_Walk( Heap_Control *heap, int source, bool dump ) { 8004c00: 37 9c ff a0 addi sp,sp,-96 8004c04: 5b 8b 00 50 sw (sp+80),r11 8004c08: 5b 8c 00 4c sw (sp+76),r12 8004c0c: 5b 8d 00 48 sw (sp+72),r13 8004c10: 5b 8e 00 44 sw (sp+68),r14 8004c14: 5b 8f 00 40 sw (sp+64),r15 8004c18: 5b 90 00 3c sw (sp+60),r16 8004c1c: 5b 91 00 38 sw (sp+56),r17 8004c20: 5b 92 00 34 sw (sp+52),r18 8004c24: 5b 93 00 30 sw (sp+48),r19 8004c28: 5b 94 00 2c sw (sp+44),r20 8004c2c: 5b 95 00 28 sw (sp+40),r21 8004c30: 5b 96 00 24 sw (sp+36),r22 8004c34: 5b 97 00 20 sw (sp+32),r23 8004c38: 5b 98 00 1c sw (sp+28),r24 8004c3c: 5b 99 00 18 sw (sp+24),r25 8004c40: 5b 9b 00 14 sw (sp+20),fp 8004c44: 5b 9d 00 10 sw (sp+16),ra uintptr_t const min_block_size = heap->min_block_size; Heap_Block *const first_block = heap->first_block; Heap_Block *const last_block = heap->last_block; Heap_Block *block = first_block; Heap_Walk_printer printer = dump ? _Heap_Walk_print : _Heap_Walk_print_nothing; 8004c48: 78 0d 08 00 mvhi r13,0x800 bool _Heap_Walk( Heap_Control *heap, int source, bool dump ) { 8004c4c: 20 63 00 ff andi r3,r3,0xff 8004c50: b8 20 60 00 mv r12,r1 8004c54: b8 40 70 00 mv r14,r2 uintptr_t const page_size = heap->page_size; 8004c58: 28 33 00 10 lw r19,(r1+16) uintptr_t const min_block_size = heap->min_block_size; 8004c5c: 28 35 00 14 lw r21,(r1+20) Heap_Block *const first_block = heap->first_block; 8004c60: 28 34 00 20 lw r20,(r1+32) Heap_Block *const last_block = heap->last_block; 8004c64: 28 36 00 24 lw r22,(r1+36) Heap_Block *block = first_block; Heap_Walk_printer printer = dump ? _Heap_Walk_print : _Heap_Walk_print_nothing; 8004c68: 39 ad 4b 68 ori r13,r13,0x4b68 8004c6c: 44 60 00 03 be r3,r0,8004c78 <_Heap_Walk+0x78> 8004c70: 78 0d 08 00 mvhi r13,0x800 8004c74: 39 ad 4b 8c ori r13,r13,0x4b8c if ( !_System_state_Is_up( _System_state_Get() ) ) { 8004c78: 78 03 08 01 mvhi r3,0x801 8004c7c: 38 63 6a 68 ori r3,r3,0x6a68 8004c80: 28 67 00 00 lw r7,(r3+0) 8004c84: 34 02 00 03 mvi r2,3 return true; 8004c88: 34 03 00 01 mvi r3,1 Heap_Block *const last_block = heap->last_block; Heap_Block *block = first_block; Heap_Walk_printer printer = dump ? _Heap_Walk_print : _Heap_Walk_print_nothing; if ( !_System_state_Is_up( _System_state_Get() ) ) { 8004c8c: 5c e2 01 08 bne r7,r2,80050ac <_Heap_Walk+0x4ac> <== NEVER TAKEN 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)( 8004c90: 29 81 00 08 lw r1,(r12+8) 8004c94: 29 86 00 18 lw r6,(r12+24) 8004c98: 29 87 00 1c lw r7,(r12+28) 8004c9c: 5b 81 00 08 sw (sp+8),r1 8004ca0: 29 81 00 0c lw r1,(r12+12) 8004ca4: 78 03 08 01 mvhi r3,0x801 8004ca8: 5b 96 00 04 sw (sp+4),r22 8004cac: 5b 81 00 0c sw (sp+12),r1 8004cb0: 34 02 00 00 mvi r2,0 8004cb4: b9 c0 08 00 mv r1,r14 8004cb8: 38 63 40 d0 ori r3,r3,0x40d0 8004cbc: ba 60 20 00 mv r4,r19 8004cc0: ba a0 28 00 mv r5,r21 8004cc4: ba 80 40 00 mv r8,r20 8004cc8: d9 a0 00 00 call r13 heap->area_begin, heap->area_end, first_block, last_block, first_free_block, last_free_block ); if ( page_size == 0 ) { 8004ccc: 5e 60 00 06 bne r19,r0,8004ce4 <_Heap_Walk+0xe4> (*printer)( source, true, "page size is zero\n" ); 8004cd0: 78 03 08 01 mvhi r3,0x801 8004cd4: b9 c0 08 00 mv r1,r14 8004cd8: 34 02 00 01 mvi r2,1 8004cdc: 38 63 41 64 ori r3,r3,0x4164 8004ce0: e0 00 00 25 bi 8004d74 <_Heap_Walk+0x174> ) { #if (CPU_ALIGNMENT == 0) return true; #else return (((uintptr_t)address % CPU_ALIGNMENT) == 0); 8004ce4: 22 6f 00 07 andi r15,r19,0x7 return false; } if ( !_Addresses_Is_aligned( (void *) page_size ) ) { 8004ce8: 45 e0 00 07 be r15,r0,8004d04 <_Heap_Walk+0x104> (*printer)( 8004cec: 78 03 08 01 mvhi r3,0x801 8004cf0: b9 c0 08 00 mv r1,r14 8004cf4: 34 02 00 01 mvi r2,1 8004cf8: 38 63 41 78 ori r3,r3,0x4178 8004cfc: ba 60 20 00 mv r4,r19 8004d00: e0 00 01 04 bi 8005110 <_Heap_Walk+0x510> RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 8004d04: ba a0 08 00 mv r1,r21 8004d08: ba 60 10 00 mv r2,r19 8004d0c: fb ff ef 9b calli 8000b78 <__umodsi3> 8004d10: b8 20 58 00 mv r11,r1 ); return false; } if ( !_Heap_Is_aligned( min_block_size, page_size ) ) { 8004d14: 44 2f 00 07 be r1,r15,8004d30 <_Heap_Walk+0x130> (*printer)( 8004d18: 78 03 08 01 mvhi r3,0x801 8004d1c: b9 c0 08 00 mv r1,r14 8004d20: 34 02 00 01 mvi r2,1 8004d24: 38 63 41 98 ori r3,r3,0x4198 8004d28: ba a0 20 00 mv r4,r21 8004d2c: e0 00 00 f9 bi 8005110 <_Heap_Walk+0x510> 8004d30: 36 81 00 08 addi r1,r20,8 8004d34: ba 60 10 00 mv r2,r19 8004d38: fb ff ef 90 calli 8000b78 <__umodsi3> ); return false; } if ( 8004d3c: 44 2b 00 07 be r1,r11,8004d58 <_Heap_Walk+0x158> !_Heap_Is_aligned( _Heap_Alloc_area_of_block( first_block ), page_size ) ) { (*printer)( 8004d40: 78 03 08 01 mvhi r3,0x801 8004d44: b9 c0 08 00 mv r1,r14 8004d48: 34 02 00 01 mvi r2,1 8004d4c: 38 63 41 bc ori r3,r3,0x41bc 8004d50: ba 80 20 00 mv r4,r20 8004d54: e0 00 00 ef bi 8005110 <_Heap_Walk+0x510> 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; 8004d58: 2a 82 00 04 lw r2,(r20+4) 8004d5c: 20 42 00 01 andi r2,r2,0x1 ); return false; } if ( !_Heap_Is_prev_used( first_block ) ) { 8004d60: 5c 41 00 07 bne r2,r1,8004d7c <_Heap_Walk+0x17c> (*printer)( 8004d64: 78 03 08 01 mvhi r3,0x801 8004d68: b9 c0 08 00 mv r1,r14 8004d6c: 34 02 00 01 mvi r2,1 8004d70: 38 63 41 f0 ori r3,r3,0x41f0 8004d74: d9 a0 00 00 call r13 8004d78: e0 00 00 40 bi 8004e78 <_Heap_Walk+0x278> - 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; 8004d7c: 2a cf 00 04 lw r15,(r22+4) 8004d80: 34 02 ff fe mvi r2,-2 8004d84: a0 4f 78 00 and r15,r2,r15 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 8004d88: b6 cf 78 00 add r15,r22,r15 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; 8004d8c: 29 e2 00 04 lw r2,(r15+4) 8004d90: 20 42 00 01 andi r2,r2,0x1 ); return false; } if ( _Heap_Is_free( last_block ) ) { 8004d94: 5c 41 00 06 bne r2,r1,8004dac <_Heap_Walk+0x1ac> (*printer)( 8004d98: 78 03 08 01 mvhi r3,0x801 8004d9c: b9 c0 08 00 mv r1,r14 8004da0: 34 02 00 01 mvi r2,1 8004da4: 38 63 42 20 ori r3,r3,0x4220 8004da8: e3 ff ff f3 bi 8004d74 <_Heap_Walk+0x174> ); return false; } if ( 8004dac: 45 f4 00 06 be r15,r20,8004dc4 <_Heap_Walk+0x1c4> <== ALWAYS TAKEN _Heap_Block_at( last_block, _Heap_Block_size( last_block ) ) != first_block ) { (*printer)( 8004db0: 78 03 08 01 mvhi r3,0x801 <== NOT EXECUTED 8004db4: b9 c0 08 00 mv r1,r14 <== NOT EXECUTED 8004db8: 34 02 00 01 mvi r2,1 <== NOT EXECUTED 8004dbc: 38 63 42 38 ori r3,r3,0x4238 <== NOT EXECUTED 8004dc0: e3 ff ff ed bi 8004d74 <_Heap_Walk+0x174> <== NOT EXECUTED int source, Heap_Walk_printer printer, Heap_Control *heap ) { uintptr_t const page_size = heap->page_size; 8004dc4: 29 92 00 10 lw r18,(r12+16) block = next_block; } while ( block != first_block ); return true; } 8004dc8: 29 8b 00 08 lw r11,(r12+8) Heap_Walk_printer printer, Heap_Control *heap ) { uintptr_t const page_size = heap->page_size; const Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); 8004dcc: b9 80 80 00 mv r16,r12 - 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; 8004dd0: 34 11 ff fe mvi r17,-2 8004dd4: e0 00 00 2d bi 8004e88 <_Heap_Walk+0x288> 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; 8004dd8: 29 83 00 20 lw r3,(r12+32) 8004ddc: 34 01 00 00 mvi r1,0 8004de0: 54 6b 00 03 bgu r3,r11,8004dec <_Heap_Walk+0x1ec> 8004de4: 29 81 00 24 lw r1,(r12+36) 8004de8: f0 2b 08 00 cmpgeu r1,r1,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 ) ) { 8004dec: 5c 20 00 06 bne r1,r0,8004e04 <_Heap_Walk+0x204> (*printer)( 8004df0: 78 03 08 01 mvhi r3,0x801 8004df4: b9 c0 08 00 mv r1,r14 8004df8: 34 02 00 01 mvi r2,1 8004dfc: 38 63 42 68 ori r3,r3,0x4268 8004e00: e0 00 00 14 bi 8004e50 <_Heap_Walk+0x250> RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 8004e04: 35 61 00 08 addi r1,r11,8 8004e08: ba 40 10 00 mv r2,r18 8004e0c: fb ff ef 5b calli 8000b78 <__umodsi3> ); return false; } if ( 8004e10: 44 20 00 06 be r1,r0,8004e28 <_Heap_Walk+0x228> !_Heap_Is_aligned( _Heap_Alloc_area_of_block( free_block ), page_size ) ) { (*printer)( 8004e14: 78 03 08 01 mvhi r3,0x801 8004e18: b9 c0 08 00 mv r1,r14 8004e1c: 34 02 00 01 mvi r2,1 8004e20: 38 63 42 88 ori r3,r3,0x4288 8004e24: e0 00 00 0b bi 8004e50 <_Heap_Walk+0x250> - 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; 8004e28: 29 63 00 04 lw r3,(r11+4) 8004e2c: a2 23 18 00 and r3,r17,r3 block = next_block; } while ( block != first_block ); return true; } 8004e30: b5 63 18 00 add r3,r11,r3 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; 8004e34: 28 63 00 04 lw r3,(r3+4) 8004e38: 20 63 00 01 andi r3,r3,0x1 ); return false; } if ( _Heap_Is_used( free_block ) ) { 8004e3c: 44 61 00 07 be r3,r1,8004e58 <_Heap_Walk+0x258> (*printer)( 8004e40: 78 03 08 01 mvhi r3,0x801 8004e44: b9 c0 08 00 mv r1,r14 8004e48: 34 02 00 01 mvi r2,1 8004e4c: 38 63 42 b8 ori r3,r3,0x42b8 8004e50: b9 60 20 00 mv r4,r11 8004e54: e0 00 00 af bi 8005110 <_Heap_Walk+0x510> ); return false; } if ( free_block->prev != prev_block ) { 8004e58: 29 65 00 0c lw r5,(r11+12) 8004e5c: 44 b0 00 09 be r5,r16,8004e80 <_Heap_Walk+0x280> (*printer)( 8004e60: 78 03 08 01 mvhi r3,0x801 8004e64: b9 c0 08 00 mv r1,r14 8004e68: 34 02 00 01 mvi r2,1 8004e6c: 38 63 42 d4 ori r3,r3,0x42d4 8004e70: b9 60 20 00 mv r4,r11 8004e74: d9 a0 00 00 call r13 if ( !_System_state_Is_up( _System_state_Get() ) ) { return true; } if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; 8004e78: 34 03 00 00 mvi r3,0 8004e7c: e0 00 00 8c bi 80050ac <_Heap_Walk+0x4ac> return false; } prev_block = free_block; free_block = free_block->next; 8004e80: b9 60 80 00 mv r16,r11 8004e84: 29 6b 00 08 lw r11,(r11+8) 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 ) { 8004e88: 5d 6c ff d4 bne r11,r12,8004dd8 <_Heap_Walk+0x1d8> 8004e8c: e0 00 00 03 bi 8004e98 <_Heap_Walk+0x298> block->prev_size ); } block = next_block; } while ( block != first_block ); 8004e90: ba 20 78 00 mv r15,r17 8004e94: e0 00 00 15 bi 8004ee8 <_Heap_Walk+0x2e8> "block 0x%08x: size %u\n", block, block_size ); } else { (*printer)( 8004e98: 78 01 08 01 mvhi r1,0x801 8004e9c: 38 21 44 84 ori r1,r1,0x4484 8004ea0: 5b 81 00 54 sw (sp+84),r1 if ( !_Heap_Is_prev_used( next_block ) ) { if ( !_Heap_Walk_check_free_block( source, printer, heap, block ) ) { return false; } } else if (prev_used) { (*printer)( 8004ea4: 78 01 08 01 mvhi r1,0x801 8004ea8: 38 21 44 6c ori r1,r1,0x446c 8004eac: 5b 81 00 58 sw (sp+88),r1 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)( 8004eb0: 78 01 08 01 mvhi r1,0x801 8004eb4: 38 21 40 98 ori r1,r1,0x4098 8004eb8: 5b 81 00 5c sw (sp+92),r1 8004ebc: 78 01 08 01 mvhi r1,0x801 8004ec0: 38 21 40 b4 ori r1,r1,0x40b4 8004ec4: 78 1b 08 01 mvhi fp,0x801 " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), block->next, block->next == last_free_block ? " (= last free)" : (block->next == free_list_tail ? " (= tail)" : "") 8004ec8: 78 17 08 01 mvhi r23,0x801 8004ecc: 78 19 08 01 mvhi r25,0x801 block, block_size, block->prev, block->prev == first_free_block ? " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), 8004ed0: 78 18 08 01 mvhi r24,0x801 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)( 8004ed4: 5b 81 00 60 sw (sp+96),r1 8004ed8: 3b 7b 43 c8 ori fp,fp,0x43c8 " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), block->next, block->next == last_free_block ? " (= last free)" : (block->next == free_list_tail ? " (= tail)" : "") 8004edc: 3a f7 44 38 ori r23,r23,0x4438 8004ee0: 3b 39 40 c4 ori r25,r25,0x40c4 block, block_size, block->prev, block->prev == first_free_block ? " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), 8004ee4: 3b 18 40 a8 ori r24,r24,0x40a8 block = next_block; } while ( block != first_block ); return true; } 8004ee8: 29 f2 00 04 lw r18,(r15+4) - 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; 8004eec: 34 01 ff fe mvi r1,-2 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; 8004ef0: 29 84 00 20 lw r4,(r12+32) - 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; 8004ef4: a2 41 80 00 and r16,r18,r1 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 8004ef8: b5 f0 88 00 add r17,r15,r16 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; 8004efc: 34 06 00 00 mvi r6,0 8004f00: 54 91 00 03 bgu r4,r17,8004f0c <_Heap_Walk+0x30c> <== NEVER TAKEN 8004f04: 29 86 00 24 lw r6,(r12+36) 8004f08: f0 d1 30 00 cmpgeu r6,r6,r17 bool const prev_used = _Heap_Is_prev_used( block ); Heap_Block *const next_block = _Heap_Block_at( block, block_size ); uintptr_t const next_block_begin = (uintptr_t) next_block; bool const is_not_last_block = block != last_block; if ( !_Heap_Is_block_in_heap( heap, next_block ) ) { 8004f0c: 5c c0 00 06 bne r6,r0,8004f24 <_Heap_Walk+0x324> (*printer)( 8004f10: 78 03 08 01 mvhi r3,0x801 8004f14: b9 c0 08 00 mv r1,r14 8004f18: 34 02 00 01 mvi r2,1 8004f1c: 38 63 43 08 ori r3,r3,0x4308 8004f20: e0 00 00 1f bi 8004f9c <_Heap_Walk+0x39c> RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 8004f24: ba 00 08 00 mv r1,r16 8004f28: ba 60 10 00 mv r2,r19 uintptr_t const block_begin = (uintptr_t) block; uintptr_t const block_size = _Heap_Block_size( block ); bool const prev_used = _Heap_Is_prev_used( block ); Heap_Block *const next_block = _Heap_Block_at( block, block_size ); uintptr_t const next_block_begin = (uintptr_t) next_block; bool const is_not_last_block = block != last_block; 8004f2c: fd f6 58 00 cmpne r11,r15,r22 8004f30: fb ff ef 12 calli 8000b78 <__umodsi3> ); return false; } if ( !_Heap_Is_aligned( block_size, page_size ) && is_not_last_block ) { 8004f34: 44 20 00 09 be r1,r0,8004f58 <_Heap_Walk+0x358> 8004f38: 45 60 00 08 be r11,r0,8004f58 <_Heap_Walk+0x358> (*printer)( 8004f3c: 78 03 08 01 mvhi r3,0x801 8004f40: b9 c0 08 00 mv r1,r14 8004f44: 34 02 00 01 mvi r2,1 8004f48: 38 63 43 38 ori r3,r3,0x4338 8004f4c: b9 e0 20 00 mv r4,r15 8004f50: ba 00 28 00 mv r5,r16 8004f54: e3 ff ff c8 bi 8004e74 <_Heap_Walk+0x274> ); return false; } if ( block_size < min_block_size && is_not_last_block ) { 8004f58: 52 15 00 0b bgeu r16,r21,8004f84 <_Heap_Walk+0x384> 8004f5c: 45 60 00 0a be r11,r0,8004f84 <_Heap_Walk+0x384> <== NEVER TAKEN (*printer)( 8004f60: 78 03 08 01 mvhi r3,0x801 8004f64: b9 c0 08 00 mv r1,r14 8004f68: 34 02 00 01 mvi r2,1 8004f6c: 38 63 43 68 ori r3,r3,0x4368 8004f70: b9 e0 20 00 mv r4,r15 8004f74: ba 00 28 00 mv r5,r16 8004f78: ba a0 30 00 mv r6,r21 8004f7c: d9 a0 00 00 call r13 8004f80: e3 ff ff be bi 8004e78 <_Heap_Walk+0x278> ); return false; } if ( next_block_begin <= block_begin && is_not_last_block ) { 8004f84: 56 2f 00 09 bgu r17,r15,8004fa8 <_Heap_Walk+0x3a8> 8004f88: 45 60 00 08 be r11,r0,8004fa8 <_Heap_Walk+0x3a8> (*printer)( 8004f8c: 78 03 08 01 mvhi r3,0x801 8004f90: b9 c0 08 00 mv r1,r14 8004f94: 34 02 00 01 mvi r2,1 8004f98: 38 63 43 94 ori r3,r3,0x4394 8004f9c: b9 e0 20 00 mv r4,r15 8004fa0: ba 20 28 00 mv r5,r17 8004fa4: e3 ff ff b4 bi 8004e74 <_Heap_Walk+0x274> 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; 8004fa8: 2a 24 00 04 lw r4,(r17+4) 8004fac: 22 52 00 01 andi r18,r18,0x1 8004fb0: 20 84 00 01 andi r4,r4,0x1 ); return false; } if ( !_Heap_Is_prev_used( next_block ) ) { 8004fb4: 5c 80 00 2d bne r4,r0,8005068 <_Heap_Walk+0x468> false, "block 0x%08x: size %u, prev 0x%08x%s, next 0x%08x%s\n", block, block_size, block->prev, block->prev == first_free_block ? 8004fb8: 29 e6 00 0c lw r6,(r15+12) 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)( 8004fbc: 29 85 00 08 lw r5,(r12+8) block = next_block; } while ( block != first_block ); return true; } 8004fc0: 29 84 00 0c lw r4,(r12+12) 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)( 8004fc4: 2b 87 00 5c lw r7,(sp+92) 8004fc8: 44 c5 00 04 be r6,r5,8004fd8 <_Heap_Walk+0x3d8> block, block_size, block->prev, block->prev == first_free_block ? " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), 8004fcc: ba e0 38 00 mv r7,r23 8004fd0: 5c cc 00 02 bne r6,r12,8004fd8 <_Heap_Walk+0x3d8> 8004fd4: bb 00 38 00 mv r7,r24 block->next, block->next == last_free_block ? 8004fd8: 29 e8 00 08 lw r8,(r15+8) 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)( 8004fdc: 2b 89 00 60 lw r9,(sp+96) 8004fe0: 45 04 00 04 be r8,r4,8004ff0 <_Heap_Walk+0x3f0> " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), block->next, block->next == last_free_block ? " (= last free)" : (block->next == free_list_tail ? " (= tail)" : "") 8004fe4: ba e0 48 00 mv r9,r23 8004fe8: 5d 0c 00 02 bne r8,r12,8004ff0 <_Heap_Walk+0x3f0> 8004fec: bb 20 48 00 mv r9,r25 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)( 8004ff0: 5b 89 00 04 sw (sp+4),r9 8004ff4: b9 c0 08 00 mv r1,r14 8004ff8: 34 02 00 00 mvi r2,0 8004ffc: bb 60 18 00 mv r3,fp 8005000: b9 e0 20 00 mv r4,r15 8005004: ba 00 28 00 mv r5,r16 8005008: d9 a0 00 00 call r13 block->next == last_free_block ? " (= last free)" : (block->next == free_list_tail ? " (= tail)" : "") ); if ( block_size != next_block->prev_size ) { 800500c: 2a 26 00 00 lw r6,(r17+0) 8005010: 46 06 00 0a be r16,r6,8005038 <_Heap_Walk+0x438> (*printer)( 8005014: 78 03 08 01 mvhi r3,0x801 8005018: b9 c0 08 00 mv r1,r14 800501c: 34 02 00 01 mvi r2,1 8005020: 38 63 44 00 ori r3,r3,0x4400 8005024: b9 e0 20 00 mv r4,r15 8005028: ba 00 28 00 mv r5,r16 800502c: ba 20 38 00 mv r7,r17 8005030: d9 a0 00 00 call r13 8005034: e3 ff ff 91 bi 8004e78 <_Heap_Walk+0x278> ); return false; } if ( !prev_used ) { 8005038: 5e 40 00 06 bne r18,r0,8005050 <_Heap_Walk+0x450> (*printer)( 800503c: 78 03 08 01 mvhi r3,0x801 8005040: b9 c0 08 00 mv r1,r14 8005044: 34 02 00 01 mvi r2,1 8005048: 38 63 44 3c ori r3,r3,0x443c 800504c: e0 00 00 30 bi 800510c <_Heap_Walk+0x50c> block = next_block; } while ( block != first_block ); return true; } 8005050: 29 85 00 08 lw r5,(r12+8) 8005054: e0 00 00 03 bi 8005060 <_Heap_Walk+0x460> { 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 ) { 8005058: 44 af 00 13 be r5,r15,80050a4 <_Heap_Walk+0x4a4> return true; } free_block = free_block->next; 800505c: 28 a5 00 08 lw r5,(r5+8) ) { 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 ) { 8005060: 5c ac ff fe bne r5,r12,8005058 <_Heap_Walk+0x458> 8005064: e0 00 00 26 bi 80050fc <_Heap_Walk+0x4fc> if ( !_Heap_Is_prev_used( next_block ) ) { if ( !_Heap_Walk_check_free_block( source, printer, heap, block ) ) { return false; } } else if (prev_used) { 8005068: 46 40 00 08 be r18,r0,8005088 <_Heap_Walk+0x488> (*printer)( 800506c: 2b 83 00 58 lw r3,(sp+88) 8005070: b9 c0 08 00 mv r1,r14 8005074: 34 02 00 00 mvi r2,0 8005078: b9 e0 20 00 mv r4,r15 800507c: ba 00 28 00 mv r5,r16 8005080: d9 a0 00 00 call r13 8005084: e0 00 00 08 bi 80050a4 <_Heap_Walk+0x4a4> "block 0x%08x: size %u\n", block, block_size ); } else { (*printer)( 8005088: 2b 83 00 54 lw r3,(sp+84) 800508c: 29 e6 00 00 lw r6,(r15+0) 8005090: b9 c0 08 00 mv r1,r14 8005094: 34 02 00 00 mvi r2,0 8005098: b9 e0 20 00 mv r4,r15 800509c: ba 00 28 00 mv r5,r16 80050a0: d9 a0 00 00 call r13 block->prev_size ); } block = next_block; } while ( block != first_block ); 80050a4: 5e 91 ff 7b bne r20,r17,8004e90 <_Heap_Walk+0x290> return true; 80050a8: 34 03 00 01 mvi r3,1 } 80050ac: b8 60 08 00 mv r1,r3 80050b0: 2b 9d 00 10 lw ra,(sp+16) 80050b4: 2b 8b 00 50 lw r11,(sp+80) 80050b8: 2b 8c 00 4c lw r12,(sp+76) 80050bc: 2b 8d 00 48 lw r13,(sp+72) 80050c0: 2b 8e 00 44 lw r14,(sp+68) 80050c4: 2b 8f 00 40 lw r15,(sp+64) 80050c8: 2b 90 00 3c lw r16,(sp+60) 80050cc: 2b 91 00 38 lw r17,(sp+56) 80050d0: 2b 92 00 34 lw r18,(sp+52) 80050d4: 2b 93 00 30 lw r19,(sp+48) 80050d8: 2b 94 00 2c lw r20,(sp+44) 80050dc: 2b 95 00 28 lw r21,(sp+40) 80050e0: 2b 96 00 24 lw r22,(sp+36) 80050e4: 2b 97 00 20 lw r23,(sp+32) 80050e8: 2b 98 00 1c lw r24,(sp+28) 80050ec: 2b 99 00 18 lw r25,(sp+24) 80050f0: 2b 9b 00 14 lw fp,(sp+20) 80050f4: 37 9c 00 60 addi sp,sp,96 80050f8: c3 a0 00 00 ret return false; } if ( !_Heap_Walk_is_in_free_list( heap, block ) ) { (*printer)( 80050fc: 78 03 08 01 mvhi r3,0x801 8005100: b9 c0 08 00 mv r1,r14 8005104: 34 02 00 01 mvi r2,1 8005108: 38 63 44 ac ori r3,r3,0x44ac 800510c: b9 e0 20 00 mv r4,r15 8005110: d9 a0 00 00 call r13 8005114: e3 ff ff 59 bi 8004e78 <_Heap_Walk+0x278> =============================================================================== 08004500 <_IO_Manager_initialization>: * workspace. * */ void _IO_Manager_initialization(void) { 8004500: 37 9c ff e8 addi sp,sp,-24 8004504: 5b 8b 00 18 sw (sp+24),r11 8004508: 5b 8c 00 14 sw (sp+20),r12 800450c: 5b 8d 00 10 sw (sp+16),r13 8004510: 5b 8e 00 0c sw (sp+12),r14 8004514: 5b 8f 00 08 sw (sp+8),r15 8004518: 5b 9d 00 04 sw (sp+4),ra 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; 800451c: 78 01 08 01 mvhi r1,0x801 8004520: 38 21 90 ac ori r1,r1,0x90ac drivers_in_table = Configuration.number_of_device_drivers; 8004524: 28 2d 00 34 lw r13,(r1+52) number_of_drivers = Configuration.maximum_drivers; 8004528: 28 2b 00 30 lw r11,(r1+48) 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; 800452c: 28 2e 00 38 lw r14,(r1+56) /* * 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 ) 8004530: 51 ab 00 03 bgeu r13,r11,800453c <_IO_Manager_initialization+0x3c> /* * 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 ) { 8004534: 5d 6d 00 0a bne r11,r13,800455c <_IO_Manager_initialization+0x5c><== ALWAYS TAKEN 8004538: e0 00 00 02 bi 8004540 <_IO_Manager_initialization+0x40> <== NOT EXECUTED /* * 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 ) 800453c: b9 a0 58 00 mv r11,r13 * 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; 8004540: 78 01 08 01 mvhi r1,0x801 8004544: 38 21 a2 64 ori r1,r1,0xa264 8004548: 58 2e 00 00 sw (r1+0),r14 _IO_Number_of_drivers = number_of_drivers; 800454c: 78 01 08 01 mvhi r1,0x801 8004550: 38 21 a2 60 ori r1,r1,0xa260 8004554: 58 2b 00 00 sw (r1+0),r11 return; 8004558: e0 00 00 27 bi 80045f4 <_IO_Manager_initialization+0xf4> * 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 ) 800455c: 34 02 00 01 mvi r2,1 8004560: b9 60 08 00 mv r1,r11 8004564: f8 00 4a 30 calli 8016e24 <__ashlsi3> 8004568: 34 02 00 03 mvi r2,3 800456c: b4 2b 08 00 add r1,r1,r11 8004570: f8 00 4a 2d calli 8016e24 <__ashlsi3> 8004574: b8 20 78 00 mv r15,r1 * The application requested extra slots in the driver table, so we * have to allocate a new driver table and copy theirs to it. */ _IO_Driver_address_table = (rtems_driver_address_table *) _Workspace_Allocate_or_fatal_error( 8004578: f8 00 0e 01 calli 8007d7c <_Workspace_Allocate_or_fatal_error> sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); _IO_Number_of_drivers = number_of_drivers; 800457c: 78 02 08 01 mvhi r2,0x801 8004580: 38 42 a2 60 ori r2,r2,0xa260 /* * 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 *) 8004584: 78 0c 08 01 mvhi r12,0x801 _Workspace_Allocate_or_fatal_error( sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); _IO_Number_of_drivers = number_of_drivers; 8004588: 58 4b 00 00 sw (r2+0),r11 memset( 800458c: b9 e0 18 00 mv r3,r15 /* * 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 *) 8004590: 39 8c a2 64 ori r12,r12,0xa264 _Workspace_Allocate_or_fatal_error( sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); _IO_Number_of_drivers = number_of_drivers; memset( 8004594: 34 02 00 00 mvi r2,0 /* * 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 *) 8004598: 59 81 00 00 sw (r12+0),r1 _Workspace_Allocate_or_fatal_error( sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); _IO_Number_of_drivers = number_of_drivers; memset( 800459c: f8 00 36 ac calli 801204c _IO_Driver_address_table, 0, sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); for ( index = 0 ; index < drivers_in_table ; index++ ) 80045a0: 34 03 00 00 mvi r3,0 80045a4: 34 04 00 00 mvi r4,0 80045a8: e0 00 00 12 bi 80045f0 <_IO_Manager_initialization+0xf0> _IO_Driver_address_table[index] = driver_table[index]; 80045ac: 29 82 00 00 lw r2,(r12+0) * registration. The driver table is now allocated in the * workspace. * */ void _IO_Manager_initialization(void) 80045b0: b5 c3 08 00 add r1,r14,r3 _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]; 80045b4: 28 29 00 00 lw r9,(r1+0) 80045b8: 28 28 00 04 lw r8,(r1+4) 80045bc: 28 27 00 08 lw r7,(r1+8) 80045c0: 28 26 00 0c lw r6,(r1+12) 80045c4: 28 25 00 10 lw r5,(r1+16) 80045c8: 28 21 00 14 lw r1,(r1+20) 80045cc: b4 43 10 00 add r2,r2,r3 80045d0: 58 49 00 00 sw (r2+0),r9 80045d4: 58 48 00 04 sw (r2+4),r8 80045d8: 58 47 00 08 sw (r2+8),r7 80045dc: 58 46 00 0c sw (r2+12),r6 80045e0: 58 45 00 10 sw (r2+16),r5 80045e4: 58 41 00 14 sw (r2+20),r1 memset( _IO_Driver_address_table, 0, sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); for ( index = 0 ; index < drivers_in_table ; index++ ) 80045e8: 34 84 00 01 addi r4,r4,1 80045ec: 34 63 00 18 addi r3,r3,24 80045f0: 55 a4 ff ef bgu r13,r4,80045ac <_IO_Manager_initialization+0xac> _IO_Driver_address_table[index] = driver_table[index]; } 80045f4: 2b 9d 00 04 lw ra,(sp+4) 80045f8: 2b 8b 00 18 lw r11,(sp+24) 80045fc: 2b 8c 00 14 lw r12,(sp+20) 8004600: 2b 8d 00 10 lw r13,(sp+16) 8004604: 2b 8e 00 0c lw r14,(sp+12) 8004608: 2b 8f 00 08 lw r15,(sp+8) 800460c: 37 9c 00 18 addi sp,sp,24 8004610: c3 a0 00 00 ret =============================================================================== 08005664 <_Objects_Allocate>: */ Objects_Control *_Objects_Allocate( Objects_Information *information ) { 8005664: 37 9c ff ec addi sp,sp,-20 8005668: 5b 8b 00 14 sw (sp+20),r11 800566c: 5b 8c 00 10 sw (sp+16),r12 8005670: 5b 8d 00 0c sw (sp+12),r13 8005674: 5b 8e 00 08 sw (sp+8),r14 8005678: 5b 9d 00 04 sw (sp+4),ra 800567c: b8 20 58 00 mv r11,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 ) 8005680: 28 21 00 18 lw r1,(r1+24) return NULL; 8005684: 34 0c 00 00 mvi r12,0 * 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 ) 8005688: 44 20 00 1e be r1,r0,8005700 <_Objects_Allocate+0x9c> <== 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 ); 800568c: 35 6d 00 20 addi r13,r11,32 8005690: b9 a0 08 00 mv r1,r13 8005694: fb ff fd 3b calli 8004b80 <_Chain_Get> 8005698: b8 20 60 00 mv r12,r1 800569c: b8 20 70 00 mv r14,r1 if ( information->auto_extend ) { 80056a0: 41 61 00 12 lbu r1,(r11+18) 80056a4: 44 20 00 17 be r1,r0,8005700 <_Objects_Allocate+0x9c> /* * If the list is empty then we are out of objects and need to * extend information base. */ if ( !the_object ) { 80056a8: 5d 80 00 07 bne r12,r0,80056c4 <_Objects_Allocate+0x60> _Objects_Extend_information( information ); 80056ac: b9 60 08 00 mv r1,r11 80056b0: f8 00 00 32 calli 8005778 <_Objects_Extend_information> the_object = (Objects_Control *) _Chain_Get( &information->Inactive ); 80056b4: b9 a0 08 00 mv r1,r13 80056b8: fb ff fd 32 calli 8004b80 <_Chain_Get> 80056bc: b8 20 60 00 mv r12,r1 } if ( the_object ) { 80056c0: 44 2e 00 10 be r1,r14,8005700 <_Objects_Allocate+0x9c> uint32_t block; block = (uint32_t) _Objects_Get_index( the_object->id ) - 80056c4: 2d 82 00 0a lhu r2,(r12+10) 80056c8: 2d 61 00 0a lhu r1,(r11+10) _Objects_Get_index( information->minimum_id ); block /= information->allocation_size; 80056cc: c8 41 08 00 sub r1,r2,r1 80056d0: 2d 62 00 14 lhu r2,(r11+20) 80056d4: f8 00 46 ae calli 801718c <__udivsi3> information->inactive_per_block[ block ]--; 80056d8: 34 02 00 02 mvi r2,2 80056dc: f8 00 45 d2 calli 8016e24 <__ashlsi3> 80056e0: 29 62 00 30 lw r2,(r11+48) 80056e4: b4 41 08 00 add r1,r2,r1 80056e8: 28 22 00 00 lw r2,(r1+0) 80056ec: 34 42 ff ff addi r2,r2,-1 80056f0: 58 22 00 00 sw (r1+0),r2 information->inactive--; 80056f4: 2d 61 00 2c lhu r1,(r11+44) 80056f8: 34 21 ff ff addi r1,r1,-1 80056fc: 0d 61 00 2c sh (r11+44),r1 ); } #endif return the_object; } 8005700: b9 80 08 00 mv r1,r12 8005704: 2b 9d 00 04 lw ra,(sp+4) 8005708: 2b 8b 00 14 lw r11,(sp+20) 800570c: 2b 8c 00 10 lw r12,(sp+16) 8005710: 2b 8d 00 0c lw r13,(sp+12) 8005714: 2b 8e 00 08 lw r14,(sp+8) 8005718: 37 9c 00 14 addi sp,sp,20 800571c: c3 a0 00 00 ret =============================================================================== 0800ed74 <_Objects_Get_information>: Objects_Information *_Objects_Get_information( Objects_APIs the_api, uint16_t the_class ) { 800ed74: 37 9c ff ec addi sp,sp,-20 800ed78: 5b 8b 00 14 sw (sp+20),r11 800ed7c: 5b 8c 00 10 sw (sp+16),r12 800ed80: 5b 8d 00 0c sw (sp+12),r13 800ed84: 5b 8e 00 08 sw (sp+8),r14 800ed88: 5b 9d 00 04 sw (sp+4),ra 800ed8c: 20 4c ff ff andi r12,r2,0xffff 800ed90: b8 20 70 00 mv r14,r1 Objects_Information *info; int the_class_api_maximum; if ( !the_class ) return NULL; 800ed94: 34 0b 00 00 mvi r11,0 ) { Objects_Information *info; int the_class_api_maximum; if ( !the_class ) 800ed98: 45 80 00 16 be r12,r0,800edf0 <_Objects_Get_information+0x7c> /* * 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 ); 800ed9c: f8 00 09 02 calli 80111a4 <_Objects_API_maximum_class> if ( the_class_api_maximum == 0 ) 800eda0: 44 20 00 14 be r1,r0,800edf0 <_Objects_Get_information+0x7c> return NULL; if ( the_class > (uint32_t) the_class_api_maximum ) 800eda4: 55 81 00 13 bgu r12,r1,800edf0 <_Objects_Get_information+0x7c> return NULL; if ( !_Objects_Information_table[ the_api ] ) 800eda8: 78 0d 08 01 mvhi r13,0x801 800edac: b9 c0 08 00 mv r1,r14 800edb0: 34 02 00 02 mvi r2,2 800edb4: 39 ad 98 bc ori r13,r13,0x98bc 800edb8: f8 00 20 1b calli 8016e24 <__ashlsi3> 800edbc: b5 a1 08 00 add r1,r13,r1 800edc0: 28 2d 00 00 lw r13,(r1+0) 800edc4: 45 a0 00 0b be r13,r0,800edf0 <_Objects_Get_information+0x7c><== NEVER TAKEN return NULL; info = _Objects_Information_table[ the_api ][ the_class ]; 800edc8: b9 80 08 00 mv r1,r12 800edcc: 34 02 00 02 mvi r2,2 800edd0: f8 00 20 15 calli 8016e24 <__ashlsi3> 800edd4: b5 a1 08 00 add r1,r13,r1 800edd8: 28 2b 00 00 lw r11,(r1+0) if ( !info ) 800eddc: 45 60 00 05 be r11,r0,800edf0 <_Objects_Get_information+0x7c><== 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 ) 800ede0: 2d 61 00 10 lhu r1,(r11+16) return NULL; 800ede4: 7c 21 00 00 cmpnei r1,r1,0 800ede8: c8 01 08 00 sub r1,r0,r1 800edec: a1 61 58 00 and r11,r11,r1 #endif return info; } 800edf0: b9 60 08 00 mv r1,r11 800edf4: 2b 9d 00 04 lw ra,(sp+4) 800edf8: 2b 8b 00 14 lw r11,(sp+20) 800edfc: 2b 8c 00 10 lw r12,(sp+16) 800ee00: 2b 8d 00 0c lw r13,(sp+12) 800ee04: 2b 8e 00 08 lw r14,(sp+8) 800ee08: 37 9c 00 14 addi sp,sp,20 800ee0c: c3 a0 00 00 ret =============================================================================== 080178a8 <_Objects_Get_no_protection>: Objects_Control *_Objects_Get_no_protection( Objects_Information *information, Objects_Id id, Objects_Locations *location ) { 80178a8: 37 9c ff f4 addi sp,sp,-12 80178ac: 5b 8b 00 0c sw (sp+12),r11 80178b0: 5b 8c 00 08 sw (sp+8),r12 80178b4: 5b 9d 00 04 sw (sp+4),ra 80178b8: b8 20 20 00 mv r4,r1 /* * 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; 80178bc: 28 21 00 08 lw r1,(r1+8) Objects_Control *_Objects_Get_no_protection( Objects_Information *information, Objects_Id id, Objects_Locations *location ) { 80178c0: b8 60 58 00 mv r11,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; 80178c4: c8 41 08 00 sub r1,r2,r1 if ( information->maximum >= index ) { 80178c8: 2c 82 00 10 lhu r2,(r4+16) /* * 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; 80178cc: 34 21 00 01 addi r1,r1,1 if ( information->maximum >= index ) { 80178d0: 54 22 00 09 bgu r1,r2,80178f4 <_Objects_Get_no_protection+0x4c> if ( (the_object = information->local_table[ index ]) != NULL ) { 80178d4: 28 8c 00 1c lw r12,(r4+28) 80178d8: 34 02 00 02 mvi r2,2 80178dc: fb ff d9 5e calli 800de54 <__ashlsi3> 80178e0: b5 81 08 00 add r1,r12,r1 80178e4: 28 21 00 00 lw r1,(r1+0) 80178e8: 44 20 00 03 be r1,r0,80178f4 <_Objects_Get_no_protection+0x4c><== NEVER TAKEN *location = OBJECTS_LOCAL; 80178ec: 59 60 00 00 sw (r11+0),r0 return the_object; 80178f0: e0 00 00 04 bi 8017900 <_Objects_Get_no_protection+0x58> /* * This isn't supported or required yet for Global objects so * if it isn't local, we don't find it. */ *location = OBJECTS_ERROR; 80178f4: 34 01 00 01 mvi r1,1 80178f8: 59 61 00 00 sw (r11+0),r1 return NULL; 80178fc: 34 01 00 00 mvi r1,0 } 8017900: 2b 9d 00 04 lw ra,(sp+4) 8017904: 2b 8b 00 0c lw r11,(sp+12) 8017908: 2b 8c 00 08 lw r12,(sp+8) 801790c: 37 9c 00 0c addi sp,sp,12 8017910: c3 a0 00 00 ret =============================================================================== 08006264 <_Objects_Id_to_name>: */ Objects_Name_or_id_lookup_errors _Objects_Id_to_name ( Objects_Id id, Objects_Name *name ) { 8006264: 37 9c ff e8 addi sp,sp,-24 8006268: 5b 8b 00 14 sw (sp+20),r11 800626c: 5b 8c 00 10 sw (sp+16),r12 8006270: 5b 8d 00 0c sw (sp+12),r13 8006274: 5b 8e 00 08 sw (sp+8),r14 8006278: 5b 9d 00 04 sw (sp+4),ra 800627c: b8 40 70 00 mv r14,r2 /* * Caller is trusted for name != NULL. */ tmpId = (id == OBJECTS_ID_OF_SELF) ? _Thread_Executing->Object.id : id; 8006280: b8 20 58 00 mv r11,r1 8006284: 5c 20 00 05 bne r1,r0,8006298 <_Objects_Id_to_name+0x34> 8006288: 78 01 08 02 mvhi r1,0x802 800628c: 38 21 0d c0 ori r1,r1,0xdc0 8006290: 28 21 00 0c lw r1,(r1+12) 8006294: 28 2b 00 08 lw r11,(r1+8) */ RTEMS_INLINE_ROUTINE Objects_APIs _Objects_Get_API( Objects_Id id ) { return (Objects_APIs) ((id >> OBJECTS_API_START_BIT) & OBJECTS_API_VALID_BITS); 8006298: 34 02 00 18 mvi r2,24 800629c: b9 60 08 00 mv r1,r11 80062a0: f8 00 57 43 calli 801bfac <__lshrsi3> 80062a4: 20 21 00 07 andi r1,r1,0x7 */ RTEMS_INLINE_ROUTINE bool _Objects_Is_api_valid( uint32_t the_api ) { if ( !the_api || the_api > OBJECTS_APIS_LAST ) 80062a8: 34 23 ff ff addi r3,r1,-1 80062ac: 34 02 00 02 mvi r2,2 the_api = _Objects_Get_API( tmpId ); if ( !_Objects_Is_api_valid( the_api ) ) return OBJECTS_INVALID_ID; 80062b0: 34 0d 00 03 mvi r13,3 80062b4: 54 62 00 14 bgu r3,r2,8006304 <_Objects_Id_to_name+0xa0> 80062b8: e0 00 00 1b bi 8006324 <_Objects_Id_to_name+0xc0> */ RTEMS_INLINE_ROUTINE uint32_t _Objects_Get_class( Objects_Id id ) { return (uint32_t) 80062bc: 34 02 00 1b mvi r2,27 80062c0: b9 60 08 00 mv r1,r11 80062c4: f8 00 57 3a calli 801bfac <__lshrsi3> if ( !_Objects_Information_table[ the_api ] ) return OBJECTS_INVALID_ID; the_class = _Objects_Get_class( tmpId ); information = _Objects_Information_table[ the_api ][ the_class ]; 80062c8: 34 02 00 02 mvi r2,2 80062cc: fb ff ec dc calli 800163c <__ashlsi3> 80062d0: b5 81 08 00 add r1,r12,r1 80062d4: 28 21 00 00 lw r1,(r1+0) if ( !information ) 80062d8: 44 20 00 0b be r1,r0,8006304 <_Objects_Id_to_name+0xa0> <== NEVER TAKEN return OBJECTS_INVALID_ID; #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES) if ( information->is_string ) 80062dc: 40 2c 00 38 lbu r12,(r1+56) 80062e0: 5d 80 00 09 bne r12,r0,8006304 <_Objects_Id_to_name+0xa0> <== NEVER TAKEN return OBJECTS_INVALID_ID; #endif the_object = _Objects_Get( information, tmpId, &ignored_location ); 80062e4: b9 60 10 00 mv r2,r11 80062e8: 37 83 00 18 addi r3,sp,24 80062ec: fb ff ff b8 calli 80061cc <_Objects_Get> if ( !the_object ) 80062f0: 44 2c 00 05 be r1,r12,8006304 <_Objects_Id_to_name+0xa0> return OBJECTS_INVALID_ID; *name = the_object->name; 80062f4: 28 21 00 0c lw r1,(r1+12) _Thread_Enable_dispatch(); return OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL; 80062f8: 34 0d 00 00 mvi r13,0 the_object = _Objects_Get( information, tmpId, &ignored_location ); if ( !the_object ) return OBJECTS_INVALID_ID; *name = the_object->name; 80062fc: 59 c1 00 00 sw (r14+0),r1 _Thread_Enable_dispatch(); 8006300: f8 00 03 65 calli 8007094 <_Thread_Enable_dispatch> return OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL; } 8006304: b9 a0 08 00 mv r1,r13 8006308: 2b 9d 00 04 lw ra,(sp+4) 800630c: 2b 8b 00 14 lw r11,(sp+20) 8006310: 2b 8c 00 10 lw r12,(sp+16) 8006314: 2b 8d 00 0c lw r13,(sp+12) 8006318: 2b 8e 00 08 lw r14,(sp+8) 800631c: 37 9c 00 18 addi sp,sp,24 8006320: c3 a0 00 00 ret the_api = _Objects_Get_API( tmpId ); if ( !_Objects_Is_api_valid( the_api ) ) return OBJECTS_INVALID_ID; if ( !_Objects_Information_table[ the_api ] ) 8006324: 78 0c 08 02 mvhi r12,0x802 8006328: 34 02 00 02 mvi r2,2 800632c: 39 8c 08 8c ori r12,r12,0x88c 8006330: fb ff ec c3 calli 800163c <__ashlsi3> 8006334: b5 81 08 00 add r1,r12,r1 8006338: 28 2c 00 00 lw r12,(r1+0) 800633c: 5d 80 ff e0 bne r12,r0,80062bc <_Objects_Id_to_name+0x58> 8006340: e3 ff ff f1 bi 8006304 <_Objects_Id_to_name+0xa0> =============================================================================== 08005c90 <_Objects_Initialize_information>: , bool supports_global, Objects_Thread_queue_Extract_callout extract #endif ) { 8005c90: 37 9c ff e4 addi sp,sp,-28 8005c94: 5b 8b 00 1c sw (sp+28),r11 8005c98: 5b 8c 00 18 sw (sp+24),r12 8005c9c: 5b 8d 00 14 sw (sp+20),r13 8005ca0: 5b 8e 00 10 sw (sp+16),r14 8005ca4: 5b 8f 00 0c sw (sp+12),r15 8005ca8: 5b 90 00 08 sw (sp+8),r16 8005cac: 5b 9d 00 04 sw (sp+4),ra 8005cb0: 20 6d ff ff andi r13,r3,0xffff 8005cb4: b8 20 58 00 mv r11,r1 8005cb8: 20 a5 ff ff andi r5,r5,0xffff uint32_t index; #endif information->the_api = the_api; information->the_class = the_class; information->size = size; 8005cbc: 58 25 00 18 sw (r1+24),r5 information->local_table = 0; information->inactive_per_block = 0; information->object_blocks = 0; information->inactive = 0; #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES) information->is_string = is_string; 8005cc0: 30 26 00 38 sb (r1+56),r6 uint32_t maximum_per_allocation; #if defined(RTEMS_MULTIPROCESSING) uint32_t index; #endif information->the_api = the_api; 8005cc4: 59 62 00 00 sw (r11+0),r2 information->the_class = the_class; 8005cc8: 0c 2d 00 04 sh (r1+4),r13 information->size = size; information->local_table = 0; 8005ccc: 58 20 00 1c sw (r1+28),r0 information->inactive_per_block = 0; 8005cd0: 58 20 00 30 sw (r1+48),r0 information->object_blocks = 0; 8005cd4: 58 20 00 34 sw (r1+52),r0 information->inactive = 0; 8005cd8: 0c 20 00 2c sh (r1+44),r0 /* * Set the maximum value to 0. It will be updated when objects are * added to the inactive set from _Objects_Extend_information() */ information->maximum = 0; 8005cdc: 0c 20 00 10 sh (r1+16),r0 , bool supports_global, Objects_Thread_queue_Extract_callout extract #endif ) { 8005ce0: b8 40 70 00 mv r14,r2 information->maximum = 0; /* * Register this Object Class in the Object Information Table. */ _Objects_Information_table[ the_api ][ the_class ] = information; 8005ce4: b8 40 08 00 mv r1,r2 8005ce8: 78 0f 08 01 mvhi r15,0x801 8005cec: 34 02 00 02 mvi r2,2 , bool supports_global, Objects_Thread_queue_Extract_callout extract #endif ) { 8005cf0: b8 80 60 00 mv r12,r4 8005cf4: b8 e0 80 00 mv r16,r7 information->maximum = 0; /* * Register this Object Class in the Object Information Table. */ _Objects_Information_table[ the_api ][ the_class ] = information; 8005cf8: 39 ef 98 bc ori r15,r15,0x98bc 8005cfc: f8 00 44 4a calli 8016e24 <__ashlsi3> 8005d00: b5 e1 08 00 add r1,r15,r1 8005d04: 28 2f 00 00 lw r15,(r1+0) 8005d08: 34 02 00 02 mvi r2,2 8005d0c: b9 a0 08 00 mv r1,r13 8005d10: f8 00 44 45 calli 8016e24 <__ashlsi3> 8005d14: b5 e1 08 00 add r1,r15,r1 8005d18: 58 2b 00 00 sw (r1+0),r11 /* * Are we operating in limited or unlimited (e.g. auto-extend) mode. */ information->auto_extend = (maximum & OBJECTS_UNLIMITED_OBJECTS) ? true : false; 8005d1c: 34 02 00 1f mvi r2,31 8005d20: b9 80 08 00 mv r1,r12 8005d24: f8 00 44 8e calli 8016f5c <__lshrsi3> maximum_per_allocation = maximum & ~OBJECTS_UNLIMITED_OBJECTS; 8005d28: 78 03 08 01 mvhi r3,0x801 8005d2c: 38 63 80 90 ori r3,r3,0x8090 /* * Are we operating in limited or unlimited (e.g. auto-extend) mode. */ information->auto_extend = (maximum & OBJECTS_UNLIMITED_OBJECTS) ? true : false; 8005d30: 20 22 00 ff andi r2,r1,0xff maximum_per_allocation = maximum & ~OBJECTS_UNLIMITED_OBJECTS; 8005d34: 28 61 00 00 lw r1,(r3+0) _Objects_Information_table[ the_api ][ the_class ] = information; /* * Are we operating in limited or unlimited (e.g. auto-extend) mode. */ information->auto_extend = 8005d38: 31 62 00 12 sb (r11+18),r2 (maximum & OBJECTS_UNLIMITED_OBJECTS) ? true : false; maximum_per_allocation = maximum & ~OBJECTS_UNLIMITED_OBJECTS; 8005d3c: a1 81 60 00 and r12,r12,r1 /* * Unlimited and maximum of zero is illogical. */ if ( information->auto_extend && maximum_per_allocation == 0) { 8005d40: 44 40 00 06 be r2,r0,8005d58 <_Objects_Initialize_information+0xc8> 8005d44: 5d 80 00 05 bne r12,r0,8005d58 <_Objects_Initialize_information+0xc8><== ALWAYS TAKEN _Internal_error_Occurred( 8005d48: 34 01 00 00 mvi r1,0 <== NOT EXECUTED 8005d4c: 34 02 00 01 mvi r2,1 <== NOT EXECUTED 8005d50: 34 03 00 13 mvi r3,19 <== NOT EXECUTED 8005d54: fb ff fe 13 calli 80055a0 <_Internal_error_Occurred> <== NOT EXECUTED information->allocation_size = maximum_per_allocation; /* * Provide a null local table entry for the case of any empty table. */ information->local_table = &null_local_table; 8005d58: 78 01 08 01 mvhi r1,0x801 8005d5c: 38 21 96 e4 ori r1,r1,0x96e4 8005d60: 59 61 00 1c sw (r11+28),r1 8005d64: 34 02 00 18 mvi r2,24 8005d68: b9 c0 08 00 mv r1,r14 } /* * The allocation unit is the maximum value */ information->allocation_size = maximum_per_allocation; 8005d6c: 0d 6c 00 14 sh (r11+20),r12 8005d70: f8 00 44 2d calli 8016e24 <__ashlsi3> 8005d74: 78 0e 00 01 mvhi r14,0x1 8005d78: b8 2e 70 00 or r14,r1,r14 (( (Objects_Id) the_class ) << OBJECTS_CLASS_START_BIT) | 8005d7c: 34 02 00 1b mvi r2,27 8005d80: b9 a0 08 00 mv r1,r13 8005d84: f8 00 44 28 calli 8016e24 <__ashlsi3> information->local_table = &null_local_table; /* * Calculate minimum and maximum Id's */ minimum_index = (maximum_per_allocation == 0) ? 0 : 1; 8005d88: 7d 82 00 00 cmpnei r2,r12,0 8005d8c: b9 c1 08 00 or r1,r14,r1 uint32_t the_class, uint32_t node, uint32_t index ) { return (( (Objects_Id) the_api ) << OBJECTS_API_START_BIT) | 8005d90: b8 22 08 00 or r1,r1,r2 information->minimum_id = 8005d94: 59 61 00 08 sw (r11+8),r1 /* * Calculate the maximum name length */ name_length = maximum_name_length; if ( name_length & (OBJECTS_NAME_ALIGNMENT-1) ) 8005d98: 22 01 00 03 andi r1,r16,0x3 8005d9c: ba 00 38 00 mv r7,r16 8005da0: 44 20 00 04 be r1,r0,8005db0 <_Objects_Initialize_information+0x120> name_length = (name_length + OBJECTS_NAME_ALIGNMENT) & 8005da4: 36 07 00 04 addi r7,r16,4 8005da8: 34 01 ff fc mvi r1,-4 8005dac: a0 e1 38 00 and r7,r7,r1 RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); 8005db0: 35 61 00 24 addi r1,r11,36 head->next = tail; 8005db4: 59 61 00 20 sw (r11+32),r1 */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); 8005db8: 35 61 00 20 addi r1,r11,32 ~(OBJECTS_NAME_ALIGNMENT-1); information->name_length = name_length; 8005dbc: 0d 67 00 3a sh (r11+58),r7 Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; head->previous = NULL; 8005dc0: 59 60 00 24 sw (r11+36),r0 tail->previous = head; 8005dc4: 59 61 00 28 sw (r11+40),r1 _Chain_Initialize_empty( &information->Inactive ); /* * Initialize objects .. if there are any */ if ( maximum_per_allocation ) { 8005dc8: 45 80 00 03 be r12,r0,8005dd4 <_Objects_Initialize_information+0x144> /* * Always have the maximum size available so the current performance * figures are create are met. If the user moves past the maximum * number then a performance hit is taken. */ _Objects_Extend_information( information ); 8005dcc: b9 60 08 00 mv r1,r11 8005dd0: fb ff fe 6a calli 8005778 <_Objects_Extend_information> _Chain_Initialize_empty( &information->global_table[ index ] ); } else information->global_table = NULL; #endif } 8005dd4: 2b 9d 00 04 lw ra,(sp+4) 8005dd8: 2b 8b 00 1c lw r11,(sp+28) 8005ddc: 2b 8c 00 18 lw r12,(sp+24) 8005de0: 2b 8d 00 14 lw r13,(sp+20) 8005de4: 2b 8e 00 10 lw r14,(sp+16) 8005de8: 2b 8f 00 0c lw r15,(sp+12) 8005dec: 2b 90 00 08 lw r16,(sp+8) 8005df0: 37 9c 00 1c addi sp,sp,28 8005df4: c3 a0 00 00 ret =============================================================================== 08003f50 <_POSIX_Condition_variables_Wait_support>: pthread_cond_t *cond, pthread_mutex_t *mutex, Watchdog_Interval timeout, bool already_timedout ) { 8003f50: 37 9c ff e0 addi sp,sp,-32 8003f54: 5b 8b 00 1c sw (sp+28),r11 8003f58: 5b 8c 00 18 sw (sp+24),r12 8003f5c: 5b 8d 00 14 sw (sp+20),r13 8003f60: 5b 8e 00 10 sw (sp+16),r14 8003f64: 5b 8f 00 0c sw (sp+12),r15 8003f68: 5b 90 00 08 sw (sp+8),r16 8003f6c: 5b 9d 00 04 sw (sp+4),ra 8003f70: b8 20 70 00 mv r14,r1 8003f74: b8 40 60 00 mv r12,r2 register POSIX_Condition_variables_Control *the_cond; Objects_Locations location; int status; int mutex_status; if ( !_POSIX_Mutex_Get( mutex, &location ) ) { 8003f78: b8 40 08 00 mv r1,r2 8003f7c: 37 82 00 20 addi r2,sp,32 pthread_cond_t *cond, pthread_mutex_t *mutex, Watchdog_Interval timeout, bool already_timedout ) { 8003f80: b8 60 78 00 mv r15,r3 8003f84: 20 90 00 ff andi r16,r4,0xff register POSIX_Condition_variables_Control *the_cond; Objects_Locations location; int status; int mutex_status; if ( !_POSIX_Mutex_Get( mutex, &location ) ) { 8003f88: f8 00 00 62 calli 8004110 <_POSIX_Mutex_Get> return EINVAL; 8003f8c: 34 0b 00 16 mvi r11,22 register POSIX_Condition_variables_Control *the_cond; Objects_Locations location; int status; int mutex_status; if ( !_POSIX_Mutex_Get( mutex, &location ) ) { 8003f90: 44 20 00 33 be r1,r0,800405c <_POSIX_Condition_variables_Wait_support+0x10c><== NEVER TAKEN */ RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void ) { RTEMS_COMPILER_MEMORY_BARRIER(); _Thread_Dispatch_disable_level -= 1; 8003f94: 78 05 08 01 mvhi r5,0x801 8003f98: 38 a5 78 68 ori r5,r5,0x7868 8003f9c: 28 a1 00 00 lw r1,(r5+0) return EINVAL; } _Thread_Unnest_dispatch(); the_cond = _POSIX_Condition_variables_Get( cond, &location ); 8003fa0: 37 82 00 20 addi r2,sp,32 8003fa4: 34 21 ff ff addi r1,r1,-1 8003fa8: 58 a1 00 00 sw (r5+0),r1 8003fac: b9 c0 08 00 mv r1,r14 8003fb0: fb ff ff 4d calli 8003ce4 <_POSIX_Condition_variables_Get> switch ( location ) { 8003fb4: 2b 85 00 20 lw r5,(sp+32) return EINVAL; } _Thread_Unnest_dispatch(); the_cond = _POSIX_Condition_variables_Get( cond, &location ); 8003fb8: b8 20 68 00 mv r13,r1 switch ( location ) { 8003fbc: 5c a0 00 28 bne r5,r0,800405c <_POSIX_Condition_variables_Wait_support+0x10c><== NEVER TAKEN case OBJECTS_LOCAL: if ( the_cond->Mutex && ( the_cond->Mutex != *mutex ) ) { 8003fc0: 28 21 00 14 lw r1,(r1+20) 8003fc4: 44 25 00 05 be r1,r5,8003fd8 <_POSIX_Condition_variables_Wait_support+0x88> 8003fc8: 29 82 00 00 lw r2,(r12+0) 8003fcc: 44 22 00 03 be r1,r2,8003fd8 <_POSIX_Condition_variables_Wait_support+0x88> _Thread_Enable_dispatch(); 8003fd0: f8 00 0d f3 calli 800779c <_Thread_Enable_dispatch> return EINVAL; 8003fd4: e0 00 00 22 bi 800405c <_POSIX_Condition_variables_Wait_support+0x10c> } (void) pthread_mutex_unlock( mutex ); 8003fd8: b9 80 08 00 mv r1,r12 8003fdc: f8 00 01 17 calli 8004438 _Thread_Enable_dispatch(); return EINVAL; } */ if ( !already_timedout ) { 8003fe0: 5e 00 00 19 bne r16,r0,8004044 <_POSIX_Condition_variables_Wait_support+0xf4><== NEVER TAKEN the_cond->Mutex = *mutex; 8003fe4: 29 81 00 00 lw r1,(r12+0) _Thread_queue_Enter_critical_section( &the_cond->Wait_queue ); _Thread_Executing->Wait.return_code = 0; 8003fe8: 78 0b 08 01 mvhi r11,0x801 8003fec: 39 6b 7d 38 ori r11,r11,0x7d38 8003ff0: 29 64 00 0c lw r4,(r11+12) return EINVAL; } */ if ( !already_timedout ) { the_cond->Mutex = *mutex; 8003ff4: 59 a1 00 14 sw (r13+20),r1 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; 8003ff8: 34 01 00 01 mvi r1,1 8003ffc: 59 a1 00 48 sw (r13+72),r1 _Thread_queue_Enter_critical_section( &the_cond->Wait_queue ); _Thread_Executing->Wait.return_code = 0; 8004000: 58 80 00 34 sw (r4+52),r0 _Thread_Executing->Wait.queue = &the_cond->Wait_queue; _Thread_Executing->Wait.id = *cond; 8004004: 29 c1 00 00 lw r1,(r14+0) 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; 8004008: 35 ad 00 18 addi r13,r13,24 _Thread_Executing->Wait.id = *cond; _Thread_queue_Enqueue( &the_cond->Wait_queue, timeout ); 800400c: 78 03 08 00 mvhi r3,0x800 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; 8004010: 58 81 00 20 sw (r4+32),r1 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; 8004014: 58 8d 00 44 sw (r4+68),r13 _Thread_Executing->Wait.id = *cond; _Thread_queue_Enqueue( &the_cond->Wait_queue, timeout ); 8004018: b9 a0 08 00 mv r1,r13 800401c: b9 e0 10 00 mv r2,r15 8004020: 38 63 82 08 ori r3,r3,0x8208 8004024: f8 00 0f 0e calli 8007c5c <_Thread_queue_Enqueue_with_handler> _Thread_Enable_dispatch(); 8004028: f8 00 0d dd calli 800779c <_Thread_Enable_dispatch> * a POSIX signal, then pthread_cond_wait returns spuriously, * according to the POSIX standard. It means that pthread_cond_wait * returns a success status, except for the fact that it was not * woken up a pthread_cond_signal or a pthread_cond_broadcast. */ status = _Thread_Executing->Wait.return_code; 800402c: 29 61 00 0c lw r1,(r11+12) 8004030: 28 2b 00 34 lw r11,(r1+52) if ( status == EINTR ) status = 0; 8004034: 7d 61 00 04 cmpnei r1,r11,4 8004038: c8 01 08 00 sub r1,r0,r1 800403c: a1 61 58 00 and r11,r11,r1 8004040: e0 00 00 03 bi 800404c <_POSIX_Condition_variables_Wait_support+0xfc> } else { _Thread_Enable_dispatch(); 8004044: f8 00 0d d6 calli 800779c <_Thread_Enable_dispatch> status = ETIMEDOUT; 8004048: 34 0b 00 74 mvi r11,116 /* * When we get here the dispatch disable level is 0. */ mutex_status = pthread_mutex_lock( mutex ); 800404c: b9 80 08 00 mv r1,r12 8004050: f8 00 00 c7 calli 800436c if ( mutex_status ) 8004054: 44 20 00 02 be r1,r0,800405c <_POSIX_Condition_variables_Wait_support+0x10c> return EINVAL; 8004058: 34 0b 00 16 mvi r11,22 case OBJECTS_ERROR: break; } return EINVAL; } 800405c: b9 60 08 00 mv r1,r11 8004060: 2b 9d 00 04 lw ra,(sp+4) 8004064: 2b 8b 00 1c lw r11,(sp+28) 8004068: 2b 8c 00 18 lw r12,(sp+24) 800406c: 2b 8d 00 14 lw r13,(sp+20) 8004070: 2b 8e 00 10 lw r14,(sp+16) 8004074: 2b 8f 00 0c lw r15,(sp+12) 8004078: 2b 90 00 08 lw r16,(sp+8) 800407c: 37 9c 00 20 addi sp,sp,32 8004080: c3 a0 00 00 ret =============================================================================== 08008d78 <_POSIX_Message_queue_Receive_support>: size_t msg_len, unsigned int *msg_prio, bool wait, Watchdog_Interval timeout ) { 8008d78: 37 9c ff dc addi sp,sp,-36 8008d7c: 5b 8b 00 18 sw (sp+24),r11 8008d80: 5b 8c 00 14 sw (sp+20),r12 8008d84: 5b 8d 00 10 sw (sp+16),r13 8008d88: 5b 8e 00 0c sw (sp+12),r14 8008d8c: 5b 8f 00 08 sw (sp+8),r15 8008d90: 5b 9d 00 04 sw (sp+4),ra 8008d94: b8 20 58 00 mv r11,r1 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( 8008d98: 78 01 08 02 mvhi r1,0x802 8008d9c: b8 40 60 00 mv r12,r2 8008da0: b8 60 78 00 mv r15,r3 8008da4: b9 60 10 00 mv r2,r11 8008da8: 38 21 92 1c ori r1,r1,0x921c 8008dac: 37 83 00 24 addi r3,sp,36 8008db0: 5b 86 00 1c sw (sp+28),r6 8008db4: b8 80 68 00 mv r13,r4 8008db8: 20 ae 00 ff andi r14,r5,0xff 8008dbc: f8 00 0c c8 calli 800c0dc <_Objects_Get> Objects_Locations location; size_t length_out; bool do_wait; the_mq_fd = _POSIX_Message_queue_Get_fd( mqdes, &location ); switch ( location ) { 8008dc0: 2b 82 00 24 lw r2,(sp+36) 8008dc4: 2b 86 00 1c lw r6,(sp+28) 8008dc8: 5c 40 00 2f bne r2,r0,8008e84 <_POSIX_Message_queue_Receive_support+0x10c> case OBJECTS_LOCAL: if ( (the_mq_fd->oflag & O_ACCMODE) == O_WRONLY ) { 8008dcc: 28 28 00 14 lw r8,(r1+20) 8008dd0: 34 02 00 01 mvi r2,1 8008dd4: 21 03 00 03 andi r3,r8,0x3 8008dd8: 5c 62 00 03 bne r3,r2,8008de4 <_POSIX_Message_queue_Receive_support+0x6c> _Thread_Enable_dispatch(); 8008ddc: f8 00 10 43 calli 800cee8 <_Thread_Enable_dispatch> 8008de0: e0 00 00 29 bi 8008e84 <_POSIX_Message_queue_Receive_support+0x10c> rtems_set_errno_and_return_minus_one( EBADF ); } the_mq = the_mq_fd->Queue; 8008de4: 28 27 00 10 lw r7,(r1+16) if ( msg_len < the_mq->Message_queue.maximum_message_size ) { 8008de8: 28 e1 00 68 lw r1,(r7+104) 8008dec: 51 e1 00 05 bgeu r15,r1,8008e00 <_POSIX_Message_queue_Receive_support+0x88> _Thread_Enable_dispatch(); 8008df0: f8 00 10 3e calli 800cee8 <_Thread_Enable_dispatch> rtems_set_errno_and_return_minus_one( EMSGSIZE ); 8008df4: f8 00 2e e1 calli 8014978 <__errno> 8008df8: 34 02 00 7a mvi r2,122 8008dfc: e0 00 00 24 bi 8008e8c <_POSIX_Message_queue_Receive_support+0x114> /* * Now if something goes wrong, we return a "length" of -1 * to indicate an error. */ length_out = -1; 8008e00: 34 01 ff ff mvi r1,-1 8008e04: 5b 81 00 20 sw (sp+32),r1 /* * A timed receive with a bad time will do a poll regardless. */ if ( wait ) 8008e08: 34 05 00 00 mvi r5,0 8008e0c: 45 c0 00 03 be r14,r0,8008e18 <_POSIX_Message_queue_Receive_support+0xa0><== NEVER TAKEN do_wait = (the_mq_fd->oflag & O_NONBLOCK) ? false : true; 8008e10: 21 05 40 00 andi r5,r8,0x4000 8008e14: 64 a5 00 00 cmpei r5,r5,0 do_wait = wait; /* * Now perform the actual message receive */ _CORE_message_queue_Seize( 8008e18: b9 60 10 00 mv r2,r11 timeout ); _Thread_Enable_dispatch(); *msg_prio = _POSIX_Message_queue_Priority_from_core(_Thread_Executing->Wait.count); 8008e1c: 78 0b 08 02 mvhi r11,0x802 do_wait = wait; /* * Now perform the actual message receive */ _CORE_message_queue_Seize( 8008e20: 34 e1 00 1c addi r1,r7,28 8008e24: b9 80 18 00 mv r3,r12 8008e28: 37 84 00 20 addi r4,sp,32 timeout ); _Thread_Enable_dispatch(); *msg_prio = _POSIX_Message_queue_Priority_from_core(_Thread_Executing->Wait.count); 8008e2c: 39 6b 92 88 ori r11,r11,0x9288 do_wait = wait; /* * Now perform the actual message receive */ _CORE_message_queue_Seize( 8008e30: f8 00 07 8b calli 800ac5c <_CORE_message_queue_Seize> &length_out, do_wait, timeout ); _Thread_Enable_dispatch(); 8008e34: f8 00 10 2d calli 800cee8 <_Thread_Enable_dispatch> *msg_prio = _POSIX_Message_queue_Priority_from_core(_Thread_Executing->Wait.count); 8008e38: 29 6c 00 0c lw r12,(r11+12) RTEMS_INLINE_ROUTINE unsigned int _POSIX_Message_queue_Priority_from_core( CORE_message_queue_Submit_types priority ) { /* absolute value without a library dependency */ return ((priority >= 0) ? priority : -priority); 8008e3c: 34 02 00 1f mvi r2,31 8008e40: 29 81 00 24 lw r1,(r12+36) 8008e44: f8 00 6c a4 calli 80240d4 <__ashrsi3> 8008e48: 29 82 00 24 lw r2,(r12+36) 8008e4c: 98 22 10 00 xor r2,r1,r2 8008e50: c8 41 08 00 sub r1,r2,r1 do_wait, timeout ); _Thread_Enable_dispatch(); *msg_prio = 8008e54: 59 a1 00 00 sw (r13+0),r1 _POSIX_Message_queue_Priority_from_core(_Thread_Executing->Wait.count); if ( !_Thread_Executing->Wait.return_code ) 8008e58: 29 81 00 34 lw r1,(r12+52) 8008e5c: 5c 20 00 03 bne r1,r0,8008e68 <_POSIX_Message_queue_Receive_support+0xf0> return length_out; 8008e60: 2b 81 00 20 lw r1,(sp+32) 8008e64: e0 00 00 0c bi 8008e94 <_POSIX_Message_queue_Receive_support+0x11c> rtems_set_errno_and_return_minus_one( 8008e68: f8 00 2e c4 calli 8014978 <__errno> 8008e6c: b8 20 60 00 mv r12,r1 8008e70: 29 61 00 0c lw r1,(r11+12) 8008e74: 28 21 00 34 lw r1,(r1+52) 8008e78: f8 00 00 b9 calli 800915c <_POSIX_Message_queue_Translate_core_message_queue_return_code> 8008e7c: 59 81 00 00 sw (r12+0),r1 8008e80: e0 00 00 04 bi 8008e90 <_POSIX_Message_queue_Receive_support+0x118> #endif case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( EBADF ); 8008e84: f8 00 2e bd calli 8014978 <__errno> 8008e88: 34 02 00 09 mvi r2,9 8008e8c: 58 22 00 00 sw (r1+0),r2 8008e90: 34 01 ff ff mvi r1,-1 } 8008e94: 2b 9d 00 04 lw ra,(sp+4) 8008e98: 2b 8b 00 18 lw r11,(sp+24) 8008e9c: 2b 8c 00 14 lw r12,(sp+20) 8008ea0: 2b 8d 00 10 lw r13,(sp+16) 8008ea4: 2b 8e 00 0c lw r14,(sp+12) 8008ea8: 2b 8f 00 08 lw r15,(sp+8) 8008eac: 37 9c 00 24 addi sp,sp,36 8008eb0: c3 a0 00 00 ret =============================================================================== 080085f4 <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch>: #include void _POSIX_Thread_Evaluate_cancellation_and_enable_dispatch( Thread_Control *the_thread ) { 80085f4: 37 9c ff fc addi sp,sp,-4 80085f8: 5b 9d 00 04 sw (sp+4),ra POSIX_API_Control *thread_support; thread_support = the_thread->API_Extensions[ THREAD_API_POSIX ]; 80085fc: 28 22 01 20 lw r2,(r1+288) if ( thread_support->cancelability_state == PTHREAD_CANCEL_ENABLE && 8008600: 28 43 00 d8 lw r3,(r2+216) 8008604: 5c 60 00 0e bne r3,r0,800863c <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch+0x48><== NEVER TAKEN 8008608: 28 44 00 dc lw r4,(r2+220) 800860c: 34 03 00 01 mvi r3,1 8008610: 5c 83 00 0b bne r4,r3,800863c <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch+0x48> thread_support->cancelability_type == PTHREAD_CANCEL_ASYNCHRONOUS && 8008614: 28 42 00 e0 lw r2,(r2+224) 8008618: 44 40 00 09 be r2,r0,800863c <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch+0x48> */ RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void ) { RTEMS_COMPILER_MEMORY_BARRIER(); _Thread_Dispatch_disable_level -= 1; 800861c: 78 02 08 01 mvhi r2,0x801 8008620: 38 42 58 58 ori r2,r2,0x5858 8008624: 28 43 00 00 lw r3,(r2+0) 8008628: 34 63 ff ff addi r3,r3,-1 800862c: 58 43 00 00 sw (r2+0),r3 thread_support->cancelation_requested ) { _Thread_Unnest_dispatch(); _POSIX_Thread_Exit( the_thread, PTHREAD_CANCELED ); 8008630: 34 02 ff ff mvi r2,-1 8008634: f8 00 02 62 calli 8008fbc <_POSIX_Thread_Exit> 8008638: e0 00 00 02 bi 8008640 <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch+0x4c> } else _Thread_Enable_dispatch(); 800863c: fb ff f3 7f calli 8005438 <_Thread_Enable_dispatch> } 8008640: 2b 9d 00 04 lw ra,(sp+4) 8008644: 37 9c 00 04 addi sp,sp,4 8008648: c3 a0 00 00 ret =============================================================================== 0800a05c <_POSIX_Thread_Translate_sched_param>: int policy, struct sched_param *param, Thread_CPU_budget_algorithms *budget_algorithm, Thread_CPU_budget_algorithm_callout *budget_callout ) { 800a05c: 37 9c ff e8 addi sp,sp,-24 800a060: 5b 8b 00 18 sw (sp+24),r11 800a064: 5b 8c 00 14 sw (sp+20),r12 800a068: 5b 8d 00 10 sw (sp+16),r13 800a06c: 5b 8e 00 0c sw (sp+12),r14 800a070: 5b 8f 00 08 sw (sp+8),r15 800a074: 5b 9d 00 04 sw (sp+4),ra 800a078: b8 20 68 00 mv r13,r1 if ( !_POSIX_Priority_Is_valid( param->sched_priority ) ) 800a07c: 28 41 00 00 lw r1,(r2+0) int policy, struct sched_param *param, Thread_CPU_budget_algorithms *budget_algorithm, Thread_CPU_budget_algorithm_callout *budget_callout ) { 800a080: b8 40 58 00 mv r11,r2 800a084: b8 60 70 00 mv r14,r3 800a088: b8 80 78 00 mv r15,r4 if ( !_POSIX_Priority_Is_valid( param->sched_priority ) ) 800a08c: fb ff ff ec calli 800a03c <_POSIX_Priority_Is_valid> return EINVAL; 800a090: 34 0c 00 16 mvi r12,22 struct sched_param *param, Thread_CPU_budget_algorithms *budget_algorithm, Thread_CPU_budget_algorithm_callout *budget_callout ) { if ( !_POSIX_Priority_Is_valid( param->sched_priority ) ) 800a094: 44 20 00 2a be r1,r0,800a13c <_POSIX_Thread_Translate_sched_param+0xe0><== NEVER TAKEN return EINVAL; *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE; 800a098: 59 c0 00 00 sw (r14+0),r0 *budget_callout = NULL; 800a09c: 59 e0 00 00 sw (r15+0),r0 if ( policy == SCHED_OTHER ) { 800a0a0: 5d a0 00 04 bne r13,r0,800a0b0 <_POSIX_Thread_Translate_sched_param+0x54> *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE; 800a0a4: 34 01 00 01 mvi r1,1 800a0a8: 59 c1 00 00 sw (r14+0),r1 800a0ac: e0 00 00 23 bi 800a138 <_POSIX_Thread_Translate_sched_param+0xdc> return 0; } if ( policy == SCHED_FIFO ) { 800a0b0: 34 01 00 01 mvi r1,1 *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE; return 0; 800a0b4: 34 0c 00 00 mvi r12,0 if ( policy == SCHED_OTHER ) { *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE; return 0; } if ( policy == SCHED_FIFO ) { 800a0b8: 45 a1 00 21 be r13,r1,800a13c <_POSIX_Thread_Translate_sched_param+0xe0> *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE; return 0; } if ( policy == SCHED_RR ) { 800a0bc: 34 01 00 02 mvi r1,2 800a0c0: 5d a1 00 03 bne r13,r1,800a0cc <_POSIX_Thread_Translate_sched_param+0x70> *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_EXHAUST_TIMESLICE; 800a0c4: 59 cd 00 00 sw (r14+0),r13 return 0; 800a0c8: e0 00 00 1d bi 800a13c <_POSIX_Thread_Translate_sched_param+0xe0> } if ( policy == SCHED_SPORADIC ) { 800a0cc: 34 01 00 04 mvi r1,4 *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_CALLOUT; *budget_callout = _POSIX_Threads_Sporadic_budget_callout; return 0; } return EINVAL; 800a0d0: 34 0c 00 16 mvi r12,22 if ( policy == SCHED_RR ) { *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_EXHAUST_TIMESLICE; return 0; } if ( policy == SCHED_SPORADIC ) { 800a0d4: 5d a1 00 1a bne r13,r1,800a13c <_POSIX_Thread_Translate_sched_param+0xe0> if ( (param->sched_ss_repl_period.tv_sec == 0) && 800a0d8: 29 61 00 08 lw r1,(r11+8) 800a0dc: 5c 20 00 03 bne r1,r0,800a0e8 <_POSIX_Thread_Translate_sched_param+0x8c> 800a0e0: 29 62 00 0c lw r2,(r11+12) 800a0e4: 44 41 00 16 be r2,r1,800a13c <_POSIX_Thread_Translate_sched_param+0xe0> (param->sched_ss_repl_period.tv_nsec == 0) ) return EINVAL; if ( (param->sched_ss_init_budget.tv_sec == 0) && 800a0e8: 29 61 00 10 lw r1,(r11+16) 800a0ec: 5c 20 00 04 bne r1,r0,800a0fc <_POSIX_Thread_Translate_sched_param+0xa0> 800a0f0: 29 62 00 14 lw r2,(r11+20) (param->sched_ss_init_budget.tv_nsec == 0) ) return EINVAL; 800a0f4: 34 0c 00 16 mvi r12,22 if ( policy == SCHED_SPORADIC ) { if ( (param->sched_ss_repl_period.tv_sec == 0) && (param->sched_ss_repl_period.tv_nsec == 0) ) return EINVAL; if ( (param->sched_ss_init_budget.tv_sec == 0) && 800a0f8: 44 41 00 11 be r2,r1,800a13c <_POSIX_Thread_Translate_sched_param+0xe0> (param->sched_ss_init_budget.tv_nsec == 0) ) return EINVAL; if ( _Timespec_To_ticks( ¶m->sched_ss_repl_period ) < 800a0fc: 35 61 00 08 addi r1,r11,8 800a100: fb ff f4 9a calli 8007368 <_Timespec_To_ticks> 800a104: b8 20 68 00 mv r13,r1 _Timespec_To_ticks( ¶m->sched_ss_init_budget ) ) 800a108: 35 61 00 10 addi r1,r11,16 800a10c: fb ff f4 97 calli 8007368 <_Timespec_To_ticks> return EINVAL; 800a110: 34 0c 00 16 mvi r12,22 if ( (param->sched_ss_init_budget.tv_sec == 0) && (param->sched_ss_init_budget.tv_nsec == 0) ) return EINVAL; if ( _Timespec_To_ticks( ¶m->sched_ss_repl_period ) < 800a114: 54 2d 00 0a bgu r1,r13,800a13c <_POSIX_Thread_Translate_sched_param+0xe0> _Timespec_To_ticks( ¶m->sched_ss_init_budget ) ) return EINVAL; if ( !_POSIX_Priority_Is_valid( param->sched_ss_low_priority ) ) 800a118: 29 61 00 04 lw r1,(r11+4) 800a11c: fb ff ff c8 calli 800a03c <_POSIX_Priority_Is_valid> 800a120: 44 20 00 07 be r1,r0,800a13c <_POSIX_Thread_Translate_sched_param+0xe0> return EINVAL; *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_CALLOUT; 800a124: 34 01 00 03 mvi r1,3 800a128: 59 c1 00 00 sw (r14+0),r1 *budget_callout = _POSIX_Threads_Sporadic_budget_callout; 800a12c: 78 01 08 00 mvhi r1,0x800 800a130: 38 21 37 fc ori r1,r1,0x37fc 800a134: 59 e1 00 00 sw (r15+0),r1 return 0; 800a138: 34 0c 00 00 mvi r12,0 } return EINVAL; } 800a13c: b9 80 08 00 mv r1,r12 800a140: 2b 9d 00 04 lw ra,(sp+4) 800a144: 2b 8b 00 18 lw r11,(sp+24) 800a148: 2b 8c 00 14 lw r12,(sp+20) 800a14c: 2b 8d 00 10 lw r13,(sp+16) 800a150: 2b 8e 00 0c lw r14,(sp+12) 800a154: 2b 8f 00 08 lw r15,(sp+8) 800a158: 37 9c 00 18 addi sp,sp,24 800a15c: c3 a0 00 00 ret =============================================================================== 0800347c <_POSIX_Threads_Initialize_user_threads_body>: * * Output parameters: NONE */ void _POSIX_Threads_Initialize_user_threads_body(void) { 800347c: 37 9c ff a8 addi sp,sp,-88 8003480: 5b 8b 00 14 sw (sp+20),r11 8003484: 5b 8c 00 10 sw (sp+16),r12 8003488: 5b 8d 00 0c sw (sp+12),r13 800348c: 5b 8e 00 08 sw (sp+8),r14 8003490: 5b 9d 00 04 sw (sp+4),ra 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; 8003494: 78 01 08 01 mvhi r1,0x801 8003498: 38 21 f0 a8 ori r1,r1,0xf0a8 maximum = Configuration_POSIX_API.number_of_initialization_threads; 800349c: 28 2e 00 30 lw r14,(r1+48) 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; 80034a0: 28 2c 00 34 lw r12,(r1+52) maximum = Configuration_POSIX_API.number_of_initialization_threads; if ( !user_threads || maximum == 0 ) 80034a4: 65 c2 00 00 cmpei r2,r14,0 80034a8: 65 81 00 00 cmpei r1,r12,0 80034ac: b8 41 08 00 or r1,r2,r1 80034b0: 5c 20 00 18 bne r1,r0,8003510 <_POSIX_Threads_Initialize_user_threads_body+0x94><== NEVER TAKEN 80034b4: 34 0d 00 00 mvi r13,0 for ( index=0 ; index < maximum ; index++ ) { /* * There is no way for these calls to fail in this situation. */ (void) pthread_attr_init( &attr ); 80034b8: 37 8b 00 18 addi r11,sp,24 80034bc: b9 60 08 00 mv r1,r11 80034c0: f8 00 1b 28 calli 800a160 (void) pthread_attr_setinheritsched( &attr, PTHREAD_EXPLICIT_SCHED ); 80034c4: 34 02 00 02 mvi r2,2 80034c8: b9 60 08 00 mv r1,r11 80034cc: f8 00 1b 32 calli 800a194 (void) pthread_attr_setstacksize(&attr, user_threads[ index ].stack_size); 80034d0: 29 82 00 04 lw r2,(r12+4) 80034d4: b9 60 08 00 mv r1,r11 80034d8: f8 00 1b 3b calli 800a1c4 status = pthread_create( 80034dc: 29 83 00 00 lw r3,(r12+0) 80034e0: 37 81 00 58 addi r1,sp,88 80034e4: b9 60 10 00 mv r2,r11 80034e8: 34 04 00 00 mvi r4,0 80034ec: fb ff fe ed calli 80030a0 80034f0: b8 20 18 00 mv r3,r1 &thread_id, &attr, user_threads[ index ].thread_entry, NULL ); if ( status ) 80034f4: 44 20 00 04 be r1,r0,8003504 <_POSIX_Threads_Initialize_user_threads_body+0x88> _Internal_error_Occurred( INTERNAL_ERROR_POSIX_API, true, status ); 80034f8: 34 01 00 02 mvi r1,2 80034fc: 34 02 00 01 mvi r2,1 8003500: f8 00 07 20 calli 8005180 <_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++ ) { 8003504: 35 ad 00 01 addi r13,r13,1 8003508: 35 8c 00 08 addi r12,r12,8 800350c: 55 cd ff ec bgu r14,r13,80034bc <_POSIX_Threads_Initialize_user_threads_body+0x40><== NEVER TAKEN NULL ); if ( status ) _Internal_error_Occurred( INTERNAL_ERROR_POSIX_API, true, status ); } } 8003510: 2b 9d 00 04 lw ra,(sp+4) 8003514: 2b 8b 00 14 lw r11,(sp+20) 8003518: 2b 8c 00 10 lw r12,(sp+16) 800351c: 2b 8d 00 0c lw r13,(sp+12) 8003520: 2b 8e 00 08 lw r14,(sp+8) 8003524: 37 9c 00 58 addi sp,sp,88 8003528: c3 a0 00 00 ret =============================================================================== 0800d4cc <_POSIX_Threads_Sporadic_budget_TSR>: */ void _POSIX_Threads_Sporadic_budget_TSR( Objects_Id id __attribute__((unused)), void *argument ) { 800d4cc: 37 9c ff f4 addi sp,sp,-12 800d4d0: 5b 8b 00 0c sw (sp+12),r11 800d4d4: 5b 8c 00 08 sw (sp+8),r12 800d4d8: 5b 9d 00 04 sw (sp+4),ra Thread_Control *the_thread; POSIX_API_Control *api; the_thread = argument; api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 800d4dc: 28 4c 01 20 lw r12,(r2+288) */ void _POSIX_Threads_Sporadic_budget_TSR( Objects_Id id __attribute__((unused)), void *argument ) { 800d4e0: b8 40 58 00 mv r11,r2 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 ); 800d4e4: 35 81 00 98 addi r1,r12,152 800d4e8: f8 00 07 e3 calli 800f474 <_Timespec_To_ticks> the_thread->cpu_time_budget = ticks; 800d4ec: 59 61 00 78 sw (r11+120),r1 RTEMS_INLINE_ROUTINE Priority_Control _POSIX_Priority_To_core( int priority ) { return (Priority_Control) (POSIX_SCHEDULER_MAXIMUM_PRIORITY - priority + 1); 800d4f0: 78 01 08 01 mvhi r1,0x801 800d4f4: 38 21 90 a8 ori r1,r1,0x90a8 800d4f8: 40 21 00 00 lbu r1,(r1+0) 800d4fc: 29 82 00 88 lw r2,(r12+136) 800d500: c8 22 10 00 sub r2,r1,r2 */ #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 ) { 800d504: 29 61 00 1c lw r1,(r11+28) ticks = _Timespec_To_ticks( &api->schedparam.sched_ss_init_budget ); the_thread->cpu_time_budget = ticks; new_priority = _POSIX_Priority_To_core( api->schedparam.sched_priority ); the_thread->real_priority = new_priority; 800d508: 59 62 00 18 sw (r11+24),r2 */ #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 ) { 800d50c: 5c 20 00 06 bne r1,r0,800d524 <_POSIX_Threads_Sporadic_budget_TSR+0x58><== NEVER TAKEN /* * If this would make them less important, then do not change it. */ if ( the_thread->current_priority > new_priority ) { 800d510: 29 61 00 14 lw r1,(r11+20) 800d514: 50 41 00 04 bgeu r2,r1,800d524 <_POSIX_Threads_Sporadic_budget_TSR+0x58> _Thread_Change_priority( the_thread, new_priority, true ); 800d518: b9 60 08 00 mv r1,r11 800d51c: 34 03 00 01 mvi r3,1 800d520: fb ff e4 07 calli 800653c <_Thread_Change_priority> #endif } } /* ticks is guaranteed to be at least one */ ticks = _Timespec_To_ticks( &api->schedparam.sched_ss_repl_period ); 800d524: 35 81 00 90 addi r1,r12,144 800d528: f8 00 07 d3 calli 800f474 <_Timespec_To_ticks> Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 800d52c: 59 81 00 b4 sw (r12+180),r1 _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 800d530: 78 01 08 01 mvhi r1,0x801 800d534: 38 21 9a 00 ori r1,r1,0x9a00 800d538: 35 82 00 a8 addi r2,r12,168 800d53c: fb ff e9 59 calli 8007aa0 <_Watchdog_Insert> _Watchdog_Insert_ticks( &api->Sporadic_timer, ticks ); } 800d540: 2b 9d 00 04 lw ra,(sp+4) 800d544: 2b 8b 00 0c lw r11,(sp+12) 800d548: 2b 8c 00 08 lw r12,(sp+8) 800d54c: 37 9c 00 0c addi sp,sp,12 800d550: c3 a0 00 00 ret =============================================================================== 0800d554 <_POSIX_Threads_Sporadic_budget_callout>: * _POSIX_Threads_Sporadic_budget_callout */ void _POSIX_Threads_Sporadic_budget_callout( Thread_Control *the_thread ) { 800d554: 37 9c ff fc addi sp,sp,-4 800d558: 5b 9d 00 04 sw (sp+4),ra /* * 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 */ 800d55c: 34 02 ff ff mvi r2,-1 ) { POSIX_API_Control *api; uint32_t new_priority; api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 800d560: 28 25 01 20 lw r5,(r1+288) /* * 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 */ 800d564: 58 22 00 78 sw (r1+120),r2 800d568: 78 02 08 01 mvhi r2,0x801 800d56c: 38 42 90 a8 ori r2,r2,0x90a8 800d570: 40 44 00 00 lbu r4,(r2+0) 800d574: 28 a2 00 8c lw r2,(r5+140) 800d578: c8 82 10 00 sub r2,r4,r2 */ #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 ) { 800d57c: 28 24 00 1c lw r4,(r1+28) * while at low priority. */ the_thread->cpu_time_budget = 0xFFFFFFFF; /* XXX should be based on MAX_U32 */ new_priority = _POSIX_Priority_To_core(api->schedparam.sched_ss_low_priority); the_thread->real_priority = new_priority; 800d580: 58 22 00 18 sw (r1+24),r2 */ #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 ) { 800d584: 5c 80 00 05 bne r4,r0,800d598 <_POSIX_Threads_Sporadic_budget_callout+0x44><== 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 ) { 800d588: 28 23 00 14 lw r3,(r1+20) 800d58c: 50 62 00 03 bgeu r3,r2,800d598 <_POSIX_Threads_Sporadic_budget_callout+0x44><== NEVER TAKEN _Thread_Change_priority( the_thread, new_priority, true ); 800d590: 34 03 00 01 mvi r3,1 800d594: fb ff e3 ea calli 800653c <_Thread_Change_priority> #if 0 printk( "lower priority\n" ); #endif } } } 800d598: 2b 9d 00 04 lw ra,(sp+4) 800d59c: 37 9c 00 04 addi sp,sp,4 800d5a0: c3 a0 00 00 ret =============================================================================== 0800317c <_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) { 800317c: 37 9c ff f8 addi sp,sp,-8 8003180: 5b 8b 00 08 sw (sp+8),r11 8003184: 5b 9d 00 04 sw (sp+4),ra bool activated; ptimer = (POSIX_Timer_Control *)data; /* Increment the number of expirations. */ ptimer->overrun = ptimer->overrun + 1; 8003188: 28 41 00 68 lw r1,(r2+104) * This is the operation that is run when a timer expires */ void _POSIX_Timer_TSR( Objects_Id timer __attribute__((unused)), void *data) { 800318c: b8 40 58 00 mv r11,r2 bool activated; ptimer = (POSIX_Timer_Control *)data; /* Increment the number of expirations. */ ptimer->overrun = ptimer->overrun + 1; 8003190: 34 21 00 01 addi r1,r1,1 8003194: 58 41 00 68 sw (r2+104),r1 /* The timer must be reprogrammed */ if ( ( ptimer->timer_data.it_interval.tv_sec != 0 ) || 8003198: 28 41 00 54 lw r1,(r2+84) 800319c: 5c 20 00 03 bne r1,r0,80031a8 <_POSIX_Timer_TSR+0x2c> 80031a0: 28 42 00 58 lw r2,(r2+88) 80031a4: 44 41 00 0d be r2,r1,80031d8 <_POSIX_Timer_TSR+0x5c> <== NEVER TAKEN ( ptimer->timer_data.it_interval.tv_nsec != 0 ) ) { activated = _POSIX_Timer_Insert_helper( 80031a8: 29 62 00 64 lw r2,(r11+100) 80031ac: 29 63 00 08 lw r3,(r11+8) 80031b0: 78 04 08 00 mvhi r4,0x800 80031b4: 35 61 00 10 addi r1,r11,16 80031b8: 38 84 31 7c ori r4,r4,0x317c 80031bc: b9 60 28 00 mv r5,r11 80031c0: f8 00 1a 6f calli 8009b7c <_POSIX_Timer_Insert_helper> ptimer->ticks, ptimer->Object.id, _POSIX_Timer_TSR, ptimer ); if ( !activated ) 80031c4: 44 20 00 0b be r1,r0,80031f0 <_POSIX_Timer_TSR+0x74> <== NEVER TAKEN return; /* Store the time when the timer was started again */ _TOD_Get( &ptimer->time ); 80031c8: 35 61 00 6c addi r1,r11,108 80031cc: f8 00 04 82 calli 80043d4 <_TOD_Get> /* The state really did not change but just to be safe */ ptimer->state = POSIX_TIMER_STATE_CREATE_RUN; 80031d0: 34 01 00 03 mvi r1,3 80031d4: e0 00 00 02 bi 80031dc <_POSIX_Timer_TSR+0x60> } else { /* Indicates that the timer is stopped */ ptimer->state = POSIX_TIMER_STATE_CREATE_STOP; 80031d8: 34 01 00 04 mvi r1,4 <== NOT EXECUTED 80031dc: 31 61 00 3c sb (r11+60),r1 /* * 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 ) ) { 80031e0: 29 62 00 44 lw r2,(r11+68) 80031e4: 29 61 00 38 lw r1,(r11+56) 80031e8: f8 00 19 15 calli 800963c } /* After the signal handler returns, the count of expirations of the * timer must be set to 0. */ ptimer->overrun = 0; 80031ec: 59 60 00 68 sw (r11+104),r0 } 80031f0: 2b 9d 00 04 lw ra,(sp+4) 80031f4: 2b 8b 00 08 lw r11,(sp+8) 80031f8: 37 9c 00 08 addi sp,sp,8 80031fc: c3 a0 00 00 ret =============================================================================== 08010b44 <_POSIX_signals_Check_signal>: bool _POSIX_signals_Check_signal( POSIX_API_Control *api, int signo, bool is_global ) { 8010b44: 37 9c ff b0 addi sp,sp,-80 8010b48: 5b 8b 00 1c sw (sp+28),r11 8010b4c: 5b 8c 00 18 sw (sp+24),r12 8010b50: 5b 8d 00 14 sw (sp+20),r13 8010b54: 5b 8e 00 10 sw (sp+16),r14 8010b58: 5b 8f 00 0c sw (sp+12),r15 8010b5c: 5b 90 00 08 sw (sp+8),r16 8010b60: 5b 9d 00 04 sw (sp+4),ra siginfo_t siginfo_struct; sigset_t saved_signals_blocked; Thread_Wait_information stored_thread_wait_information; if ( ! _POSIX_signals_Clear_signals( api, signo, &siginfo_struct, 8010b64: 37 90 00 48 addi r16,sp,72 bool _POSIX_signals_Check_signal( POSIX_API_Control *api, int signo, bool is_global ) { 8010b68: 20 64 00 ff andi r4,r3,0xff siginfo_t siginfo_struct; sigset_t saved_signals_blocked; Thread_Wait_information stored_thread_wait_information; if ( ! _POSIX_signals_Clear_signals( api, signo, &siginfo_struct, 8010b6c: 34 05 00 01 mvi r5,1 8010b70: ba 00 18 00 mv r3,r16 bool _POSIX_signals_Check_signal( POSIX_API_Control *api, int signo, bool is_global ) { 8010b74: b8 20 68 00 mv r13,r1 8010b78: b8 40 58 00 mv r11,r2 siginfo_t siginfo_struct; sigset_t saved_signals_blocked; Thread_Wait_information stored_thread_wait_information; if ( ! _POSIX_signals_Clear_signals( api, signo, &siginfo_struct, 8010b7c: f8 00 00 37 calli 8010c58 <_POSIX_signals_Clear_signals> is_global, true ) ) return false; 8010b80: 34 0f 00 00 mvi r15,0 { siginfo_t siginfo_struct; sigset_t saved_signals_blocked; Thread_Wait_information stored_thread_wait_information; if ( ! _POSIX_signals_Clear_signals( api, signo, &siginfo_struct, 8010b84: 44 20 00 2b be r1,r0,8010c30 <_POSIX_signals_Check_signal+0xec> #endif /* * Just to prevent sending a signal which is currently being ignored. */ if ( _POSIX_signals_Vectors[ signo ].sa_handler == SIG_IGN ) 8010b88: 34 02 00 01 mvi r2,1 8010b8c: b9 60 08 00 mv r1,r11 8010b90: f8 00 18 a5 calli 8016e24 <__ashlsi3> 8010b94: 78 0c 08 01 mvhi r12,0x801 8010b98: b4 2b 08 00 add r1,r1,r11 8010b9c: 34 02 00 02 mvi r2,2 8010ba0: f8 00 18 a1 calli 8016e24 <__ashlsi3> 8010ba4: 39 8c 9e 40 ori r12,r12,0x9e40 8010ba8: b5 81 60 00 add r12,r12,r1 8010bac: 29 8e 00 08 lw r14,(r12+8) 8010bb0: 34 01 00 01 mvi r1,1 8010bb4: 45 c1 00 1f be r14,r1,8010c30 <_POSIX_signals_Check_signal+0xec><== NEVER TAKEN return false; /* * Block the signals requested in sa_mask */ saved_signals_blocked = api->signals_blocked; 8010bb8: 29 af 00 d0 lw r15,(r13+208) api->signals_blocked |= _POSIX_signals_Vectors[ signo ].sa_mask; 8010bbc: 29 81 00 04 lw r1,(r12+4) /* * We have to save the blocking information of the current wait queue * because the signal handler may subsequently go on and put the thread * on a wait queue, for its own purposes. */ memcpy( &stored_thread_wait_information, &_Thread_Executing->Wait, 8010bc0: 34 03 00 28 mvi r3,40 /* * Block the signals requested in sa_mask */ saved_signals_blocked = api->signals_blocked; api->signals_blocked |= _POSIX_signals_Vectors[ signo ].sa_mask; 8010bc4: b8 2f 08 00 or r1,r1,r15 8010bc8: 59 a1 00 d0 sw (r13+208),r1 /* * We have to save the blocking information of the current wait queue * because the signal handler may subsequently go on and put the thread * on a wait queue, for its own purposes. */ memcpy( &stored_thread_wait_information, &_Thread_Executing->Wait, 8010bcc: 78 01 08 01 mvhi r1,0x801 8010bd0: 38 21 9d f0 ori r1,r1,0x9df0 8010bd4: 28 22 00 0c lw r2,(r1+12) 8010bd8: 37 81 00 20 addi r1,sp,32 8010bdc: 34 42 00 20 addi r2,r2,32 8010be0: f8 00 04 da calli 8011f48 sizeof( Thread_Wait_information )); /* * Here, the signal handler function executes */ switch ( _POSIX_signals_Vectors[ signo ].sa_flags ) { 8010be4: 29 82 00 00 lw r2,(r12+0) 8010be8: 34 01 00 02 mvi r1,2 8010bec: 5c 41 00 06 bne r2,r1,8010c04 <_POSIX_signals_Check_signal+0xc0> case SA_SIGINFO: (*_POSIX_signals_Vectors[ signo ].sa_sigaction)( 8010bf0: b9 60 08 00 mv r1,r11 8010bf4: ba 00 10 00 mv r2,r16 8010bf8: 34 03 00 00 mvi r3,0 8010bfc: d9 c0 00 00 call r14 signo, &siginfo_struct, NULL /* context is undefined per 1003.1b-1993, p. 66 */ ); break; 8010c00: e0 00 00 03 bi 8010c0c <_POSIX_signals_Check_signal+0xc8> default: (*_POSIX_signals_Vectors[ signo ].sa_handler)( signo ); 8010c04: b9 60 08 00 mv r1,r11 8010c08: d9 c0 00 00 call r14 } /* * Restore the blocking information */ memcpy( &_Thread_Executing->Wait, &stored_thread_wait_information, 8010c0c: 78 01 08 01 mvhi r1,0x801 8010c10: 38 21 9d f0 ori r1,r1,0x9df0 8010c14: 28 21 00 0c lw r1,(r1+12) 8010c18: 37 82 00 20 addi r2,sp,32 8010c1c: 34 03 00 28 mvi r3,40 8010c20: 34 21 00 20 addi r1,r1,32 8010c24: f8 00 04 c9 calli 8011f48 sizeof( Thread_Wait_information )); /* * Restore the previous set of blocked signals */ api->signals_blocked = saved_signals_blocked; 8010c28: 59 af 00 d0 sw (r13+208),r15 return true; 8010c2c: 34 0f 00 01 mvi r15,1 } 8010c30: b9 e0 08 00 mv r1,r15 8010c34: 2b 9d 00 04 lw ra,(sp+4) 8010c38: 2b 8b 00 1c lw r11,(sp+28) 8010c3c: 2b 8c 00 18 lw r12,(sp+24) 8010c40: 2b 8d 00 14 lw r13,(sp+20) 8010c44: 2b 8e 00 10 lw r14,(sp+16) 8010c48: 2b 8f 00 0c lw r15,(sp+12) 8010c4c: 2b 90 00 08 lw r16,(sp+8) 8010c50: 37 9c 00 50 addi sp,sp,80 8010c54: c3 a0 00 00 ret =============================================================================== 08011308 <_POSIX_signals_Clear_process_signals>: */ void _POSIX_signals_Clear_process_signals( int signo ) { 8011308: 37 9c ff ec addi sp,sp,-20 801130c: 5b 8b 00 14 sw (sp+20),r11 8011310: 5b 8c 00 10 sw (sp+16),r12 8011314: 5b 8d 00 0c sw (sp+12),r13 8011318: 5b 8e 00 08 sw (sp+8),r14 801131c: 5b 9d 00 04 sw (sp+4),ra 8011320: b8 20 60 00 mv r12,r1 clear_signal = true; mask = signo_to_mask( signo ); ISR_Level level; _ISR_Disable( level ); 8011324: 90 00 68 00 rcsr r13,IE 8011328: 34 01 ff fe mvi r1,-2 801132c: a1 a1 08 00 and r1,r13,r1 8011330: d0 01 00 00 wcsr IE,r1 if ( _POSIX_signals_Vectors[ signo ].sa_flags == SA_SIGINFO ) { 8011334: 34 02 00 01 mvi r2,1 8011338: b9 80 08 00 mv r1,r12 801133c: f8 00 16 ba calli 8016e24 <__ashlsi3> 8011340: b4 2c 70 00 add r14,r1,r12 8011344: 34 02 00 02 mvi r2,2 8011348: 78 0b 08 01 mvhi r11,0x801 801134c: b9 c0 08 00 mv r1,r14 8011350: f8 00 16 b5 calli 8016e24 <__ashlsi3> 8011354: 39 6b 9e 40 ori r11,r11,0x9e40 8011358: b5 61 08 00 add r1,r11,r1 801135c: 28 22 00 00 lw r2,(r1+0) 8011360: 34 01 00 02 mvi r1,2 8011364: 5c 41 00 0a bne r2,r1,801138c <_POSIX_signals_Clear_process_signals+0x84> } if ( clear_signal ) { _POSIX_signals_Pending &= ~mask; } _ISR_Enable( level ); } 8011368: 34 02 00 02 mvi r2,2 801136c: 78 0b 08 01 mvhi r11,0x801 8011370: b9 c0 08 00 mv r1,r14 8011374: f8 00 16 ac calli 8016e24 <__ashlsi3> 8011378: 39 6b a0 38 ori r11,r11,0xa038 801137c: b5 61 08 00 add r1,r11,r1 RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 8011380: 34 22 00 04 addi r2,r1,4 ISR_Level level; _ISR_Disable( level ); if ( _POSIX_signals_Vectors[ signo ].sa_flags == SA_SIGINFO ) { if ( !_Chain_Is_empty( &_POSIX_signals_Siginfo[ signo ] ) ) 8011384: 28 21 00 00 lw r1,(r1+0) 8011388: 5c 22 00 0a bne r1,r2,80113b0 <_POSIX_signals_Clear_process_signals+0xa8><== NEVER TAKEN 801138c: 35 82 ff ff addi r2,r12,-1 clear_signal = false; } if ( clear_signal ) { _POSIX_signals_Pending &= ~mask; 8011390: 78 0b 08 01 mvhi r11,0x801 8011394: 34 01 00 01 mvi r1,1 8011398: f8 00 16 a3 calli 8016e24 <__ashlsi3> 801139c: 39 6b a0 34 ori r11,r11,0xa034 80113a0: 29 62 00 00 lw r2,(r11+0) 80113a4: a4 20 08 00 not r1,r1 80113a8: a0 22 08 00 and r1,r1,r2 80113ac: 59 61 00 00 sw (r11+0),r1 } _ISR_Enable( level ); 80113b0: d0 0d 00 00 wcsr IE,r13 } 80113b4: 2b 9d 00 04 lw ra,(sp+4) 80113b8: 2b 8b 00 14 lw r11,(sp+20) 80113bc: 2b 8c 00 10 lw r12,(sp+16) 80113c0: 2b 8d 00 0c lw r13,(sp+12) 80113c4: 2b 8e 00 08 lw r14,(sp+8) 80113c8: 37 9c 00 14 addi sp,sp,20 80113cc: c3 a0 00 00 ret =============================================================================== 08003db8 <_POSIX_signals_Get_lowest>: #include int _POSIX_signals_Get_lowest( sigset_t set ) { 8003db8: 37 9c ff f0 addi sp,sp,-16 8003dbc: 5b 8b 00 10 sw (sp+16),r11 8003dc0: 5b 8c 00 0c sw (sp+12),r12 8003dc4: 5b 8d 00 08 sw (sp+8),r13 8003dc8: 5b 9d 00 04 sw (sp+4),ra int signo; for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) { 8003dcc: 34 0b 00 1b mvi r11,27 #include int _POSIX_signals_Get_lowest( sigset_t set ) { 8003dd0: b8 20 60 00 mv r12,r1 int signo; for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) { 8003dd4: 34 0d 00 20 mvi r13,32 8003dd8: 34 01 00 01 mvi r1,1 8003ddc: 35 62 ff ff addi r2,r11,-1 8003de0: f8 00 65 f5 calli 801d5b4 <__ashlsi3> if ( set & signo_to_mask( signo ) ) { 8003de4: a0 2c 08 00 and r1,r1,r12 8003de8: 5c 20 00 0c bne r1,r0,8003e18 <_POSIX_signals_Get_lowest+0x60><== NEVER TAKEN sigset_t set ) { int signo; for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) { 8003dec: 35 6b 00 01 addi r11,r11,1 8003df0: 5d 6d ff fa bne r11,r13,8003dd8 <_POSIX_signals_Get_lowest+0x20> 8003df4: 34 0b 00 01 mvi r11,1 */ #if (SIGHUP != 1) #error "Assumption that SIGHUP==1 violated!!" #endif for ( signo = SIGHUP ; signo <= __SIGLASTNOTRT ; signo++ ) { 8003df8: 34 0d 00 1b mvi r13,27 8003dfc: 34 01 00 01 mvi r1,1 8003e00: 35 62 ff ff addi r2,r11,-1 8003e04: f8 00 65 ec calli 801d5b4 <__ashlsi3> if ( set & signo_to_mask( signo ) ) { 8003e08: a0 2c 08 00 and r1,r1,r12 8003e0c: 5c 20 00 03 bne r1,r0,8003e18 <_POSIX_signals_Get_lowest+0x60> */ #if (SIGHUP != 1) #error "Assumption that SIGHUP==1 violated!!" #endif for ( signo = SIGHUP ; signo <= __SIGLASTNOTRT ; signo++ ) { 8003e10: 35 6b 00 01 addi r11,r11,1 8003e14: 5d 6d ff fa bne r11,r13,8003dfc <_POSIX_signals_Get_lowest+0x44><== ALWAYS TAKEN * a return 0. This routine will NOT be called unless a signal * is pending in the set passed in. */ found_it: return signo; } 8003e18: b9 60 08 00 mv r1,r11 8003e1c: 2b 9d 00 04 lw ra,(sp+4) 8003e20: 2b 8b 00 10 lw r11,(sp+16) 8003e24: 2b 8c 00 0c lw r12,(sp+12) 8003e28: 2b 8d 00 08 lw r13,(sp+8) 8003e2c: 37 9c 00 10 addi sp,sp,16 8003e30: c3 a0 00 00 ret =============================================================================== 080254c4 <_POSIX_signals_Unblock_thread>: bool _POSIX_signals_Unblock_thread( Thread_Control *the_thread, int signo, siginfo_t *info ) { 80254c4: 37 9c ff ec addi sp,sp,-20 80254c8: 5b 8b 00 14 sw (sp+20),r11 80254cc: 5b 8c 00 10 sw (sp+16),r12 80254d0: 5b 8d 00 0c sw (sp+12),r13 80254d4: 5b 8e 00 08 sw (sp+8),r14 80254d8: 5b 9d 00 04 sw (sp+4),ra 80254dc: b8 20 58 00 mv r11,r1 80254e0: b8 40 70 00 mv r14,r2 POSIX_API_Control *api; sigset_t mask; siginfo_t *the_info = NULL; api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 80254e4: 28 2c 01 20 lw r12,(r1+288) 80254e8: 34 42 ff ff addi r2,r2,-1 80254ec: 34 01 00 01 mvi r1,1 bool _POSIX_signals_Unblock_thread( Thread_Control *the_thread, int signo, siginfo_t *info ) { 80254f0: b8 60 68 00 mv r13,r3 80254f4: fb ff 72 6b calli 8001ea0 <__ashlsi3> /* * Is the thread is specifically waiting for a signal? */ if ( _States_Is_interruptible_signal( the_thread->current_state ) ) { 80254f8: 78 03 08 02 mvhi r3,0x802 80254fc: 38 63 6d 10 ori r3,r3,0x6d10 8025500: 29 64 00 10 lw r4,(r11+16) 8025504: 28 62 00 00 lw r2,(r3+0) 8025508: a0 82 18 00 and r3,r4,r2 802550c: 5c 62 00 1c bne r3,r2,802557c <_POSIX_signals_Unblock_thread+0xb8> if ( (the_thread->Wait.option & mask) || (~api->signals_blocked & mask) ) { 8025510: 29 62 00 30 lw r2,(r11+48) 8025514: a0 22 10 00 and r2,r1,r2 8025518: 5c 40 00 06 bne r2,r0,8025530 <_POSIX_signals_Unblock_thread+0x6c> 802551c: 29 82 00 d0 lw r2,(r12+208) /* * This should only be reached via pthread_kill(). */ return false; 8025520: 34 0c 00 00 mvi r12,0 * Is the thread is specifically waiting for a signal? */ if ( _States_Is_interruptible_signal( the_thread->current_state ) ) { if ( (the_thread->Wait.option & mask) || (~api->signals_blocked & mask) ) { 8025524: a4 40 10 00 not r2,r2 8025528: a0 22 08 00 and r1,r1,r2 802552c: 44 2c 00 39 be r1,r12,8025610 <_POSIX_signals_Unblock_thread+0x14c> the_thread->Wait.return_code = EINTR; 8025530: 34 01 00 04 mvi r1,4 8025534: 59 61 00 34 sw (r11+52),r1 the_info = (siginfo_t *) the_thread->Wait.return_argument; 8025538: 29 61 00 28 lw r1,(r11+40) if ( !info ) { 802553c: 5d a0 00 06 bne r13,r0,8025554 <_POSIX_signals_Unblock_thread+0x90> the_info->si_signo = signo; the_info->si_code = SI_USER; 8025540: 34 02 00 01 mvi r2,1 the_thread->Wait.return_code = EINTR; the_info = (siginfo_t *) the_thread->Wait.return_argument; if ( !info ) { the_info->si_signo = signo; 8025544: 58 2e 00 00 sw (r1+0),r14 the_info->si_code = SI_USER; 8025548: 58 22 00 04 sw (r1+4),r2 the_info->si_value.sival_int = 0; 802554c: 58 20 00 08 sw (r1+8),r0 8025550: e0 00 00 07 bi 802556c <_POSIX_signals_Unblock_thread+0xa8> } else { *the_info = *info; 8025554: 29 a3 00 00 lw r3,(r13+0) 8025558: 29 a2 00 04 lw r2,(r13+4) 802555c: 29 a4 00 08 lw r4,(r13+8) 8025560: 58 23 00 00 sw (r1+0),r3 8025564: 58 22 00 04 sw (r1+4),r2 8025568: 58 24 00 08 sw (r1+8),r4 } _Thread_queue_Extract_with_proxy( the_thread ); 802556c: b9 60 08 00 mv r1,r11 8025570: fb ff 9c c3 calli 800c87c <_Thread_queue_Extract_with_proxy> return true; 8025574: 34 0c 00 01 mvi r12,1 8025578: e0 00 00 26 bi 8025610 <_POSIX_signals_Unblock_thread+0x14c> } /* * Thread is not waiting due to a sigwait. */ if ( ~api->signals_blocked & mask ) { 802557c: 29 82 00 d0 lw r2,(r12+208) } else if ( the_thread->current_state == STATES_READY ) { if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) _Thread_Dispatch_necessary = true; } } return false; 8025580: 34 0c 00 00 mvi r12,0 } /* * Thread is not waiting due to a sigwait. */ if ( ~api->signals_blocked & mask ) { 8025584: a4 40 10 00 not r2,r2 8025588: a0 22 08 00 and r1,r1,r2 802558c: 44 20 00 21 be r1,r0,8025610 <_POSIX_signals_Unblock_thread+0x14c> 8025590: 78 01 10 00 mvhi r1,0x1000 8025594: a0 81 08 00 and r1,r4,r1 * it is not blocked, THEN * we need to dispatch at the end of this ISR. * + Any other combination, do nothing. */ if ( _States_Is_interruptible_by_signal( the_thread->current_state ) ) { 8025598: 44 20 00 15 be r1,r0,80255ec <_POSIX_signals_Unblock_thread+0x128> */ RTEMS_INLINE_ROUTINE bool _States_Is_waiting_on_thread_queue ( States_Control the_states ) { return (the_states & STATES_WAITING_ON_THREAD_QUEUE); 802559c: 78 02 08 02 mvhi r2,0x802 the_thread->Wait.return_code = EINTR; 80255a0: 34 01 00 04 mvi r1,4 80255a4: 38 42 6a c4 ori r2,r2,0x6ac4 80255a8: 59 61 00 34 sw (r11+52),r1 80255ac: 28 41 00 00 lw r1,(r2+0) 80255b0: a0 81 08 00 and r1,r4,r1 /* * In pthread_cond_wait, a thread will be blocking on a thread * queue, but is also interruptible by a POSIX signal. */ if ( _States_Is_waiting_on_thread_queue(the_thread->current_state) ) 80255b4: 44 20 00 04 be r1,r0,80255c4 <_POSIX_signals_Unblock_thread+0x100> _Thread_queue_Extract_with_proxy( the_thread ); 80255b8: b9 60 08 00 mv r1,r11 80255bc: fb ff 9c b0 calli 800c87c <_Thread_queue_Extract_with_proxy> 80255c0: e0 00 00 14 bi 8025610 <_POSIX_signals_Unblock_thread+0x14c> */ RTEMS_INLINE_ROUTINE bool _States_Is_delaying ( States_Control the_states ) { return (the_states & STATES_DELAYING); 80255c4: 20 84 00 08 andi r4,r4,0x8 else if ( _States_Is_delaying(the_thread->current_state) ) { 80255c8: 44 8c 00 12 be r4,r12,8025610 <_POSIX_signals_Unblock_thread+0x14c><== NEVER TAKEN (void) _Watchdog_Remove( &the_thread->Timer ); 80255cc: 35 61 00 48 addi r1,r11,72 80255d0: fb ff 9f 80 calli 800d3d0 <_Watchdog_Remove> RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 80255d4: 78 03 08 02 mvhi r3,0x802 80255d8: 38 63 69 18 ori r3,r3,0x6918 80255dc: 28 62 00 00 lw r2,(r3+0) 80255e0: b9 60 08 00 mv r1,r11 80255e4: fb ff 99 73 calli 800bbb0 <_Thread_Clear_state> 80255e8: e0 00 00 0a bi 8025610 <_POSIX_signals_Unblock_thread+0x14c> _Thread_Unblock( the_thread ); } } else if ( the_thread->current_state == STATES_READY ) { 80255ec: 5c 8c 00 09 bne r4,r12,8025610 <_POSIX_signals_Unblock_thread+0x14c><== NEVER TAKEN if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) 80255f0: 78 01 08 02 mvhi r1,0x802 80255f4: 38 21 9e f0 ori r1,r1,0x9ef0 80255f8: 28 22 00 08 lw r2,(r1+8) 80255fc: 44 4c 00 05 be r2,r12,8025610 <_POSIX_signals_Unblock_thread+0x14c> 8025600: 28 22 00 0c lw r2,(r1+12) 8025604: 5d 62 00 03 bne r11,r2,8025610 <_POSIX_signals_Unblock_thread+0x14c><== NEVER TAKEN _Thread_Dispatch_necessary = true; 8025608: 34 02 00 01 mvi r2,1 802560c: 30 22 00 18 sb (r1+24),r2 } } return false; } 8025610: b9 80 08 00 mv r1,r12 8025614: 2b 9d 00 04 lw ra,(sp+4) 8025618: 2b 8b 00 14 lw r11,(sp+20) 802561c: 2b 8c 00 10 lw r12,(sp+16) 8025620: 2b 8d 00 0c lw r13,(sp+12) 8025624: 2b 8e 00 08 lw r14,(sp+8) 8025628: 37 9c 00 14 addi sp,sp,20 802562c: c3 a0 00 00 ret =============================================================================== 08004264 <_RTEMS_tasks_Initialize_user_tasks_body>: * * Output parameters: NONE */ void _RTEMS_tasks_Initialize_user_tasks_body( void ) { 8004264: 37 9c ff e8 addi sp,sp,-24 8004268: 5b 8b 00 14 sw (sp+20),r11 800426c: 5b 8c 00 10 sw (sp+16),r12 8004270: 5b 8d 00 0c sw (sp+12),r13 8004274: 5b 8e 00 08 sw (sp+8),r14 8004278: 5b 9d 00 04 sw (sp+4),ra rtems_initialization_tasks_table *user_tasks; /* * Move information into local variables */ user_tasks = Configuration_RTEMS_API.User_initialization_tasks_table; 800427c: 78 01 08 01 mvhi r1,0x801 8004280: 38 21 90 74 ori r1,r1,0x9074 8004284: 28 2b 00 2c lw r11,(r1+44) maximum = Configuration_RTEMS_API.number_of_initialization_tasks; 8004288: 28 2e 00 28 lw r14,(r1+40) /* * Verify that we have a set of user tasks to iterate */ if ( !user_tasks ) 800428c: 34 0d 00 00 mvi r13,0 8004290: 5d 60 00 1a bne r11,r0,80042f8 <_RTEMS_tasks_Initialize_user_tasks_body+0x94> 8004294: e0 00 00 1a bi 80042fc <_RTEMS_tasks_Initialize_user_tasks_body+0x98> /* * Now iterate over the initialization tasks and create/start them. */ for ( index=0 ; index < maximum ; index++ ) { return_value = rtems_task_create( 8004298: 29 61 00 00 lw r1,(r11+0) 800429c: 29 62 00 08 lw r2,(r11+8) 80042a0: 29 63 00 04 lw r3,(r11+4) 80042a4: 29 64 00 14 lw r4,(r11+20) 80042a8: 29 65 00 0c lw r5,(r11+12) 80042ac: 37 86 00 18 addi r6,sp,24 80042b0: f8 00 26 95 calli 800dd04 80042b4: b8 20 60 00 mv r12,r1 user_tasks[ index ].stack_size, user_tasks[ index ].mode_set, user_tasks[ index ].attribute_set, &id ); if ( !rtems_is_status_successful( return_value ) ) 80042b8: 44 20 00 05 be r1,r0,80042cc <_RTEMS_tasks_Initialize_user_tasks_body+0x68><== ALWAYS TAKEN _Internal_error_Occurred( INTERNAL_ERROR_RTEMS_API, true, return_value ); 80042bc: 34 01 00 01 mvi r1,1 <== NOT EXECUTED 80042c0: 34 02 00 01 mvi r2,1 <== NOT EXECUTED 80042c4: b9 80 18 00 mv r3,r12 <== NOT EXECUTED 80042c8: e0 00 00 0a bi 80042f0 <_RTEMS_tasks_Initialize_user_tasks_body+0x8c><== NOT EXECUTED return_value = rtems_task_start( 80042cc: 29 63 00 18 lw r3,(r11+24) 80042d0: 29 62 00 10 lw r2,(r11+16) 80042d4: 2b 81 00 18 lw r1,(sp+24) 80042d8: 35 6b 00 1c addi r11,r11,28 80042dc: f8 00 00 0f calli 8004318 80042e0: b8 20 18 00 mv r3,r1 id, user_tasks[ index ].entry_point, user_tasks[ index ].argument ); if ( !rtems_is_status_successful( return_value ) ) 80042e4: 44 2c 00 04 be r1,r12,80042f4 <_RTEMS_tasks_Initialize_user_tasks_body+0x90> _Internal_error_Occurred( INTERNAL_ERROR_RTEMS_API, true, return_value ); 80042e8: 34 01 00 01 mvi r1,1 80042ec: 34 02 00 01 mvi r2,1 80042f0: f8 00 04 ac calli 80055a0 <_Internal_error_Occurred> return; /* * Now iterate over the initialization tasks and create/start them. */ for ( index=0 ; index < maximum ; index++ ) { 80042f4: 35 ad 00 01 addi r13,r13,1 80042f8: 55 cd ff e8 bgu r14,r13,8004298 <_RTEMS_tasks_Initialize_user_tasks_body+0x34> user_tasks[ index ].argument ); if ( !rtems_is_status_successful( return_value ) ) _Internal_error_Occurred( INTERNAL_ERROR_RTEMS_API, true, return_value ); } } 80042fc: 2b 9d 00 04 lw ra,(sp+4) 8004300: 2b 8b 00 14 lw r11,(sp+20) 8004304: 2b 8c 00 10 lw r12,(sp+16) 8004308: 2b 8d 00 0c lw r13,(sp+12) 800430c: 2b 8e 00 08 lw r14,(sp+8) 8004310: 37 9c 00 18 addi sp,sp,24 8004314: c3 a0 00 00 ret =============================================================================== 08004604 <_Rate_monotonic_Timeout>: void _Rate_monotonic_Timeout( Objects_Id id, void *ignored ) { 8004604: 37 9c ff f4 addi sp,sp,-12 8004608: 5b 8b 00 08 sw (sp+8),r11 800460c: 5b 9d 00 04 sw (sp+4),ra 8004610: b8 20 10 00 mv r2,r1 8004614: 78 01 08 02 mvhi r1,0x802 8004618: 38 21 08 90 ori r1,r1,0x890 800461c: 37 83 00 0c addi r3,sp,12 8004620: f8 00 08 e7 calli 80069bc <_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 ) { 8004624: 2b 82 00 0c lw r2,(sp+12) 8004628: b8 20 58 00 mv r11,r1 800462c: 5c 40 00 22 bne r2,r0,80046b4 <_Rate_monotonic_Timeout+0xb0><== NEVER TAKEN case OBJECTS_LOCAL: the_thread = the_period->owner; 8004630: 28 21 00 40 lw r1,(r1+64) */ RTEMS_INLINE_ROUTINE bool _States_Is_waiting_for_period ( States_Control the_states ) { return (the_states & STATES_WAITING_FOR_PERIOD); 8004634: 28 23 00 10 lw r3,(r1+16) 8004638: 20 63 40 00 andi r3,r3,0x4000 if ( _States_Is_waiting_for_period( the_thread->current_state ) && 800463c: 44 62 00 09 be r3,r2,8004660 <_Rate_monotonic_Timeout+0x5c> 8004640: 28 23 00 20 lw r3,(r1+32) 8004644: 29 62 00 08 lw r2,(r11+8) 8004648: 5c 62 00 06 bne r3,r2,8004660 <_Rate_monotonic_Timeout+0x5c> RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 800464c: 78 03 08 01 mvhi r3,0x801 8004650: 38 63 e6 ec ori r3,r3,0xe6ec 8004654: 28 62 00 00 lw r2,(r3+0) 8004658: f8 00 0b 70 calli 8007418 <_Thread_Clear_state> 800465c: e0 00 00 06 bi 8004674 <_Rate_monotonic_Timeout+0x70> _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 ) { 8004660: 29 62 00 38 lw r2,(r11+56) 8004664: 34 01 00 01 mvi r1,1 8004668: 5c 41 00 0c bne r2,r1,8004698 <_Rate_monotonic_Timeout+0x94> the_period->state = RATE_MONOTONIC_EXPIRED_WHILE_BLOCKING; 800466c: 34 01 00 03 mvi r1,3 8004670: 59 61 00 38 sw (r11+56),r1 _Rate_monotonic_Initiate_statistics( the_period ); 8004674: b9 60 08 00 mv r1,r11 8004678: fb ff fe 2e calli 8003f30 <_Rate_monotonic_Initiate_statistics> Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 800467c: 29 61 00 3c lw r1,(r11+60) _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 8004680: 35 62 00 10 addi r2,r11,16 Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 8004684: 59 61 00 1c sw (r11+28),r1 _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 8004688: 78 01 08 02 mvhi r1,0x802 800468c: 38 21 0a 98 ori r1,r1,0xa98 8004690: f8 00 11 02 calli 8008a98 <_Watchdog_Insert> 8004694: e0 00 00 03 bi 80046a0 <_Rate_monotonic_Timeout+0x9c> _Watchdog_Insert_ticks( &the_period->Timer, the_period->next_length ); } else the_period->state = RATE_MONOTONIC_EXPIRED; 8004698: 34 01 00 04 mvi r1,4 800469c: 59 61 00 38 sw (r11+56),r1 */ RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void ) { RTEMS_COMPILER_MEMORY_BARRIER(); _Thread_Dispatch_disable_level -= 1; 80046a0: 78 01 08 02 mvhi r1,0x802 80046a4: 38 21 09 b8 ori r1,r1,0x9b8 80046a8: 28 22 00 00 lw r2,(r1+0) 80046ac: 34 42 ff ff addi r2,r2,-1 80046b0: 58 22 00 00 sw (r1+0),r2 case OBJECTS_REMOTE: /* impossible */ #endif case OBJECTS_ERROR: break; } } 80046b4: 2b 9d 00 04 lw ra,(sp+4) 80046b8: 2b 8b 00 08 lw r11,(sp+8) 80046bc: 37 9c 00 0c addi sp,sp,12 80046c0: c3 a0 00 00 ret =============================================================================== 08003fc4 <_Rate_monotonic_Update_statistics>: void _Rate_monotonic_Update_statistics( Rate_monotonic_Control *the_period ) { 8003fc4: 37 9c ff e4 addi sp,sp,-28 8003fc8: 5b 8b 00 0c sw (sp+12),r11 8003fcc: 5b 8c 00 08 sw (sp+8),r12 8003fd0: 5b 9d 00 04 sw (sp+4),ra 8003fd4: b8 20 58 00 mv r11,r1 /* * Update the counts. */ stats = &the_period->Statistics; stats->count++; 8003fd8: 28 21 00 54 lw r1,(r1+84) if ( the_period->state == RATE_MONOTONIC_EXPIRED ) 8003fdc: 29 62 00 38 lw r2,(r11+56) /* * Update the counts. */ stats = &the_period->Statistics; stats->count++; 8003fe0: 34 21 00 01 addi r1,r1,1 8003fe4: 59 61 00 54 sw (r11+84),r1 if ( the_period->state == RATE_MONOTONIC_EXPIRED ) 8003fe8: 34 01 00 04 mvi r1,4 8003fec: 5c 41 00 04 bne r2,r1,8003ffc <_Rate_monotonic_Update_statistics+0x38> stats->missed_count++; 8003ff0: 29 61 00 58 lw r1,(r11+88) 8003ff4: 34 21 00 01 addi r1,r1,1 8003ff8: 59 61 00 58 sw (r11+88),r1 /* * Grab status for time statistics. */ valid_status = _Rate_monotonic_Get_status( the_period, &since_last_period, &executed ); 8003ffc: 37 8c 00 18 addi r12,sp,24 stats->missed_count++; /* * Grab status for time statistics. */ valid_status = 8004000: b9 60 08 00 mv r1,r11 8004004: 37 82 00 10 addi r2,sp,16 8004008: b9 80 18 00 mv r3,r12 800400c: fb ff ff 90 calli 8003e4c <_Rate_monotonic_Get_status> _Rate_monotonic_Get_status( the_period, &since_last_period, &executed ); if (!valid_status) 8004010: 44 20 00 28 be r1,r0,80040b0 <_Rate_monotonic_Update_statistics+0xec><== NEVER TAKEN /* * Update CPU time */ #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ _Timestamp_Add_to( &stats->total_cpu_time, &executed ); 8004014: b9 80 10 00 mv r2,r12 8004018: 35 61 00 6c addi r1,r11,108 800401c: f8 00 11 3c calli 800850c <_Timespec_Add_to> if ( _Timestamp_Less_than( &executed, &stats->min_cpu_time ) ) 8004020: b9 80 08 00 mv r1,r12 8004024: 35 62 00 5c addi r2,r11,92 8004028: f8 00 11 97 calli 8008684 <_Timespec_Less_than> 800402c: 44 20 00 05 be r1,r0,8004040 <_Rate_monotonic_Update_statistics+0x7c> stats->min_cpu_time = executed; 8004030: 2b 81 00 18 lw r1,(sp+24) 8004034: 59 61 00 5c sw (r11+92),r1 8004038: 2b 81 00 1c lw r1,(sp+28) 800403c: 59 61 00 60 sw (r11+96),r1 if ( _Timestamp_Greater_than( &executed, &stats->max_cpu_time ) ) 8004040: 37 81 00 18 addi r1,sp,24 8004044: 35 62 00 64 addi r2,r11,100 8004048: f8 00 11 84 calli 8008658 <_Timespec_Greater_than> 800404c: 44 20 00 05 be r1,r0,8004060 <_Rate_monotonic_Update_statistics+0x9c> stats->max_cpu_time = executed; 8004050: 2b 81 00 18 lw r1,(sp+24) 8004054: 59 61 00 64 sw (r11+100),r1 8004058: 2b 81 00 1c lw r1,(sp+28) 800405c: 59 61 00 68 sw (r11+104),r1 /* * Update Wall time */ #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ _Timestamp_Add_to( &stats->total_wall_time, &since_last_period ); 8004060: 37 8c 00 10 addi r12,sp,16 8004064: b9 80 10 00 mv r2,r12 8004068: 35 61 00 84 addi r1,r11,132 800406c: f8 00 11 28 calli 800850c <_Timespec_Add_to> if ( _Timestamp_Less_than( &since_last_period, &stats->min_wall_time ) ) 8004070: b9 80 08 00 mv r1,r12 8004074: 35 62 00 74 addi r2,r11,116 8004078: f8 00 11 83 calli 8008684 <_Timespec_Less_than> 800407c: 44 20 00 05 be r1,r0,8004090 <_Rate_monotonic_Update_statistics+0xcc> stats->min_wall_time = since_last_period; 8004080: 2b 81 00 10 lw r1,(sp+16) 8004084: 59 61 00 74 sw (r11+116),r1 8004088: 2b 81 00 14 lw r1,(sp+20) 800408c: 59 61 00 78 sw (r11+120),r1 if ( _Timestamp_Greater_than( &since_last_period, &stats->max_wall_time ) ) 8004090: 37 81 00 10 addi r1,sp,16 8004094: 35 62 00 7c addi r2,r11,124 8004098: f8 00 11 70 calli 8008658 <_Timespec_Greater_than> 800409c: 44 20 00 05 be r1,r0,80040b0 <_Rate_monotonic_Update_statistics+0xec> stats->max_wall_time = since_last_period; 80040a0: 2b 81 00 10 lw r1,(sp+16) 80040a4: 59 61 00 7c sw (r11+124),r1 80040a8: 2b 81 00 14 lw r1,(sp+20) 80040ac: 59 61 00 80 sw (r11+128),r1 stats->min_wall_time = since_last_period; if ( since_last_period > stats->max_wall_time ) stats->max_wall_time = since_last_period; #endif } 80040b0: 2b 9d 00 04 lw ra,(sp+4) 80040b4: 2b 8b 00 0c lw r11,(sp+12) 80040b8: 2b 8c 00 08 lw r12,(sp+8) 80040bc: 37 9c 00 1c addi sp,sp,28 80040c0: c3 a0 00 00 ret =============================================================================== 0800ee10 <_Scheduler_priority_Block>: void _Scheduler_priority_Block( Scheduler_Control *the_scheduler, Thread_Control *the_thread ) { 800ee10: 37 9c ff ec addi sp,sp,-20 800ee14: 5b 8b 00 14 sw (sp+20),r11 800ee18: 5b 8c 00 10 sw (sp+16),r12 800ee1c: 5b 8d 00 0c sw (sp+12),r13 800ee20: 5b 8e 00 08 sw (sp+8),r14 800ee24: 5b 9d 00 04 sw (sp+4),ra 800ee28: b8 40 60 00 mv r12,r2 RTEMS_INLINE_ROUTINE void _Scheduler_priority_Ready_queue_extract( Thread_Control *the_thread ) { Chain_Control *ready = the_thread->scheduler.priority->ready_chain; 800ee2c: 28 42 00 8c lw r2,(r2+140) 800ee30: 28 43 00 00 lw r3,(r2+0) if ( _Chain_Has_only_one_node( ready ) ) { 800ee34: 28 64 00 00 lw r4,(r3+0) 800ee38: 28 62 00 08 lw r2,(r3+8) 800ee3c: 5c 82 00 13 bne r4,r2,800ee88 <_Scheduler_priority_Block+0x78> RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); 800ee40: 34 62 00 04 addi r2,r3,4 head->next = tail; 800ee44: 58 62 00 00 sw (r3+0),r2 head->previous = NULL; 800ee48: 58 60 00 04 sw (r3+4),r0 tail->previous = head; 800ee4c: 58 63 00 08 sw (r3+8),r3 _Chain_Initialize_empty( ready ); _Priority_bit_map_Remove( &the_thread->scheduler.priority->Priority_map ); 800ee50: 29 82 00 8c lw r2,(r12+140) RTEMS_INLINE_ROUTINE void _Priority_bit_map_Remove ( Priority_bit_map_Information *the_priority_map ) { *the_priority_map->minor &= the_priority_map->block_minor; 800ee54: 28 44 00 04 lw r4,(r2+4) 800ee58: 2c 45 00 0e lhu r5,(r2+14) 800ee5c: 2c 83 00 00 lhu r3,(r4+0) 800ee60: a0 65 18 00 and r3,r3,r5 800ee64: 0c 83 00 00 sh (r4+0),r3 if ( *the_priority_map->minor == 0 ) 800ee68: 5c 60 00 0c bne r3,r0,800ee98 <_Scheduler_priority_Block+0x88> _Priority_Major_bit_map &= the_priority_map->block_major; 800ee6c: 78 03 08 01 mvhi r3,0x801 800ee70: 38 63 9e 10 ori r3,r3,0x9e10 800ee74: 2c 64 00 00 lhu r4,(r3+0) 800ee78: 2c 42 00 0c lhu r2,(r2+12) 800ee7c: a0 44 10 00 and r2,r2,r4 800ee80: 0c 62 00 00 sh (r3+0),r2 800ee84: e0 00 00 05 bi 800ee98 <_Scheduler_priority_Block+0x88> ) { Chain_Node *next; Chain_Node *previous; next = the_node->next; 800ee88: 29 83 00 00 lw r3,(r12+0) previous = the_node->previous; 800ee8c: 29 82 00 04 lw r2,(r12+4) next->previous = previous; 800ee90: 58 62 00 04 sw (r3+4),r2 previous->next = next; 800ee94: 58 43 00 00 sw (r2+0),r3 RTEMS_INLINE_ROUTINE bool _Thread_Is_heir ( const Thread_Control *the_thread ) { return ( the_thread == _Thread_Heir ); 800ee98: 78 02 08 01 mvhi r2,0x801 800ee9c: 38 42 9d f0 ori r2,r2,0x9df0 { _Scheduler_priority_Ready_queue_extract(the_thread); /* TODO: flash critical section */ if ( _Thread_Is_heir( the_thread ) ) 800eea0: 28 42 00 10 lw r2,(r2+16) 800eea4: 5d 82 00 39 bne r12,r2,800ef88 <_Scheduler_priority_Block+0x178> RTEMS_INLINE_ROUTINE Priority_Control _Priority_bit_map_Get_highest( void ) { Priority_bit_map_Control minor; Priority_bit_map_Control major; _Bitfield_Find_first_bit( _Priority_Major_bit_map, major ); 800eea8: 78 02 08 01 mvhi r2,0x801 800eeac: 38 42 9e 10 ori r2,r2,0x9e10 _Scheduler_priority_Block_body(the_scheduler, the_thread); } 800eeb0: 28 2e 00 00 lw r14,(r1+0) 800eeb4: 2c 41 00 00 lhu r1,(r2+0) 800eeb8: 78 0b 08 01 mvhi r11,0x801 800eebc: 34 02 00 ff mvi r2,255 800eec0: 20 21 ff ff andi r1,r1,0xffff 800eec4: 39 6b 7f 1c ori r11,r11,0x7f1c 800eec8: 54 22 00 05 bgu r1,r2,800eedc <_Scheduler_priority_Block+0xcc> 800eecc: b5 61 58 00 add r11,r11,r1 800eed0: 41 6d 00 00 lbu r13,(r11+0) 800eed4: 35 ad 00 08 addi r13,r13,8 800eed8: e0 00 00 05 bi 800eeec <_Scheduler_priority_Block+0xdc> 800eedc: 34 02 00 08 mvi r2,8 800eee0: f8 00 20 1f calli 8016f5c <__lshrsi3> 800eee4: b5 61 58 00 add r11,r11,r1 800eee8: 41 6d 00 00 lbu r13,(r11+0) _Bitfield_Find_first_bit( _Priority_Bit_map[major], minor ); 800eeec: 34 02 00 01 mvi r2,1 800eef0: 78 0b 08 01 mvhi r11,0x801 800eef4: b9 a0 08 00 mv r1,r13 800eef8: f8 00 1f cb calli 8016e24 <__ashlsi3> 800eefc: 39 6b 9e 18 ori r11,r11,0x9e18 800ef00: b5 61 58 00 add r11,r11,r1 800ef04: 2d 62 00 00 lhu r2,(r11+0) 800ef08: 34 01 00 ff mvi r1,255 800ef0c: 78 0b 08 01 mvhi r11,0x801 800ef10: 39 6b 7f 1c ori r11,r11,0x7f1c 800ef14: 54 41 00 05 bgu r2,r1,800ef28 <_Scheduler_priority_Block+0x118> 800ef18: b5 62 58 00 add r11,r11,r2 800ef1c: 41 6b 00 00 lbu r11,(r11+0) 800ef20: 35 6b 00 08 addi r11,r11,8 800ef24: e0 00 00 06 bi 800ef3c <_Scheduler_priority_Block+0x12c> 800ef28: b8 40 08 00 mv r1,r2 800ef2c: 34 02 00 08 mvi r2,8 800ef30: f8 00 20 0b calli 8016f5c <__lshrsi3> 800ef34: b5 61 58 00 add r11,r11,r1 800ef38: 41 6b 00 00 lbu r11,(r11+0) return (_Priority_Bits_index( major ) << 4) + 800ef3c: 34 02 00 04 mvi r2,4 800ef40: b9 a0 08 00 mv r1,r13 800ef44: f8 00 1f b8 calli 8016e24 <__ashlsi3> 800ef48: b5 61 58 00 add r11,r11,r1 Chain_Control *the_ready_queue ) { Priority_Control index = _Priority_bit_map_Get_highest(); if ( !_Chain_Is_empty( &the_ready_queue[ index ] ) ) 800ef4c: 34 02 00 01 mvi r2,1 800ef50: b9 60 08 00 mv r1,r11 800ef54: f8 00 1f b4 calli 8016e24 <__ashlsi3> 800ef58: 34 02 00 02 mvi r2,2 800ef5c: b4 2b 08 00 add r1,r1,r11 800ef60: f8 00 1f b1 calli 8016e24 <__ashlsi3> 800ef64: b5 c1 08 00 add r1,r14,r1 800ef68: 28 23 00 00 lw r3,(r1+0) RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 800ef6c: 34 21 00 04 addi r1,r1,4 return (Thread_Control *) _Chain_First( &the_ready_queue[ index ] ); return NULL; 800ef70: 34 02 00 00 mvi r2,0 Chain_Control *the_ready_queue ) { Priority_Control index = _Priority_bit_map_Get_highest(); if ( !_Chain_Is_empty( &the_ready_queue[ index ] ) ) 800ef74: 44 61 00 02 be r3,r1,800ef7c <_Scheduler_priority_Block+0x16c><== NEVER TAKEN return (Thread_Control *) _Chain_First( &the_ready_queue[ index ] ); 800ef78: b8 60 10 00 mv r2,r3 RTEMS_INLINE_ROUTINE void _Scheduler_priority_Schedule_body( Scheduler_Control *the_scheduler ) { _Thread_Heir = _Scheduler_priority_Ready_queue_first( 800ef7c: 78 01 08 01 mvhi r1,0x801 800ef80: 38 21 9d f0 ori r1,r1,0x9df0 800ef84: 58 22 00 10 sw (r1+16),r2 RTEMS_INLINE_ROUTINE bool _Thread_Is_executing ( const Thread_Control *the_thread ) { return ( the_thread == _Thread_Executing ); 800ef88: 78 01 08 01 mvhi r1,0x801 800ef8c: 38 21 9d f0 ori r1,r1,0x9df0 /* TODO: flash critical section */ if ( _Thread_Is_heir( the_thread ) ) _Scheduler_priority_Schedule_body(the_scheduler); if ( _Thread_Is_executing( the_thread ) ) 800ef90: 28 22 00 0c lw r2,(r1+12) 800ef94: 5d 82 00 03 bne r12,r2,800efa0 <_Scheduler_priority_Block+0x190> _Thread_Dispatch_necessary = true; 800ef98: 34 02 00 01 mvi r2,1 800ef9c: 30 22 00 18 sb (r1+24),r2 800efa0: 2b 9d 00 04 lw ra,(sp+4) 800efa4: 2b 8b 00 14 lw r11,(sp+20) 800efa8: 2b 8c 00 10 lw r12,(sp+16) 800efac: 2b 8d 00 0c lw r13,(sp+12) 800efb0: 2b 8e 00 08 lw r14,(sp+8) 800efb4: 37 9c 00 14 addi sp,sp,20 800efb8: c3 a0 00 00 ret =============================================================================== 080061f4 <_Scheduler_priority_Schedule>: */ void _Scheduler_priority_Schedule( Scheduler_Control *the_scheduler ) { 80061f4: 37 9c ff f0 addi sp,sp,-16 80061f8: 5b 8b 00 10 sw (sp+16),r11 80061fc: 5b 8c 00 0c sw (sp+12),r12 8006200: 5b 8d 00 08 sw (sp+8),r13 8006204: 5b 9d 00 04 sw (sp+4),ra RTEMS_INLINE_ROUTINE Priority_Control _Priority_bit_map_Get_highest( void ) { Priority_bit_map_Control minor; Priority_bit_map_Control major; _Bitfield_Find_first_bit( _Priority_Major_bit_map, major ); 8006208: 78 02 08 01 mvhi r2,0x801 800620c: 38 42 9e 10 ori r2,r2,0x9e10 _Scheduler_priority_Schedule_body( the_scheduler ); } 8006210: 28 2d 00 00 lw r13,(r1+0) 8006214: 2c 41 00 00 lhu r1,(r2+0) 8006218: 78 0b 08 01 mvhi r11,0x801 800621c: 34 02 00 ff mvi r2,255 8006220: 20 21 ff ff andi r1,r1,0xffff 8006224: 39 6b 7f 1c ori r11,r11,0x7f1c 8006228: 54 22 00 05 bgu r1,r2,800623c <_Scheduler_priority_Schedule+0x48> 800622c: b5 61 58 00 add r11,r11,r1 8006230: 41 6c 00 00 lbu r12,(r11+0) 8006234: 35 8c 00 08 addi r12,r12,8 8006238: e0 00 00 05 bi 800624c <_Scheduler_priority_Schedule+0x58> 800623c: 34 02 00 08 mvi r2,8 8006240: f8 00 43 47 calli 8016f5c <__lshrsi3> 8006244: b5 61 58 00 add r11,r11,r1 8006248: 41 6c 00 00 lbu r12,(r11+0) _Bitfield_Find_first_bit( _Priority_Bit_map[major], minor ); 800624c: 34 02 00 01 mvi r2,1 8006250: 78 0b 08 01 mvhi r11,0x801 8006254: b9 80 08 00 mv r1,r12 8006258: f8 00 42 f3 calli 8016e24 <__ashlsi3> 800625c: 39 6b 9e 18 ori r11,r11,0x9e18 8006260: b5 61 58 00 add r11,r11,r1 8006264: 2d 62 00 00 lhu r2,(r11+0) 8006268: 34 01 00 ff mvi r1,255 800626c: 78 0b 08 01 mvhi r11,0x801 8006270: 39 6b 7f 1c ori r11,r11,0x7f1c 8006274: 54 41 00 05 bgu r2,r1,8006288 <_Scheduler_priority_Schedule+0x94> 8006278: b5 62 58 00 add r11,r11,r2 800627c: 41 6b 00 00 lbu r11,(r11+0) 8006280: 35 6b 00 08 addi r11,r11,8 8006284: e0 00 00 06 bi 800629c <_Scheduler_priority_Schedule+0xa8> 8006288: b8 40 08 00 mv r1,r2 800628c: 34 02 00 08 mvi r2,8 8006290: f8 00 43 33 calli 8016f5c <__lshrsi3> 8006294: b5 61 58 00 add r11,r11,r1 8006298: 41 6b 00 00 lbu r11,(r11+0) return (_Priority_Bits_index( major ) << 4) + 800629c: 34 02 00 04 mvi r2,4 80062a0: b9 80 08 00 mv r1,r12 80062a4: f8 00 42 e0 calli 8016e24 <__ashlsi3> 80062a8: b5 61 58 00 add r11,r11,r1 Chain_Control *the_ready_queue ) { Priority_Control index = _Priority_bit_map_Get_highest(); if ( !_Chain_Is_empty( &the_ready_queue[ index ] ) ) 80062ac: 34 02 00 01 mvi r2,1 80062b0: b9 60 08 00 mv r1,r11 80062b4: f8 00 42 dc calli 8016e24 <__ashlsi3> 80062b8: 34 02 00 02 mvi r2,2 80062bc: b4 2b 08 00 add r1,r1,r11 80062c0: f8 00 42 d9 calli 8016e24 <__ashlsi3> 80062c4: b5 a1 08 00 add r1,r13,r1 80062c8: 28 23 00 00 lw r3,(r1+0) RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 80062cc: 34 21 00 04 addi r1,r1,4 return (Thread_Control *) _Chain_First( &the_ready_queue[ index ] ); return NULL; 80062d0: 34 02 00 00 mvi r2,0 Chain_Control *the_ready_queue ) { Priority_Control index = _Priority_bit_map_Get_highest(); if ( !_Chain_Is_empty( &the_ready_queue[ index ] ) ) 80062d4: 44 61 00 02 be r3,r1,80062dc <_Scheduler_priority_Schedule+0xe8><== NEVER TAKEN return (Thread_Control *) _Chain_First( &the_ready_queue[ index ] ); 80062d8: b8 60 10 00 mv r2,r3 RTEMS_INLINE_ROUTINE void _Scheduler_priority_Schedule_body( Scheduler_Control *the_scheduler ) { _Thread_Heir = _Scheduler_priority_Ready_queue_first( 80062dc: 78 01 08 01 mvhi r1,0x801 80062e0: 38 21 9d f0 ori r1,r1,0x9df0 80062e4: 58 22 00 10 sw (r1+16),r2 80062e8: 2b 9d 00 04 lw ra,(sp+4) 80062ec: 2b 8b 00 10 lw r11,(sp+16) 80062f0: 2b 8c 00 0c lw r12,(sp+12) 80062f4: 2b 8d 00 08 lw r13,(sp+8) 80062f8: 37 9c 00 10 addi sp,sp,16 80062fc: c3 a0 00 00 ret =============================================================================== 08004fd8 <_TOD_Get>: */ void _TOD_Get( struct timespec *time ) { 8004fd8: 37 9c ff e4 addi sp,sp,-28 8004fdc: 5b 8b 00 0c sw (sp+12),r11 8004fe0: 5b 8c 00 08 sw (sp+8),r12 8004fe4: 5b 9d 00 04 sw (sp+4),ra 8004fe8: b8 20 58 00 mv r11,r1 /* assume time checked for NULL by caller */ /* _TOD_Now is the native current time */ nanoseconds = 0; _ISR_Disable( level ); 8004fec: 90 00 60 00 rcsr r12,IE 8004ff0: 34 01 ff fe mvi r1,-2 8004ff4: a1 81 08 00 and r1,r12,r1 8004ff8: d0 01 00 00 wcsr IE,r1 now = _TOD_Now; 8004ffc: 78 02 08 01 mvhi r2,0x801 8005000: 38 42 99 c8 ori r2,r2,0x99c8 8005004: 28 41 00 00 lw r1,(r2+0) 8005008: 5b 81 00 10 sw (sp+16),r1 800500c: 28 41 00 04 lw r1,(r2+4) if ( _Watchdog_Nanoseconds_since_tick_handler ) 8005010: 78 02 08 01 mvhi r2,0x801 8005014: 38 42 9a 9c ori r2,r2,0x9a9c 8005018: 28 43 00 00 lw r3,(r2+0) /* assume time checked for NULL by caller */ /* _TOD_Now is the native current time */ nanoseconds = 0; _ISR_Disable( level ); now = _TOD_Now; 800501c: 5b 81 00 14 sw (sp+20),r1 long nanoseconds; /* assume time checked for NULL by caller */ /* _TOD_Now is the native current time */ nanoseconds = 0; 8005020: 34 02 00 00 mvi r2,0 _ISR_Disable( level ); now = _TOD_Now; if ( _Watchdog_Nanoseconds_since_tick_handler ) 8005024: 44 60 00 03 be r3,r0,8005030 <_TOD_Get+0x58> <== ALWAYS TAKEN nanoseconds = (*_Watchdog_Nanoseconds_since_tick_handler)(); 8005028: d8 60 00 00 call r3 <== NOT EXECUTED 800502c: b8 20 10 00 mv r2,r1 <== NOT EXECUTED _ISR_Enable( level ); 8005030: d0 0c 00 00 wcsr IE,r12 _Timestamp_Set( &offset, 0, nanoseconds ); 8005034: 5b 82 00 1c sw (sp+28),r2 _Timestamp_Add_to( &now, &offset ); 8005038: 37 81 00 10 addi r1,sp,16 800503c: 37 82 00 18 addi r2,sp,24 now = _TOD_Now; if ( _Watchdog_Nanoseconds_since_tick_handler ) nanoseconds = (*_Watchdog_Nanoseconds_since_tick_handler)(); _ISR_Enable( level ); _Timestamp_Set( &offset, 0, nanoseconds ); 8005040: 5b 80 00 18 sw (sp+24),r0 _Timestamp_Add_to( &now, &offset ); 8005044: f8 00 09 84 calli 8007654 <_Timespec_Add_to> _Timestamp_To_timespec( &now, time ); 8005048: 2b 81 00 10 lw r1,(sp+16) 800504c: 59 61 00 00 sw (r11+0),r1 8005050: 2b 81 00 14 lw r1,(sp+20) 8005054: 59 61 00 04 sw (r11+4),r1 } 8005058: 2b 9d 00 04 lw ra,(sp+4) 800505c: 2b 8b 00 0c lw r11,(sp+12) 8005060: 2b 8c 00 08 lw r12,(sp+8) 8005064: 37 9c 00 1c addi sp,sp,28 8005068: c3 a0 00 00 ret =============================================================================== 0800e674 <_TOD_Get_uptime>: */ void _TOD_Get_uptime( Timestamp_Control *uptime ) { 800e674: 37 9c ff e4 addi sp,sp,-28 800e678: 5b 8b 00 0c sw (sp+12),r11 800e67c: 5b 8c 00 08 sw (sp+8),r12 800e680: 5b 9d 00 04 sw (sp+4),ra 800e684: b8 20 58 00 mv r11,r1 /* assume time checked for NULL by caller */ /* _TOD_Uptime is in native timestamp format */ nanoseconds = 0; _ISR_Disable( level ); 800e688: 90 00 60 00 rcsr r12,IE 800e68c: 34 01 ff fe mvi r1,-2 800e690: a1 81 08 00 and r1,r12,r1 800e694: d0 01 00 00 wcsr IE,r1 up = _TOD_Uptime; 800e698: 78 02 08 01 mvhi r2,0x801 800e69c: 38 42 99 9c ori r2,r2,0x999c 800e6a0: 28 41 00 00 lw r1,(r2+0) 800e6a4: 5b 81 00 10 sw (sp+16),r1 800e6a8: 28 41 00 04 lw r1,(r2+4) if ( _Watchdog_Nanoseconds_since_tick_handler ) 800e6ac: 78 02 08 01 mvhi r2,0x801 800e6b0: 38 42 9a 9c ori r2,r2,0x9a9c 800e6b4: 28 43 00 00 lw r3,(r2+0) /* assume time checked for NULL by caller */ /* _TOD_Uptime is in native timestamp format */ nanoseconds = 0; _ISR_Disable( level ); up = _TOD_Uptime; 800e6b8: 5b 81 00 14 sw (sp+20),r1 long nanoseconds; /* assume time checked for NULL by caller */ /* _TOD_Uptime is in native timestamp format */ nanoseconds = 0; 800e6bc: 34 02 00 00 mvi r2,0 _ISR_Disable( level ); up = _TOD_Uptime; if ( _Watchdog_Nanoseconds_since_tick_handler ) 800e6c0: 44 60 00 03 be r3,r0,800e6cc <_TOD_Get_uptime+0x58> <== ALWAYS TAKEN nanoseconds = (*_Watchdog_Nanoseconds_since_tick_handler)(); 800e6c4: d8 60 00 00 call r3 <== NOT EXECUTED 800e6c8: b8 20 10 00 mv r2,r1 <== NOT EXECUTED _ISR_Enable( level ); 800e6cc: d0 0c 00 00 wcsr IE,r12 _Timestamp_Set( &offset, 0, nanoseconds ); 800e6d0: 5b 82 00 1c sw (sp+28),r2 _Timestamp_Add_to( &up, &offset ); 800e6d4: 37 81 00 10 addi r1,sp,16 800e6d8: 37 82 00 18 addi r2,sp,24 up = _TOD_Uptime; if ( _Watchdog_Nanoseconds_since_tick_handler ) nanoseconds = (*_Watchdog_Nanoseconds_since_tick_handler)(); _ISR_Enable( level ); _Timestamp_Set( &offset, 0, nanoseconds ); 800e6dc: 5b 80 00 18 sw (sp+24),r0 _Timestamp_Add_to( &up, &offset ); 800e6e0: fb ff e3 dd calli 8007654 <_Timespec_Add_to> *uptime = up; 800e6e4: 2b 81 00 10 lw r1,(sp+16) 800e6e8: 59 61 00 00 sw (r11+0),r1 800e6ec: 2b 81 00 14 lw r1,(sp+20) 800e6f0: 59 61 00 04 sw (r11+4),r1 } 800e6f4: 2b 9d 00 04 lw ra,(sp+4) 800e6f8: 2b 8b 00 0c lw r11,(sp+12) 800e6fc: 2b 8c 00 08 lw r12,(sp+8) 800e700: 37 9c 00 1c addi sp,sp,28 800e704: c3 a0 00 00 ret =============================================================================== 08004230 <_TOD_Validate>: */ bool _TOD_Validate( const rtems_time_of_day *the_tod ) { 8004230: 37 9c ff f0 addi sp,sp,-16 8004234: 5b 8b 00 10 sw (sp+16),r11 8004238: 5b 8c 00 0c sw (sp+12),r12 800423c: 5b 8d 00 08 sw (sp+8),r13 8004240: 5b 9d 00 04 sw (sp+4),ra 8004244: b8 20 58 00 mv r11,r1 uint32_t days_in_month; uint32_t ticks_per_second; ticks_per_second = TOD_MICROSECONDS_PER_SECOND / rtems_configuration_get_microseconds_per_tick(); 8004248: 78 01 08 02 mvhi r1,0x802 800424c: 38 21 10 c4 ori r1,r1,0x10c4 8004250: 28 22 00 0c lw r2,(r1+12) (the_tod->hour >= TOD_HOURS_PER_DAY) || (the_tod->month == 0) || (the_tod->month > TOD_MONTHS_PER_YEAR) || (the_tod->year < TOD_BASE_YEAR) || (the_tod->day == 0) ) return false; 8004254: 34 0c 00 00 mvi r12,0 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) || 8004258: 45 60 00 22 be r11,r0,80042e0 <_TOD_Validate+0xb0> <== NEVER TAKEN ) { uint32_t days_in_month; uint32_t ticks_per_second; ticks_per_second = TOD_MICROSECONDS_PER_SECOND / 800425c: 78 03 08 01 mvhi r3,0x801 8004260: 38 63 e4 ac ori r3,r3,0xe4ac 8004264: 28 61 00 00 lw r1,(r3+0) 8004268: f8 00 62 ea calli 801ce10 <__udivsi3> rtems_configuration_get_microseconds_per_tick(); if ((!the_tod) || 800426c: 29 62 00 18 lw r2,(r11+24) 8004270: 50 41 00 1c bgeu r2,r1,80042e0 <_TOD_Validate+0xb0> (the_tod->ticks >= ticks_per_second) || 8004274: 29 62 00 14 lw r2,(r11+20) 8004278: 34 01 00 3b mvi r1,59 800427c: 54 41 00 19 bgu r2,r1,80042e0 <_TOD_Validate+0xb0> (the_tod->second >= TOD_SECONDS_PER_MINUTE) || 8004280: 29 62 00 10 lw r2,(r11+16) 8004284: 54 41 00 17 bgu r2,r1,80042e0 <_TOD_Validate+0xb0> (the_tod->minute >= TOD_MINUTES_PER_HOUR) || 8004288: 29 62 00 0c lw r2,(r11+12) 800428c: 34 01 00 17 mvi r1,23 8004290: 54 41 00 14 bgu r2,r1,80042e0 <_TOD_Validate+0xb0> (the_tod->hour >= TOD_HOURS_PER_DAY) || (the_tod->month == 0) || 8004294: 29 61 00 04 lw r1,(r11+4) rtems_configuration_get_microseconds_per_tick(); if ((!the_tod) || (the_tod->ticks >= ticks_per_second) || (the_tod->second >= TOD_SECONDS_PER_MINUTE) || (the_tod->minute >= TOD_MINUTES_PER_HOUR) || (the_tod->hour >= TOD_HOURS_PER_DAY) || 8004298: 44 20 00 12 be r1,r0,80042e0 <_TOD_Validate+0xb0> <== NEVER TAKEN (the_tod->month == 0) || 800429c: 34 02 00 0c mvi r2,12 80042a0: 54 22 00 10 bgu r1,r2,80042e0 <_TOD_Validate+0xb0> (the_tod->month > TOD_MONTHS_PER_YEAR) || (the_tod->year < TOD_BASE_YEAR) || 80042a4: 29 62 00 00 lw r2,(r11+0) (the_tod->ticks >= ticks_per_second) || (the_tod->second >= TOD_SECONDS_PER_MINUTE) || (the_tod->minute >= TOD_MINUTES_PER_HOUR) || (the_tod->hour >= TOD_HOURS_PER_DAY) || (the_tod->month == 0) || (the_tod->month > TOD_MONTHS_PER_YEAR) || 80042a8: 34 03 07 c3 mvi r3,1987 80042ac: 50 62 00 0d bgeu r3,r2,80042e0 <_TOD_Validate+0xb0> (the_tod->year < TOD_BASE_YEAR) || (the_tod->day == 0) ) 80042b0: 29 6d 00 08 lw r13,(r11+8) (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) || 80042b4: 45 a0 00 0b be r13,r0,80042e0 <_TOD_Validate+0xb0> <== NEVER TAKEN 80042b8: 78 0b 08 01 mvhi r11,0x801 (the_tod->day == 0) ) return false; if ( (the_tod->year % 4) == 0 ) 80042bc: 20 42 00 03 andi r2,r2,0x3 80042c0: 39 6b ed 64 ori r11,r11,0xed64 80042c4: 5c 40 00 02 bne r2,r0,80042cc <_TOD_Validate+0x9c> days_in_month = _TOD_Days_per_month[ 1 ][ the_tod->month ]; 80042c8: 34 21 00 0d addi r1,r1,13 else days_in_month = _TOD_Days_per_month[ 0 ][ the_tod->month ]; 80042cc: 34 02 00 02 mvi r2,2 80042d0: fb ff f3 f4 calli 80012a0 <__ashlsi3> 80042d4: b5 61 08 00 add r1,r11,r1 80042d8: 28 2c 00 00 lw r12,(r1+0) * false - if the the_tod is invalid * * NOTE: This routine only works for leap-years through 2099. */ bool _TOD_Validate( 80042dc: f1 8d 60 00 cmpgeu r12,r12,r13 if ( the_tod->day > days_in_month ) return false; return true; } 80042e0: b9 80 08 00 mv r1,r12 80042e4: 2b 9d 00 04 lw ra,(sp+4) 80042e8: 2b 8b 00 10 lw r11,(sp+16) 80042ec: 2b 8c 00 0c lw r12,(sp+12) 80042f0: 2b 8d 00 08 lw r13,(sp+8) 80042f4: 37 9c 00 10 addi sp,sp,16 80042f8: c3 a0 00 00 ret =============================================================================== 0800653c <_Thread_Change_priority>: void _Thread_Change_priority( Thread_Control *the_thread, Priority_Control new_priority, bool prepend_it ) { 800653c: 37 9c ff e8 addi sp,sp,-24 8006540: 5b 8b 00 14 sw (sp+20),r11 8006544: 5b 8c 00 10 sw (sp+16),r12 8006548: 5b 8d 00 0c sw (sp+12),r13 800654c: 5b 8e 00 08 sw (sp+8),r14 8006550: 5b 9d 00 04 sw (sp+4),ra */ /* * Save original state */ original_state = the_thread->current_state; 8006554: 28 2e 00 10 lw r14,(r1+16) void _Thread_Change_priority( Thread_Control *the_thread, Priority_Control new_priority, bool prepend_it ) { 8006558: b8 20 58 00 mv r11,r1 /* * 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 ); 800655c: 5b 82 00 18 sw (sp+24),r2 void _Thread_Change_priority( Thread_Control *the_thread, Priority_Control new_priority, bool prepend_it ) { 8006560: 20 6d 00 ff andi r13,r3,0xff /* * 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 ); 8006564: f8 00 03 c1 calli 8007468 <_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 ) 8006568: 29 61 00 14 lw r1,(r11+20) 800656c: 2b 82 00 18 lw r2,(sp+24) 8006570: 44 22 00 03 be r1,r2,800657c <_Thread_Change_priority+0x40> _Thread_Set_priority( the_thread, new_priority ); 8006574: b9 60 08 00 mv r1,r11 8006578: f8 00 03 97 calli 80073d4 <_Thread_Set_priority> _ISR_Disable( level ); 800657c: 90 00 60 00 rcsr r12,IE 8006580: 34 05 ff fe mvi r5,-2 8006584: a1 85 28 00 and r5,r12,r5 8006588: d0 05 00 00 wcsr IE,r5 /* * 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; 800658c: 29 61 00 10 lw r1,(r11+16) if ( state != STATES_TRANSIENT ) { 8006590: 34 02 00 04 mvi r2,4 8006594: 21 c4 00 04 andi r4,r14,0x4 8006598: 44 22 00 0f be r1,r2,80065d4 <_Thread_Change_priority+0x98> /* Only clear the transient state if it wasn't set already */ if ( ! _States_Is_transient( original_state ) ) 800659c: 5c 80 00 04 bne r4,r0,80065ac <_Thread_Change_priority+0x70><== NEVER TAKEN RTEMS_INLINE_ROUTINE States_Control _States_Clear ( States_Control states_to_clear, States_Control current_state ) { return (current_state & ~states_to_clear); 80065a0: 34 02 ff fb mvi r2,-5 80065a4: a0 22 10 00 and r2,r1,r2 the_thread->current_state = _States_Clear( STATES_TRANSIENT, state ); 80065a8: 59 62 00 10 sw (r11+16),r2 _ISR_Enable( level ); 80065ac: d0 0c 00 00 wcsr IE,r12 */ RTEMS_INLINE_ROUTINE bool _States_Is_waiting_on_thread_queue ( States_Control the_states ) { return (the_states & STATES_WAITING_ON_THREAD_QUEUE); 80065b0: 78 03 08 01 mvhi r3,0x801 80065b4: 38 63 80 94 ori r3,r3,0x8094 80065b8: 28 62 00 00 lw r2,(r3+0) 80065bc: a0 22 08 00 and r1,r1,r2 if ( _States_Is_waiting_on_thread_queue( state ) ) { 80065c0: 44 20 00 3d be r1,r0,80066b4 <_Thread_Change_priority+0x178> _Thread_queue_Requeue( the_thread->Wait.queue, the_thread ); 80065c4: 29 61 00 44 lw r1,(r11+68) 80065c8: b9 60 10 00 mv r2,r11 80065cc: f8 00 03 4d calli 8007300 <_Thread_queue_Requeue> 80065d0: e0 00 00 39 bi 80066b4 <_Thread_Change_priority+0x178> } return; } /* Only clear the transient state if it wasn't set already */ if ( ! _States_Is_transient( original_state ) ) { 80065d4: 5c 80 00 28 bne r4,r0,8006674 <_Thread_Change_priority+0x138><== NEVER TAKEN 80065d8: 78 02 08 01 mvhi r2,0x801 * Ready Queue with interrupts off. * * FIXME: hard-coded for priority scheduling. Might be ok since this * function is specific to priority scheduling? */ the_thread->current_state = _States_Clear( STATES_TRANSIENT, state ); 80065dc: 59 60 00 10 sw (r11+16),r0 80065e0: 29 61 00 8c lw r1,(r11+140) 80065e4: 38 42 9e 10 ori r2,r2,0x9e10 if ( prepend_it ) 80065e8: 45 a4 00 12 be r13,r4,8006630 <_Thread_Change_priority+0xf4> RTEMS_INLINE_ROUTINE void _Priority_bit_map_Add ( Priority_bit_map_Information *the_priority_map ) { *the_priority_map->minor |= the_priority_map->ready_minor; 80065ec: 28 23 00 04 lw r3,(r1+4) 80065f0: 2c 24 00 0a lhu r4,(r1+10) 80065f4: 2c 66 00 00 lhu r6,(r3+0) 80065f8: b8 c4 20 00 or r4,r6,r4 80065fc: 0c 64 00 00 sh (r3+0),r4 _Priority_Major_bit_map |= the_priority_map->ready_major; 8006600: 2c 43 00 00 lhu r3,(r2+0) 8006604: 2c 24 00 08 lhu r4,(r1+8) Thread_Control *the_thread ) { _Priority_bit_map_Add( &the_thread->scheduler.priority->Priority_map ); _Chain_Prepend_unprotected( the_thread->scheduler.priority->ready_chain, 8006608: 28 21 00 00 lw r1,(r1+0) 800660c: b8 83 18 00 or r3,r4,r3 8006610: 20 63 ff ff andi r3,r3,0xffff 8006614: 0c 43 00 00 sh (r2+0),r3 ) { Chain_Node *before_node; the_node->previous = after_node; before_node = after_node->next; 8006618: 28 22 00 00 lw r2,(r1+0) Chain_Node *the_node ) { Chain_Node *before_node; the_node->previous = after_node; 800661c: 59 61 00 04 sw (r11+4),r1 before_node = after_node->next; after_node->next = the_node; 8006620: 58 2b 00 00 sw (r1+0),r11 the_node->next = before_node; 8006624: 59 62 00 00 sw (r11+0),r2 before_node->previous = the_node; 8006628: 58 4b 00 04 sw (r2+4),r11 800662c: e0 00 00 12 bi 8006674 <_Thread_Change_priority+0x138> RTEMS_INLINE_ROUTINE void _Priority_bit_map_Add ( Priority_bit_map_Information *the_priority_map ) { *the_priority_map->minor |= the_priority_map->ready_minor; 8006630: 28 23 00 04 lw r3,(r1+4) 8006634: 2c 24 00 0a lhu r4,(r1+10) 8006638: 2c 66 00 00 lhu r6,(r3+0) 800663c: b8 c4 20 00 or r4,r6,r4 8006640: 0c 64 00 00 sh (r3+0),r4 _Priority_Major_bit_map |= the_priority_map->ready_major; 8006644: 2c 24 00 08 lhu r4,(r1+8) 8006648: 2c 43 00 00 lhu r3,(r2+0) Thread_Control *the_thread ) { _Priority_bit_map_Add( &the_thread->scheduler.priority->Priority_map ); _Chain_Append_unprotected( the_thread->scheduler.priority->ready_chain, 800664c: 28 21 00 00 lw r1,(r1+0) 8006650: b8 83 18 00 or r3,r4,r3 8006654: 20 63 ff ff andi r3,r3,0xffff 8006658: 0c 43 00 00 sh (r2+0),r3 Chain_Control *the_chain, Chain_Node *the_node ) { Chain_Node *tail = _Chain_Tail( the_chain ); Chain_Node *old_last = tail->previous; 800665c: 28 22 00 08 lw r2,(r1+8) RTEMS_INLINE_ROUTINE void _Chain_Append_unprotected( Chain_Control *the_chain, Chain_Node *the_node ) { Chain_Node *tail = _Chain_Tail( the_chain ); 8006660: 34 23 00 04 addi r3,r1,4 Chain_Node *old_last = tail->previous; the_node->next = tail; 8006664: 59 63 00 00 sw (r11+0),r3 tail->previous = the_node; 8006668: 58 2b 00 08 sw (r1+8),r11 old_last->next = the_node; 800666c: 58 4b 00 00 sw (r2+0),r11 the_node->previous = old_last; 8006670: 59 62 00 04 sw (r11+4),r2 _Scheduler_priority_Ready_queue_enqueue_first( the_thread ); else _Scheduler_priority_Ready_queue_enqueue( the_thread ); } _ISR_Flash( level ); 8006674: d0 0c 00 00 wcsr IE,r12 8006678: d0 05 00 00 wcsr IE,r5 */ RTEMS_INLINE_ROUTINE void _Scheduler_Schedule( Scheduler_Control *the_scheduler ) { the_scheduler->Operations.schedule( the_scheduler ); 800667c: 78 01 08 01 mvhi r1,0x801 8006680: 38 21 99 a4 ori r1,r1,0x99a4 8006684: 28 22 00 04 lw r2,(r1+4) 8006688: d8 40 00 00 call r2 * is also the heir thread, and false otherwise. */ RTEMS_INLINE_ROUTINE bool _Thread_Is_executing_also_the_heir( void ) { return ( _Thread_Executing == _Thread_Heir ); 800668c: 78 01 08 01 mvhi r1,0x801 8006690: 38 21 9d f0 ori r1,r1,0x9df0 8006694: 28 22 00 0c lw r2,(r1+12) * We altered the set of thread priorities. So let's figure out * who is the heir and if we need to switch to them. */ _Scheduler_Schedule(&_Scheduler); if ( !_Thread_Is_executing_also_the_heir() && 8006698: 28 23 00 10 lw r3,(r1+16) 800669c: 44 43 00 05 be r2,r3,80066b0 <_Thread_Change_priority+0x174> 80066a0: 40 42 00 74 lbu r2,(r2+116) 80066a4: 44 40 00 03 be r2,r0,80066b0 <_Thread_Change_priority+0x174> _Thread_Executing->is_preemptible ) _Thread_Dispatch_necessary = true; 80066a8: 34 02 00 01 mvi r2,1 80066ac: 30 22 00 18 sb (r1+24),r2 _ISR_Enable( level ); 80066b0: d0 0c 00 00 wcsr IE,r12 } 80066b4: 2b 9d 00 04 lw ra,(sp+4) 80066b8: 2b 8b 00 14 lw r11,(sp+20) 80066bc: 2b 8c 00 10 lw r12,(sp+16) 80066c0: 2b 8d 00 0c lw r13,(sp+12) 80066c4: 2b 8e 00 08 lw r14,(sp+8) 80066c8: 37 9c 00 18 addi sp,sp,24 80066cc: c3 a0 00 00 ret =============================================================================== 0800bdd8 <_Thread_Delay_ended>: void _Thread_Delay_ended( Objects_Id id, void *ignored __attribute__((unused)) ) { 800bdd8: 37 9c ff f8 addi sp,sp,-8 800bddc: 5b 9d 00 04 sw (sp+4),ra Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); 800bde0: 37 82 00 08 addi r2,sp,8 800bde4: f8 00 00 7c calli 800bfd4 <_Thread_Get> switch ( location ) { 800bde8: 2b 82 00 08 lw r2,(sp+8) 800bdec: 5c 40 00 0a bne r2,r0,800be14 <_Thread_Delay_ended+0x3c> <== NEVER TAKEN #if defined(RTEMS_MULTIPROCESSING) case OBJECTS_REMOTE: /* impossible */ #endif break; case OBJECTS_LOCAL: _Thread_Clear_state( 800bdf0: 78 03 08 02 mvhi r3,0x802 800bdf4: 38 63 6a cc ori r3,r3,0x6acc 800bdf8: 28 62 00 00 lw r2,(r3+0) 800bdfc: fb ff ff 6d calli 800bbb0 <_Thread_Clear_state> 800be00: 78 01 08 02 mvhi r1,0x802 800be04: 38 21 9a 20 ori r1,r1,0x9a20 800be08: 28 22 00 00 lw r2,(r1+0) 800be0c: 34 42 ff ff addi r2,r2,-1 800be10: 58 22 00 00 sw (r1+0),r2 | STATES_INTERRUPTIBLE_BY_SIGNAL ); _Thread_Unnest_dispatch(); break; } } 800be14: 2b 9d 00 04 lw ra,(sp+4) 800be18: 37 9c 00 08 addi sp,sp,8 800be1c: c3 a0 00 00 ret =============================================================================== 080067b8 <_Thread_Dispatch>: * dispatch thread * no dispatch thread */ void _Thread_Dispatch( void ) { 80067b8: 37 9c ff c0 addi sp,sp,-64 80067bc: 5b 8b 00 30 sw (sp+48),r11 80067c0: 5b 8c 00 2c sw (sp+44),r12 80067c4: 5b 8d 00 28 sw (sp+40),r13 80067c8: 5b 8e 00 24 sw (sp+36),r14 80067cc: 5b 8f 00 20 sw (sp+32),r15 80067d0: 5b 90 00 1c sw (sp+28),r16 80067d4: 5b 91 00 18 sw (sp+24),r17 80067d8: 5b 92 00 14 sw (sp+20),r18 80067dc: 5b 93 00 10 sw (sp+16),r19 80067e0: 5b 94 00 0c sw (sp+12),r20 80067e4: 5b 95 00 08 sw (sp+8),r21 80067e8: 5b 9d 00 04 sw (sp+4),ra Thread_Control *executing; Thread_Control *heir; ISR_Level level; executing = _Thread_Executing; 80067ec: 78 01 08 01 mvhi r1,0x801 80067f0: 38 21 9d f0 ori r1,r1,0x9df0 80067f4: 28 2d 00 0c lw r13,(r1+12) _ISR_Disable( level ); 80067f8: 90 00 20 00 rcsr r4,IE 80067fc: 34 01 ff fe mvi r1,-2 8006800: a0 81 08 00 and r1,r4,r1 8006804: d0 01 00 00 wcsr IE,r1 while ( _Thread_Dispatch_necessary == true ) { 8006808: 78 0c 08 01 mvhi r12,0x801 heir = _Thread_Heir; _Thread_Dispatch_disable_level = 1; 800680c: 78 11 08 01 mvhi r17,0x801 #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; 8006810: 78 0f 08 01 mvhi r15,0x801 #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ { Timestamp_Control uptime, ran; _TOD_Get_uptime( &uptime ); _Timestamp_Subtract( 8006814: 78 0e 08 01 mvhi r14,0x801 #endif /* * Switch libc's task specific data. */ if ( _Thread_libc_reent ) { 8006818: 78 10 08 01 mvhi r16,0x801 Thread_Control *heir; ISR_Level level; executing = _Thread_Executing; _ISR_Disable( level ); while ( _Thread_Dispatch_necessary == true ) { 800681c: 39 8c 9d f0 ori r12,r12,0x9df0 heir = _Thread_Heir; _Thread_Dispatch_disable_level = 1; 8006820: 3a 31 99 20 ori r17,r17,0x9920 8006824: 34 14 00 01 mvi r20,1 #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; 8006828: 39 ef 98 b8 ori r15,r15,0x98b8 _ISR_Enable( level ); #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ { Timestamp_Control uptime, ran; _TOD_Get_uptime( &uptime ); 800682c: 37 93 00 3c addi r19,sp,60 _Timestamp_Subtract( 8006830: 39 ce 99 ec ori r14,r14,0x99ec 8006834: 37 92 00 34 addi r18,sp,52 #endif /* * Switch libc's task specific data. */ if ( _Thread_libc_reent ) { 8006838: 3a 10 99 c4 ori r16,r16,0x99c4 #endif #endif executing = _Thread_Executing; _ISR_Disable( level ); 800683c: 34 15 ff fe mvi r21,-2 Thread_Control *heir; ISR_Level level; executing = _Thread_Executing; _ISR_Disable( level ); while ( _Thread_Dispatch_necessary == true ) { 8006840: e0 00 00 28 bi 80068e0 <_Thread_Dispatch+0x128> heir = _Thread_Heir; 8006844: 29 8b 00 10 lw r11,(r12+16) _Thread_Dispatch_disable_level = 1; 8006848: 5a 34 00 00 sw (r17+0),r20 _Thread_Dispatch_necessary = false; 800684c: 31 80 00 18 sb (r12+24),r0 _Thread_Executing = heir; 8006850: 59 8b 00 0c sw (r12+12),r11 /* * When the heir and executing are the same, then we are being * requested to do the post switch dispatching. This is normally * done to dispatch signals. */ if ( heir == executing ) 8006854: 45 6d 00 26 be r11,r13,80068ec <_Thread_Dispatch+0x134> */ #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 ) 8006858: 29 61 00 7c lw r1,(r11+124) 800685c: 5c 34 00 03 bne r1,r20,8006868 <_Thread_Dispatch+0xb0> heir->cpu_time_budget = _Thread_Ticks_per_timeslice; 8006860: 29 e1 00 00 lw r1,(r15+0) 8006864: 59 61 00 78 sw (r11+120),r1 _ISR_Enable( level ); 8006868: d0 04 00 00 wcsr IE,r4 #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ { Timestamp_Control uptime, ran; _TOD_Get_uptime( &uptime ); 800686c: ba 60 08 00 mv r1,r19 8006870: f8 00 1f 81 calli 800e674 <_TOD_Get_uptime> _Timestamp_Subtract( 8006874: b9 c0 08 00 mv r1,r14 8006878: ba 60 10 00 mv r2,r19 800687c: ba 40 18 00 mv r3,r18 8006880: f8 00 03 8e calli 80076b8 <_Timespec_Subtract> &_Thread_Time_of_last_context_switch, &uptime, &ran ); _Timestamp_Add_to( &executing->cpu_time_used, &ran ); 8006884: 35 a1 00 84 addi r1,r13,132 8006888: ba 40 10 00 mv r2,r18 800688c: f8 00 03 72 calli 8007654 <_Timespec_Add_to> _Thread_Time_of_last_context_switch = uptime; 8006890: 2b 81 00 3c lw r1,(sp+60) #endif /* * Switch libc's task specific data. */ if ( _Thread_libc_reent ) { 8006894: 2a 04 00 00 lw r4,(r16+0) &_Thread_Time_of_last_context_switch, &uptime, &ran ); _Timestamp_Add_to( &executing->cpu_time_used, &ran ); _Thread_Time_of_last_context_switch = uptime; 8006898: 59 c1 00 00 sw (r14+0),r1 800689c: 2b 81 00 40 lw r1,(sp+64) 80068a0: 59 c1 00 04 sw (r14+4),r1 #endif /* * Switch libc's task specific data. */ if ( _Thread_libc_reent ) { 80068a4: 44 80 00 05 be r4,r0,80068b8 <_Thread_Dispatch+0x100> <== NEVER TAKEN executing->libc_reent = *_Thread_libc_reent; 80068a8: 28 81 00 00 lw r1,(r4+0) 80068ac: 59 a1 01 18 sw (r13+280),r1 *_Thread_libc_reent = heir->libc_reent; 80068b0: 29 61 01 18 lw r1,(r11+280) 80068b4: 58 81 00 00 sw (r4+0),r1 } _User_extensions_Thread_switch( executing, heir ); 80068b8: b9 a0 08 00 mv r1,r13 80068bc: b9 60 10 00 mv r2,r11 80068c0: f8 00 04 5d calli 8007a34 <_User_extensions_Thread_switch> if ( executing->fp_context != NULL ) _Context_Save_fp( &executing->fp_context ); #endif #endif _Context_Switch( &executing->Registers, &heir->Registers ); 80068c4: 35 a1 00 c4 addi r1,r13,196 80068c8: 35 62 00 c4 addi r2,r11,196 80068cc: f8 00 05 3b calli 8007db8 <_CPU_Context_switch> if ( executing->fp_context != NULL ) _Context_Restore_fp( &executing->fp_context ); #endif #endif executing = _Thread_Executing; 80068d0: 29 8d 00 0c lw r13,(r12+12) _ISR_Disable( level ); 80068d4: 90 00 20 00 rcsr r4,IE 80068d8: a0 95 08 00 and r1,r4,r21 80068dc: d0 01 00 00 wcsr IE,r1 Thread_Control *heir; ISR_Level level; executing = _Thread_Executing; _ISR_Disable( level ); while ( _Thread_Dispatch_necessary == true ) { 80068e0: 41 81 00 18 lbu r1,(r12+24) 80068e4: 20 21 00 ff andi r1,r1,0xff 80068e8: 5c 20 ff d7 bne r1,r0,8006844 <_Thread_Dispatch+0x8c> _ISR_Disable( level ); } post_switch: _Thread_Dispatch_disable_level = 0; 80068ec: 78 01 08 01 mvhi r1,0x801 80068f0: 38 21 99 20 ori r1,r1,0x9920 80068f4: 58 20 00 00 sw (r1+0),r0 _ISR_Enable( level ); 80068f8: d0 04 00 00 wcsr IE,r4 _API_extensions_Run_postswitch(); 80068fc: fb ff f8 3d calli 80049f0 <_API_extensions_Run_postswitch> } 8006900: 2b 9d 00 04 lw ra,(sp+4) 8006904: 2b 8b 00 30 lw r11,(sp+48) 8006908: 2b 8c 00 2c lw r12,(sp+44) 800690c: 2b 8d 00 28 lw r13,(sp+40) 8006910: 2b 8e 00 24 lw r14,(sp+36) 8006914: 2b 8f 00 20 lw r15,(sp+32) 8006918: 2b 90 00 1c lw r16,(sp+28) 800691c: 2b 91 00 18 lw r17,(sp+24) 8006920: 2b 92 00 14 lw r18,(sp+20) 8006924: 2b 93 00 10 lw r19,(sp+16) 8006928: 2b 94 00 0c lw r20,(sp+12) 800692c: 2b 95 00 08 lw r21,(sp+8) 8006930: 37 9c 00 40 addi sp,sp,64 8006934: c3 a0 00 00 ret =============================================================================== 080111ec <_Thread_Handler>: * * Output parameters: NONE */ void _Thread_Handler( void ) { 80111ec: 37 9c ff f4 addi sp,sp,-12 80111f0: 5b 8b 00 0c sw (sp+12),r11 80111f4: 5b 8c 00 08 sw (sp+8),r12 80111f8: 5b 9d 00 04 sw (sp+4),ra #if defined(EXECUTE_GLOBAL_CONSTRUCTORS) static char doneConstructors; char doneCons; #endif executing = _Thread_Executing; 80111fc: 78 01 08 01 mvhi r1,0x801 8011200: 38 21 9d f0 ori r1,r1,0x9df0 8011204: 28 2b 00 0c lw r11,(r1+12) /* * have to put level into a register for those cpu's that use * inline asm here */ level = executing->Start.isr_level; 8011208: 29 61 00 ac lw r1,(r11+172) _ISR_Set_level(level); 801120c: 64 21 00 00 cmpei r1,r1,0 8011210: d0 01 00 00 wcsr IE,r1 #if defined(EXECUTE_GLOBAL_CONSTRUCTORS) doneCons = doneConstructors; 8011214: 78 01 08 01 mvhi r1,0x801 8011218: 38 21 97 7c ori r1,r1,0x977c 801121c: 40 2c 00 00 lbu r12,(r1+0) doneConstructors = 1; 8011220: 34 02 00 01 mvi r2,1 8011224: 30 22 00 00 sb (r1+0),r2 /* * 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 ); 8011228: b9 60 08 00 mv r1,r11 801122c: fb ff d9 76 calli 8007804 <_User_extensions_Thread_begin> /* * At this point, the dispatch disable level BETTER be 1. */ _Thread_Enable_dispatch(); 8011230: fb ff d5 c2 calli 8006938 <_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) */ { 8011234: 5d 80 00 02 bne r12,r0,801123c <_Thread_Handler+0x50> INIT_NAME (); 8011238: fb ff bb 72 calli 8000000 } #endif if ( executing->Start.prototype == THREAD_START_NUMERIC ) { 801123c: 29 61 00 94 lw r1,(r11+148) 8011240: 5c 20 00 04 bne r1,r0,8011250 <_Thread_Handler+0x64> executing->Wait.return_argument = (*(Thread_Entry_numeric) executing->Start.entry_point)( 8011244: 29 62 00 90 lw r2,(r11+144) 8011248: 29 61 00 9c lw r1,(r11+156) 801124c: e0 00 00 05 bi 8011260 <_Thread_Handler+0x74> executing->Start.numeric_argument ); } #if defined(RTEMS_POSIX_API) else if ( executing->Start.prototype == THREAD_START_POINTER ) { 8011250: 34 02 00 01 mvi r2,1 8011254: 5c 22 00 05 bne r1,r2,8011268 <_Thread_Handler+0x7c> <== NEVER TAKEN executing->Wait.return_argument = (*(Thread_Entry_pointer) executing->Start.entry_point)( 8011258: 29 62 00 90 lw r2,(r11+144) 801125c: 29 61 00 98 lw r1,(r11+152) 8011260: d8 40 00 00 call r2 executing->Start.numeric_argument ); } #if defined(RTEMS_POSIX_API) else if ( executing->Start.prototype == THREAD_START_POINTER ) { executing->Wait.return_argument = 8011264: 59 61 00 28 sw (r11+40),r1 * 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 ); 8011268: b9 60 08 00 mv r1,r11 801126c: fb ff d9 7e calli 8007864 <_User_extensions_Thread_exitted> _Internal_error_Occurred( 8011270: 34 01 00 00 mvi r1,0 8011274: 34 02 00 01 mvi r2,1 8011278: 34 03 00 05 mvi r3,5 801127c: fb ff d0 c9 calli 80055a0 <_Internal_error_Occurred> =============================================================================== 0800a31c <_Thread_Resume>: void _Thread_Resume( Thread_Control *the_thread, bool force ) { 800a31c: 37 9c ff f8 addi sp,sp,-8 800a320: 5b 8b 00 08 sw (sp+8),r11 800a324: 5b 9d 00 04 sw (sp+4),ra 800a328: b8 20 10 00 mv r2,r1 ISR_Level level; States_Control current_state; _ISR_Disable( level ); 800a32c: 90 00 58 00 rcsr r11,IE 800a330: 34 01 ff fe mvi r1,-2 800a334: a1 61 08 00 and r1,r11,r1 800a338: d0 01 00 00 wcsr IE,r1 current_state = the_thread->current_state; 800a33c: 28 41 00 10 lw r1,(r2+16) if ( current_state & STATES_SUSPENDED ) { 800a340: 20 23 00 02 andi r3,r1,0x2 800a344: 44 60 00 09 be r3,r0,800a368 <_Thread_Resume+0x4c> <== NEVER TAKEN RTEMS_INLINE_ROUTINE States_Control _States_Clear ( States_Control states_to_clear, States_Control current_state ) { return (current_state & ~states_to_clear); 800a348: 34 03 ff fd mvi r3,-3 800a34c: a0 23 08 00 and r1,r1,r3 current_state = the_thread->current_state = _States_Clear(STATES_SUSPENDED, current_state); 800a350: 58 41 00 10 sw (r2+16),r1 if ( _States_Is_ready( current_state ) ) { 800a354: 5c 20 00 05 bne r1,r0,800a368 <_Thread_Resume+0x4c> RTEMS_INLINE_ROUTINE void _Scheduler_Unblock( Scheduler_Control *the_scheduler, Thread_Control *the_thread ) { the_scheduler->Operations.unblock( the_scheduler, the_thread ); 800a358: 78 01 08 01 mvhi r1,0x801 800a35c: 38 21 99 f4 ori r1,r1,0x99f4 800a360: 28 23 00 10 lw r3,(r1+16) 800a364: d8 60 00 00 call r3 _Scheduler_Unblock( &_Scheduler, the_thread ); } } _ISR_Enable( level ); 800a368: d0 0b 00 00 wcsr IE,r11 } 800a36c: 2b 9d 00 04 lw ra,(sp+4) 800a370: 2b 8b 00 08 lw r11,(sp+8) 800a374: 37 9c 00 08 addi sp,sp,8 800a378: c3 a0 00 00 ret =============================================================================== 0800bcd4 <_Thread_Tickle_timeslice>: * * Output parameters: NONE */ void _Thread_Tickle_timeslice( void ) { 800bcd4: 37 9c ff f8 addi sp,sp,-8 800bcd8: 5b 8b 00 08 sw (sp+8),r11 800bcdc: 5b 9d 00 04 sw (sp+4),ra Thread_Control *executing; executing = _Thread_Executing; 800bce0: 78 01 08 01 mvhi r1,0x801 800bce4: 38 21 ae b0 ori r1,r1,0xaeb0 800bce8: 28 2b 00 0c lw r11,(r1+12) /* * If the thread is not preemptible or is not ready, then * just return. */ if ( !executing->is_preemptible ) 800bcec: 41 61 00 74 lbu r1,(r11+116) 800bcf0: 44 20 00 1e be r1,r0,800bd68 <_Thread_Tickle_timeslice+0x94> return; if ( !_States_Is_ready( executing->current_state ) ) 800bcf4: 29 61 00 10 lw r1,(r11+16) 800bcf8: 5c 20 00 1c bne r1,r0,800bd68 <_Thread_Tickle_timeslice+0x94> /* * The cpu budget algorithm determines what happens next. */ switch ( executing->budget_algorithm ) { 800bcfc: 29 61 00 7c lw r1,(r11+124) 800bd00: 44 20 00 1a be r1,r0,800bd68 <_Thread_Tickle_timeslice+0x94> 800bd04: 34 02 00 02 mvi r2,2 800bd08: 50 41 00 04 bgeu r2,r1,800bd18 <_Thread_Tickle_timeslice+0x44> 800bd0c: 34 02 00 03 mvi r2,3 800bd10: 5c 22 00 16 bne r1,r2,800bd68 <_Thread_Tickle_timeslice+0x94><== NEVER TAKEN 800bd14: e0 00 00 0e bi 800bd4c <_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 ) { 800bd18: 29 61 00 78 lw r1,(r11+120) 800bd1c: 34 21 ff ff addi r1,r1,-1 800bd20: 59 61 00 78 sw (r11+120),r1 800bd24: 48 20 00 11 bg r1,r0,800bd68 <_Thread_Tickle_timeslice+0x94> * always operates on the scheduler that 'owns' the currently executing * thread. */ RTEMS_INLINE_ROUTINE void _Scheduler_Yield( void ) { _Scheduler.Operations.yield( &_Scheduler ); 800bd28: 78 01 08 01 mvhi r1,0x801 800bd2c: 38 21 aa 64 ori r1,r1,0xaa64 800bd30: 28 22 00 08 lw r2,(r1+8) 800bd34: d8 40 00 00 call r2 * executing thread's timeslice is reset. Otherwise, the * currently executing thread is placed at the rear of the * FIFO for this priority and a new heir is selected. */ _Scheduler_Yield( ); executing->cpu_time_budget = _Thread_Ticks_per_timeslice; 800bd38: 78 01 08 01 mvhi r1,0x801 800bd3c: 38 21 a9 78 ori r1,r1,0xa978 800bd40: 28 21 00 00 lw r1,(r1+0) 800bd44: 59 61 00 78 sw (r11+120),r1 800bd48: e0 00 00 08 bi 800bd68 <_Thread_Tickle_timeslice+0x94> } break; #if defined(RTEMS_SCORE_THREAD_ENABLE_SCHEDULER_CALLOUT) case THREAD_CPU_BUDGET_ALGORITHM_CALLOUT: if ( --executing->cpu_time_budget == 0 ) 800bd4c: 29 61 00 78 lw r1,(r11+120) 800bd50: 34 21 ff ff addi r1,r1,-1 800bd54: 59 61 00 78 sw (r11+120),r1 800bd58: 5c 20 00 04 bne r1,r0,800bd68 <_Thread_Tickle_timeslice+0x94> (*executing->budget_callout)( executing ); 800bd5c: 29 62 00 80 lw r2,(r11+128) 800bd60: b9 60 08 00 mv r1,r11 800bd64: d8 40 00 00 call r2 break; #endif } } 800bd68: 2b 9d 00 04 lw ra,(sp+4) 800bd6c: 2b 8b 00 08 lw r11,(sp+8) 800bd70: 37 9c 00 08 addi sp,sp,8 800bd74: c3 a0 00 00 ret =============================================================================== 08006fb0 <_Thread_queue_Enqueue_priority>: Thread_blocking_operation_States _Thread_queue_Enqueue_priority ( Thread_queue_Control *the_thread_queue, Thread_Control *the_thread, ISR_Level *level_p ) { 8006fb0: 37 9c ff cc addi sp,sp,-52 8006fb4: 5b 8b 00 34 sw (sp+52),r11 8006fb8: 5b 8c 00 30 sw (sp+48),r12 8006fbc: 5b 8d 00 2c sw (sp+44),r13 8006fc0: 5b 8e 00 28 sw (sp+40),r14 8006fc4: 5b 8f 00 24 sw (sp+36),r15 8006fc8: 5b 90 00 20 sw (sp+32),r16 8006fcc: 5b 91 00 1c sw (sp+28),r17 8006fd0: 5b 92 00 18 sw (sp+24),r18 8006fd4: 5b 93 00 14 sw (sp+20),r19 8006fd8: 5b 94 00 10 sw (sp+16),r20 8006fdc: 5b 95 00 0c sw (sp+12),r21 8006fe0: 5b 96 00 08 sw (sp+8),r22 8006fe4: 5b 9d 00 04 sw (sp+4),ra Priority_Control priority; States_Control block_state; _Chain_Initialize_empty( &the_thread->Wait.Block2n ); priority = the_thread->current_priority; 8006fe8: 28 50 00 14 lw r16,(r2+20) Thread_blocking_operation_States _Thread_queue_Enqueue_priority ( Thread_queue_Control *the_thread_queue, Thread_Control *the_thread, ISR_Level *level_p ) { 8006fec: b8 20 68 00 mv r13,r1 RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); 8006ff0: 34 41 00 3c addi r1,r2,60 head->next = tail; 8006ff4: 58 41 00 38 sw (r2+56),r1 */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); 8006ff8: 34 41 00 38 addi r1,r2,56 Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; head->previous = NULL; tail->previous = head; 8006ffc: 58 41 00 40 sw (r2+64),r1 { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; head->previous = NULL; 8007000: 58 40 00 3c sw (r2+60),r0 8007004: b8 40 60 00 mv r12,r2 RTEMS_INLINE_ROUTINE uint32_t _Thread_queue_Header_number ( Priority_Control the_priority ) { return (the_priority / TASK_QUEUE_DATA_PRIORITIES_PER_HEADER); 8007008: ba 00 08 00 mv r1,r16 800700c: 34 02 00 06 mvi r2,6 8007010: b8 60 a8 00 mv r21,r3 8007014: f8 00 3f d2 calli 8016f5c <__lshrsi3> 8007018: b8 20 70 00 mv r14,r1 the_thread->Wait.queue = the_thread_queue; _ISR_Enable( level ); return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; restart_reverse_search: search_priority = PRIORITY_MAXIMUM + 1; 800701c: 78 12 08 01 mvhi r18,0x801 RTEMS_INLINE_ROUTINE bool _Thread_queue_Is_reverse_search ( Priority_Control the_priority ) { return ( the_priority & TASK_QUEUE_DATA_REVERSE_SEARCH_MASK ); 8007020: 22 01 00 20 andi r1,r16,0x20 _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; 8007024: 29 b3 00 38 lw r19,(r13+56) the_thread->Wait.queue = the_thread_queue; _ISR_Enable( level ); return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; restart_reverse_search: search_priority = PRIORITY_MAXIMUM + 1; 8007028: 3a 52 90 a8 ori r18,r18,0x90a8 _ISR_Disable( level ); 800702c: 34 16 ff fe mvi r22,-2 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 ) ) 8007030: 5c 20 00 30 bne r1,r0,80070f0 <_Thread_queue_Enqueue_priority+0x140> goto restart_reverse_search; restart_forward_search: search_priority = PRIORITY_MINIMUM - 1; _ISR_Disable( level ); 8007034: 34 14 ff fe mvi r20,-2 8007038: 90 00 78 00 rcsr r15,IE 800703c: a1 f4 90 00 and r18,r15,r20 8007040: d0 12 00 00 wcsr IE,r18 * * WARNING! Returning with interrupts disabled! */ *level_p = level; return the_thread_queue->sync_state; } 8007044: 34 02 00 01 mvi r2,1 8007048: b9 c0 08 00 mv r1,r14 800704c: f8 00 3f 76 calli 8016e24 <__ashlsi3> 8007050: b4 2e 08 00 add r1,r1,r14 8007054: 34 02 00 02 mvi r2,2 8007058: f8 00 3f 73 calli 8016e24 <__ashlsi3> 800705c: b5 a1 08 00 add r1,r13,r1 goto restart_reverse_search; restart_forward_search: search_priority = PRIORITY_MINIMUM - 1; _ISR_Disable( level ); search_thread = (Thread_Control *) _Chain_First( header ); 8007060: 28 2b 00 00 lw r11,(r1+0) if ( _Thread_queue_Is_reverse_search( priority ) ) goto restart_reverse_search; restart_forward_search: search_priority = PRIORITY_MINIMUM - 1; 8007064: 34 11 ff ff mvi r17,-1 _ISR_Disable( level ); search_thread = (Thread_Control *) _Chain_First( header ); while ( !_Chain_Is_tail( header, (Chain_Node *)search_thread ) ) { 8007068: e0 00 00 0b bi 8007094 <_Thread_queue_Enqueue_priority+0xe4> search_priority = search_thread->current_priority; 800706c: 29 71 00 14 lw r17,(r11+20) if ( priority <= search_priority ) 8007070: 52 30 00 12 bgeu r17,r16,80070b8 <_Thread_queue_Enqueue_priority+0x108> break; search_priority = search_thread->current_priority; if ( priority <= search_priority ) break; #endif _ISR_Flash( level ); 8007074: d0 0f 00 00 wcsr IE,r15 8007078: d0 12 00 00 wcsr IE,r18 RTEMS_INLINE_ROUTINE bool _States_Are_set ( States_Control the_states, States_Control mask ) { return ( (the_states & mask) != STATES_READY); 800707c: 29 61 00 10 lw r1,(r11+16) 8007080: a2 61 08 00 and r1,r19,r1 if ( !_States_Are_set( search_thread->current_state, block_state) ) { 8007084: 5c 20 00 03 bne r1,r0,8007090 <_Thread_queue_Enqueue_priority+0xe0><== ALWAYS TAKEN _ISR_Enable( level ); 8007088: d0 0f 00 00 wcsr IE,r15 <== NOT EXECUTED goto restart_forward_search; 800708c: e3 ff ff eb bi 8007038 <_Thread_queue_Enqueue_priority+0x88><== NOT EXECUTED } search_thread = (Thread_Control *)search_thread->Object.Node.next; 8007090: 29 6b 00 00 lw r11,(r11+0) RTEMS_INLINE_ROUTINE bool _Chain_Is_tail( Chain_Control *the_chain, const Chain_Node *the_node ) { return (the_node == _Chain_Tail(the_chain)); 8007094: 34 02 00 01 mvi r2,1 8007098: b9 c0 08 00 mv r1,r14 800709c: f8 00 3f 62 calli 8016e24 <__ashlsi3> 80070a0: b4 2e 08 00 add r1,r1,r14 80070a4: 34 02 00 02 mvi r2,2 80070a8: f8 00 3f 5f calli 8016e24 <__ashlsi3> 80070ac: b5 a1 08 00 add r1,r13,r1 80070b0: 34 21 00 04 addi r1,r1,4 restart_forward_search: search_priority = PRIORITY_MINIMUM - 1; _ISR_Disable( level ); search_thread = (Thread_Control *) _Chain_First( header ); while ( !_Chain_Is_tail( header, (Chain_Node *)search_thread ) ) { 80070b4: 5d 61 ff ee bne r11,r1,800706c <_Thread_queue_Enqueue_priority+0xbc> } search_thread = (Thread_Control *)search_thread->Object.Node.next; } if ( the_thread_queue->sync_state != 80070b8: 29 a3 00 30 lw r3,(r13+48) 80070bc: 34 02 00 01 mvi r2,1 80070c0: b9 e0 08 00 mv r1,r15 80070c4: 5c 62 00 43 bne r3,r2,80071d0 <_Thread_queue_Enqueue_priority+0x220><== NEVER TAKEN THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) goto synchronize; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; 80070c8: 59 a0 00 30 sw (r13+48),r0 if ( priority == search_priority ) 80070cc: 46 11 00 38 be r16,r17,80071ac <_Thread_queue_Enqueue_priority+0x1fc> goto equal_priority; search_node = (Chain_Node *) search_thread; previous_node = search_node->previous; 80070d0: 29 61 00 04 lw r1,(r11+4) the_node = (Chain_Node *) the_thread; the_node->next = search_node; 80070d4: 59 8b 00 00 sw (r12+0),r11 the_node->previous = previous_node; 80070d8: 59 81 00 04 sw (r12+4),r1 previous_node->next = the_node; 80070dc: 58 2c 00 00 sw (r1+0),r12 search_node->previous = the_node; 80070e0: 59 6c 00 04 sw (r11+4),r12 the_thread->Wait.queue = the_thread_queue; 80070e4: 59 8d 00 44 sw (r12+68),r13 _ISR_Enable( level ); 80070e8: d0 0f 00 00 wcsr IE,r15 80070ec: e0 00 00 2e bi 80071a4 <_Thread_queue_Enqueue_priority+0x1f4> return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; restart_reverse_search: search_priority = PRIORITY_MAXIMUM + 1; 80070f0: 42 51 00 00 lbu r17,(r18+0) 80070f4: 36 31 00 01 addi r17,r17,1 _ISR_Disable( level ); 80070f8: 90 00 78 00 rcsr r15,IE 80070fc: a1 f6 a0 00 and r20,r15,r22 8007100: d0 14 00 00 wcsr IE,r20 * * WARNING! Returning with interrupts disabled! */ *level_p = level; return the_thread_queue->sync_state; } 8007104: 34 02 00 01 mvi r2,1 8007108: b9 c0 08 00 mv r1,r14 800710c: f8 00 3f 46 calli 8016e24 <__ashlsi3> 8007110: b4 2e 08 00 add r1,r1,r14 8007114: 34 02 00 02 mvi r2,2 8007118: f8 00 3f 43 calli 8016e24 <__ashlsi3> 800711c: b5 a1 08 00 add r1,r13,r1 restart_reverse_search: search_priority = PRIORITY_MAXIMUM + 1; _ISR_Disable( level ); search_thread = (Thread_Control *) _Chain_Last( header ); 8007120: 28 2b 00 08 lw r11,(r1+8) while ( !_Chain_Is_head( header, (Chain_Node *)search_thread ) ) { 8007124: e0 00 00 0b bi 8007150 <_Thread_queue_Enqueue_priority+0x1a0> search_priority = search_thread->current_priority; 8007128: 29 71 00 14 lw r17,(r11+20) if ( priority >= search_priority ) 800712c: 52 11 00 11 bgeu r16,r17,8007170 <_Thread_queue_Enqueue_priority+0x1c0> break; search_priority = search_thread->current_priority; if ( priority >= search_priority ) break; #endif _ISR_Flash( level ); 8007130: d0 0f 00 00 wcsr IE,r15 8007134: d0 14 00 00 wcsr IE,r20 8007138: 29 61 00 10 lw r1,(r11+16) 800713c: a2 61 08 00 and r1,r19,r1 if ( !_States_Are_set( search_thread->current_state, block_state) ) { 8007140: 5c 20 00 03 bne r1,r0,800714c <_Thread_queue_Enqueue_priority+0x19c><== ALWAYS TAKEN _ISR_Enable( level ); 8007144: d0 0f 00 00 wcsr IE,r15 <== NOT EXECUTED goto restart_reverse_search; 8007148: e3 ff ff ea bi 80070f0 <_Thread_queue_Enqueue_priority+0x140><== NOT EXECUTED } search_thread = (Thread_Control *) search_thread->Object.Node.previous; 800714c: 29 6b 00 04 lw r11,(r11+4) RTEMS_INLINE_ROUTINE bool _Chain_Is_head( Chain_Control *the_chain, const Chain_Node *the_node ) { return (the_node == _Chain_Head(the_chain)); 8007150: 34 02 00 01 mvi r2,1 8007154: b9 c0 08 00 mv r1,r14 8007158: f8 00 3f 33 calli 8016e24 <__ashlsi3> 800715c: b4 2e 08 00 add r1,r1,r14 8007160: 34 02 00 02 mvi r2,2 8007164: f8 00 3f 30 calli 8016e24 <__ashlsi3> 8007168: b5 a1 08 00 add r1,r13,r1 restart_reverse_search: search_priority = PRIORITY_MAXIMUM + 1; _ISR_Disable( level ); search_thread = (Thread_Control *) _Chain_Last( header ); while ( !_Chain_Is_head( header, (Chain_Node *)search_thread ) ) { 800716c: 5d 61 ff ef bne r11,r1,8007128 <_Thread_queue_Enqueue_priority+0x178> } search_thread = (Thread_Control *) search_thread->Object.Node.previous; } if ( the_thread_queue->sync_state != 8007170: 29 a3 00 30 lw r3,(r13+48) 8007174: 34 02 00 01 mvi r2,1 8007178: b9 e0 08 00 mv r1,r15 800717c: 5c 62 00 15 bne r3,r2,80071d0 <_Thread_queue_Enqueue_priority+0x220><== NEVER TAKEN THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) goto synchronize; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; 8007180: 59 a0 00 30 sw (r13+48),r0 if ( priority == search_priority ) 8007184: 46 11 00 0a be r16,r17,80071ac <_Thread_queue_Enqueue_priority+0x1fc> goto equal_priority; search_node = (Chain_Node *) search_thread; next_node = search_node->next; 8007188: 29 61 00 00 lw r1,(r11+0) the_node = (Chain_Node *) the_thread; the_node->next = next_node; the_node->previous = search_node; 800718c: 59 8b 00 04 sw (r12+4),r11 search_node = (Chain_Node *) search_thread; next_node = search_node->next; the_node = (Chain_Node *) the_thread; the_node->next = next_node; 8007190: 59 81 00 00 sw (r12+0),r1 the_node->previous = search_node; search_node->next = the_node; 8007194: 59 6c 00 00 sw (r11+0),r12 next_node->previous = the_node; 8007198: 58 2c 00 04 sw (r1+4),r12 the_thread->Wait.queue = the_thread_queue; 800719c: 59 8d 00 44 sw (r12+68),r13 _ISR_Enable( level ); 80071a0: d0 0f 00 00 wcsr IE,r15 return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; 80071a4: 34 01 00 01 mvi r1,1 80071a8: e0 00 00 0c bi 80071d8 <_Thread_queue_Enqueue_priority+0x228> equal_priority: /* add at end of priority group */ search_node = _Chain_Tail( &search_thread->Wait.Block2n ); previous_node = search_node->previous; 80071ac: 29 61 00 40 lw r1,(r11+64) the_thread->Wait.queue = the_thread_queue; _ISR_Enable( level ); return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; equal_priority: /* add at end of priority group */ search_node = _Chain_Tail( &search_thread->Wait.Block2n ); 80071b0: 35 62 00 3c addi r2,r11,60 previous_node = search_node->previous; the_node = (Chain_Node *) the_thread; the_node->next = search_node; 80071b4: 59 82 00 00 sw (r12+0),r2 the_node->previous = previous_node; 80071b8: 59 81 00 04 sw (r12+4),r1 previous_node->next = the_node; 80071bc: 58 2c 00 00 sw (r1+0),r12 search_node->previous = the_node; 80071c0: 59 6c 00 40 sw (r11+64),r12 the_thread->Wait.queue = the_thread_queue; 80071c4: 59 8d 00 44 sw (r12+68),r13 _ISR_Enable( level ); 80071c8: d0 0f 00 00 wcsr IE,r15 80071cc: e3 ff ff f6 bi 80071a4 <_Thread_queue_Enqueue_priority+0x1f4> * 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; 80071d0: 5a a1 00 00 sw (r21+0),r1 <== NOT EXECUTED return the_thread_queue->sync_state; 80071d4: 29 a1 00 30 lw r1,(r13+48) <== NOT EXECUTED } 80071d8: 2b 9d 00 04 lw ra,(sp+4) 80071dc: 2b 8b 00 34 lw r11,(sp+52) 80071e0: 2b 8c 00 30 lw r12,(sp+48) 80071e4: 2b 8d 00 2c lw r13,(sp+44) 80071e8: 2b 8e 00 28 lw r14,(sp+40) 80071ec: 2b 8f 00 24 lw r15,(sp+36) 80071f0: 2b 90 00 20 lw r16,(sp+32) 80071f4: 2b 91 00 1c lw r17,(sp+28) 80071f8: 2b 92 00 18 lw r18,(sp+24) 80071fc: 2b 93 00 14 lw r19,(sp+20) 8007200: 2b 94 00 10 lw r20,(sp+16) 8007204: 2b 95 00 0c lw r21,(sp+12) 8007208: 2b 96 00 08 lw r22,(sp+8) 800720c: 37 9c 00 34 addi sp,sp,52 8007210: c3 a0 00 00 ret =============================================================================== 0800f3d0 <_Thread_queue_Process_timeout>: #include void _Thread_queue_Process_timeout( Thread_Control *the_thread ) { 800f3d0: 37 9c ff fc addi sp,sp,-4 800f3d4: 5b 9d 00 04 sw (sp+4),ra 800f3d8: b8 20 10 00 mv r2,r1 Thread_queue_Control *the_thread_queue = the_thread->Wait.queue; 800f3dc: 28 21 00 44 lw r1,(r1+68) * If it is not satisfied, then it is "nothing happened" and * this is the "timeout" transition. After a request is satisfied, * a timeout is not allowed to occur. */ if ( the_thread_queue->sync_state != THREAD_BLOCKING_OPERATION_SYNCHRONIZED && 800f3e0: 28 24 00 30 lw r4,(r1+48) 800f3e4: 44 80 00 0c be r4,r0,800f414 <_Thread_queue_Process_timeout+0x44> RTEMS_INLINE_ROUTINE bool _Thread_Is_executing ( const Thread_Control *the_thread ) { return ( the_thread == _Thread_Executing ); 800f3e8: 78 03 08 01 mvhi r3,0x801 800f3ec: 38 63 9d f0 ori r3,r3,0x9df0 800f3f0: 28 63 00 0c lw r3,(r3+12) 800f3f4: 5c 43 00 08 bne r2,r3,800f414 <_Thread_queue_Process_timeout+0x44><== NEVER TAKEN _Thread_Is_executing( the_thread ) ) { if ( the_thread_queue->sync_state != THREAD_BLOCKING_OPERATION_SATISFIED ) { 800f3f8: 34 03 00 03 mvi r3,3 800f3fc: 44 83 00 09 be r4,r3,800f420 <_Thread_queue_Process_timeout+0x50><== ALWAYS TAKEN the_thread->Wait.return_code = the_thread->Wait.queue->timeout_status; 800f400: 28 23 00 3c lw r3,(r1+60) <== NOT EXECUTED 800f404: 58 43 00 34 sw (r2+52),r3 <== NOT EXECUTED the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT; 800f408: 34 02 00 02 mvi r2,2 <== NOT EXECUTED 800f40c: 58 22 00 30 sw (r1+48),r2 <== NOT EXECUTED 800f410: e0 00 00 04 bi 800f420 <_Thread_queue_Process_timeout+0x50><== NOT EXECUTED } } else { the_thread->Wait.return_code = the_thread->Wait.queue->timeout_status; 800f414: 28 23 00 3c lw r3,(r1+60) 800f418: 58 43 00 34 sw (r2+52),r3 _Thread_queue_Extract( the_thread->Wait.queue, the_thread ); 800f41c: f8 00 07 99 calli 8011280 <_Thread_queue_Extract> } } 800f420: 2b 9d 00 04 lw ra,(sp+4) 800f424: 37 9c 00 04 addi sp,sp,4 800f428: c3 a0 00 00 ret =============================================================================== 08007300 <_Thread_queue_Requeue>: void _Thread_queue_Requeue( Thread_queue_Control *the_thread_queue, Thread_Control *the_thread ) { 8007300: 37 9c ff ec addi sp,sp,-20 8007304: 5b 8b 00 10 sw (sp+16),r11 8007308: 5b 8c 00 0c sw (sp+12),r12 800730c: 5b 8d 00 08 sw (sp+8),r13 8007310: 5b 9d 00 04 sw (sp+4),ra 8007314: b8 20 58 00 mv r11,r1 8007318: b8 40 60 00 mv r12,r2 /* * Just in case the thread really wasn't blocked on a thread queue * when we get here. */ if ( !the_thread_queue ) 800731c: 44 20 00 19 be r1,r0,8007380 <_Thread_queue_Requeue+0x80> <== 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 ) { 8007320: 28 22 00 34 lw r2,(r1+52) 8007324: 34 01 00 01 mvi r1,1 8007328: 5c 41 00 16 bne r2,r1,8007380 <_Thread_queue_Requeue+0x80> <== NEVER TAKEN Thread_queue_Control *tq = the_thread_queue; ISR_Level level; ISR_Level level_ignored; _ISR_Disable( level ); 800732c: 90 00 68 00 rcsr r13,IE 8007330: 34 01 ff fe mvi r1,-2 8007334: a1 a1 08 00 and r1,r13,r1 8007338: d0 01 00 00 wcsr IE,r1 */ RTEMS_INLINE_ROUTINE bool _States_Is_waiting_on_thread_queue ( States_Control the_states ) { return (the_states & STATES_WAITING_ON_THREAD_QUEUE); 800733c: 78 03 08 01 mvhi r3,0x801 8007340: 38 63 80 94 ori r3,r3,0x8094 8007344: 29 82 00 10 lw r2,(r12+16) 8007348: 28 61 00 00 lw r1,(r3+0) 800734c: a0 41 08 00 and r1,r2,r1 if ( _States_Is_waiting_on_thread_queue( the_thread->current_state ) ) { 8007350: 44 20 00 0b be r1,r0,800737c <_Thread_queue_Requeue+0x7c> <== NEVER TAKEN 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; 8007354: 34 01 00 01 mvi r1,1 8007358: 59 61 00 30 sw (r11+48),r1 _Thread_queue_Enter_critical_section( tq ); _Thread_queue_Extract_priority_helper( tq, the_thread, true ); 800735c: b9 80 10 00 mv r2,r12 8007360: b9 60 08 00 mv r1,r11 8007364: 34 03 00 01 mvi r3,1 8007368: f8 00 1f cc calli 800f298 <_Thread_queue_Extract_priority_helper> (void) _Thread_queue_Enqueue_priority( tq, the_thread, &level_ignored ); 800736c: b9 60 08 00 mv r1,r11 8007370: b9 80 10 00 mv r2,r12 8007374: 37 83 00 14 addi r3,sp,20 8007378: fb ff ff 0e calli 8006fb0 <_Thread_queue_Enqueue_priority> } _ISR_Enable( level ); 800737c: d0 0d 00 00 wcsr IE,r13 } } 8007380: 2b 9d 00 04 lw ra,(sp+4) 8007384: 2b 8b 00 10 lw r11,(sp+16) 8007388: 2b 8c 00 0c lw r12,(sp+12) 800738c: 2b 8d 00 08 lw r13,(sp+8) 8007390: 37 9c 00 14 addi sp,sp,20 8007394: c3 a0 00 00 ret =============================================================================== 08007398 <_Thread_queue_Timeout>: void _Thread_queue_Timeout( Objects_Id id, void *ignored __attribute__((unused)) ) { 8007398: 37 9c ff f8 addi sp,sp,-8 800739c: 5b 9d 00 04 sw (sp+4),ra Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); 80073a0: 37 82 00 08 addi r2,sp,8 80073a4: fb ff fd 72 calli 800696c <_Thread_Get> switch ( location ) { 80073a8: 2b 82 00 08 lw r2,(sp+8) 80073ac: 5c 40 00 07 bne r2,r0,80073c8 <_Thread_queue_Timeout+0x30> <== NEVER TAKEN #if defined(RTEMS_MULTIPROCESSING) case OBJECTS_REMOTE: /* impossible */ #endif break; case OBJECTS_LOCAL: _Thread_queue_Process_timeout( the_thread ); 80073b0: f8 00 20 08 calli 800f3d0 <_Thread_queue_Process_timeout> */ RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void ) { RTEMS_COMPILER_MEMORY_BARRIER(); _Thread_Dispatch_disable_level -= 1; 80073b4: 78 01 08 01 mvhi r1,0x801 80073b8: 38 21 99 20 ori r1,r1,0x9920 80073bc: 28 22 00 00 lw r2,(r1+0) 80073c0: 34 42 ff ff addi r2,r2,-1 80073c4: 58 22 00 00 sw (r1+0),r2 _Thread_Unnest_dispatch(); break; } } 80073c8: 2b 9d 00 04 lw ra,(sp+4) 80073cc: 37 9c 00 08 addi sp,sp,8 80073d0: c3 a0 00 00 ret =============================================================================== 080146b8 <_Timer_server_Body>: * @a arg points to the corresponding timer server control block. */ static rtems_task _Timer_server_Body( rtems_task_argument arg ) { 80146b8: 37 9c ff a8 addi sp,sp,-88 80146bc: 5b 8b 00 40 sw (sp+64),r11 80146c0: 5b 8c 00 3c sw (sp+60),r12 80146c4: 5b 8d 00 38 sw (sp+56),r13 80146c8: 5b 8e 00 34 sw (sp+52),r14 80146cc: 5b 8f 00 30 sw (sp+48),r15 80146d0: 5b 90 00 2c sw (sp+44),r16 80146d4: 5b 91 00 28 sw (sp+40),r17 80146d8: 5b 92 00 24 sw (sp+36),r18 80146dc: 5b 93 00 20 sw (sp+32),r19 80146e0: 5b 94 00 1c sw (sp+28),r20 80146e4: 5b 95 00 18 sw (sp+24),r21 80146e8: 5b 96 00 14 sw (sp+20),r22 80146ec: 5b 97 00 10 sw (sp+16),r23 80146f0: 5b 98 00 0c sw (sp+12),r24 80146f4: 5b 99 00 08 sw (sp+8),r25 80146f8: 5b 9d 00 04 sw (sp+4),ra static void _Timer_server_Process_interval_watchdogs( Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = _Watchdog_Ticks_since_boot; 80146fc: 78 10 08 03 mvhi r16,0x803 * @a arg points to the corresponding timer server control block. */ static rtems_task _Timer_server_Body( rtems_task_argument arg ) { 8014700: b8 20 58 00 mv r11,r1 ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; 8014704: 37 82 00 54 addi r2,sp,84 8014708: 37 81 00 50 addi r1,sp,80 801470c: 37 8f 00 44 addi r15,sp,68 8014710: 37 91 00 48 addi r17,sp,72 static void _Timer_server_Process_tod_watchdogs( Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); 8014714: 78 0e 08 03 mvhi r14,0x803 8014718: 5b 82 00 50 sw (sp+80),r2 head->previous = NULL; 801471c: 5b 80 00 54 sw (sp+84),r0 tail->previous = head; 8014720: 5b 81 00 58 sw (sp+88),r1 ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; 8014724: 5b 91 00 44 sw (sp+68),r17 head->previous = NULL; 8014728: 5b 80 00 48 sw (sp+72),r0 tail->previous = head; 801472c: 5b 8f 00 4c sw (sp+76),r15 Chain_Control *tmp; /* * 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; 8014730: b8 20 c8 00 mv r25,r1 static void _Timer_server_Process_interval_watchdogs( Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = _Watchdog_Ticks_since_boot; 8014734: 3a 10 fd e0 ori r16,r16,0xfde0 */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; watchdogs->last_snapshot = snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 8014738: 35 73 00 30 addi r19,r11,48 static void _Timer_server_Process_tod_watchdogs( Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); 801473c: 39 ce fd 58 ori r14,r14,0xfd58 /* * 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 ); 8014740: 35 6d 00 68 addi r13,r11,104 Timer_Control *timer ) { if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); } else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) { 8014744: 34 18 00 03 mvi r24,3 * of zero it will be processed in the next iteration of the timer server * body loop. */ _Timer_server_Process_insertions( ts ); _ISR_Disable( level ); 8014748: 34 12 ff fe mvi r18,-2 */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_tail( const Chain_Control *the_chain ) { return &the_chain->Tail.Node; 801474c: b8 40 b8 00 mv r23,r2 _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; 8014750: 34 16 00 01 mvi r22,1 static void _Timer_server_Stop_interval_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog ); 8014754: 35 75 00 08 addi r21,r11,8 static void _Timer_server_Stop_tod_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->TOD_watchdogs.System_watchdog ); 8014758: 35 74 00 40 addi r20,r11,64 Chain_Control *tmp; /* * 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; 801475c: 59 79 00 78 sw (r11+120),r25 static void _Timer_server_Process_interval_watchdogs( Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = _Watchdog_Ticks_since_boot; 8014760: 2a 02 00 00 lw r2,(r16+0) /* * We assume adequate unsigned arithmetic here. */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; 8014764: 29 63 00 3c lw r3,(r11+60) watchdogs->last_snapshot = snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 8014768: ba 60 08 00 mv r1,r19 /* * We assume adequate unsigned arithmetic here. */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; watchdogs->last_snapshot = snapshot; 801476c: 59 62 00 3c sw (r11+60),r2 _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 8014770: c8 43 10 00 sub r2,r2,r3 8014774: b9 e0 18 00 mv r3,r15 8014778: f8 00 15 8b calli 8019da4 <_Watchdog_Adjust_to_chain> Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); Watchdog_Interval last_snapshot = watchdogs->last_snapshot; 801477c: 29 64 00 74 lw r4,(r11+116) static void _Timer_server_Process_tod_watchdogs( Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); 8014780: 29 cc 00 00 lw r12,(r14+0) /* * 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 ) { 8014784: 50 8c 00 06 bgeu r4,r12,801479c <_Timer_server_Body+0xe4> /* * 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 ); 8014788: b9 a0 08 00 mv r1,r13 801478c: c9 84 10 00 sub r2,r12,r4 8014790: b9 e0 18 00 mv r3,r15 8014794: f8 00 15 84 calli 8019da4 <_Watchdog_Adjust_to_chain> 8014798: e0 00 00 06 bi 80147b0 <_Timer_server_Body+0xf8> } else if ( snapshot < last_snapshot ) { 801479c: 51 84 00 05 bgeu r12,r4,80147b0 <_Timer_server_Body+0xf8> /* * 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 ); 80147a0: b9 a0 08 00 mv r1,r13 80147a4: 34 02 00 01 mvi r2,1 80147a8: c8 8c 18 00 sub r3,r4,r12 80147ac: f8 00 15 47 calli 8019cc8 <_Watchdog_Adjust> } watchdogs->last_snapshot = snapshot; 80147b0: 59 6c 00 74 sw (r11+116),r12 static void _Timer_server_Insert_timer( Timer_server_Control *ts, Timer_Control *timer ) { if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { 80147b4: 34 0c 00 01 mvi r12,1 } static void _Timer_server_Process_insertions( Timer_server_Control *ts ) { while ( true ) { Timer_Control *timer = (Timer_Control *) _Chain_Get( ts->insert_chain ); 80147b8: 29 63 00 78 lw r3,(r11+120) 80147bc: b8 60 08 00 mv r1,r3 80147c0: f8 00 03 84 calli 80155d0 <_Chain_Get> 80147c4: b8 20 10 00 mv r2,r1 if ( timer == NULL ) { 80147c8: 44 20 00 09 be r1,r0,80147ec <_Timer_server_Body+0x134> <== ALWAYS TAKEN static void _Timer_server_Insert_timer( Timer_server_Control *ts, Timer_Control *timer ) { if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { 80147cc: 28 23 00 38 lw r3,(r1+56) <== NOT EXECUTED _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); 80147d0: ba 60 08 00 mv r1,r19 <== NOT EXECUTED static void _Timer_server_Insert_timer( Timer_server_Control *ts, Timer_Control *timer ) { if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { 80147d4: 44 6c 00 03 be r3,r12,80147e0 <_Timer_server_Body+0x128> <== NOT EXECUTED _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); } else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) { 80147d8: 5c 78 ff f8 bne r3,r24,80147b8 <_Timer_server_Body+0x100> <== NOT EXECUTED _Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker ); 80147dc: b9 a0 08 00 mv r1,r13 <== NOT EXECUTED 80147e0: 34 42 00 10 addi r2,r2,16 <== NOT EXECUTED 80147e4: f8 00 15 95 calli 8019e38 <_Watchdog_Insert> <== NOT EXECUTED 80147e8: e3 ff ff f4 bi 80147b8 <_Timer_server_Body+0x100> <== NOT EXECUTED * of zero it will be processed in the next iteration of the timer server * body loop. */ _Timer_server_Process_insertions( ts ); _ISR_Disable( level ); 80147ec: 90 00 20 00 rcsr r4,IE 80147f0: a0 92 08 00 and r1,r4,r18 80147f4: d0 01 00 00 wcsr IE,r1 tmp = ts->insert_chain; 80147f8: 29 61 00 78 lw r1,(r11+120) if ( _Chain_Is_empty( insert_chain ) ) { 80147fc: 2b 81 00 50 lw r1,(sp+80) 8014800: 34 03 00 01 mvi r3,1 8014804: 5c 37 00 03 bne r1,r23,8014810 <_Timer_server_Body+0x158> <== NEVER TAKEN ts->insert_chain = NULL; 8014808: 59 60 00 78 sw (r11+120),r0 do_loop = false; 801480c: 34 03 00 00 mvi r3,0 } _ISR_Enable( level ); 8014810: d0 04 00 00 wcsr IE,r4 * 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; while ( do_loop ) { 8014814: 5c 60 ff d3 bne r3,r0,8014760 <_Timer_server_Body+0xa8> <== NEVER TAKEN _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 ) ) { 8014818: 2b 81 00 44 lw r1,(sp+68) 801481c: 44 31 00 13 be r1,r17,8014868 <_Timer_server_Body+0x1b0> /* * It is essential that interrupts are disable here since an interrupt * service routine may remove a watchdog from the chain. */ _ISR_Disable( level ); 8014820: 90 00 18 00 rcsr r3,IE 8014824: a0 72 08 00 and r1,r3,r18 8014828: d0 01 00 00 wcsr IE,r1 initialized = false; } #endif return status; } 801482c: 2b 82 00 44 lw r2,(sp+68) */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected( Chain_Control *the_chain ) { if ( !_Chain_Is_empty(the_chain)) 8014830: 44 51 00 0c be r2,r17,8014860 <_Timer_server_Body+0x1a8> Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *old_first = head->next; Chain_Node *new_first = old_first->next; 8014834: 28 44 00 00 lw r4,(r2+0) head->next = new_first; 8014838: 5b 84 00 44 sw (sp+68),r4 new_first->previous = head; 801483c: 58 8f 00 04 sw (r4+4),r15 * 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 ) { 8014840: 44 40 00 08 be r2,r0,8014860 <_Timer_server_Body+0x1a8> <== NEVER TAKEN watchdog->state = WATCHDOG_INACTIVE; 8014844: 58 40 00 08 sw (r2+8),r0 _ISR_Enable( level ); 8014848: d0 03 00 00 wcsr IE,r3 /* * 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 ); 801484c: 28 43 00 1c lw r3,(r2+28) 8014850: 28 41 00 20 lw r1,(r2+32) 8014854: 28 42 00 24 lw r2,(r2+36) 8014858: d8 60 00 00 call r3 } 801485c: e3 ff ff f1 bi 8014820 <_Timer_server_Body+0x168> watchdog = (Watchdog_Control *) _Chain_Get_unprotected( &fire_chain ); if ( watchdog != NULL ) { watchdog->state = WATCHDOG_INACTIVE; _ISR_Enable( level ); } else { _ISR_Enable( level ); 8014860: d0 03 00 00 wcsr IE,r3 8014864: e3 ff ff be bi 801475c <_Timer_server_Body+0xa4> * the active flag of the timer server is true. */ (*watchdog->routine)( watchdog->id, watchdog->user_data ); } } else { ts->active = false; 8014868: 31 60 00 7c sb (r11+124),r0 /* * Block until there is something to do. */ _Thread_Disable_dispatch(); 801486c: fb ff ff 53 calli 80145b8 <_Thread_Disable_dispatch> _Thread_Set_state( ts->thread, STATES_DELAYING ); 8014870: 29 61 00 00 lw r1,(r11+0) 8014874: 34 02 00 08 mvi r2,8 8014878: f8 00 12 dc calli 80193e8 <_Thread_Set_state> _Timer_server_Reset_interval_system_watchdog( ts ); 801487c: b9 60 08 00 mv r1,r11 8014880: fb ff ff 54 calli 80145d0 <_Timer_server_Reset_interval_system_watchdog> _Timer_server_Reset_tod_system_watchdog( ts ); 8014884: b9 60 08 00 mv r1,r11 8014888: fb ff ff 6f calli 8014644 <_Timer_server_Reset_tod_system_watchdog> _Thread_Enable_dispatch(); 801488c: f8 00 0f db calli 80187f8 <_Thread_Enable_dispatch> static void _Timer_server_Stop_interval_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog ); 8014890: ba a0 08 00 mv r1,r21 _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; 8014894: 31 76 00 7c sb (r11+124),r22 static void _Timer_server_Stop_interval_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog ); 8014898: f8 00 15 c5 calli 8019fac <_Watchdog_Remove> static void _Timer_server_Stop_tod_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->TOD_watchdogs.System_watchdog ); 801489c: ba 80 08 00 mv r1,r20 80148a0: f8 00 15 c3 calli 8019fac <_Watchdog_Remove> 80148a4: e3 ff ff ae bi 801475c <_Timer_server_Body+0xa4> =============================================================================== 080148a8 <_Timer_server_Schedule_operation_method>: static void _Timer_server_Schedule_operation_method( Timer_server_Control *ts, Timer_Control *timer ) { 80148a8: 37 9c ff f4 addi sp,sp,-12 80148ac: 5b 8b 00 0c sw (sp+12),r11 80148b0: 5b 8c 00 08 sw (sp+8),r12 80148b4: 5b 9d 00 04 sw (sp+4),ra 80148b8: b8 20 58 00 mv r11,r1 if ( ts->insert_chain == NULL ) { 80148bc: 28 21 00 78 lw r1,(r1+120) static void _Timer_server_Schedule_operation_method( Timer_server_Control *ts, Timer_Control *timer ) { 80148c0: b8 40 60 00 mv r12,r2 if ( ts->insert_chain == NULL ) { 80148c4: 5c 20 00 43 bne r1,r0,80149d0 <_Timer_server_Schedule_operation_method+0x128><== NEVER TAKEN * is the reference point for the delta chain. Thus if we do not update the * reference point we have to add DT to the initial delta of the watchdog * being inserted. This could result in an integer overflow. */ _Thread_Disable_dispatch(); 80148c8: fb ff ff 3c calli 80145b8 <_Thread_Disable_dispatch> if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { 80148cc: 29 81 00 38 lw r1,(r12+56) 80148d0: 34 02 00 01 mvi r2,1 80148d4: 5c 22 00 1d bne r1,r2,8014948 <_Timer_server_Schedule_operation_method+0xa0> /* * We have to advance the last known ticks value of the server and update * the watchdog chain accordingly. */ _ISR_Disable( level ); 80148d8: 90 00 10 00 rcsr r2,IE 80148dc: 34 01 ff fe mvi r1,-2 80148e0: a0 41 08 00 and r1,r2,r1 80148e4: d0 01 00 00 wcsr IE,r1 snapshot = _Watchdog_Ticks_since_boot; 80148e8: 78 01 08 03 mvhi r1,0x803 80148ec: 38 21 fd e0 ori r1,r1,0xfde0 80148f0: 28 23 00 00 lw r3,(r1+0) initialized = false; } #endif return status; } 80148f4: 29 61 00 30 lw r1,(r11+48) * We have to advance the last known ticks value of the server and update * the watchdog chain accordingly. */ _ISR_Disable( level ); snapshot = _Watchdog_Ticks_since_boot; last_snapshot = ts->Interval_watchdogs.last_snapshot; 80148f8: 29 65 00 3c lw r5,(r11+60) RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 80148fc: 35 64 00 34 addi r4,r11,52 if ( !_Chain_Is_empty( &ts->Interval_watchdogs.Chain ) ) { 8014900: 44 24 00 07 be r1,r4,801491c <_Timer_server_Schedule_operation_method+0x74> /* * We assume adequate unsigned arithmetic here. */ delta = snapshot - last_snapshot; delta_interval = first_watchdog->delta_interval; 8014904: 28 26 00 10 lw r6,(r1+16) first_watchdog = _Watchdog_First( &ts->Interval_watchdogs.Chain ); /* * We assume adequate unsigned arithmetic here. */ delta = snapshot - last_snapshot; 8014908: c8 65 28 00 sub r5,r3,r5 delta_interval = first_watchdog->delta_interval; if (delta_interval > delta) { delta_interval -= delta; } else { delta_interval = 0; 801490c: 34 04 00 00 mvi r4,0 * We assume adequate unsigned arithmetic here. */ delta = snapshot - last_snapshot; delta_interval = first_watchdog->delta_interval; if (delta_interval > delta) { 8014910: 50 a6 00 02 bgeu r5,r6,8014918 <_Timer_server_Schedule_operation_method+0x70> delta_interval -= delta; 8014914: c8 c5 20 00 sub r4,r6,r5 } else { delta_interval = 0; } first_watchdog->delta_interval = delta_interval; 8014918: 58 24 00 10 sw (r1+16),r4 } ts->Interval_watchdogs.last_snapshot = snapshot; 801491c: 59 63 00 3c sw (r11+60),r3 _ISR_Enable( level ); 8014920: d0 02 00 00 wcsr IE,r2 _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); 8014924: 35 61 00 30 addi r1,r11,48 8014928: 35 82 00 10 addi r2,r12,16 801492c: f8 00 15 43 calli 8019e38 <_Watchdog_Insert> if ( !ts->active ) { 8014930: 41 61 00 7c lbu r1,(r11+124) 8014934: 20 21 00 ff andi r1,r1,0xff 8014938: 5c 20 00 24 bne r1,r0,80149c8 <_Timer_server_Schedule_operation_method+0x120> _Timer_server_Reset_interval_system_watchdog( ts ); 801493c: b9 60 08 00 mv r1,r11 8014940: fb ff ff 24 calli 80145d0 <_Timer_server_Reset_interval_system_watchdog> 8014944: e0 00 00 21 bi 80149c8 <_Timer_server_Schedule_operation_method+0x120> } } else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) { 8014948: 34 02 00 03 mvi r2,3 801494c: 5c 22 00 1f bne r1,r2,80149c8 <_Timer_server_Schedule_operation_method+0x120> /* * We have to advance the last known seconds value of the server and update * the watchdog chain accordingly. */ _ISR_Disable( level ); 8014950: 90 00 30 00 rcsr r6,IE 8014954: 34 01 ff fe mvi r1,-2 8014958: a0 c1 08 00 and r1,r6,r1 801495c: d0 01 00 00 wcsr IE,r1 initialized = false; } #endif return status; } 8014960: 29 62 00 68 lw r2,(r11+104) /* * We have to advance the last known seconds value of the server and update * the watchdog chain accordingly. */ _ISR_Disable( level ); snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); 8014964: 78 01 08 03 mvhi r1,0x803 last_snapshot = ts->TOD_watchdogs.last_snapshot; 8014968: 29 65 00 74 lw r5,(r11+116) /* * We have to advance the last known seconds value of the server and update * the watchdog chain accordingly. */ _ISR_Disable( level ); snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); 801496c: 38 21 fd 58 ori r1,r1,0xfd58 8014970: 35 63 00 6c addi r3,r11,108 8014974: 28 21 00 00 lw r1,(r1+0) last_snapshot = ts->TOD_watchdogs.last_snapshot; if ( !_Chain_Is_empty( &ts->TOD_watchdogs.Chain ) ) { 8014978: 44 43 00 0a be r2,r3,80149a0 <_Timer_server_Schedule_operation_method+0xf8> first_watchdog = _Watchdog_First( &ts->TOD_watchdogs.Chain ); delta_interval = first_watchdog->delta_interval; 801497c: 28 44 00 10 lw r4,(r2+16) } } else { /* * Someone put us in the past. */ delta = last_snapshot - snapshot; 8014980: b4 85 18 00 add r3,r4,r5 delta_interval += delta; 8014984: c8 61 18 00 sub r3,r3,r1 snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); last_snapshot = ts->TOD_watchdogs.last_snapshot; if ( !_Chain_Is_empty( &ts->TOD_watchdogs.Chain ) ) { first_watchdog = _Watchdog_First( &ts->TOD_watchdogs.Chain ); delta_interval = first_watchdog->delta_interval; if ( snapshot > last_snapshot ) { 8014988: 50 a1 00 05 bgeu r5,r1,801499c <_Timer_server_Schedule_operation_method+0xf4> /* * We advanced in time. */ delta = snapshot - last_snapshot; 801498c: c8 25 28 00 sub r5,r1,r5 if (delta_interval > delta) { delta_interval -= delta; } else { delta_interval = 0; 8014990: 34 03 00 00 mvi r3,0 if ( snapshot > last_snapshot ) { /* * We advanced in time. */ delta = snapshot - last_snapshot; if (delta_interval > delta) { 8014994: 50 a4 00 02 bgeu r5,r4,801499c <_Timer_server_Schedule_operation_method+0xf4><== NEVER TAKEN delta_interval -= delta; 8014998: c8 85 18 00 sub r3,r4,r5 * Someone put us in the past. */ delta = last_snapshot - snapshot; delta_interval += delta; } first_watchdog->delta_interval = delta_interval; 801499c: 58 43 00 10 sw (r2+16),r3 } ts->TOD_watchdogs.last_snapshot = snapshot; 80149a0: 59 61 00 74 sw (r11+116),r1 _ISR_Enable( level ); 80149a4: d0 06 00 00 wcsr IE,r6 _Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker ); 80149a8: 35 61 00 68 addi r1,r11,104 80149ac: 35 82 00 10 addi r2,r12,16 80149b0: f8 00 15 22 calli 8019e38 <_Watchdog_Insert> if ( !ts->active ) { 80149b4: 41 61 00 7c lbu r1,(r11+124) 80149b8: 20 21 00 ff andi r1,r1,0xff 80149bc: 5c 20 00 03 bne r1,r0,80149c8 <_Timer_server_Schedule_operation_method+0x120><== NEVER TAKEN _Timer_server_Reset_tod_system_watchdog( ts ); 80149c0: b9 60 08 00 mv r1,r11 80149c4: fb ff ff 20 calli 8014644 <_Timer_server_Reset_tod_system_watchdog> } } _Thread_Enable_dispatch(); 80149c8: f8 00 0f 8c calli 80187f8 <_Thread_Enable_dispatch> 80149cc: e0 00 00 03 bi 80149d8 <_Timer_server_Schedule_operation_method+0x130> * server is not preemptible, so we must be in interrupt context here. No * thread dispatch will happen until the timer server finishes its * critical section. We have to use the protected chain methods because * we may be interrupted by a higher priority interrupt. */ _Chain_Append( ts->insert_chain, &timer->Object.Node ); 80149d0: 29 61 00 78 lw r1,(r11+120) <== NOT EXECUTED 80149d4: f8 00 02 e9 calli 8015578 <_Chain_Append> <== NOT EXECUTED } } 80149d8: 2b 9d 00 04 lw ra,(sp+4) 80149dc: 2b 8b 00 0c lw r11,(sp+12) 80149e0: 2b 8c 00 08 lw r12,(sp+8) 80149e4: 37 9c 00 0c addi sp,sp,12 80149e8: c3 a0 00 00 ret =============================================================================== 08007700 <_User_extensions_Handler_initialization>: #include #include #include void _User_extensions_Handler_initialization(void) { 8007700: 37 9c ff ec addi sp,sp,-20 8007704: 5b 8b 00 14 sw (sp+20),r11 8007708: 5b 8c 00 10 sw (sp+16),r12 800770c: 5b 8d 00 0c sw (sp+12),r13 8007710: 5b 8e 00 08 sw (sp+8),r14 8007714: 5b 9d 00 04 sw (sp+4),ra User_extensions_Control *extension; uint32_t i; uint32_t number_of_extensions; User_extensions_Table *initial_extensions; number_of_extensions = Configuration.number_of_initial_extensions; 8007718: 78 02 08 01 mvhi r2,0x801 800771c: 38 42 90 ac ori r2,r2,0x90ac 8007720: 28 4e 00 3c lw r14,(r2+60) initial_extensions = Configuration.User_extension_table; 8007724: 28 4b 00 40 lw r11,(r2+64) ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; 8007728: 78 03 08 01 mvhi r3,0x801 800772c: 78 02 08 01 mvhi r2,0x801 8007730: 38 42 9a a0 ori r2,r2,0x9aa0 8007734: 38 63 9a a4 ori r3,r3,0x9aa4 8007738: 58 43 00 00 sw (r2+0),r3 head->previous = NULL; 800773c: 58 40 00 04 sw (r2+4),r0 tail->previous = head; 8007740: 58 42 00 08 sw (r2+8),r2 ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; 8007744: 78 03 08 01 mvhi r3,0x801 8007748: 78 02 08 01 mvhi r2,0x801 800774c: 38 42 99 24 ori r2,r2,0x9924 8007750: 38 63 99 28 ori r3,r3,0x9928 8007754: 58 43 00 00 sw (r2+0),r3 head->previous = NULL; 8007758: 58 40 00 04 sw (r2+4),r0 tail->previous = head; 800775c: 58 42 00 08 sw (r2+8),r2 _Chain_Initialize_empty( &_User_extensions_List ); _Chain_Initialize_empty( &_User_extensions_Switches_list ); if ( initial_extensions ) { 8007760: 45 60 00 22 be r11,r0,80077e8 <_User_extensions_Handler_initialization+0xe8><== NEVER TAKEN extension = (User_extensions_Control *) _Workspace_Allocate_or_fatal_error( number_of_extensions * sizeof( User_extensions_Control ) 8007764: 34 02 00 34 mvi r2,52 8007768: b9 c0 08 00 mv r1,r14 800776c: f8 00 3e 23 calli 8016ff8 <__mulsi3> 8007770: b8 20 68 00 mv r13,r1 _Chain_Initialize_empty( &_User_extensions_List ); _Chain_Initialize_empty( &_User_extensions_Switches_list ); if ( initial_extensions ) { extension = (User_extensions_Control *) _Workspace_Allocate_or_fatal_error( 8007774: f8 00 01 82 calli 8007d7c <_Workspace_Allocate_or_fatal_error> number_of_extensions * sizeof( User_extensions_Control ) ); memset ( 8007778: b9 a0 18 00 mv r3,r13 800777c: 34 02 00 00 mvi r2,0 _Chain_Initialize_empty( &_User_extensions_List ); _Chain_Initialize_empty( &_User_extensions_Switches_list ); if ( initial_extensions ) { extension = (User_extensions_Control *) _Workspace_Allocate_or_fatal_error( 8007780: b8 20 60 00 mv r12,r1 extension, 0, number_of_extensions * sizeof( User_extensions_Control ) ); for ( i = 0 ; i < number_of_extensions ; i++ ) { 8007784: 34 0d 00 00 mvi r13,0 extension = (User_extensions_Control *) _Workspace_Allocate_or_fatal_error( number_of_extensions * sizeof( User_extensions_Control ) ); memset ( 8007788: f8 00 2a 31 calli 801204c extension, 0, number_of_extensions * sizeof( User_extensions_Control ) ); for ( i = 0 ; i < number_of_extensions ; i++ ) { 800778c: e0 00 00 16 bi 80077e4 <_User_extensions_Handler_initialization+0xe4> RTEMS_INLINE_ROUTINE void _User_extensions_Add_set_with_table( User_extensions_Control *extension, const User_extensions_Table *extension_table ) { extension->Callouts = *extension_table; 8007790: 29 61 00 1c lw r1,(r11+28) 8007794: 29 68 00 00 lw r8,(r11+0) 8007798: 29 67 00 04 lw r7,(r11+4) 800779c: 29 66 00 08 lw r6,(r11+8) 80077a0: 29 65 00 0c lw r5,(r11+12) 80077a4: 29 64 00 10 lw r4,(r11+16) 80077a8: 29 63 00 14 lw r3,(r11+20) 80077ac: 29 62 00 18 lw r2,(r11+24) 80077b0: 59 81 00 30 sw (r12+48),r1 80077b4: 59 88 00 14 sw (r12+20),r8 80077b8: 59 87 00 18 sw (r12+24),r7 80077bc: 59 86 00 1c sw (r12+28),r6 80077c0: 59 85 00 20 sw (r12+32),r5 80077c4: 59 84 00 24 sw (r12+36),r4 80077c8: 59 83 00 28 sw (r12+40),r3 80077cc: 59 82 00 2c sw (r12+44),r2 _User_extensions_Add_set( extension ); 80077d0: b9 80 08 00 mv r1,r12 80077d4: f8 00 1f 46 calli 800f4ec <_User_extensions_Add_set> _User_extensions_Add_set_with_table (extension, &initial_extensions[i]); extension++; 80077d8: 35 8c 00 34 addi r12,r12,52 extension, 0, number_of_extensions * sizeof( User_extensions_Control ) ); for ( i = 0 ; i < number_of_extensions ; i++ ) { 80077dc: 35 ad 00 01 addi r13,r13,1 80077e0: 35 6b 00 20 addi r11,r11,32 80077e4: 55 cd ff eb bgu r14,r13,8007790 <_User_extensions_Handler_initialization+0x90> _User_extensions_Add_set_with_table (extension, &initial_extensions[i]); extension++; } } } 80077e8: 2b 9d 00 04 lw ra,(sp+4) 80077ec: 2b 8b 00 14 lw r11,(sp+20) 80077f0: 2b 8c 00 10 lw r12,(sp+16) 80077f4: 2b 8d 00 0c lw r13,(sp+12) 80077f8: 2b 8e 00 08 lw r14,(sp+8) 80077fc: 37 9c 00 14 addi sp,sp,20 8007800: c3 a0 00 00 ret =============================================================================== 0800889c <_Watchdog_Adjust>: void _Watchdog_Adjust( Chain_Control *header, Watchdog_Adjust_directions direction, Watchdog_Interval units ) { 800889c: 37 9c ff e4 addi sp,sp,-28 80088a0: 5b 8b 00 1c sw (sp+28),r11 80088a4: 5b 8c 00 18 sw (sp+24),r12 80088a8: 5b 8d 00 14 sw (sp+20),r13 80088ac: 5b 8e 00 10 sw (sp+16),r14 80088b0: 5b 8f 00 0c sw (sp+12),r15 80088b4: 5b 90 00 08 sw (sp+8),r16 80088b8: 5b 9d 00 04 sw (sp+4),ra 80088bc: b8 20 60 00 mv r12,r1 80088c0: b8 60 58 00 mv r11,r3 ISR_Level level; _ISR_Disable( level ); 80088c4: 90 00 08 00 rcsr r1,IE 80088c8: 34 03 ff fe mvi r3,-2 80088cc: a0 23 18 00 and r3,r1,r3 80088d0: d0 03 00 00 wcsr IE,r3 } } _ISR_Enable( level ); } 80088d4: 29 83 00 00 lw r3,(r12+0) RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 80088d8: 35 8e 00 04 addi r14,r12,4 * hence the compiler must not assume *header to remain * unmodified across that call. * * Till Straumann, 7/2003 */ if ( !_Chain_Is_empty( header ) ) { 80088dc: 44 6e 00 1d be r3,r14,8008950 <_Watchdog_Adjust+0xb4> switch ( direction ) { 80088e0: 44 40 00 04 be r2,r0,80088f0 <_Watchdog_Adjust+0x54> 80088e4: 34 04 00 01 mvi r4,1 80088e8: 5c 44 00 1a bne r2,r4,8008950 <_Watchdog_Adjust+0xb4> <== NEVER TAKEN 80088ec: e0 00 00 04 bi 80088fc <_Watchdog_Adjust+0x60> 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; 80088f0: 34 10 00 01 mvi r16,1 _ISR_Enable( level ); _Watchdog_Tickle( header ); _ISR_Disable( level ); 80088f4: 34 0f ff fe mvi r15,-2 80088f8: e0 00 00 15 bi 800894c <_Watchdog_Adjust+0xb0> * Till Straumann, 7/2003 */ if ( !_Chain_Is_empty( header ) ) { switch ( direction ) { case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; 80088fc: 28 62 00 10 lw r2,(r3+16) 8008900: b4 4b 58 00 add r11,r2,r11 8008904: 58 6b 00 10 sw (r3+16),r11 break; 8008908: e0 00 00 12 bi 8008950 <_Watchdog_Adjust+0xb4> RTEMS_INLINE_ROUTINE Watchdog_Control *_Watchdog_First( Chain_Control *header ) { return ( (Watchdog_Control *) _Chain_First( header ) ); 800890c: 29 82 00 00 lw r2,(r12+0) case WATCHDOG_FORWARD: while ( units ) { if ( units < _Watchdog_First( header )->delta_interval ) { 8008910: 28 4d 00 10 lw r13,(r2+16) 8008914: 51 6d 00 04 bgeu r11,r13,8008924 <_Watchdog_Adjust+0x88> _Watchdog_First( header )->delta_interval -= units; 8008918: c9 ab 58 00 sub r11,r13,r11 800891c: 58 4b 00 10 sw (r2+16),r11 break; 8008920: e0 00 00 0c bi 8008950 <_Watchdog_Adjust+0xb4> } else { units -= _Watchdog_First( header )->delta_interval; _Watchdog_First( header )->delta_interval = 1; 8008924: 58 50 00 10 sw (r2+16),r16 _ISR_Enable( level ); 8008928: d0 01 00 00 wcsr IE,r1 _Watchdog_Tickle( header ); 800892c: b9 80 08 00 mv r1,r12 8008930: f8 00 00 98 calli 8008b90 <_Watchdog_Tickle> _ISR_Disable( level ); 8008934: 90 00 08 00 rcsr r1,IE 8008938: a0 2f 10 00 and r2,r1,r15 800893c: d0 02 00 00 wcsr IE,r2 if ( _Chain_Is_empty( header ) ) 8008940: 29 82 00 00 lw r2,(r12+0) 8008944: 44 4e 00 03 be r2,r14,8008950 <_Watchdog_Adjust+0xb4> while ( units ) { if ( units < _Watchdog_First( header )->delta_interval ) { _Watchdog_First( header )->delta_interval -= units; break; } else { units -= _Watchdog_First( header )->delta_interval; 8008948: c9 6d 58 00 sub r11,r11,r13 switch ( direction ) { case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; break; case WATCHDOG_FORWARD: while ( units ) { 800894c: 5d 60 ff f0 bne r11,r0,800890c <_Watchdog_Adjust+0x70> <== ALWAYS TAKEN } break; } } _ISR_Enable( level ); 8008950: d0 01 00 00 wcsr IE,r1 } 8008954: 2b 9d 00 04 lw ra,(sp+4) 8008958: 2b 8b 00 1c lw r11,(sp+28) 800895c: 2b 8c 00 18 lw r12,(sp+24) 8008960: 2b 8d 00 14 lw r13,(sp+20) 8008964: 2b 8e 00 10 lw r14,(sp+16) 8008968: 2b 8f 00 0c lw r15,(sp+12) 800896c: 2b 90 00 08 lw r16,(sp+8) 8008970: 37 9c 00 1c addi sp,sp,28 8008974: c3 a0 00 00 ret =============================================================================== 08007c14 <_Watchdog_Remove>: { ISR_Level level; Watchdog_States previous_state; Watchdog_Control *next_watchdog; _ISR_Disable( level ); 8007c14: 90 00 28 00 rcsr r5,IE 8007c18: 34 02 ff fe mvi r2,-2 8007c1c: a0 a2 10 00 and r2,r5,r2 8007c20: d0 02 00 00 wcsr IE,r2 previous_state = the_watchdog->state; 8007c24: 28 23 00 08 lw r3,(r1+8) switch ( previous_state ) { 8007c28: 34 02 00 01 mvi r2,1 8007c2c: 44 62 00 05 be r3,r2,8007c40 <_Watchdog_Remove+0x2c> 8007c30: 44 60 00 1b be r3,r0,8007c9c <_Watchdog_Remove+0x88> 8007c34: 34 02 00 03 mvi r2,3 8007c38: 54 62 00 19 bgu r3,r2,8007c9c <_Watchdog_Remove+0x88> <== NEVER TAKEN 8007c3c: e0 00 00 03 bi 8007c48 <_Watchdog_Remove+0x34> /* * 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; 8007c40: 58 20 00 08 sw (r1+8),r0 break; 8007c44: e0 00 00 16 bi 8007c9c <_Watchdog_Remove+0x88> } the_watchdog->stop_time = _Watchdog_Ticks_since_boot; _ISR_Enable( level ); return( previous_state ); } 8007c48: 28 22 00 00 lw r2,(r1+0) break; case WATCHDOG_ACTIVE: case WATCHDOG_REMOVE_IT: the_watchdog->state = WATCHDOG_INACTIVE; 8007c4c: 58 20 00 08 sw (r1+8),r0 next_watchdog = _Watchdog_Next( the_watchdog ); if ( _Watchdog_Next(next_watchdog) ) 8007c50: 28 44 00 00 lw r4,(r2+0) 8007c54: 44 80 00 05 be r4,r0,8007c68 <_Watchdog_Remove+0x54> next_watchdog->delta_interval += the_watchdog->delta_interval; 8007c58: 28 46 00 10 lw r6,(r2+16) 8007c5c: 28 24 00 10 lw r4,(r1+16) 8007c60: b4 c4 20 00 add r4,r6,r4 8007c64: 58 44 00 10 sw (r2+16),r4 if ( _Watchdog_Sync_count ) 8007c68: 78 04 08 01 mvhi r4,0x801 8007c6c: 38 84 9a 4c ori r4,r4,0x9a4c 8007c70: 28 84 00 00 lw r4,(r4+0) 8007c74: 44 80 00 07 be r4,r0,8007c90 <_Watchdog_Remove+0x7c> _Watchdog_Sync_level = _ISR_Nest_level; 8007c78: 78 04 08 01 mvhi r4,0x801 8007c7c: 38 84 9d f0 ori r4,r4,0x9df0 8007c80: 28 86 00 08 lw r6,(r4+8) 8007c84: 78 04 08 01 mvhi r4,0x801 8007c88: 38 84 99 e4 ori r4,r4,0x99e4 8007c8c: 58 86 00 00 sw (r4+0),r6 { Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; 8007c90: 28 24 00 04 lw r4,(r1+4) next->previous = previous; 8007c94: 58 44 00 04 sw (r2+4),r4 previous->next = next; 8007c98: 58 82 00 00 sw (r4+0),r2 _Chain_Extract_unprotected( &the_watchdog->Node ); break; } the_watchdog->stop_time = _Watchdog_Ticks_since_boot; 8007c9c: 78 02 08 01 mvhi r2,0x801 8007ca0: 38 42 9a 50 ori r2,r2,0x9a50 8007ca4: 28 42 00 00 lw r2,(r2+0) 8007ca8: 58 22 00 18 sw (r1+24),r2 _ISR_Enable( level ); 8007cac: d0 05 00 00 wcsr IE,r5 return( previous_state ); } 8007cb0: b8 60 08 00 mv r1,r3 8007cb4: c3 a0 00 00 ret =============================================================================== 080084e8 <_Watchdog_Report_chain>: void _Watchdog_Report_chain( const char *name, Chain_Control *header ) { 80084e8: 37 9c ff ec addi sp,sp,-20 80084ec: 5b 8b 00 14 sw (sp+20),r11 80084f0: 5b 8c 00 10 sw (sp+16),r12 80084f4: 5b 8d 00 0c sw (sp+12),r13 80084f8: 5b 8e 00 08 sw (sp+8),r14 80084fc: 5b 9d 00 04 sw (sp+4),ra 8008500: b8 20 70 00 mv r14,r1 8008504: b8 40 60 00 mv r12,r2 ISR_Level level; Chain_Node *node; _ISR_Disable( level ); 8008508: 90 00 68 00 rcsr r13,IE 800850c: 34 01 ff fe mvi r1,-2 8008510: a1 a1 08 00 and r1,r13,r1 8008514: d0 01 00 00 wcsr IE,r1 printk( "Watchdog Chain: %s %p\n", name, header ); 8008518: 78 01 08 01 mvhi r1,0x801 800851c: b9 80 18 00 mv r3,r12 8008520: 38 21 e8 b4 ori r1,r1,0xe8b4 8008524: b9 c0 10 00 mv r2,r14 8008528: fb ff eb a9 calli 80033cc printk( "== end of %s \n", name ); } else { printk( "Chain is empty\n" ); } _ISR_Enable( level ); } 800852c: 29 8b 00 00 lw r11,(r12+0) RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 8008530: 35 8c 00 04 addi r12,r12,4 ISR_Level level; Chain_Node *node; _ISR_Disable( level ); printk( "Watchdog Chain: %s %p\n", name, header ); if ( !_Chain_Is_empty( header ) ) { 8008534: 45 6c 00 0b be r11,r12,8008560 <_Watchdog_Report_chain+0x78> node != _Chain_Tail(header) ; node = node->next ) { Watchdog_Control *watch = (Watchdog_Control *) node; _Watchdog_Report( NULL, watch ); 8008538: b9 60 10 00 mv r2,r11 800853c: 34 01 00 00 mvi r1,0 8008540: f8 00 00 13 calli 800858c <_Watchdog_Report> _ISR_Disable( level ); printk( "Watchdog Chain: %s %p\n", name, header ); if ( !_Chain_Is_empty( header ) ) { for ( node = _Chain_First( header ) ; node != _Chain_Tail(header) ; node = node->next ) 8008544: 29 6b 00 00 lw r11,(r11+0) Chain_Node *node; _ISR_Disable( level ); printk( "Watchdog Chain: %s %p\n", name, header ); if ( !_Chain_Is_empty( header ) ) { for ( node = _Chain_First( header ) ; 8008548: 5d 6c ff fc bne r11,r12,8008538 <_Watchdog_Report_chain+0x50><== NEVER TAKEN { Watchdog_Control *watch = (Watchdog_Control *) node; _Watchdog_Report( NULL, watch ); } printk( "== end of %s \n", name ); 800854c: 78 01 08 01 mvhi r1,0x801 8008550: 38 21 e8 cc ori r1,r1,0xe8cc 8008554: b9 c0 10 00 mv r2,r14 8008558: fb ff eb 9d calli 80033cc 800855c: e0 00 00 04 bi 800856c <_Watchdog_Report_chain+0x84> } else { printk( "Chain is empty\n" ); 8008560: 78 01 08 01 mvhi r1,0x801 8008564: 38 21 e8 dc ori r1,r1,0xe8dc 8008568: fb ff eb 99 calli 80033cc } _ISR_Enable( level ); 800856c: d0 0d 00 00 wcsr IE,r13 } 8008570: 2b 9d 00 04 lw ra,(sp+4) 8008574: 2b 8b 00 14 lw r11,(sp+20) 8008578: 2b 8c 00 10 lw r12,(sp+16) 800857c: 2b 8d 00 0c lw r13,(sp+12) 8008580: 2b 8e 00 08 lw r14,(sp+8) 8008584: 37 9c 00 14 addi sp,sp,20 8008588: c3 a0 00 00 ret =============================================================================== 0800c44c <_Watchdog_Tickle>: */ void _Watchdog_Tickle( Chain_Control *header ) { 800c44c: 37 9c ff e4 addi sp,sp,-28 800c450: 5b 8b 00 1c sw (sp+28),r11 800c454: 5b 8c 00 18 sw (sp+24),r12 800c458: 5b 8d 00 14 sw (sp+20),r13 800c45c: 5b 8e 00 10 sw (sp+16),r14 800c460: 5b 8f 00 0c sw (sp+12),r15 800c464: 5b 90 00 08 sw (sp+8),r16 800c468: 5b 9d 00 04 sw (sp+4),ra 800c46c: b8 20 60 00 mv r12,r1 * See the comment in watchdoginsert.c and watchdogadjust.c * about why it's safe not to declare header a pointer to * volatile data - till, 2003/7 */ _ISR_Disable( level ); 800c470: 90 00 18 00 rcsr r3,IE 800c474: 34 01 ff fe mvi r1,-2 800c478: a0 61 08 00 and r1,r3,r1 800c47c: d0 01 00 00 wcsr IE,r1 } while ( !_Chain_Is_empty( header ) && (the_watchdog->delta_interval == 0) ); leave: _ISR_Enable(level); } 800c480: 29 8b 00 00 lw r11,(r12+0) RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 800c484: 35 8e 00 04 addi r14,r12,4 * See the comment in watchdoginsert.c and watchdogadjust.c * about why it's safe not to declare header a pointer to * volatile data - till, 2003/7 */ _ISR_Disable( level ); 800c488: b8 60 10 00 mv r2,r3 if ( _Chain_Is_empty( header ) ) 800c48c: 45 6e 00 1a be r11,r14,800c4f4 <_Watchdog_Tickle+0xa8> * to be inserted has already had its delta_interval adjusted to 0, and * so is added to the head of the chain with a delta_interval of 0. * * Steven Johnson - 12/2005 (gcc-3.2.3 -O3 on powerpc) */ if (the_watchdog->delta_interval != 0) { 800c490: 29 61 00 10 lw r1,(r11+16) 800c494: 44 20 00 04 be r1,r0,800c4a4 <_Watchdog_Tickle+0x58> the_watchdog->delta_interval--; 800c498: 34 21 ff ff addi r1,r1,-1 800c49c: 59 61 00 10 sw (r11+16),r1 if ( the_watchdog->delta_interval != 0 ) 800c4a0: 5c 20 00 15 bne r1,r0,800c4f4 <_Watchdog_Tickle+0xa8> */ void _Watchdog_Tickle( Chain_Control *header ) { 800c4a4: b8 60 68 00 mv r13,r3 do { watchdog_state = _Watchdog_Remove( the_watchdog ); _ISR_Enable( level ); switch( watchdog_state ) { 800c4a8: 34 10 00 02 mvi r16,2 case WATCHDOG_REMOVE_IT: break; } _ISR_Disable( level ); 800c4ac: 34 0f ff fe mvi r15,-2 800c4b0: e0 00 00 02 bi 800c4b8 <_Watchdog_Tickle+0x6c> 800c4b4: b8 40 68 00 mv r13,r2 if ( the_watchdog->delta_interval != 0 ) goto leave; } do { watchdog_state = _Watchdog_Remove( the_watchdog ); 800c4b8: b9 60 08 00 mv r1,r11 800c4bc: fb ff ff bb calli 800c3a8 <_Watchdog_Remove> _ISR_Enable( level ); 800c4c0: d0 0d 00 00 wcsr IE,r13 switch( watchdog_state ) { 800c4c4: 5c 30 00 05 bne r1,r16,800c4d8 <_Watchdog_Tickle+0x8c> <== NEVER TAKEN case WATCHDOG_ACTIVE: (*the_watchdog->routine)( 800c4c8: 29 63 00 1c lw r3,(r11+28) 800c4cc: 29 61 00 20 lw r1,(r11+32) 800c4d0: 29 62 00 24 lw r2,(r11+36) 800c4d4: d8 60 00 00 call r3 case WATCHDOG_REMOVE_IT: break; } _ISR_Disable( level ); 800c4d8: 90 00 10 00 rcsr r2,IE 800c4dc: a0 4f 08 00 and r1,r2,r15 800c4e0: d0 01 00 00 wcsr IE,r1 } while ( !_Chain_Is_empty( header ) && (the_watchdog->delta_interval == 0) ); leave: _ISR_Enable(level); } 800c4e4: 29 8b 00 00 lw r11,(r12+0) _ISR_Disable( level ); the_watchdog = _Watchdog_First( header ); } while ( !_Chain_Is_empty( header ) && (the_watchdog->delta_interval == 0) ); 800c4e8: 45 6e 00 03 be r11,r14,800c4f4 <_Watchdog_Tickle+0xa8> } _ISR_Disable( level ); the_watchdog = _Watchdog_First( header ); } while ( !_Chain_Is_empty( header ) && 800c4ec: 29 61 00 10 lw r1,(r11+16) 800c4f0: 44 20 ff f1 be r1,r0,800c4b4 <_Watchdog_Tickle+0x68> (the_watchdog->delta_interval == 0) ); leave: _ISR_Enable(level); 800c4f4: d0 02 00 00 wcsr IE,r2 } 800c4f8: 2b 9d 00 04 lw ra,(sp+4) 800c4fc: 2b 8b 00 1c lw r11,(sp+28) 800c500: 2b 8c 00 18 lw r12,(sp+24) 800c504: 2b 8d 00 14 lw r13,(sp+20) 800c508: 2b 8e 00 10 lw r14,(sp+16) 800c50c: 2b 8f 00 0c lw r15,(sp+12) 800c510: 2b 90 00 08 lw r16,(sp+8) 800c514: 37 9c 00 1c addi sp,sp,28 800c518: c3 a0 00 00 ret =============================================================================== 08003974 : * operation(s) cannot be canceled */ int aio_cancel(int fildes, struct aiocb *aiocbp) { 8003974: 37 9c ff ec addi sp,sp,-20 8003978: 5b 8b 00 14 sw (sp+20),r11 800397c: 5b 8c 00 10 sw (sp+16),r12 8003980: 5b 8d 00 0c sw (sp+12),r13 8003984: 5b 8e 00 08 sw (sp+8),r14 8003988: 5b 9d 00 04 sw (sp+4),ra rtems_aio_request_chain *r_chain; int result; pthread_mutex_lock (&aio_request_queue.mutex); 800398c: 78 0b 08 01 mvhi r11,0x801 8003990: 39 6b 77 f8 ori r11,r11,0x77f8 * operation(s) cannot be canceled */ int aio_cancel(int fildes, struct aiocb *aiocbp) { 8003994: b8 20 68 00 mv r13,r1 8003998: b8 40 60 00 mv r12,r2 rtems_aio_request_chain *r_chain; int result; pthread_mutex_lock (&aio_request_queue.mutex); 800399c: b9 60 08 00 mv r1,r11 80039a0: f8 00 04 bd calli 8004c94 if (aiocbp == NULL) 80039a4: 5d 80 00 38 bne r12,r0,8003a84 { if (fcntl (fildes, F_GETFL) < 0) { 80039a8: b9 a0 08 00 mv r1,r13 80039ac: 34 02 00 03 mvi r2,3 80039b0: f8 00 1d d2 calli 800b0f8 80039b4: 4c 2c 00 06 bge r1,r12,80039cc <== NEVER TAKEN pthread_mutex_unlock(&aio_request_queue.mutex); 80039b8: b9 60 08 00 mv r1,r11 80039bc: f8 00 04 e9 calli 8004d60 rtems_set_errno_and_return_minus_one (EBADF); 80039c0: f8 00 2e d3 calli 800f50c <__errno> 80039c4: 34 02 00 09 mvi r2,9 80039c8: e0 00 00 35 bi 8003a9c } r_chain = rtems_aio_search_fd (&aio_request_queue.work_req, 80039cc: 78 01 08 01 mvhi r1,0x801 <== NOT EXECUTED 80039d0: 38 21 78 40 ori r1,r1,0x7840 <== NOT EXECUTED 80039d4: b9 a0 10 00 mv r2,r13 <== NOT EXECUTED 80039d8: 34 03 00 00 mvi r3,0 <== NOT EXECUTED 80039dc: f8 00 00 c1 calli 8003ce0 <== NOT EXECUTED 80039e0: b8 20 60 00 mv r12,r1 <== NOT EXECUTED fildes, 0); if (r_chain == NULL) 80039e4: 5c 20 00 1b bne r1,r0,8003a50 <== NOT EXECUTED { if (!rtems_chain_is_empty (&aio_request_queue.idle_req)) 80039e8: 29 62 00 54 lw r2,(r11+84) <== NOT EXECUTED 80039ec: 78 01 08 01 mvhi r1,0x801 <== NOT EXECUTED 80039f0: 38 21 78 50 ori r1,r1,0x7850 <== NOT EXECUTED 80039f4: 44 41 00 13 be r2,r1,8003a40 <== NOT EXECUTED { r_chain = rtems_aio_search_fd (&aio_request_queue.idle_req, 80039f8: 78 01 08 01 mvhi r1,0x801 <== NOT EXECUTED 80039fc: 38 21 78 4c ori r1,r1,0x784c <== NOT EXECUTED 8003a00: b9 a0 10 00 mv r2,r13 <== NOT EXECUTED 8003a04: 34 03 00 00 mvi r3,0 <== NOT EXECUTED 8003a08: f8 00 00 b6 calli 8003ce0 <== NOT EXECUTED 8003a0c: b8 20 60 00 mv r12,r1 <== NOT EXECUTED fildes, 0); if (r_chain == NULL) { 8003a10: 44 20 00 0c be r1,r0,8003a40 <== NOT EXECUTED */ RTEMS_INLINE_ROUTINE void rtems_chain_extract( rtems_chain_node *the_node ) { _Chain_Extract( the_node ); 8003a14: f8 00 0a 7a calli 80063fc <_Chain_Extract> <== NOT EXECUTED pthread_mutex_unlock(&aio_request_queue.mutex); return AIO_ALLDONE; } rtems_chain_extract (&r_chain->next_fd); rtems_aio_remove_fd (r_chain); 8003a18: b9 80 08 00 mv r1,r12 <== NOT EXECUTED 8003a1c: f8 00 01 ab calli 80040c8 <== NOT EXECUTED pthread_mutex_destroy (&r_chain->mutex); 8003a20: 35 8d 00 1c addi r13,r12,28 <== NOT EXECUTED 8003a24: b9 a0 08 00 mv r1,r13 <== NOT EXECUTED 8003a28: f8 00 03 e1 calli 80049ac <== NOT EXECUTED pthread_cond_destroy (&r_chain->mutex); 8003a2c: b9 a0 08 00 mv r1,r13 <== NOT EXECUTED 8003a30: f8 00 02 e0 calli 80045b0 <== NOT EXECUTED free (r_chain); 8003a34: b9 80 08 00 mv r1,r12 <== NOT EXECUTED 8003a38: fb ff f9 ca calli 8002160 <== NOT EXECUTED 8003a3c: e0 00 00 0e bi 8003a74 <== NOT EXECUTED pthread_mutex_unlock (&aio_request_queue.mutex); return AIO_CANCELED; } pthread_mutex_unlock (&aio_request_queue.mutex); 8003a40: b9 60 08 00 mv r1,r11 <== NOT EXECUTED 8003a44: f8 00 04 c7 calli 8004d60 <== NOT EXECUTED return AIO_ALLDONE; 8003a48: 34 0c 00 02 mvi r12,2 <== NOT EXECUTED 8003a4c: e0 00 00 39 bi 8003b30 <== NOT EXECUTED } pthread_mutex_lock (&r_chain->mutex); 8003a50: 34 2d 00 1c addi r13,r1,28 <== NOT EXECUTED 8003a54: b9 a0 08 00 mv r1,r13 <== NOT EXECUTED 8003a58: f8 00 04 8f calli 8004c94 <== NOT EXECUTED 8003a5c: b9 80 08 00 mv r1,r12 <== NOT EXECUTED 8003a60: f8 00 0a 67 calli 80063fc <_Chain_Extract> <== NOT EXECUTED rtems_chain_extract (&r_chain->next_fd); rtems_aio_remove_fd (r_chain); 8003a64: b9 80 08 00 mv r1,r12 <== NOT EXECUTED 8003a68: f8 00 01 98 calli 80040c8 <== NOT EXECUTED pthread_mutex_unlock (&r_chain->mutex); 8003a6c: b9 a0 08 00 mv r1,r13 <== NOT EXECUTED 8003a70: f8 00 04 bc calli 8004d60 <== NOT EXECUTED pthread_mutex_unlock (&aio_request_queue.mutex); 8003a74: b9 60 08 00 mv r1,r11 <== NOT EXECUTED 8003a78: f8 00 04 ba calli 8004d60 <== NOT EXECUTED return AIO_CANCELED; 8003a7c: 34 0c 00 00 mvi r12,0 <== NOT EXECUTED 8003a80: e0 00 00 2c bi 8003b30 <== NOT EXECUTED } else { if (aiocbp->aio_fildes != fildes) { 8003a84: 29 8e 00 00 lw r14,(r12+0) 8003a88: 45 cd 00 08 be r14,r13,8003aa8 <== NEVER TAKEN pthread_mutex_unlock (&aio_request_queue.mutex); 8003a8c: b9 60 08 00 mv r1,r11 8003a90: f8 00 04 b4 calli 8004d60 rtems_set_errno_and_return_minus_one (EINVAL); 8003a94: f8 00 2e 9e calli 800f50c <__errno> 8003a98: 34 02 00 16 mvi r2,22 8003a9c: 58 22 00 00 sw (r1+0),r2 8003aa0: 34 0c ff ff mvi r12,-1 8003aa4: e0 00 00 23 bi 8003b30 } r_chain = rtems_aio_search_fd (&aio_request_queue.work_req, 8003aa8: 78 01 08 01 mvhi r1,0x801 <== NOT EXECUTED 8003aac: 38 21 78 40 ori r1,r1,0x7840 <== NOT EXECUTED 8003ab0: b9 c0 10 00 mv r2,r14 <== NOT EXECUTED 8003ab4: 34 03 00 00 mvi r3,0 <== NOT EXECUTED 8003ab8: f8 00 00 8a calli 8003ce0 <== NOT EXECUTED 8003abc: b8 20 68 00 mv r13,r1 <== NOT EXECUTED fildes, 0); if (r_chain == NULL) 8003ac0: 5c 20 00 10 bne r1,r0,8003b00 <== NOT EXECUTED if (!rtems_chain_is_empty (&aio_request_queue.idle_req)) 8003ac4: 29 62 00 54 lw r2,(r11+84) <== NOT EXECUTED 8003ac8: 78 01 08 01 mvhi r1,0x801 <== NOT EXECUTED 8003acc: 38 21 78 50 ori r1,r1,0x7850 <== NOT EXECUTED 8003ad0: 44 41 00 0c be r2,r1,8003b00 <== NOT EXECUTED { r_chain = rtems_aio_search_fd (&aio_request_queue.idle_req, 8003ad4: 78 01 08 01 mvhi r1,0x801 <== NOT EXECUTED 8003ad8: 38 21 78 4c ori r1,r1,0x784c <== NOT EXECUTED 8003adc: b9 c0 10 00 mv r2,r14 <== NOT EXECUTED 8003ae0: 34 03 00 00 mvi r3,0 <== NOT EXECUTED 8003ae4: f8 00 00 7f calli 8003ce0 <== NOT EXECUTED fildes, 0); if (r_chain == NULL) 8003ae8: 44 20 ff e9 be r1,r0,8003a8c <== NOT EXECUTED { pthread_mutex_unlock (&aio_request_queue.mutex); rtems_set_errno_and_return_minus_one (EINVAL); } result = rtems_aio_remove_req (&r_chain->next_fd, aiocbp); 8003aec: b9 80 10 00 mv r2,r12 <== NOT EXECUTED 8003af0: f8 00 01 90 calli 8004130 <== NOT EXECUTED 8003af4: b8 20 60 00 mv r12,r1 <== NOT EXECUTED pthread_mutex_unlock (&aio_request_queue.mutex); 8003af8: b9 60 08 00 mv r1,r11 <== NOT EXECUTED 8003afc: e0 00 00 0c bi 8003b2c <== NOT EXECUTED return result; } pthread_mutex_lock (&r_chain->mutex); 8003b00: 35 ab 00 1c addi r11,r13,28 <== NOT EXECUTED 8003b04: b9 60 08 00 mv r1,r11 <== NOT EXECUTED 8003b08: f8 00 04 63 calli 8004c94 <== NOT EXECUTED result = rtems_aio_remove_req (&r_chain->next_fd, aiocbp); 8003b0c: b9 80 10 00 mv r2,r12 <== NOT EXECUTED 8003b10: b9 a0 08 00 mv r1,r13 <== NOT EXECUTED 8003b14: f8 00 01 87 calli 8004130 <== NOT EXECUTED 8003b18: b8 20 60 00 mv r12,r1 <== NOT EXECUTED pthread_mutex_unlock (&r_chain->mutex); 8003b1c: b9 60 08 00 mv r1,r11 <== NOT EXECUTED 8003b20: f8 00 04 90 calli 8004d60 <== NOT EXECUTED pthread_mutex_unlock (&aio_request_queue.mutex); 8003b24: 78 01 08 01 mvhi r1,0x801 <== NOT EXECUTED 8003b28: 38 21 77 f8 ori r1,r1,0x77f8 <== NOT EXECUTED 8003b2c: f8 00 04 8d calli 8004d60 <== NOT EXECUTED return result; } return AIO_ALLDONE; } 8003b30: b9 80 08 00 mv r1,r12 8003b34: 2b 9d 00 04 lw ra,(sp+4) 8003b38: 2b 8b 00 14 lw r11,(sp+20) 8003b3c: 2b 8c 00 10 lw r12,(sp+16) 8003b40: 2b 8d 00 0c lw r13,(sp+12) 8003b44: 2b 8e 00 08 lw r14,(sp+8) 8003b48: 37 9c 00 14 addi sp,sp,20 8003b4c: c3 a0 00 00 ret =============================================================================== 08003b58 : int aio_fsync( int op, struct aiocb *aiocbp ) { 8003b58: 37 9c ff f4 addi sp,sp,-12 8003b5c: 5b 8b 00 0c sw (sp+12),r11 8003b60: 5b 8c 00 08 sw (sp+8),r12 8003b64: 5b 9d 00 04 sw (sp+4),ra 8003b68: b8 40 58 00 mv r11,r2 rtems_aio_request *req; int mode; if (op != O_SYNC) 8003b6c: 34 02 20 00 mvi r2,8192 rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); 8003b70: 34 0c 00 16 mvi r12,22 ) { rtems_aio_request *req; int mode; if (op != O_SYNC) 8003b74: 5c 22 00 09 bne r1,r2,8003b98 rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); mode = fcntl (aiocbp->aio_fildes, F_GETFL); 8003b78: 29 61 00 00 lw r1,(r11+0) 8003b7c: 34 02 00 03 mvi r2,3 8003b80: f8 00 1d 5e calli 800b0f8 if (!(((mode & O_ACCMODE) == O_WRONLY) || ((mode & O_ACCMODE) == O_RDWR))) 8003b84: 20 21 00 03 andi r1,r1,0x3 8003b88: 34 21 ff ff addi r1,r1,-1 8003b8c: 34 02 00 01 mvi r2,1 8003b90: 50 41 00 09 bgeu r2,r1,8003bb4 <== NEVER TAKEN rtems_aio_set_errno_return_minus_one (EBADF, aiocbp); 8003b94: 34 0c 00 09 mvi r12,9 8003b98: 34 01 ff ff mvi r1,-1 8003b9c: 59 6c 00 2c sw (r11+44),r12 8003ba0: 59 61 00 30 sw (r11+48),r1 8003ba4: f8 00 2e 5a calli 800f50c <__errno> 8003ba8: 58 2c 00 00 sw (r1+0),r12 8003bac: 34 01 ff ff mvi r1,-1 8003bb0: e0 00 00 09 bi 8003bd4 req = malloc (sizeof (rtems_aio_request)); 8003bb4: 34 01 00 18 mvi r1,24 8003bb8: fb ff fb 22 calli 8002840 if (req == NULL) rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); 8003bbc: 34 0c 00 0b mvi r12,11 mode = fcntl (aiocbp->aio_fildes, F_GETFL); if (!(((mode & O_ACCMODE) == O_WRONLY) || ((mode & O_ACCMODE) == O_RDWR))) rtems_aio_set_errno_return_minus_one (EBADF, aiocbp); req = malloc (sizeof (rtems_aio_request)); if (req == NULL) 8003bc0: 44 20 ff f6 be r1,r0,8003b98 rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); req->aiocbp = aiocbp; 8003bc4: 58 2b 00 14 sw (r1+20),r11 req->aiocbp->aio_lio_opcode = LIO_SYNC; 8003bc8: 34 02 00 03 mvi r2,3 8003bcc: 59 62 00 28 sw (r11+40),r2 return rtems_aio_enqueue (req); 8003bd0: f8 00 01 72 calli 8004198 } 8003bd4: 2b 9d 00 04 lw ra,(sp+4) 8003bd8: 2b 8b 00 0c lw r11,(sp+12) 8003bdc: 2b 8c 00 08 lw r12,(sp+8) 8003be0: 37 9c 00 0c addi sp,sp,12 8003be4: c3 a0 00 00 ret =============================================================================== 080043f4 : * 0 - otherwise */ int aio_read (struct aiocb *aiocbp) { 80043f4: 37 9c ff f4 addi sp,sp,-12 80043f8: 5b 8b 00 0c sw (sp+12),r11 80043fc: 5b 8c 00 08 sw (sp+8),r12 8004400: 5b 9d 00 04 sw (sp+4),ra 8004404: b8 20 58 00 mv r11,r1 rtems_aio_request *req; int mode; mode = fcntl (aiocbp->aio_fildes, F_GETFL); 8004408: 28 21 00 00 lw r1,(r1+0) 800440c: 34 02 00 03 mvi r2,3 if (!(((mode & O_ACCMODE) == O_RDONLY) || ((mode & O_ACCMODE) == O_RDWR))) rtems_aio_set_errno_return_minus_one (EBADF, aiocbp); 8004410: 34 0c 00 09 mvi r12,9 aio_read (struct aiocb *aiocbp) { rtems_aio_request *req; int mode; mode = fcntl (aiocbp->aio_fildes, F_GETFL); 8004414: f8 00 1b 39 calli 800b0f8 if (!(((mode & O_ACCMODE) == O_RDONLY) || ((mode & O_ACCMODE) == O_RDWR))) 8004418: 20 21 00 03 andi r1,r1,0x3 800441c: 7c 22 00 02 cmpnei r2,r1,2 8004420: 7c 21 00 00 cmpnei r1,r1,0 8004424: a0 41 08 00 and r1,r2,r1 8004428: 5c 20 00 04 bne r1,r0,8004438 rtems_aio_set_errno_return_minus_one (EBADF, aiocbp); if (aiocbp->aio_reqprio < 0 || aiocbp->aio_reqprio > AIO_PRIO_DELTA_MAX) 800442c: 29 6c 00 10 lw r12,(r11+16) 8004430: 45 81 00 09 be r12,r1,8004454 rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); 8004434: 34 0c 00 16 mvi r12,22 8004438: 34 01 ff ff mvi r1,-1 800443c: 59 6c 00 2c sw (r11+44),r12 8004440: 59 61 00 30 sw (r11+48),r1 8004444: f8 00 2c 32 calli 800f50c <__errno> 8004448: 58 2c 00 00 sw (r1+0),r12 800444c: 34 01 ff ff mvi r1,-1 8004450: e0 00 00 0d bi 8004484 if (aiocbp->aio_offset < 0) 8004454: 29 61 00 04 lw r1,(r11+4) 8004458: 4c 2c 00 02 bge r1,r12,8004460 800445c: e3 ff ff f6 bi 8004434 rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); req = malloc (sizeof (rtems_aio_request)); 8004460: 34 01 00 18 mvi r1,24 8004464: fb ff f8 f7 calli 8002840 if (req == NULL) 8004468: 5c 2c 00 03 bne r1,r12,8004474 <== ALWAYS TAKEN rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); 800446c: 34 0c 00 0b mvi r12,11 <== NOT EXECUTED 8004470: e3 ff ff f2 bi 8004438 <== NOT EXECUTED req->aiocbp = aiocbp; 8004474: 58 2b 00 14 sw (r1+20),r11 req->aiocbp->aio_lio_opcode = LIO_READ; 8004478: 34 02 00 01 mvi r2,1 800447c: 59 62 00 28 sw (r11+40),r2 return rtems_aio_enqueue (req); 8004480: fb ff ff 46 calli 8004198 } 8004484: 2b 9d 00 04 lw ra,(sp+4) 8004488: 2b 8b 00 0c lw r11,(sp+12) 800448c: 2b 8c 00 08 lw r12,(sp+8) 8004490: 37 9c 00 0c addi sp,sp,12 8004494: c3 a0 00 00 ret =============================================================================== 080044a0 : * 0 - otherwise */ int aio_write (struct aiocb *aiocbp) { 80044a0: 37 9c ff f4 addi sp,sp,-12 80044a4: 5b 8b 00 0c sw (sp+12),r11 80044a8: 5b 8c 00 08 sw (sp+8),r12 80044ac: 5b 9d 00 04 sw (sp+4),ra 80044b0: b8 20 58 00 mv r11,r1 rtems_aio_request *req; int mode; mode = fcntl (aiocbp->aio_fildes, F_GETFL); 80044b4: 28 21 00 00 lw r1,(r1+0) 80044b8: 34 02 00 03 mvi r2,3 80044bc: f8 00 1b 0f calli 800b0f8 if (!(((mode & O_ACCMODE) == O_WRONLY) || ((mode & O_ACCMODE) == O_RDWR))) 80044c0: 20 21 00 03 andi r1,r1,0x3 80044c4: 34 21 ff ff addi r1,r1,-1 80044c8: 34 02 00 01 mvi r2,1 80044cc: 50 41 00 03 bgeu r2,r1,80044d8 rtems_aio_set_errno_return_minus_one (EBADF, aiocbp); 80044d0: 34 0c 00 09 mvi r12,9 80044d4: e0 00 00 04 bi 80044e4 if (aiocbp->aio_reqprio < 0 || aiocbp->aio_reqprio > AIO_PRIO_DELTA_MAX) 80044d8: 29 61 00 10 lw r1,(r11+16) 80044dc: 44 20 00 09 be r1,r0,8004500 rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); 80044e0: 34 0c 00 16 mvi r12,22 80044e4: 34 01 ff ff mvi r1,-1 80044e8: 59 6c 00 2c sw (r11+44),r12 80044ec: 59 61 00 30 sw (r11+48),r1 80044f0: f8 00 2c 07 calli 800f50c <__errno> 80044f4: 58 2c 00 00 sw (r1+0),r12 80044f8: 34 01 ff ff mvi r1,-1 80044fc: e0 00 00 0c bi 800452c if (aiocbp->aio_offset < 0) 8004500: 29 62 00 04 lw r2,(r11+4) 8004504: 4c 41 00 02 bge r2,r1,800450c 8004508: e3 ff ff f6 bi 80044e0 rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); req = malloc (sizeof (rtems_aio_request)); 800450c: 34 01 00 18 mvi r1,24 8004510: fb ff f8 cc calli 8002840 if (req == NULL) rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); 8004514: 34 0c 00 0b mvi r12,11 if (aiocbp->aio_offset < 0) rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); req = malloc (sizeof (rtems_aio_request)); if (req == NULL) 8004518: 44 20 ff f3 be r1,r0,80044e4 <== NEVER TAKEN rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); req->aiocbp = aiocbp; 800451c: 58 2b 00 14 sw (r1+20),r11 req->aiocbp->aio_lio_opcode = LIO_WRITE; 8004520: 34 02 00 02 mvi r2,2 8004524: 59 62 00 28 sw (r11+40),r2 return rtems_aio_enqueue (req); 8004528: fb ff ff 1c calli 8004198 } 800452c: 2b 9d 00 04 lw ra,(sp+4) 8004530: 2b 8b 00 0c lw r11,(sp+12) 8004534: 2b 8c 00 08 lw r12,(sp+8) 8004538: 37 9c 00 0c addi sp,sp,12 800453c: c3 a0 00 00 ret =============================================================================== 08002dac : int clock_gettime( clockid_t clock_id, struct timespec *tp ) { 8002dac: 37 9c ff fc addi sp,sp,-4 8002db0: 5b 9d 00 04 sw (sp+4),ra 8002db4: b8 20 18 00 mv r3,r1 8002db8: b8 40 08 00 mv r1,r2 if ( !tp ) 8002dbc: 44 40 00 11 be r2,r0,8002e00 rtems_set_errno_and_return_minus_one( EINVAL ); if ( clock_id == CLOCK_REALTIME ) { 8002dc0: 34 02 00 01 mvi r2,1 8002dc4: 5c 62 00 03 bne r3,r2,8002dd0 _TOD_Get(tp); 8002dc8: f8 00 06 f7 calli 80049a4 <_TOD_Get> 8002dcc: e0 00 00 06 bi 8002de4 return 0; } #ifdef CLOCK_MONOTONIC if ( clock_id == CLOCK_MONOTONIC ) { 8002dd0: 34 02 00 04 mvi r2,4 8002dd4: 44 62 00 03 be r3,r2,8002de0 <== NEVER TAKEN return 0; } #endif #ifdef _POSIX_CPUTIME if ( clock_id == CLOCK_PROCESS_CPUTIME ) { 8002dd8: 34 02 00 02 mvi r2,2 8002ddc: 5c 62 00 04 bne r3,r2,8002dec _TOD_Get_uptime_as_timespec( tp ); 8002de0: f8 00 07 16 calli 8004a38 <_TOD_Get_uptime_as_timespec> return 0; 8002de4: 34 01 00 00 mvi r1,0 8002de8: e0 00 00 0a bi 8002e10 } #endif #ifdef _POSIX_THREAD_CPUTIME if ( clock_id == CLOCK_THREAD_CPUTIME ) 8002dec: 34 01 00 03 mvi r1,3 8002df0: 5c 61 00 04 bne r3,r1,8002e00 rtems_set_errno_and_return_minus_one( ENOSYS ); 8002df4: f8 00 2a af calli 800d8b0 <__errno> 8002df8: 34 02 00 58 mvi r2,88 8002dfc: e0 00 00 03 bi 8002e08 #endif rtems_set_errno_and_return_minus_one( EINVAL ); 8002e00: f8 00 2a ac calli 800d8b0 <__errno> 8002e04: 34 02 00 16 mvi r2,22 8002e08: 58 22 00 00 sw (r1+0),r2 8002e0c: 34 01 ff ff mvi r1,-1 return 0; } 8002e10: 2b 9d 00 04 lw ra,(sp+4) 8002e14: 37 9c 00 04 addi sp,sp,4 8002e18: c3 a0 00 00 ret =============================================================================== 08002e1c : int clock_settime( clockid_t clock_id, const struct timespec *tp ) { 8002e1c: 37 9c ff fc addi sp,sp,-4 8002e20: 5b 9d 00 04 sw (sp+4),ra if ( !tp ) 8002e24: 44 40 00 1a be r2,r0,8002e8c <== NEVER TAKEN rtems_set_errno_and_return_minus_one( EINVAL ); if ( clock_id == CLOCK_REALTIME ) { 8002e28: 34 03 00 01 mvi r3,1 8002e2c: 5c 23 00 11 bne r1,r3,8002e70 if ( tp->tv_sec < TOD_SECONDS_1970_THROUGH_1988 ) 8002e30: 78 04 08 01 mvhi r4,0x801 8002e34: 38 84 e4 ac ori r4,r4,0xe4ac 8002e38: 28 43 00 00 lw r3,(r2+0) 8002e3c: 28 81 00 00 lw r1,(r4+0) 8002e40: 54 61 00 02 bgu r3,r1,8002e48 8002e44: e0 00 00 12 bi 8002e8c rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 8002e48: 78 01 08 02 mvhi r1,0x802 8002e4c: 38 21 08 b8 ori r1,r1,0x8b8 8002e50: 28 23 00 00 lw r3,(r1+0) 8002e54: 34 63 00 01 addi r3,r3,1 8002e58: 58 23 00 00 sw (r1+0),r3 rtems_set_errno_and_return_minus_one( EINVAL ); _Thread_Disable_dispatch(); _TOD_Set( tp ); 8002e5c: b8 40 08 00 mv r1,r2 8002e60: f8 00 07 13 calli 8004aac <_TOD_Set> _Thread_Enable_dispatch(); 8002e64: f8 00 0d 3d calli 8006358 <_Thread_Enable_dispatch> rtems_set_errno_and_return_minus_one( ENOSYS ); #endif else rtems_set_errno_and_return_minus_one( EINVAL ); return 0; 8002e68: 34 01 00 00 mvi r1,0 8002e6c: e0 00 00 0c bi 8002e9c _Thread_Disable_dispatch(); _TOD_Set( tp ); _Thread_Enable_dispatch(); } #ifdef _POSIX_CPUTIME else if ( clock_id == CLOCK_PROCESS_CPUTIME ) 8002e70: 34 02 00 02 mvi r2,2 8002e74: 44 22 00 03 be r1,r2,8002e80 rtems_set_errno_and_return_minus_one( ENOSYS ); #endif #ifdef _POSIX_THREAD_CPUTIME else if ( clock_id == CLOCK_THREAD_CPUTIME ) 8002e78: 34 02 00 03 mvi r2,3 8002e7c: 5c 22 00 04 bne r1,r2,8002e8c rtems_set_errno_and_return_minus_one( ENOSYS ); 8002e80: f8 00 2a 8c calli 800d8b0 <__errno> 8002e84: 34 02 00 58 mvi r2,88 8002e88: e0 00 00 03 bi 8002e94 #endif else rtems_set_errno_and_return_minus_one( EINVAL ); 8002e8c: f8 00 2a 89 calli 800d8b0 <__errno> 8002e90: 34 02 00 16 mvi r2,22 8002e94: 58 22 00 00 sw (r1+0),r2 8002e98: 34 01 ff ff mvi r1,-1 return 0; } 8002e9c: 2b 9d 00 04 lw ra,(sp+4) 8002ea0: 37 9c 00 04 addi sp,sp,4 8002ea4: c3 a0 00 00 ret =============================================================================== 080251ac : int killinfo( pid_t pid, int sig, const union sigval *value ) { 80251ac: 37 9c ff dc addi sp,sp,-36 80251b0: 5b 8b 00 18 sw (sp+24),r11 80251b4: 5b 8c 00 14 sw (sp+20),r12 80251b8: 5b 8d 00 10 sw (sp+16),r13 80251bc: 5b 8e 00 0c sw (sp+12),r14 80251c0: 5b 8f 00 08 sw (sp+8),r15 80251c4: 5b 9d 00 04 sw (sp+4),ra 80251c8: b8 20 60 00 mv r12,r1 80251cc: b8 40 58 00 mv r11,r2 80251d0: b8 60 68 00 mv r13,r3 POSIX_signals_Siginfo_node *psiginfo; /* * Only supported for the "calling process" (i.e. this node). */ if ( pid != getpid() ) 80251d4: fb ff fe e8 calli 8024d74 80251d8: 45 81 00 04 be r12,r1,80251e8 rtems_set_errno_and_return_minus_one( ESRCH ); 80251dc: fb ff b7 8b calli 8013008 <__errno> 80251e0: 34 02 00 03 mvi r2,3 80251e4: e0 00 00 04 bi 80251f4 /* * Validate the signal passed. */ if ( !sig ) 80251e8: 5d 60 00 06 bne r11,r0,8025200 rtems_set_errno_and_return_minus_one( EINVAL ); 80251ec: fb ff b7 87 calli 8013008 <__errno> 80251f0: 34 02 00 16 mvi r2,22 80251f4: 58 22 00 00 sw (r1+0),r2 80251f8: 34 01 ff ff mvi r1,-1 80251fc: e0 00 00 9f bi 8025478 static inline bool is_valid_signo( int signo ) { return ((signo) >= 1 && (signo) <= 32 ); 8025200: 35 6f ff ff addi r15,r11,-1 if ( !is_valid_signo(sig) ) 8025204: 34 01 00 1f mvi r1,31 8025208: 50 2f 00 02 bgeu r1,r15,8025210 802520c: e3 ff ff f8 bi 80251ec rtems_set_errno_and_return_minus_one( EINVAL ); /* * If the signal is being ignored, then we are out of here. */ if ( _POSIX_signals_Vectors[ sig ].sa_handler == SIG_IGN ) 8025210: 34 02 00 01 mvi r2,1 8025214: b9 60 08 00 mv r1,r11 8025218: fb ff 73 22 calli 8001ea0 <__ashlsi3> 802521c: 34 02 00 02 mvi r2,2 8025220: 78 0c 08 02 mvhi r12,0x802 8025224: b4 2b 08 00 add r1,r1,r11 8025228: fb ff 73 1e calli 8001ea0 <__ashlsi3> 802522c: 39 8c 9f 40 ori r12,r12,0x9f40 8025230: b5 81 08 00 add r1,r12,r1 8025234: 28 22 00 08 lw r2,(r1+8) 8025238: 34 0e 00 01 mvi r14,1 return 0; 802523c: 34 01 00 00 mvi r1,0 rtems_set_errno_and_return_minus_one( EINVAL ); /* * If the signal is being ignored, then we are out of here. */ if ( _POSIX_signals_Vectors[ sig ].sa_handler == SIG_IGN ) 8025240: 44 4e 00 8e be r2,r14,8025478 /* * P1003.1c/Draft 10, p. 33 says that certain signals should always * be directed to the executing thread such as those caused by hardware * faults. */ if ( (sig == SIGFPE) || (sig == SIGILL) || (sig == SIGSEGV ) ) 8025244: 65 62 00 04 cmpei r2,r11,4 8025248: 65 61 00 08 cmpei r1,r11,8 802524c: b8 41 08 00 or r1,r2,r1 8025250: 5c 20 00 03 bne r1,r0,802525c 8025254: 34 01 00 0b mvi r1,11 8025258: 5d 61 00 05 bne r11,r1,802526c return pthread_kill( pthread_self(), sig ); 802525c: f8 00 01 3a calli 8025744 8025260: b9 60 10 00 mv r2,r11 8025264: f8 00 00 f3 calli 8025630 8025268: e0 00 00 84 bi 8025478 static inline sigset_t signo_to_mask( uint32_t sig ) { return 1u << (sig - 1); 802526c: 34 01 00 01 mvi r1,1 8025270: b9 e0 10 00 mv r2,r15 8025274: fb ff 73 0b calli 8001ea0 <__ashlsi3> /* * Build up a siginfo structure */ siginfo = &siginfo_struct; siginfo->si_signo = sig; 8025278: 5b 8b 00 1c sw (sp+28),r11 siginfo->si_code = SI_USER; 802527c: 5b 8e 00 20 sw (sp+32),r14 8025280: b8 20 60 00 mv r12,r1 if ( !value ) { 8025284: 5d a0 00 03 bne r13,r0,8025290 siginfo->si_value.sival_int = 0; 8025288: 5b 80 00 24 sw (sp+36),r0 802528c: e0 00 00 03 bi 8025298 } else { siginfo->si_value = *value; 8025290: 29 a1 00 00 lw r1,(r13+0) 8025294: 5b 81 00 24 sw (sp+36),r1 8025298: 78 01 08 02 mvhi r1,0x802 802529c: 38 21 9a 20 ori r1,r1,0x9a20 80252a0: 28 22 00 00 lw r2,(r1+0) 80252a4: 34 42 00 01 addi r2,r2,1 80252a8: 58 22 00 00 sw (r1+0),r2 /* * Is the currently executing thread interested? If so then it will * get it an execute it as soon as the dispatcher executes. */ the_thread = _Thread_Executing; 80252ac: 78 01 08 02 mvhi r1,0x802 80252b0: 38 21 9e f0 ori r1,r1,0x9ef0 80252b4: 28 23 00 0c lw r3,(r1+12) api = the_thread->API_Extensions[ THREAD_API_POSIX ]; if ( _POSIX_signals_Is_interested( api, mask ) ) { 80252b8: 28 61 01 20 lw r1,(r3+288) 80252bc: 28 21 00 d0 lw r1,(r1+208) 80252c0: a4 20 08 00 not r1,r1 80252c4: a1 81 08 00 and r1,r12,r1 80252c8: 5c 20 00 3f bne r1,r0,80253c4 } DEBUG_STEP("\n"); _Thread_Enable_dispatch(); return 0; } 80252cc: 78 01 08 02 mvhi r1,0x802 80252d0: 38 21 a0 cc ori r1,r1,0xa0cc 80252d4: 28 22 00 00 lw r2,(r1+0) /* XXX violation of visibility -- need to define thread queue support */ the_chain = &_POSIX_signals_Wait_queue.Queues.Fifo; for ( the_node = _Chain_First( the_chain ); 80252d8: 78 01 08 02 mvhi r1,0x802 80252dc: 38 21 a0 d0 ori r1,r1,0xa0d0 80252e0: e0 00 00 0b bi 802530c #endif /* * Is this thread is actually blocked waiting for the signal? */ if (the_thread->Wait.option & mask) 80252e4: 28 44 00 30 lw r4,(r2+48) for ( the_node = _Chain_First( the_chain ); !_Chain_Is_tail( the_chain, the_node ) ; the_node = the_node->next ) { the_thread = (Thread_Control *)the_node; 80252e8: b8 40 18 00 mv r3,r2 api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 80252ec: 28 45 01 20 lw r5,(r2+288) #endif /* * Is this thread is actually blocked waiting for the signal? */ if (the_thread->Wait.option & mask) 80252f0: a1 84 20 00 and r4,r12,r4 80252f4: 5c 80 00 34 bne r4,r0,80253c4 /* * Is this thread is blocked waiting for another signal but has * not blocked this one? */ if (~api->signals_blocked & mask) 80252f8: 28 a5 00 d0 lw r5,(r5+208) 80252fc: a4 a0 28 00 not r5,r5 8025300: a1 85 28 00 and r5,r12,r5 8025304: 5c a4 00 30 bne r5,r4,80253c4 the_chain = &_POSIX_signals_Wait_queue.Queues.Fifo; for ( the_node = _Chain_First( the_chain ); !_Chain_Is_tail( the_chain, the_node ) ; the_node = the_node->next ) { 8025308: 28 42 00 00 lw r2,(r2+0) /* XXX violation of visibility -- need to define thread queue support */ the_chain = &_POSIX_signals_Wait_queue.Queues.Fifo; for ( the_node = _Chain_First( the_chain ); 802530c: 5c 41 ff f6 bne r2,r1,80252e4 * NOTES: * * + rtems internal threads do not receive signals. */ interested = NULL; interested_priority = PRIORITY_MAXIMUM + 1; 8025310: 78 01 08 02 mvhi r1,0x802 8025314: 38 21 90 c0 ori r1,r1,0x90c0 8025318: 40 21 00 00 lbu r1,(r1+0) */ #define _POSIX_signals_Is_interested( _api, _mask ) \ ( ~(_api)->signals_blocked & (_mask) ) int killinfo( 802531c: 78 02 08 02 mvhi r2,0x802 * NOTES: * * + rtems internal threads do not receive signals. */ interested = NULL; interested_priority = PRIORITY_MAXIMUM + 1; 8025320: 78 04 08 02 mvhi r4,0x802 */ #define _POSIX_signals_Is_interested( _api, _mask ) \ ( ~(_api)->signals_blocked & (_mask) ) int killinfo( 8025324: 38 42 99 bc ori r2,r2,0x99bc * NOTES: * * + rtems internal threads do not receive signals. */ interested = NULL; interested_priority = PRIORITY_MAXIMUM + 1; 8025328: 34 21 00 01 addi r1,r1,1 802532c: 38 84 99 c4 ori r4,r4,0x99c4 */ #define _POSIX_signals_Is_interested( _api, _mask ) \ ( ~(_api)->signals_blocked & (_mask) ) int killinfo( 8025330: 34 4d 00 10 addi r13,r2,16 * * NOTES: * * + rtems internal threads do not receive signals. */ interested = NULL; 8025334: 34 03 00 00 mvi r3,0 */ RTEMS_INLINE_ROUTINE bool _States_Is_interruptible_by_signal ( States_Control the_states ) { return (the_states & STATES_INTERRUPTIBLE_BY_SIGNAL); 8025338: 78 08 10 00 mvhi r8,0x1000 for (the_api = OBJECTS_CLASSIC_API; the_api <= OBJECTS_APIS_LAST; the_api++) { /* * This can occur when no one is interested and an API is not configured. */ if ( !_Objects_Information_table[ the_api ] ) 802533c: 28 85 00 00 lw r5,(r4+0) 8025340: 44 a0 00 1e be r5,r0,80253b8 <== NEVER TAKEN continue; the_info = _Objects_Information_table[ the_api ][ 1 ]; 8025344: 28 a5 00 04 lw r5,(r5+4) #endif maximum = the_info->maximum; object_table = the_info->local_table; for ( index = 1 ; index <= maximum ; index++ ) { 8025348: 34 06 00 01 mvi r6,1 */ if ( !the_info ) continue; #endif maximum = the_info->maximum; 802534c: 2c ae 00 10 lhu r14,(r5+16) 8025350: 28 a7 00 1c lw r7,(r5+28) object_table = the_info->local_table; for ( index = 1 ; index <= maximum ; index++ ) { 8025354: e0 00 00 18 bi 80253b4 the_thread = (Thread_Control *) object_table[ index ]; 8025358: 28 e2 00 04 lw r2,(r7+4) if ( !the_thread ) 802535c: 44 40 00 14 be r2,r0,80253ac /* * If this thread is of lower priority than the interested thread, * go on to the next thread. */ if ( the_thread->current_priority > interested_priority ) 8025360: 28 45 00 14 lw r5,(r2+20) 8025364: 54 a1 00 12 bgu r5,r1,80253ac #if defined(RTEMS_DEBUG) if ( !api ) continue; #endif if ( !_POSIX_signals_Is_interested( api, mask ) ) 8025368: 28 49 01 20 lw r9,(r2+288) 802536c: 29 29 00 d0 lw r9,(r9+208) 8025370: a5 20 48 00 not r9,r9 8025374: a1 89 48 00 and r9,r12,r9 8025378: 45 20 00 0d be r9,r0,80253ac * * NOTE: We initialized interested_priority to PRIORITY_MAXIMUM + 1 * so we never have to worry about deferencing a NULL * interested thread. */ if ( the_thread->current_priority < interested_priority ) { 802537c: 54 25 00 0a bgu r1,r5,80253a4 * and blocking interruptibutable by signal. * * If the interested thread is ready, don't think about changing. */ if ( interested && !_States_Is_ready( interested->current_state ) ) { 8025380: 44 60 00 0b be r3,r0,80253ac <== NEVER TAKEN 8025384: 28 69 00 10 lw r9,(r3+16) 8025388: 45 20 00 09 be r9,r0,80253ac <== NEVER TAKEN /* preferred ready over blocked */ DEBUG_STEP("5"); if ( _States_Is_ready( the_thread->current_state ) ) { 802538c: 28 4a 00 10 lw r10,(r2+16) 8025390: 45 40 00 05 be r10,r0,80253a4 8025394: a1 28 48 00 and r9,r9,r8 continue; } DEBUG_STEP("6"); /* prefer blocked/interruptible over blocked/not interruptible */ if ( !_States_Is_interruptible_by_signal(interested->current_state) ) { 8025398: 5d 20 00 05 bne r9,r0,80253ac 802539c: a1 48 50 00 and r10,r10,r8 DEBUG_STEP("7"); if ( _States_Is_interruptible_by_signal(the_thread->current_state) ) { 80253a0: 45 49 00 03 be r10,r9,80253ac */ if ( interested && !_States_Is_ready( interested->current_state ) ) { /* preferred ready over blocked */ DEBUG_STEP("5"); if ( _States_Is_ready( the_thread->current_state ) ) { 80253a4: b8 a0 08 00 mv r1,r5 80253a8: b8 40 18 00 mv r3,r2 #endif maximum = the_info->maximum; object_table = the_info->local_table; for ( index = 1 ; index <= maximum ; index++ ) { 80253ac: 34 c6 00 01 addi r6,r6,1 80253b0: 34 e7 00 04 addi r7,r7,4 80253b4: 51 c6 ff e9 bgeu r14,r6,8025358 80253b8: 34 84 00 04 addi r4,r4,4 * + rtems internal threads do not receive signals. */ interested = NULL; interested_priority = PRIORITY_MAXIMUM + 1; for (the_api = OBJECTS_CLASSIC_API; the_api <= OBJECTS_APIS_LAST; the_api++) { 80253bc: 5c 8d ff e0 bne r4,r13,802533c } } } } if ( interested ) { 80253c0: 44 60 00 06 be r3,r0,80253d8 /* * Returns true if the signal was synchronously given to a thread * blocked waiting for the signal. */ if ( _POSIX_signals_Unblock_thread( the_thread, sig, siginfo ) ) { 80253c4: b8 60 08 00 mv r1,r3 80253c8: b9 60 10 00 mv r2,r11 80253cc: 37 83 00 1c addi r3,sp,28 80253d0: f8 00 00 3d calli 80254c4 <_POSIX_signals_Unblock_thread> 80253d4: 5c 20 00 27 bne r1,r0,8025470 /* * We may have woken up a thread but we definitely need to post the * signal to the process wide information set. */ _POSIX_signals_Set_process_signals( mask ); 80253d8: b9 80 08 00 mv r1,r12 80253dc: f8 00 00 2f calli 8025498 <_POSIX_signals_Set_process_signals> if ( _POSIX_signals_Vectors[ sig ].sa_flags == SA_SIGINFO ) { 80253e0: b9 60 08 00 mv r1,r11 80253e4: 34 02 00 01 mvi r2,1 80253e8: fb ff 72 ae calli 8001ea0 <__ashlsi3> 80253ec: b4 2b 58 00 add r11,r1,r11 80253f0: 34 02 00 02 mvi r2,2 80253f4: 78 0c 08 02 mvhi r12,0x802 80253f8: b9 60 08 00 mv r1,r11 80253fc: fb ff 72 a9 calli 8001ea0 <__ashlsi3> 8025400: 39 8c 9f 40 ori r12,r12,0x9f40 8025404: b5 81 08 00 add r1,r12,r1 8025408: 28 22 00 00 lw r2,(r1+0) 802540c: 34 01 00 02 mvi r1,2 8025410: 5c 41 00 18 bne r2,r1,8025470 psiginfo = (POSIX_signals_Siginfo_node *) _Chain_Get( &_POSIX_signals_Inactive_siginfo ); 8025414: 78 01 08 02 mvhi r1,0x802 8025418: 38 21 a0 c0 ori r1,r1,0xa0c0 802541c: fb ff 92 85 calli 8009e30 <_Chain_Get> 8025420: b8 20 60 00 mv r12,r1 if ( !psiginfo ) { 8025424: 5c 20 00 05 bne r1,r0,8025438 _Thread_Enable_dispatch(); 8025428: fb ff 9a de calli 800bfa0 <_Thread_Enable_dispatch> rtems_set_errno_and_return_minus_one( EAGAIN ); 802542c: fb ff b6 f7 calli 8013008 <__errno> 8025430: 34 02 00 0b mvi r2,11 8025434: e3 ff ff 70 bi 80251f4 } psiginfo->Info = *siginfo; 8025438: 2b 81 00 1c lw r1,(sp+28) _Chain_Append( &_POSIX_signals_Siginfo[ sig ], &psiginfo->Node ); 802543c: 34 02 00 02 mvi r2,2 if ( !psiginfo ) { _Thread_Enable_dispatch(); rtems_set_errno_and_return_minus_one( EAGAIN ); } psiginfo->Info = *siginfo; 8025440: 59 81 00 08 sw (r12+8),r1 8025444: 2b 81 00 20 lw r1,(sp+32) 8025448: 59 81 00 0c sw (r12+12),r1 802544c: 2b 81 00 24 lw r1,(sp+36) 8025450: 59 81 00 10 sw (r12+16),r1 _Chain_Append( &_POSIX_signals_Siginfo[ sig ], &psiginfo->Node ); 8025454: b9 60 08 00 mv r1,r11 8025458: fb ff 72 92 calli 8001ea0 <__ashlsi3> 802545c: 78 02 08 02 mvhi r2,0x802 8025460: 38 42 a1 38 ori r2,r2,0xa138 8025464: b4 22 08 00 add r1,r1,r2 8025468: b9 80 10 00 mv r2,r12 802546c: fb ff 92 5b calli 8009dd8 <_Chain_Append> } DEBUG_STEP("\n"); _Thread_Enable_dispatch(); 8025470: fb ff 9a cc calli 800bfa0 <_Thread_Enable_dispatch> return 0; 8025474: 34 01 00 00 mvi r1,0 } 8025478: 2b 9d 00 04 lw ra,(sp+4) 802547c: 2b 8b 00 18 lw r11,(sp+24) 8025480: 2b 8c 00 14 lw r12,(sp+20) 8025484: 2b 8d 00 10 lw r13,(sp+16) 8025488: 2b 8e 00 0c lw r14,(sp+12) 802548c: 2b 8f 00 08 lw r15,(sp+8) 8025490: 37 9c 00 24 addi sp,sp,36 8025494: c3 a0 00 00 ret =============================================================================== 0800842c : pthread_attr_t *attr, int policy ) { if ( !attr || !attr->is_initialized ) return EINVAL; 800842c: 34 03 00 16 mvi r3,22 int pthread_attr_setschedpolicy( pthread_attr_t *attr, int policy ) { if ( !attr || !attr->is_initialized ) 8008430: 44 20 00 0c be r1,r0,8008460 8008434: 28 24 00 00 lw r4,(r1+0) 8008438: 44 80 00 0a be r4,r0,8008460 return EINVAL; switch ( policy ) { 800843c: 48 02 00 08 bg r0,r2,800845c 8008440: 34 03 00 02 mvi r3,2 8008444: 4c 62 00 03 bge r3,r2,8008450 8008448: 34 03 00 04 mvi r3,4 800844c: 5c 43 00 04 bne r2,r3,800845c <== NEVER TAKEN case SCHED_OTHER: case SCHED_FIFO: case SCHED_RR: case SCHED_SPORADIC: attr->schedpolicy = policy; 8008450: 58 22 00 14 sw (r1+20),r2 return 0; 8008454: 34 03 00 00 mvi r3,0 8008458: e0 00 00 02 bi 8008460 default: return ENOTSUP; 800845c: 34 03 00 86 mvi r3,134 } } 8008460: b8 60 08 00 mv r1,r3 8008464: c3 a0 00 00 ret =============================================================================== 0800340c : int pthread_barrier_init( pthread_barrier_t *barrier, const pthread_barrierattr_t *attr, unsigned int count ) { 800340c: 37 9c ff dc addi sp,sp,-36 8003410: 5b 8b 00 14 sw (sp+20),r11 8003414: 5b 8c 00 10 sw (sp+16),r12 8003418: 5b 8d 00 0c sw (sp+12),r13 800341c: 5b 8e 00 08 sw (sp+8),r14 8003420: 5b 9d 00 04 sw (sp+4),ra /* * Error check parameters */ if ( !barrier ) return EINVAL; 8003424: 34 04 00 16 mvi r4,22 int pthread_barrier_init( pthread_barrier_t *barrier, const pthread_barrierattr_t *attr, unsigned int count ) { 8003428: b8 20 68 00 mv r13,r1 800342c: b8 60 58 00 mv r11,r3 const pthread_barrierattr_t *the_attr; /* * Error check parameters */ if ( !barrier ) 8003430: 44 20 00 2a be r1,r0,80034d8 return EINVAL; if ( count == 0 ) 8003434: 44 60 00 29 be r3,r0,80034d8 return EINVAL; /* * If the user passed in NULL, use the default attributes */ if ( attr ) { 8003438: 5c 40 00 05 bne r2,r0,800344c the_attr = attr; } else { (void) pthread_barrierattr_init( &my_attr ); 800343c: 37 8c 00 18 addi r12,sp,24 8003440: b9 80 08 00 mv r1,r12 8003444: fb ff ff bb calli 8003330 the_attr = &my_attr; 8003448: b9 80 10 00 mv r2,r12 } /* * Now start error checking the attributes that we are going to use */ if ( !the_attr->is_initialized ) 800344c: 28 41 00 00 lw r1,(r2+0) return EINVAL; 8003450: 34 04 00 16 mvi r4,22 } /* * Now start error checking the attributes that we are going to use */ if ( !the_attr->is_initialized ) 8003454: 44 20 00 21 be r1,r0,80034d8 return EINVAL; switch ( the_attr->process_shared ) { 8003458: 28 4e 00 04 lw r14,(r2+4) 800345c: 5d c0 00 1f bne r14,r0,80034d8 <== NEVER TAKEN rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 8003460: 78 02 08 01 mvhi r2,0x801 8003464: 38 42 68 68 ori r2,r2,0x6868 8003468: 28 41 00 00 lw r1,(r2+0) } /* * Convert from POSIX attributes to Core Barrier attributes */ the_attributes.discipline = CORE_BARRIER_AUTOMATIC_RELEASE; 800346c: 5b 80 00 20 sw (sp+32),r0 the_attributes.maximum_count = count; 8003470: 5b 8b 00 24 sw (sp+36),r11 8003474: 34 21 00 01 addi r1,r1,1 8003478: 58 41 00 00 sw (r2+0),r1 * the inactive chain of free barrier control blocks. */ RTEMS_INLINE_ROUTINE POSIX_Barrier_Control *_POSIX_Barrier_Allocate( void ) { return (POSIX_Barrier_Control *) _Objects_Allocate( &_POSIX_Barrier_Information ); 800347c: 78 0c 08 01 mvhi r12,0x801 8003480: 39 8c 6b c0 ori r12,r12,0x6bc0 8003484: b9 80 08 00 mv r1,r12 8003488: f8 00 07 e5 calli 800541c <_Objects_Allocate> 800348c: b8 20 58 00 mv r11,r1 */ _Thread_Disable_dispatch(); /* prevents deletion */ the_barrier = _POSIX_Barrier_Allocate(); if ( !the_barrier ) { 8003490: 5c 2e 00 04 bne r1,r14,80034a0 _Thread_Enable_dispatch(); 8003494: f8 00 0c 65 calli 8006628 <_Thread_Enable_dispatch> return EAGAIN; 8003498: 34 04 00 0b mvi r4,11 800349c: e0 00 00 0f bi 80034d8 } _CORE_barrier_Initialize( &the_barrier->Barrier, &the_attributes ); 80034a0: 34 21 00 10 addi r1,r1,16 80034a4: 37 82 00 20 addi r2,sp,32 80034a8: f8 00 04 e8 calli 8004848 <_CORE_barrier_Initialize> uint32_t name ) { _Objects_Set_local_object( information, _Objects_Get_index( the_object->id ), 80034ac: 29 6e 00 08 lw r14,(r11+8) #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 80034b0: 29 8c 00 1c lw r12,(r12+28) 80034b4: 34 02 00 02 mvi r2,2 80034b8: 21 c1 ff ff andi r1,r14,0xffff 80034bc: f8 00 3d bb calli 8012ba8 <__ashlsi3> 80034c0: b5 81 08 00 add r1,r12,r1 80034c4: 58 2b 00 00 sw (r1+0),r11 _Objects_Get_index( the_object->id ), the_object ); /* ASSERT: information->is_string == false */ the_object->name.name_u32 = name; 80034c8: 59 60 00 0c sw (r11+12),r0 ); /* * Exit the critical section and return the user an operational barrier */ *barrier = the_barrier->Object.id; 80034cc: 59 ae 00 00 sw (r13+0),r14 _Thread_Enable_dispatch(); 80034d0: f8 00 0c 56 calli 8006628 <_Thread_Enable_dispatch> return 0; 80034d4: 34 04 00 00 mvi r4,0 } 80034d8: b8 80 08 00 mv r1,r4 80034dc: 2b 9d 00 04 lw ra,(sp+4) 80034e0: 2b 8b 00 14 lw r11,(sp+20) 80034e4: 2b 8c 00 10 lw r12,(sp+16) 80034e8: 2b 8d 00 0c lw r13,(sp+12) 80034ec: 2b 8e 00 08 lw r14,(sp+8) 80034f0: 37 9c 00 24 addi sp,sp,36 80034f4: c3 a0 00 00 ret =============================================================================== 08002c88 : void pthread_cleanup_push( void (*routine)( void * ), void *arg ) { 8002c88: 37 9c ff f4 addi sp,sp,-12 8002c8c: 5b 8b 00 0c sw (sp+12),r11 8002c90: 5b 8c 00 08 sw (sp+8),r12 8002c94: 5b 9d 00 04 sw (sp+4),ra 8002c98: b8 20 58 00 mv r11,r1 8002c9c: b8 40 60 00 mv r12,r2 /* * 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 ) 8002ca0: 44 20 00 13 be r1,r0,8002cec rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 8002ca4: 78 03 08 01 mvhi r3,0x801 8002ca8: 38 63 68 50 ori r3,r3,0x6850 8002cac: 28 61 00 00 lw r1,(r3+0) 8002cb0: 34 21 00 01 addi r1,r1,1 8002cb4: 58 61 00 00 sw (r3+0),r1 return; _Thread_Disable_dispatch(); handler = _Workspace_Allocate( sizeof( POSIX_Cancel_Handler_control ) ); 8002cb8: 34 01 00 10 mvi r1,16 8002cbc: f8 00 11 87 calli 80072d8 <_Workspace_Allocate> 8002cc0: b8 20 10 00 mv r2,r1 if ( handler ) { 8002cc4: 44 20 00 09 be r1,r0,8002ce8 <== NEVER TAKEN thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; 8002cc8: 78 03 08 01 mvhi r3,0x801 8002ccc: 38 63 6d 20 ori r3,r3,0x6d20 8002cd0: 28 61 00 0c lw r1,(r3+12) handler_stack = &thread_support->Cancellation_Handlers; 8002cd4: 28 21 01 20 lw r1,(r1+288) handler->routine = routine; 8002cd8: 58 4b 00 08 sw (r2+8),r11 handler->arg = arg; 8002cdc: 58 4c 00 0c sw (r2+12),r12 _Chain_Append( handler_stack, &handler->Node ); 8002ce0: 34 21 00 e4 addi r1,r1,228 8002ce4: f8 00 04 f8 calli 80040c4 <_Chain_Append> } _Thread_Enable_dispatch(); 8002ce8: f8 00 0c 3f calli 8005de4 <_Thread_Enable_dispatch> } 8002cec: 2b 9d 00 04 lw ra,(sp+4) 8002cf0: 2b 8b 00 0c lw r11,(sp+12) 8002cf4: 2b 8c 00 08 lw r12,(sp+8) 8002cf8: 37 9c 00 0c addi sp,sp,12 8002cfc: c3 a0 00 00 ret =============================================================================== 08003d50 : int pthread_cond_init( pthread_cond_t *cond, const pthread_condattr_t *attr ) { 8003d50: 37 9c ff ec addi sp,sp,-20 8003d54: 5b 8b 00 14 sw (sp+20),r11 8003d58: 5b 8c 00 10 sw (sp+16),r12 8003d5c: 5b 8d 00 0c sw (sp+12),r13 8003d60: 5b 8e 00 08 sw (sp+8),r14 8003d64: 5b 9d 00 04 sw (sp+4),ra 8003d68: b8 20 70 00 mv r14,r1 8003d6c: b8 40 58 00 mv r11,r2 POSIX_Condition_variables_Control *the_cond; const pthread_condattr_t *the_attr; if ( attr ) the_attr = attr; 8003d70: 5c 40 00 03 bne r2,r0,8003d7c else the_attr = &_POSIX_Condition_variables_Default_attributes; 8003d74: 78 0b 08 01 mvhi r11,0x801 8003d78: 39 6b 59 d8 ori r11,r11,0x59d8 /* * Be careful about attributes when global!!! */ if ( the_attr->process_shared == PTHREAD_PROCESS_SHARED ) 8003d7c: 29 63 00 04 lw r3,(r11+4) 8003d80: 34 02 00 01 mvi r2,1 return EINVAL; 8003d84: 34 01 00 16 mvi r1,22 else the_attr = &_POSIX_Condition_variables_Default_attributes; /* * Be careful about attributes when global!!! */ if ( the_attr->process_shared == PTHREAD_PROCESS_SHARED ) 8003d88: 44 62 00 26 be r3,r2,8003e20 <== NEVER TAKEN return EINVAL; if ( !the_attr->is_initialized ) 8003d8c: 29 62 00 00 lw r2,(r11+0) 8003d90: 44 40 00 24 be r2,r0,8003e20 rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 8003d94: 78 02 08 01 mvhi r2,0x801 8003d98: 38 42 78 68 ori r2,r2,0x7868 8003d9c: 28 41 00 00 lw r1,(r2+0) 8003da0: 34 21 00 01 addi r1,r1,1 8003da4: 58 41 00 00 sw (r2+0),r1 RTEMS_INLINE_ROUTINE POSIX_Condition_variables_Control *_POSIX_Condition_variables_Allocate( void ) { return (POSIX_Condition_variables_Control *) _Objects_Allocate( &_POSIX_Condition_variables_Information ); 8003da8: 78 0d 08 01 mvhi r13,0x801 8003dac: 39 ad 7c 58 ori r13,r13,0x7c58 8003db0: b9 a0 08 00 mv r1,r13 8003db4: f8 00 09 86 calli 80063cc <_Objects_Allocate> 8003db8: b8 20 60 00 mv r12,r1 _Thread_Disable_dispatch(); the_cond = _POSIX_Condition_variables_Allocate(); if ( !the_cond ) { 8003dbc: 5c 20 00 04 bne r1,r0,8003dcc _Thread_Enable_dispatch(); 8003dc0: f8 00 0e 77 calli 800779c <_Thread_Enable_dispatch> return ENOMEM; 8003dc4: 34 01 00 0c mvi r1,12 8003dc8: e0 00 00 16 bi 8003e20 the_cond->process_shared = the_attr->process_shared; the_cond->Mutex = POSIX_CONDITION_VARIABLES_NO_MUTEX; _Thread_queue_Initialize( 8003dcc: 78 04 08 01 mvhi r4,0x801 if ( !the_cond ) { _Thread_Enable_dispatch(); return ENOMEM; } the_cond->process_shared = the_attr->process_shared; 8003dd0: 29 61 00 04 lw r1,(r11+4) the_cond->Mutex = POSIX_CONDITION_VARIABLES_NO_MUTEX; _Thread_queue_Initialize( 8003dd4: 38 84 59 e0 ori r4,r4,0x59e0 8003dd8: 28 83 00 00 lw r3,(r4+0) if ( !the_cond ) { _Thread_Enable_dispatch(); return ENOMEM; } the_cond->process_shared = the_attr->process_shared; 8003ddc: 59 81 00 10 sw (r12+16),r1 the_cond->Mutex = POSIX_CONDITION_VARIABLES_NO_MUTEX; _Thread_queue_Initialize( 8003de0: 34 04 00 74 mvi r4,116 8003de4: 35 81 00 18 addi r1,r12,24 8003de8: 34 02 00 00 mvi r2,0 return ENOMEM; } the_cond->process_shared = the_attr->process_shared; the_cond->Mutex = POSIX_CONDITION_VARIABLES_NO_MUTEX; 8003dec: 59 80 00 14 sw (r12+20),r0 _Thread_queue_Initialize( 8003df0: f8 00 10 b6 calli 80080c8 <_Thread_queue_Initialize> uint32_t name ) { _Objects_Set_local_object( information, _Objects_Get_index( the_object->id ), 8003df4: 29 8b 00 08 lw r11,(r12+8) #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 8003df8: 29 ad 00 1c lw r13,(r13+28) 8003dfc: 34 02 00 02 mvi r2,2 8003e00: 21 61 ff ff andi r1,r11,0xffff 8003e04: f8 00 3f 20 calli 8013a84 <__ashlsi3> 8003e08: b5 a1 10 00 add r2,r13,r1 8003e0c: 58 4c 00 00 sw (r2+0),r12 _Objects_Get_index( the_object->id ), the_object ); /* ASSERT: information->is_string == false */ the_object->name.name_u32 = name; 8003e10: 59 80 00 0c sw (r12+12),r0 &_POSIX_Condition_variables_Information, &the_cond->Object, 0 ); *cond = the_cond->Object.id; 8003e14: 59 cb 00 00 sw (r14+0),r11 _Thread_Enable_dispatch(); 8003e18: f8 00 0e 61 calli 800779c <_Thread_Enable_dispatch> return 0; 8003e1c: 34 01 00 00 mvi r1,0 } 8003e20: 2b 9d 00 04 lw ra,(sp+4) 8003e24: 2b 8b 00 14 lw r11,(sp+20) 8003e28: 2b 8c 00 10 lw r12,(sp+16) 8003e2c: 2b 8d 00 0c lw r13,(sp+12) 8003e30: 2b 8e 00 08 lw r14,(sp+8) 8003e34: 37 9c 00 14 addi sp,sp,20 8003e38: c3 a0 00 00 ret =============================================================================== 08003bc4 : int pthread_condattr_destroy( pthread_condattr_t *attr ) { if ( !attr || attr->is_initialized == false ) return EINVAL; 8003bc4: 34 02 00 16 mvi r2,22 int pthread_condattr_destroy( pthread_condattr_t *attr ) { if ( !attr || attr->is_initialized == false ) 8003bc8: 44 20 00 05 be r1,r0,8003bdc 8003bcc: 28 23 00 00 lw r3,(r1+0) 8003bd0: 44 60 00 03 be r3,r0,8003bdc <== NEVER TAKEN return EINVAL; attr->is_initialized = false; 8003bd4: 58 20 00 00 sw (r1+0),r0 return 0; 8003bd8: 34 02 00 00 mvi r2,0 } 8003bdc: b8 40 08 00 mv r1,r2 8003be0: c3 a0 00 00 ret =============================================================================== 080030a0 : pthread_t *thread, const pthread_attr_t *attr, void *(*start_routine)( void * ), void *arg ) { 80030a0: 37 9c ff a0 addi sp,sp,-96 80030a4: 5b 8b 00 3c sw (sp+60),r11 80030a8: 5b 8c 00 38 sw (sp+56),r12 80030ac: 5b 8d 00 34 sw (sp+52),r13 80030b0: 5b 8e 00 30 sw (sp+48),r14 80030b4: 5b 8f 00 2c sw (sp+44),r15 80030b8: 5b 90 00 28 sw (sp+40),r16 80030bc: 5b 91 00 24 sw (sp+36),r17 80030c0: 5b 92 00 20 sw (sp+32),r18 80030c4: 5b 93 00 1c sw (sp+28),r19 80030c8: 5b 94 00 18 sw (sp+24),r20 80030cc: 5b 95 00 14 sw (sp+20),r21 80030d0: 5b 9d 00 10 sw (sp+16),ra struct sched_param schedparam; Objects_Name name; int rc; if ( !start_routine ) return EFAULT; 80030d4: 34 0d 00 0e mvi r13,14 pthread_t *thread, const pthread_attr_t *attr, void *(*start_routine)( void * ), void *arg ) { 80030d8: b8 20 88 00 mv r17,r1 80030dc: b8 60 80 00 mv r16,r3 80030e0: b8 80 90 00 mv r18,r4 int schedpolicy = SCHED_RR; struct sched_param schedparam; Objects_Name name; int rc; if ( !start_routine ) 80030e4: 44 60 00 a5 be r3,r0,8003378 return EFAULT; the_attr = (attr) ? attr : &_POSIX_Threads_Default_attributes; 80030e8: b8 40 58 00 mv r11,r2 80030ec: 5c 40 00 03 bne r2,r0,80030f8 80030f0: 78 0b 08 01 mvhi r11,0x801 80030f4: 39 6b d3 dc ori r11,r11,0xd3dc if ( !the_attr->is_initialized ) 80030f8: 29 61 00 00 lw r1,(r11+0) return EINVAL; 80030fc: 34 0d 00 16 mvi r13,22 if ( !start_routine ) return EFAULT; the_attr = (attr) ? attr : &_POSIX_Threads_Default_attributes; if ( !the_attr->is_initialized ) 8003100: 44 20 00 9e be r1,r0,8003378 * 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) ) 8003104: 29 61 00 04 lw r1,(r11+4) 8003108: 44 20 00 06 be r1,r0,8003120 800310c: 78 02 08 01 mvhi r2,0x801 8003110: 38 42 f0 e0 ori r2,r2,0xf0e0 8003114: 29 63 00 08 lw r3,(r11+8) 8003118: 28 41 00 00 lw r1,(r2+0) 800311c: 54 23 00 97 bgu r1,r3,8003378 * 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 ) { 8003120: 29 62 00 10 lw r2,(r11+16) 8003124: 34 01 00 01 mvi r1,1 8003128: 44 41 00 05 be r2,r1,800313c 800312c: 34 01 00 02 mvi r1,2 schedpolicy = the_attr->schedpolicy; schedparam = the_attr->schedparam; break; default: return EINVAL; 8003130: 34 0d 00 16 mvi r13,22 * 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 ) { 8003134: 5c 41 00 91 bne r2,r1,8003378 8003138: e0 00 00 14 bi 8003188 case PTHREAD_INHERIT_SCHED: api = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; 800313c: 78 02 08 01 mvhi r2,0x801 8003140: 38 42 fd 28 ori r2,r2,0xfd28 8003144: 28 41 00 0c lw r1,(r2+12) 8003148: 28 22 01 20 lw r2,(r1+288) schedpolicy = api->schedpolicy; schedparam = api->schedparam; 800314c: 28 48 00 88 lw r8,(r2+136) 8003150: 28 47 00 8c lw r7,(r2+140) 8003154: 28 46 00 90 lw r6,(r2+144) 8003158: 28 45 00 94 lw r5,(r2+148) 800315c: 28 44 00 98 lw r4,(r2+152) 8003160: 28 43 00 9c lw r3,(r2+156) * attributes structure. */ switch ( the_attr->inheritsched ) { case PTHREAD_INHERIT_SCHED: api = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; schedpolicy = api->schedpolicy; 8003164: 28 4f 00 84 lw r15,(r2+132) schedparam = api->schedparam; 8003168: 28 41 00 a0 lw r1,(r2+160) 800316c: 5b 88 00 40 sw (sp+64),r8 8003170: 5b 87 00 44 sw (sp+68),r7 8003174: 5b 86 00 48 sw (sp+72),r6 8003178: 5b 85 00 4c sw (sp+76),r5 800317c: 5b 84 00 50 sw (sp+80),r4 8003180: 5b 83 00 54 sw (sp+84),r3 8003184: e0 00 00 0f bi 80031c0 break; case PTHREAD_EXPLICIT_SCHED: schedpolicy = the_attr->schedpolicy; schedparam = the_attr->schedparam; 8003188: 29 67 00 18 lw r7,(r11+24) 800318c: 29 66 00 1c lw r6,(r11+28) 8003190: 29 65 00 20 lw r5,(r11+32) 8003194: 29 64 00 24 lw r4,(r11+36) 8003198: 29 63 00 28 lw r3,(r11+40) 800319c: 29 62 00 2c lw r2,(r11+44) schedpolicy = api->schedpolicy; schedparam = api->schedparam; break; case PTHREAD_EXPLICIT_SCHED: schedpolicy = the_attr->schedpolicy; 80031a0: 29 6f 00 14 lw r15,(r11+20) schedparam = the_attr->schedparam; 80031a4: 29 61 00 30 lw r1,(r11+48) 80031a8: 5b 87 00 40 sw (sp+64),r7 80031ac: 5b 86 00 44 sw (sp+68),r6 80031b0: 5b 85 00 48 sw (sp+72),r5 80031b4: 5b 84 00 4c sw (sp+76),r4 80031b8: 5b 83 00 50 sw (sp+80),r3 80031bc: 5b 82 00 54 sw (sp+84),r2 /* * Check the contentionscope since rtems only supports PROCESS wide * contention (i.e. no system wide contention). */ if ( the_attr->contentionscope != PTHREAD_SCOPE_PROCESS ) 80031c0: 29 6c 00 0c lw r12,(r11+12) schedparam = api->schedparam; break; case PTHREAD_EXPLICIT_SCHED: schedpolicy = the_attr->schedpolicy; schedparam = the_attr->schedparam; 80031c4: 5b 81 00 58 sw (sp+88),r1 /* * Check the contentionscope since rtems only supports PROCESS wide * contention (i.e. no system wide contention). */ if ( the_attr->contentionscope != PTHREAD_SCOPE_PROCESS ) return ENOTSUP; 80031c8: 34 0d 00 86 mvi r13,134 /* * Check the contentionscope since rtems only supports PROCESS wide * contention (i.e. no system wide contention). */ if ( the_attr->contentionscope != PTHREAD_SCOPE_PROCESS ) 80031cc: 5d 80 00 6b bne r12,r0,8003378 return ENOTSUP; /* * Interpret the scheduling parameters. */ if ( !_POSIX_Priority_Is_valid( schedparam.sched_priority ) ) 80031d0: 2b 81 00 40 lw r1,(sp+64) return EINVAL; 80031d4: 34 0d 00 16 mvi r13,22 return ENOTSUP; /* * Interpret the scheduling parameters. */ if ( !_POSIX_Priority_Is_valid( schedparam.sched_priority ) ) 80031d8: f8 00 1b 99 calli 800a03c <_POSIX_Priority_Is_valid> 80031dc: 44 2c 00 67 be r1,r12,8003378 <== NEVER TAKEN RTEMS_INLINE_ROUTINE Priority_Control _POSIX_Priority_To_core( int priority ) { return (Priority_Control) (POSIX_SCHEDULER_MAXIMUM_PRIORITY - priority + 1); 80031e0: 78 02 08 01 mvhi r2,0x801 80031e4: 38 42 f0 e4 ori r2,r2,0xf0e4 80031e8: 40 54 00 00 lbu r20,(r2+0) core_priority = _POSIX_Priority_To_core( schedparam.sched_priority ); /* * Set the core scheduling policy information. */ rc = _POSIX_Thread_Translate_sched_param( 80031ec: b9 e0 08 00 mv r1,r15 80031f0: 37 82 00 40 addi r2,sp,64 80031f4: 37 83 00 60 addi r3,sp,96 80031f8: 37 84 00 5c addi r4,sp,92 * Interpret the scheduling parameters. */ if ( !_POSIX_Priority_Is_valid( schedparam.sched_priority ) ) return EINVAL; core_priority = _POSIX_Priority_To_core( schedparam.sched_priority ); 80031fc: 2b 93 00 40 lw r19,(sp+64) /* * Set the core scheduling policy information. */ rc = _POSIX_Thread_Translate_sched_param( 8003200: f8 00 1b 97 calli 800a05c <_POSIX_Thread_Translate_sched_param> 8003204: b8 20 68 00 mv r13,r1 schedpolicy, &schedparam, &budget_algorithm, &budget_callout ); if ( rc ) 8003208: 5c 20 00 5c bne r1,r0,8003378 <== NEVER TAKEN #endif /* * Lock the allocator mutex for protection */ _RTEMS_Lock_allocator(); 800320c: 78 0c 08 01 mvhi r12,0x801 8003210: 39 8c f9 18 ori r12,r12,0xf918 8003214: 29 81 00 00 lw r1,(r12+0) 8003218: f8 00 04 f5 calli 80045ec <_API_Mutex_Lock> * _POSIX_Threads_Allocate */ RTEMS_INLINE_ROUTINE Thread_Control *_POSIX_Threads_Allocate( void ) { return (Thread_Control *) _Objects_Allocate( &_POSIX_Threads_Information ); 800321c: 78 02 08 01 mvhi r2,0x801 8003220: b8 40 08 00 mv r1,r2 8003224: 38 21 fa 30 ori r1,r1,0xfa30 8003228: f8 00 08 07 calli 8005244 <_Objects_Allocate> 800322c: b8 20 70 00 mv r14,r1 * Allocate the thread control block. * * NOTE: Global threads are not currently supported. */ the_thread = _POSIX_Threads_Allocate(); if ( !the_thread ) { 8003230: 5c 2d 00 03 bne r1,r13,800323c _RTEMS_Unlock_allocator(); 8003234: 29 81 00 00 lw r1,(r12+0) 8003238: e0 00 00 21 bi 80032bc static inline size_t _POSIX_Threads_Ensure_minimum_stack ( size_t size ) { if ( size >= PTHREAD_MINIMUM_STACK_SIZE ) 800323c: 78 02 08 01 mvhi r2,0x801 8003240: 38 42 f0 e0 ori r2,r2,0xf0e0 8003244: 28 41 00 00 lw r1,(r2+0) /* * Initialize the core thread for this task. */ name.name_p = NULL; /* posix threads don't have a name by default */ status = _Thread_Initialize( 8003248: 29 6c 00 08 lw r12,(r11+8) static inline size_t _POSIX_Threads_Ensure_minimum_stack ( size_t size ) { if ( size >= PTHREAD_MINIMUM_STACK_SIZE ) 800324c: 34 02 00 01 mvi r2,1 8003250: f8 00 61 e5 calli 801b9e4 <__ashlsi3> /* * Initialize the core thread for this task. */ name.name_p = NULL; /* posix threads don't have a name by default */ status = _Thread_Initialize( 8003254: 29 75 00 04 lw r21,(r11+4) static inline size_t _POSIX_Threads_Ensure_minimum_stack ( size_t size ) { if ( size >= PTHREAD_MINIMUM_STACK_SIZE ) 8003258: b8 20 28 00 mv r5,r1 /* * Initialize the core thread for this task. */ name.name_p = NULL; /* posix threads don't have a name by default */ status = _Thread_Initialize( 800325c: 50 2c 00 02 bgeu r1,r12,8003264 8003260: b9 80 28 00 mv r5,r12 8003264: 2b 81 00 5c lw r1,(sp+92) 8003268: 78 0c 08 01 mvhi r12,0x801 800326c: 2b 88 00 60 lw r8,(sp+96) 8003270: 39 8c fa 30 ori r12,r12,0xfa30 8003274: 5b 81 00 04 sw (sp+4),r1 8003278: b8 a0 20 00 mv r4,r5 800327c: b9 80 08 00 mv r1,r12 8003280: b9 c0 10 00 mv r2,r14 8003284: ba a0 18 00 mv r3,r21 8003288: 34 05 00 00 mvi r5,0 800328c: ca 93 30 00 sub r6,r20,r19 8003290: 34 07 00 01 mvi r7,1 8003294: 5b 80 00 08 sw (sp+8),r0 8003298: 5b 80 00 0c sw (sp+12),r0 800329c: f8 00 0c c7 calli 80065b8 <_Thread_Initialize> budget_callout, 0, /* isr level */ name /* posix threads don't have a name */ ); if ( !status ) { 80032a0: 5c 20 00 0a bne r1,r0,80032c8 <== ALWAYS TAKEN RTEMS_INLINE_ROUTINE void _POSIX_Threads_Free ( Thread_Control *the_pthread ) { _Objects_Free( &_POSIX_Threads_Information, &the_pthread->Object ); 80032a4: b9 80 08 00 mv r1,r12 <== NOT EXECUTED 80032a8: b9 c0 10 00 mv r2,r14 <== NOT EXECUTED 80032ac: f8 00 08 e2 calli 8005634 <_Objects_Free> <== NOT EXECUTED _POSIX_Threads_Free( the_thread ); _RTEMS_Unlock_allocator(); 80032b0: 78 01 08 01 mvhi r1,0x801 <== NOT EXECUTED 80032b4: 38 21 f9 18 ori r1,r1,0xf918 <== NOT EXECUTED 80032b8: 28 21 00 00 lw r1,(r1+0) <== NOT EXECUTED 80032bc: f8 00 04 e9 calli 8004660 <_API_Mutex_Unlock> return EAGAIN; 80032c0: 34 0d 00 0b mvi r13,11 80032c4: e0 00 00 2d bi 8003378 } /* * finish initializing the per API structure */ api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 80032c8: 29 cc 01 20 lw r12,(r14+288) api->Attributes = *the_attr; 80032cc: b9 60 10 00 mv r2,r11 80032d0: 34 03 00 40 mvi r3,64 80032d4: b9 80 08 00 mv r1,r12 80032d8: f8 00 2a d9 calli 800de3c api->detachstate = the_attr->detachstate; 80032dc: 29 61 00 3c lw r1,(r11+60) api->schedparam = schedparam; /* * POSIX threads are allocated and started in one operation. */ status = _Thread_Start( 80032e0: 34 02 00 01 mvi r2,1 */ api = the_thread->API_Extensions[ THREAD_API_POSIX ]; api->Attributes = *the_attr; api->detachstate = the_attr->detachstate; api->schedpolicy = schedpolicy; 80032e4: 59 8f 00 84 sw (r12+132),r15 * finish initializing the per API structure */ api = the_thread->API_Extensions[ THREAD_API_POSIX ]; api->Attributes = *the_attr; api->detachstate = the_attr->detachstate; 80032e8: 59 81 00 40 sw (r12+64),r1 api->schedpolicy = schedpolicy; api->schedparam = schedparam; 80032ec: 2b 81 00 40 lw r1,(sp+64) /* * POSIX threads are allocated and started in one operation. */ status = _Thread_Start( 80032f0: ba 00 18 00 mv r3,r16 80032f4: ba 40 20 00 mv r4,r18 api = the_thread->API_Extensions[ THREAD_API_POSIX ]; api->Attributes = *the_attr; api->detachstate = the_attr->detachstate; api->schedpolicy = schedpolicy; api->schedparam = schedparam; 80032f8: 59 81 00 88 sw (r12+136),r1 80032fc: 2b 81 00 44 lw r1,(sp+68) /* * POSIX threads are allocated and started in one operation. */ status = _Thread_Start( 8003300: 34 05 00 00 mvi r5,0 api = the_thread->API_Extensions[ THREAD_API_POSIX ]; api->Attributes = *the_attr; api->detachstate = the_attr->detachstate; api->schedpolicy = schedpolicy; api->schedparam = schedparam; 8003304: 59 81 00 8c sw (r12+140),r1 8003308: 2b 81 00 48 lw r1,(sp+72) 800330c: 59 81 00 90 sw (r12+144),r1 8003310: 2b 81 00 4c lw r1,(sp+76) 8003314: 59 81 00 94 sw (r12+148),r1 8003318: 2b 81 00 50 lw r1,(sp+80) 800331c: 59 81 00 98 sw (r12+152),r1 8003320: 2b 81 00 54 lw r1,(sp+84) 8003324: 59 81 00 9c sw (r12+156),r1 8003328: 2b 81 00 58 lw r1,(sp+88) 800332c: 59 81 00 a0 sw (r12+160),r1 /* * POSIX threads are allocated and started in one operation. */ status = _Thread_Start( 8003330: b9 c0 08 00 mv r1,r14 8003334: f8 00 0f 86 calli 800714c <_Thread_Start> _RTEMS_Unlock_allocator(); return EINVAL; } #endif if ( schedpolicy == SCHED_SPORADIC ) { 8003338: 34 01 00 04 mvi r1,4 800333c: 5d e1 00 09 bne r15,r1,8003360 _Watchdog_Insert_ticks( 8003340: 35 81 00 90 addi r1,r12,144 8003344: f8 00 10 09 calli 8007368 <_Timespec_To_ticks> ) { the_watchdog->initial = units; _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 8003348: 78 02 08 01 mvhi r2,0x801 Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 800334c: 59 81 00 b4 sw (r12+180),r1 _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 8003350: b8 40 08 00 mv r1,r2 8003354: 38 21 f9 38 ori r1,r1,0xf938 8003358: 35 82 00 a8 addi r2,r12,168 800335c: f8 00 11 38 calli 800783c <_Watchdog_Insert> } /* * Return the id and indicate we successfully created the thread */ *thread = the_thread->Object.id; 8003360: 29 c1 00 08 lw r1,(r14+8) 8003364: 5a 21 00 00 sw (r17+0),r1 _RTEMS_Unlock_allocator(); 8003368: 78 01 08 01 mvhi r1,0x801 800336c: 38 21 f9 18 ori r1,r1,0xf918 8003370: 28 21 00 00 lw r1,(r1+0) 8003374: f8 00 04 bb calli 8004660 <_API_Mutex_Unlock> return 0; } 8003378: b9 a0 08 00 mv r1,r13 800337c: 2b 9d 00 10 lw ra,(sp+16) 8003380: 2b 8b 00 3c lw r11,(sp+60) 8003384: 2b 8c 00 38 lw r12,(sp+56) 8003388: 2b 8d 00 34 lw r13,(sp+52) 800338c: 2b 8e 00 30 lw r14,(sp+48) 8003390: 2b 8f 00 2c lw r15,(sp+44) 8003394: 2b 90 00 28 lw r16,(sp+40) 8003398: 2b 91 00 24 lw r17,(sp+36) 800339c: 2b 92 00 20 lw r18,(sp+32) 80033a0: 2b 93 00 1c lw r19,(sp+28) 80033a4: 2b 94 00 18 lw r20,(sp+24) 80033a8: 2b 95 00 14 lw r21,(sp+20) 80033ac: 37 9c 00 60 addi sp,sp,96 80033b0: c3 a0 00 00 ret =============================================================================== 08010e68 : void pthread_exit( void *value_ptr ) { 8010e68: 37 9c ff fc addi sp,sp,-4 8010e6c: 5b 9d 00 04 sw (sp+4),ra _POSIX_Thread_Exit( _Thread_Executing, value_ptr ); 8010e70: 78 03 08 01 mvhi r3,0x801 8010e74: 38 63 9d f0 ori r3,r3,0x9df0 } void pthread_exit( void *value_ptr ) { 8010e78: b8 20 10 00 mv r2,r1 _POSIX_Thread_Exit( _Thread_Executing, value_ptr ); 8010e7c: 28 61 00 0c lw r1,(r3+12) 8010e80: fb ff ff d4 calli 8010dd0 <_POSIX_Thread_Exit> } 8010e84: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED 8010e88: 37 9c 00 04 addi sp,sp,4 <== NOT EXECUTED 8010e8c: c3 a0 00 00 ret <== NOT EXECUTED =============================================================================== 08005658 : int pthread_mutex_timedlock( pthread_mutex_t *mutex, const struct timespec *abstime ) { 8005658: 37 9c ff ec addi sp,sp,-20 800565c: 5b 8b 00 10 sw (sp+16),r11 8005660: 5b 8c 00 0c sw (sp+12),r12 8005664: 5b 8d 00 08 sw (sp+8),r13 8005668: 5b 9d 00 04 sw (sp+4),ra 800566c: b8 20 68 00 mv r13,r1 * * 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 ); 8005670: b8 40 08 00 mv r1,r2 8005674: 37 82 00 14 addi r2,sp,20 8005678: f8 00 00 41 calli 800577c <_POSIX_Absolute_timeout_to_ticks> int _EXFUN(pthread_mutex_trylock, (pthread_mutex_t *__mutex)); int _EXFUN(pthread_mutex_unlock, (pthread_mutex_t *__mutex)); #if defined(_POSIX_TIMEOUTS) int _EXFUN(pthread_mutex_timedlock, 800567c: 64 2c 00 03 cmpei r12,r1,3 if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE ) do_wait = false; lock_status = _POSIX_Mutex_Lock_support( mutex, do_wait, ticks ); 8005680: 2b 83 00 14 lw r3,(sp+20) * * 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 ); 8005684: b8 20 58 00 mv r11,r1 if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE ) do_wait = false; lock_status = _POSIX_Mutex_Lock_support( mutex, do_wait, ticks ); 8005688: b9 80 10 00 mv r2,r12 800568c: b9 a0 08 00 mv r1,r13 8005690: fb ff ff a3 calli 800551c <_POSIX_Mutex_Lock_support> * This service only gives us the option to block. We used a polling * attempt to lock if the abstime was not in the future. If we did * not obtain the mutex, then not look at the status immediately, * make sure the right reason is returned. */ if ( !do_wait && (lock_status == EBUSY) ) { 8005694: 5d 80 00 0b bne r12,r0,80056c0 8005698: 34 02 00 10 mvi r2,16 800569c: 5c 22 00 09 bne r1,r2,80056c0 <== NEVER TAKEN if ( status == POSIX_ABSOLUTE_TIMEOUT_INVALID ) 80056a0: 45 60 00 05 be r11,r0,80056b4 <== NEVER TAKEN return EINVAL; if ( status == POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST || 80056a4: 35 6b ff ff addi r11,r11,-1 80056a8: 34 02 00 01 mvi r2,1 80056ac: 50 4b 00 04 bgeu r2,r11,80056bc <== ALWAYS TAKEN 80056b0: e0 00 00 04 bi 80056c0 <== NOT EXECUTED * not obtain the mutex, then not look at the status immediately, * make sure the right reason is returned. */ if ( !do_wait && (lock_status == EBUSY) ) { if ( status == POSIX_ABSOLUTE_TIMEOUT_INVALID ) return EINVAL; 80056b4: 34 01 00 16 mvi r1,22 <== NOT EXECUTED 80056b8: e0 00 00 02 bi 80056c0 <== NOT EXECUTED if ( status == POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST || status == POSIX_ABSOLUTE_TIMEOUT_IS_NOW ) return ETIMEDOUT; 80056bc: 34 01 00 74 mvi r1,116 } return lock_status; } 80056c0: 2b 9d 00 04 lw ra,(sp+4) 80056c4: 2b 8b 00 10 lw r11,(sp+16) 80056c8: 2b 8c 00 0c lw r12,(sp+12) 80056cc: 2b 8d 00 08 lw r13,(sp+8) 80056d0: 37 9c 00 14 addi sp,sp,20 80056d4: c3 a0 00 00 ret =============================================================================== 0800295c : const pthread_mutexattr_t *attr, int *type ) { if ( !attr ) return EINVAL; 800295c: 34 03 00 16 mvi r3,22 int pthread_mutexattr_gettype( const pthread_mutexattr_t *attr, int *type ) { if ( !attr ) 8002960: 44 20 00 07 be r1,r0,800297c return EINVAL; if ( !attr->is_initialized ) 8002964: 28 24 00 00 lw r4,(r1+0) 8002968: 44 80 00 05 be r4,r0,800297c return EINVAL; if ( !type ) 800296c: 44 40 00 04 be r2,r0,800297c <== NEVER TAKEN return EINVAL; *type = attr->type; 8002970: 28 21 00 10 lw r1,(r1+16) return 0; 8002974: 34 03 00 00 mvi r3,0 return EINVAL; if ( !type ) return EINVAL; *type = attr->type; 8002978: 58 41 00 00 sw (r2+0),r1 return 0; } 800297c: b8 60 08 00 mv r1,r3 8002980: c3 a0 00 00 ret =============================================================================== 08005188 : pthread_mutexattr_t *attr, int pshared ) { if ( !attr || !attr->is_initialized ) return EINVAL; 8005188: 34 03 00 16 mvi r3,22 int pthread_mutexattr_setpshared( pthread_mutexattr_t *attr, int pshared ) { if ( !attr || !attr->is_initialized ) 800518c: 44 20 00 07 be r1,r0,80051a8 8005190: 28 24 00 00 lw r4,(r1+0) 8005194: 44 80 00 05 be r4,r0,80051a8 return EINVAL; switch ( pshared ) { 8005198: 34 04 00 01 mvi r4,1 800519c: 54 44 00 03 bgu r2,r4,80051a8 <== NEVER TAKEN case PTHREAD_PROCESS_SHARED: case PTHREAD_PROCESS_PRIVATE: attr->process_shared = pshared; 80051a0: 58 22 00 04 sw (r1+4),r2 return 0; 80051a4: 34 03 00 00 mvi r3,0 default: return EINVAL; } } 80051a8: b8 60 08 00 mv r1,r3 80051ac: c3 a0 00 00 ret =============================================================================== 080029d0 : pthread_mutexattr_t *attr, int type ) { if ( !attr || !attr->is_initialized ) return EINVAL; 80029d0: 34 03 00 16 mvi r3,22 int pthread_mutexattr_settype( pthread_mutexattr_t *attr, int type ) { if ( !attr || !attr->is_initialized ) 80029d4: 44 20 00 07 be r1,r0,80029f0 80029d8: 28 24 00 00 lw r4,(r1+0) 80029dc: 44 80 00 05 be r4,r0,80029f0 <== NEVER TAKEN return EINVAL; switch ( type ) { 80029e0: 34 04 00 03 mvi r4,3 80029e4: 54 44 00 03 bgu r2,r4,80029f0 case PTHREAD_MUTEX_NORMAL: case PTHREAD_MUTEX_RECURSIVE: case PTHREAD_MUTEX_ERRORCHECK: case PTHREAD_MUTEX_DEFAULT: attr->type = type; 80029e8: 58 22 00 10 sw (r1+16),r2 return 0; 80029ec: 34 03 00 00 mvi r3,0 default: return EINVAL; } } 80029f0: b8 60 08 00 mv r1,r3 80029f4: c3 a0 00 00 ret =============================================================================== 080038a4 : int pthread_once( pthread_once_t *once_control, void (*init_routine)(void) ) { 80038a4: 37 9c ff ec addi sp,sp,-20 80038a8: 5b 8b 00 10 sw (sp+16),r11 80038ac: 5b 8c 00 0c sw (sp+12),r12 80038b0: 5b 8d 00 08 sw (sp+8),r13 80038b4: 5b 9d 00 04 sw (sp+4),ra 80038b8: b8 20 58 00 mv r11,r1 80038bc: b8 40 60 00 mv r12,r2 if ( !once_control || !init_routine ) 80038c0: 64 21 00 00 cmpei r1,r1,0 80038c4: 64 42 00 00 cmpei r2,r2,0 80038c8: b8 41 10 00 or r2,r2,r1 return EINVAL; 80038cc: 34 01 00 16 mvi r1,22 int pthread_once( pthread_once_t *once_control, void (*init_routine)(void) ) { if ( !once_control || !init_routine ) 80038d0: 5c 40 00 13 bne r2,r0,800391c return EINVAL; if ( !once_control->init_executed ) { 80038d4: 29 6d 00 04 lw r13,(r11+4) once_control->init_executed = true; (*init_routine)(); } rtems_task_mode(saveMode, RTEMS_PREEMPT_MASK, &saveMode); } return 0; 80038d8: 34 01 00 00 mvi r1,0 ) { if ( !once_control || !init_routine ) return EINVAL; if ( !once_control->init_executed ) { 80038dc: 5d a2 00 10 bne r13,r2,800391c rtems_mode saveMode; rtems_task_mode(RTEMS_NO_PREEMPT, RTEMS_PREEMPT_MASK, &saveMode); 80038e0: 34 01 01 00 mvi r1,256 80038e4: 34 02 01 00 mvi r2,256 80038e8: 37 83 00 14 addi r3,sp,20 80038ec: f8 00 01 96 calli 8003f44 if ( !once_control->init_executed ) { 80038f0: 29 61 00 04 lw r1,(r11+4) 80038f4: 5c 2d 00 05 bne r1,r13,8003908 <== NEVER TAKEN once_control->is_initialized = true; 80038f8: 34 01 00 01 mvi r1,1 80038fc: 59 61 00 00 sw (r11+0),r1 once_control->init_executed = true; 8003900: 59 61 00 04 sw (r11+4),r1 (*init_routine)(); 8003904: d9 80 00 00 call r12 } rtems_task_mode(saveMode, RTEMS_PREEMPT_MASK, &saveMode); 8003908: 2b 81 00 14 lw r1,(sp+20) 800390c: 34 02 01 00 mvi r2,256 8003910: 37 83 00 14 addi r3,sp,20 8003914: f8 00 01 8c calli 8003f44 } return 0; 8003918: 34 01 00 00 mvi r1,0 } 800391c: 2b 9d 00 04 lw ra,(sp+4) 8003920: 2b 8b 00 10 lw r11,(sp+16) 8003924: 2b 8c 00 0c lw r12,(sp+12) 8003928: 2b 8d 00 08 lw r13,(sp+8) 800392c: 37 9c 00 14 addi sp,sp,20 8003930: c3 a0 00 00 ret =============================================================================== 0800425c : int pthread_rwlock_init( pthread_rwlock_t *rwlock, const pthread_rwlockattr_t *attr ) { 800425c: 37 9c ff e0 addi sp,sp,-32 8004260: 5b 8b 00 14 sw (sp+20),r11 8004264: 5b 8c 00 10 sw (sp+16),r12 8004268: 5b 8d 00 0c sw (sp+12),r13 800426c: 5b 8e 00 08 sw (sp+8),r14 8004270: 5b 9d 00 04 sw (sp+4),ra /* * Error check parameters */ if ( !rwlock ) return EINVAL; 8004274: 34 03 00 16 mvi r3,22 int pthread_rwlock_init( pthread_rwlock_t *rwlock, const pthread_rwlockattr_t *attr ) { 8004278: b8 20 68 00 mv r13,r1 const pthread_rwlockattr_t *the_attr; /* * Error check parameters */ if ( !rwlock ) 800427c: 44 20 00 28 be r1,r0,800431c return EINVAL; /* * If the user passed in NULL, use the default attributes */ if ( attr ) { 8004280: 5c 40 00 05 bne r2,r0,8004294 the_attr = attr; } else { (void) pthread_rwlockattr_init( &default_attr ); 8004284: 37 8b 00 18 addi r11,sp,24 8004288: b9 60 08 00 mv r1,r11 800428c: f8 00 02 ff calli 8004e88 the_attr = &default_attr; 8004290: b9 60 10 00 mv r2,r11 } /* * Now start error checking the attributes that we are going to use */ if ( !the_attr->is_initialized ) 8004294: 28 41 00 00 lw r1,(r2+0) return EINVAL; 8004298: 34 03 00 16 mvi r3,22 } /* * Now start error checking the attributes that we are going to use */ if ( !the_attr->is_initialized ) 800429c: 44 20 00 20 be r1,r0,800431c <== NEVER TAKEN return EINVAL; switch ( the_attr->process_shared ) { 80042a0: 28 4e 00 04 lw r14,(r2+4) 80042a4: 5d c0 00 1e bne r14,r0,800431c <== NEVER TAKEN rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 80042a8: 78 02 08 01 mvhi r2,0x801 80042ac: 38 42 88 68 ori r2,r2,0x8868 80042b0: 28 41 00 00 lw r1,(r2+0) */ RTEMS_INLINE_ROUTINE void _CORE_RWLock_Initialize_attributes( CORE_RWLock_Attributes *the_attributes ) { the_attributes->XXX = 0; 80042b4: 5b 80 00 20 sw (sp+32),r0 80042b8: 34 21 00 01 addi r1,r1,1 80042bc: 58 41 00 00 sw (r2+0),r1 * the inactive chain of free RWLock control blocks. */ RTEMS_INLINE_ROUTINE POSIX_RWLock_Control *_POSIX_RWLock_Allocate( void ) { return (POSIX_RWLock_Control *) _Objects_Allocate( &_POSIX_RWLock_Information ); 80042c0: 78 0c 08 01 mvhi r12,0x801 80042c4: 39 8c 8a 00 ori r12,r12,0x8a00 80042c8: b9 80 08 00 mv r1,r12 80042cc: f8 00 09 a3 calli 8006958 <_Objects_Allocate> 80042d0: b8 20 58 00 mv r11,r1 */ _Thread_Disable_dispatch(); /* prevents deletion */ the_rwlock = _POSIX_RWLock_Allocate(); if ( !the_rwlock ) { 80042d4: 5c 2e 00 04 bne r1,r14,80042e4 _Thread_Enable_dispatch(); 80042d8: f8 00 0e 23 calli 8007b64 <_Thread_Enable_dispatch> return EAGAIN; 80042dc: 34 03 00 0b mvi r3,11 80042e0: e0 00 00 0f bi 800431c } _CORE_RWLock_Initialize( &the_rwlock->RWLock, &the_attributes ); 80042e4: 34 21 00 10 addi r1,r1,16 80042e8: 37 82 00 20 addi r2,sp,32 80042ec: f8 00 06 de calli 8005e64 <_CORE_RWLock_Initialize> uint32_t name ) { _Objects_Set_local_object( information, _Objects_Get_index( the_object->id ), 80042f0: 29 6e 00 08 lw r14,(r11+8) #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 80042f4: 29 8c 00 1c lw r12,(r12+28) 80042f8: 34 02 00 02 mvi r2,2 80042fc: 21 c1 ff ff andi r1,r14,0xffff 8004300: f8 00 40 bf calli 80145fc <__ashlsi3> 8004304: b5 81 08 00 add r1,r12,r1 8004308: 58 2b 00 00 sw (r1+0),r11 _Objects_Get_index( the_object->id ), the_object ); /* ASSERT: information->is_string == false */ the_object->name.name_u32 = name; 800430c: 59 60 00 0c sw (r11+12),r0 &_POSIX_RWLock_Information, &the_rwlock->Object, 0 ); *rwlock = the_rwlock->Object.id; 8004310: 59 ae 00 00 sw (r13+0),r14 _Thread_Enable_dispatch(); 8004314: f8 00 0e 14 calli 8007b64 <_Thread_Enable_dispatch> return 0; 8004318: 34 03 00 00 mvi r3,0 } 800431c: b8 60 08 00 mv r1,r3 8004320: 2b 9d 00 04 lw ra,(sp+4) 8004324: 2b 8b 00 14 lw r11,(sp+20) 8004328: 2b 8c 00 10 lw r12,(sp+16) 800432c: 2b 8d 00 0c lw r13,(sp+12) 8004330: 2b 8e 00 08 lw r14,(sp+8) 8004334: 37 9c 00 20 addi sp,sp,32 8004338: c3 a0 00 00 ret =============================================================================== 080043c4 : int pthread_rwlock_timedrdlock( pthread_rwlock_t *rwlock, const struct timespec *abstime ) { 80043c4: 37 9c ff e0 addi sp,sp,-32 80043c8: 5b 8b 00 18 sw (sp+24),r11 80043cc: 5b 8c 00 14 sw (sp+20),r12 80043d0: 5b 8d 00 10 sw (sp+16),r13 80043d4: 5b 8e 00 0c sw (sp+12),r14 80043d8: 5b 8f 00 08 sw (sp+8),r15 80043dc: 5b 9d 00 04 sw (sp+4),ra 80043e0: b8 20 70 00 mv r14,r1 Watchdog_Interval ticks; bool do_wait = true; POSIX_Absolute_timeout_conversion_results_t status; if ( !rwlock ) return EINVAL; 80043e4: 34 0b 00 16 mvi r11,22 int pthread_rwlock_timedrdlock( pthread_rwlock_t *rwlock, const struct timespec *abstime ) { 80043e8: b8 40 08 00 mv r1,r2 Objects_Locations location; Watchdog_Interval ticks; bool do_wait = true; POSIX_Absolute_timeout_conversion_results_t status; if ( !rwlock ) 80043ec: 45 c0 00 25 be r14,r0,8004480 * * 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 ); 80043f0: 37 82 00 1c addi r2,sp,28 80043f4: f8 00 1c 13 calli 800b440 <_POSIX_Absolute_timeout_to_ticks> 80043f8: 29 c2 00 00 lw r2,(r14+0) 80043fc: b8 20 60 00 mv r12,r1 8004400: 78 01 08 01 mvhi r1,0x801 8004404: 38 21 8a 00 ori r1,r1,0x8a00 8004408: 37 83 00 20 addi r3,sp,32 800440c: f8 00 0a b8 calli 8006eec <_Objects_Get> if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE ) do_wait = false; the_rwlock = _POSIX_RWLock_Get( rwlock, &location ); switch ( location ) { 8004410: 2b 8f 00 20 lw r15,(sp+32) 8004414: 5d e0 00 1b bne r15,r0,8004480 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, 8004418: 65 8d 00 03 cmpei r13,r12,3 case OBJECTS_LOCAL: _CORE_RWLock_Obtain_for_reading( 800441c: 29 c2 00 00 lw r2,(r14+0) 8004420: 2b 84 00 1c lw r4,(sp+28) 8004424: 34 21 00 10 addi r1,r1,16 8004428: b9 a0 18 00 mv r3,r13 800442c: 34 05 00 00 mvi r5,0 8004430: f8 00 06 9a calli 8005e98 <_CORE_RWLock_Obtain_for_reading> do_wait, ticks, NULL ); _Thread_Enable_dispatch(); 8004434: f8 00 0d cc calli 8007b64 <_Thread_Enable_dispatch> if ( !do_wait ) { 8004438: 5d af 00 0c bne r13,r15,8004468 if ( _Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE ) { 800443c: 78 01 08 01 mvhi r1,0x801 8004440: 38 21 8d 38 ori r1,r1,0x8d38 8004444: 28 21 00 0c lw r1,(r1+12) 8004448: 28 22 00 34 lw r2,(r1+52) 800444c: 34 01 00 02 mvi r1,2 8004450: 5c 41 00 06 bne r2,r1,8004468 if ( status == POSIX_ABSOLUTE_TIMEOUT_INVALID ) 8004454: 45 8d 00 0b be r12,r13,8004480 <== NEVER TAKEN return EINVAL; if ( status == POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST || 8004458: 35 8c ff ff addi r12,r12,-1 800445c: 34 01 00 01 mvi r1,1 status == POSIX_ABSOLUTE_TIMEOUT_IS_NOW ) return ETIMEDOUT; 8004460: 34 0b 00 74 mvi r11,116 _Thread_Enable_dispatch(); if ( !do_wait ) { if ( _Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE ) { if ( status == POSIX_ABSOLUTE_TIMEOUT_INVALID ) return EINVAL; if ( status == POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST || 8004464: 50 2c 00 07 bgeu r1,r12,8004480 <== ALWAYS TAKEN return ETIMEDOUT; } } return _POSIX_RWLock_Translate_core_RWLock_return_code( (CORE_RWLock_Status) _Thread_Executing->Wait.return_code 8004468: 78 01 08 01 mvhi r1,0x801 800446c: 38 21 8d 38 ori r1,r1,0x8d38 8004470: 28 21 00 0c lw r1,(r1+12) status == POSIX_ABSOLUTE_TIMEOUT_IS_NOW ) return ETIMEDOUT; } } return _POSIX_RWLock_Translate_core_RWLock_return_code( 8004474: 28 21 00 34 lw r1,(r1+52) 8004478: f8 00 00 43 calli 8004584 <_POSIX_RWLock_Translate_core_RWLock_return_code> 800447c: b8 20 58 00 mv r11,r1 case OBJECTS_ERROR: break; } return EINVAL; } 8004480: b9 60 08 00 mv r1,r11 8004484: 2b 9d 00 04 lw ra,(sp+4) 8004488: 2b 8b 00 18 lw r11,(sp+24) 800448c: 2b 8c 00 14 lw r12,(sp+20) 8004490: 2b 8d 00 10 lw r13,(sp+16) 8004494: 2b 8e 00 0c lw r14,(sp+12) 8004498: 2b 8f 00 08 lw r15,(sp+8) 800449c: 37 9c 00 20 addi sp,sp,32 80044a0: c3 a0 00 00 ret =============================================================================== 080044a4 : int pthread_rwlock_timedwrlock( pthread_rwlock_t *rwlock, const struct timespec *abstime ) { 80044a4: 37 9c ff e0 addi sp,sp,-32 80044a8: 5b 8b 00 18 sw (sp+24),r11 80044ac: 5b 8c 00 14 sw (sp+20),r12 80044b0: 5b 8d 00 10 sw (sp+16),r13 80044b4: 5b 8e 00 0c sw (sp+12),r14 80044b8: 5b 8f 00 08 sw (sp+8),r15 80044bc: 5b 9d 00 04 sw (sp+4),ra 80044c0: b8 20 70 00 mv r14,r1 Watchdog_Interval ticks; bool do_wait = true; POSIX_Absolute_timeout_conversion_results_t status; if ( !rwlock ) return EINVAL; 80044c4: 34 0b 00 16 mvi r11,22 int pthread_rwlock_timedwrlock( pthread_rwlock_t *rwlock, const struct timespec *abstime ) { 80044c8: b8 40 08 00 mv r1,r2 Objects_Locations location; Watchdog_Interval ticks; bool do_wait = true; POSIX_Absolute_timeout_conversion_results_t status; if ( !rwlock ) 80044cc: 45 c0 00 25 be r14,r0,8004560 * * 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 ); 80044d0: 37 82 00 1c addi r2,sp,28 80044d4: f8 00 1b db calli 800b440 <_POSIX_Absolute_timeout_to_ticks> 80044d8: 29 c2 00 00 lw r2,(r14+0) 80044dc: b8 20 60 00 mv r12,r1 80044e0: 78 01 08 01 mvhi r1,0x801 80044e4: 38 21 8a 00 ori r1,r1,0x8a00 80044e8: 37 83 00 20 addi r3,sp,32 80044ec: f8 00 0a 80 calli 8006eec <_Objects_Get> if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE ) do_wait = false; the_rwlock = _POSIX_RWLock_Get( rwlock, &location ); switch ( location ) { 80044f0: 2b 8f 00 20 lw r15,(sp+32) 80044f4: 5d e0 00 1b bne r15,r0,8004560 (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, 80044f8: 65 8d 00 03 cmpei r13,r12,3 case OBJECTS_LOCAL: _CORE_RWLock_Obtain_for_writing( 80044fc: 29 c2 00 00 lw r2,(r14+0) 8004500: 2b 84 00 1c lw r4,(sp+28) 8004504: 34 21 00 10 addi r1,r1,16 8004508: b9 a0 18 00 mv r3,r13 800450c: 34 05 00 00 mvi r5,0 8004510: f8 00 06 a4 calli 8005fa0 <_CORE_RWLock_Obtain_for_writing> do_wait, ticks, NULL ); _Thread_Enable_dispatch(); 8004514: f8 00 0d 94 calli 8007b64 <_Thread_Enable_dispatch> if ( !do_wait && 8004518: 5d af 00 0c bne r13,r15,8004548 (_Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE) ) { 800451c: 78 01 08 01 mvhi r1,0x801 8004520: 38 21 8d 38 ori r1,r1,0x8d38 8004524: 28 21 00 0c lw r1,(r1+12) ticks, NULL ); _Thread_Enable_dispatch(); if ( !do_wait && 8004528: 28 22 00 34 lw r2,(r1+52) 800452c: 34 01 00 02 mvi r1,2 8004530: 5c 41 00 06 bne r2,r1,8004548 (_Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE) ) { if ( status == POSIX_ABSOLUTE_TIMEOUT_INVALID ) 8004534: 45 8d 00 0b be r12,r13,8004560 <== NEVER TAKEN return EINVAL; if ( status == POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST || 8004538: 35 8c ff ff addi r12,r12,-1 800453c: 34 01 00 01 mvi r1,1 status == POSIX_ABSOLUTE_TIMEOUT_IS_NOW ) return ETIMEDOUT; 8004540: 34 0b 00 74 mvi r11,116 _Thread_Enable_dispatch(); if ( !do_wait && (_Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE) ) { if ( status == POSIX_ABSOLUTE_TIMEOUT_INVALID ) return EINVAL; if ( status == POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST || 8004544: 50 2c 00 07 bgeu r1,r12,8004560 <== ALWAYS TAKEN status == POSIX_ABSOLUTE_TIMEOUT_IS_NOW ) return ETIMEDOUT; } return _POSIX_RWLock_Translate_core_RWLock_return_code( (CORE_RWLock_Status) _Thread_Executing->Wait.return_code 8004548: 78 01 08 01 mvhi r1,0x801 800454c: 38 21 8d 38 ori r1,r1,0x8d38 8004550: 28 21 00 0c lw r1,(r1+12) if ( status == POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST || status == POSIX_ABSOLUTE_TIMEOUT_IS_NOW ) return ETIMEDOUT; } return _POSIX_RWLock_Translate_core_RWLock_return_code( 8004554: 28 21 00 34 lw r1,(r1+52) 8004558: f8 00 00 0b calli 8004584 <_POSIX_RWLock_Translate_core_RWLock_return_code> 800455c: b8 20 58 00 mv r11,r1 case OBJECTS_ERROR: break; } return EINVAL; } 8004560: b9 60 08 00 mv r1,r11 8004564: 2b 9d 00 04 lw ra,(sp+4) 8004568: 2b 8b 00 18 lw r11,(sp+24) 800456c: 2b 8c 00 14 lw r12,(sp+20) 8004570: 2b 8d 00 10 lw r13,(sp+16) 8004574: 2b 8e 00 0c lw r14,(sp+12) 8004578: 2b 8f 00 08 lw r15,(sp+8) 800457c: 37 9c 00 20 addi sp,sp,32 8004580: c3 a0 00 00 ret =============================================================================== 08004ea8 : pthread_rwlockattr_t *attr, int pshared ) { if ( !attr ) return EINVAL; 8004ea8: 34 03 00 16 mvi r3,22 int pthread_rwlockattr_setpshared( pthread_rwlockattr_t *attr, int pshared ) { if ( !attr ) 8004eac: 44 20 00 07 be r1,r0,8004ec8 return EINVAL; if ( !attr->is_initialized ) 8004eb0: 28 24 00 00 lw r4,(r1+0) 8004eb4: 44 80 00 05 be r4,r0,8004ec8 return EINVAL; switch ( pshared ) { 8004eb8: 34 04 00 01 mvi r4,1 8004ebc: 54 44 00 03 bgu r2,r4,8004ec8 <== NEVER TAKEN case PTHREAD_PROCESS_SHARED: case PTHREAD_PROCESS_PRIVATE: attr->process_shared = pshared; 8004ec0: 58 22 00 04 sw (r1+4),r2 return 0; 8004ec4: 34 03 00 00 mvi r3,0 default: return EINVAL; } } 8004ec8: b8 60 08 00 mv r1,r3 8004ecc: c3 a0 00 00 ret =============================================================================== 08006124 : int pthread_setschedparam( pthread_t thread, int policy, struct sched_param *param ) { 8006124: 37 9c ff dc addi sp,sp,-36 8006128: 5b 8b 00 18 sw (sp+24),r11 800612c: 5b 8c 00 14 sw (sp+20),r12 8006130: 5b 8d 00 10 sw (sp+16),r13 8006134: 5b 8e 00 0c sw (sp+12),r14 8006138: 5b 8f 00 08 sw (sp+8),r15 800613c: 5b 9d 00 04 sw (sp+4),ra /* * Check all the parameters */ if ( !param ) return EINVAL; 8006140: 34 0e 00 16 mvi r14,22 int pthread_setschedparam( pthread_t thread, int policy, struct sched_param *param ) { 8006144: b8 20 58 00 mv r11,r1 8006148: b8 40 78 00 mv r15,r2 800614c: b8 60 60 00 mv r12,r3 int rc; /* * Check all the parameters */ if ( !param ) 8006150: 44 60 00 46 be r3,r0,8006268 <== NEVER TAKEN return EINVAL; rc = _POSIX_Thread_Translate_sched_param( 8006154: b8 40 08 00 mv r1,r2 8006158: 37 84 00 20 addi r4,sp,32 800615c: b8 60 10 00 mv r2,r3 8006160: 37 83 00 24 addi r3,sp,36 8006164: f8 00 19 f5 calli 800c938 <_POSIX_Thread_Translate_sched_param> 8006168: b8 20 70 00 mv r14,r1 policy, param, &budget_algorithm, &budget_callout ); if ( rc ) 800616c: 5c 20 00 3f bne r1,r0,8006268 <== NEVER TAKEN 8006170: 78 03 08 01 mvhi r3,0x801 8006174: b8 60 08 00 mv r1,r3 8006178: 38 21 aa a0 ori r1,r1,0xaaa0 800617c: b9 60 10 00 mv r2,r11 8006180: 37 83 00 1c addi r3,sp,28 8006184: f8 00 07 a7 calli 8008020 <_Objects_Get> 8006188: b8 20 68 00 mv r13,r1 /* * Actually change the scheduling policy and parameters */ the_thread = _POSIX_Threads_Get( thread, &location ); switch ( location ) { 800618c: 2b 81 00 1c lw r1,(sp+28) 8006190: 5c 2e 00 35 bne r1,r14,8006264 <== NEVER TAKEN case OBJECTS_LOCAL: api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 8006194: 29 ab 01 20 lw r11,(r13+288) if ( api->schedpolicy == SCHED_SPORADIC ) 8006198: 34 01 00 04 mvi r1,4 800619c: 29 62 00 84 lw r2,(r11+132) 80061a0: 5c 41 00 03 bne r2,r1,80061ac (void) _Watchdog_Remove( &api->Sporadic_timer ); 80061a4: 35 61 00 a8 addi r1,r11,168 80061a8: f8 00 10 41 calli 800a2ac <_Watchdog_Remove> api->schedpolicy = policy; 80061ac: 59 6f 00 84 sw (r11+132),r15 api->schedparam = *param; 80061b0: 29 81 00 14 lw r1,(r12+20) 80061b4: 29 82 00 00 lw r2,(r12+0) 80061b8: 29 86 00 04 lw r6,(r12+4) 80061bc: 29 85 00 08 lw r5,(r12+8) 80061c0: 29 84 00 0c lw r4,(r12+12) 80061c4: 29 83 00 10 lw r3,(r12+16) 80061c8: 29 87 00 18 lw r7,(r12+24) 80061cc: 59 61 00 9c sw (r11+156),r1 the_thread->budget_algorithm = budget_algorithm; 80061d0: 2b 81 00 24 lw r1,(sp+36) if ( api->schedpolicy == SCHED_SPORADIC ) (void) _Watchdog_Remove( &api->Sporadic_timer ); api->schedpolicy = policy; api->schedparam = *param; 80061d4: 59 62 00 88 sw (r11+136),r2 80061d8: 59 66 00 8c sw (r11+140),r6 80061dc: 59 65 00 90 sw (r11+144),r5 80061e0: 59 64 00 94 sw (r11+148),r4 80061e4: 59 63 00 98 sw (r11+152),r3 80061e8: 59 67 00 a0 sw (r11+160),r7 the_thread->budget_algorithm = budget_algorithm; 80061ec: 59 a1 00 7c sw (r13+124),r1 the_thread->budget_callout = budget_callout; 80061f0: 2b 81 00 20 lw r1,(sp+32) 80061f4: 59 a1 00 80 sw (r13+128),r1 switch ( api->schedpolicy ) { 80061f8: 48 0f 00 19 bg r0,r15,800625c <== NEVER TAKEN 80061fc: 34 01 00 02 mvi r1,2 8006200: 4c 2f 00 04 bge r1,r15,8006210 8006204: 34 01 00 04 mvi r1,4 8006208: 5d e1 00 15 bne r15,r1,800625c <== NEVER TAKEN 800620c: e0 00 00 0e bi 8006244 case SCHED_OTHER: case SCHED_FIFO: case SCHED_RR: the_thread->cpu_time_budget = _Thread_Ticks_per_timeslice; 8006210: 78 01 08 01 mvhi r1,0x801 8006214: 38 21 a8 60 ori r1,r1,0xa860 8006218: 28 21 00 00 lw r1,(r1+0) the_thread->real_priority = _POSIX_Priority_To_core( api->schedparam.sched_priority ); _Thread_Change_priority( 800621c: 34 03 00 01 mvi r3,1 switch ( api->schedpolicy ) { case SCHED_OTHER: case SCHED_FIFO: case SCHED_RR: the_thread->cpu_time_budget = _Thread_Ticks_per_timeslice; 8006220: 59 a1 00 78 sw (r13+120),r1 8006224: 78 01 08 01 mvhi r1,0x801 8006228: 38 21 a0 e4 ori r1,r1,0xa0e4 800622c: 40 21 00 00 lbu r1,(r1+0) 8006230: c8 22 10 00 sub r2,r1,r2 the_thread->real_priority = 8006234: 59 a2 00 18 sw (r13+24),r2 _POSIX_Priority_To_core( api->schedparam.sched_priority ); _Thread_Change_priority( 8006238: b9 a0 08 00 mv r1,r13 800623c: f8 00 09 98 calli 800889c <_Thread_Change_priority> the_thread, the_thread->real_priority, true ); break; 8006240: e0 00 00 07 bi 800625c case SCHED_SPORADIC: api->ss_high_priority = api->schedparam.sched_priority; 8006244: 59 62 00 a4 sw (r11+164),r2 _Watchdog_Remove( &api->Sporadic_timer ); 8006248: 35 61 00 a8 addi r1,r11,168 800624c: f8 00 10 18 calli 800a2ac <_Watchdog_Remove> _POSIX_Threads_Sporadic_budget_TSR( 0, the_thread ); 8006250: 34 01 00 00 mvi r1,0 8006254: b9 a0 10 00 mv r2,r13 8006258: fb ff ff 62 calli 8005fe0 <_POSIX_Threads_Sporadic_budget_TSR> break; } _Thread_Enable_dispatch(); 800625c: f8 00 0a c6 calli 8008d74 <_Thread_Enable_dispatch> return 0; 8006260: e0 00 00 02 bi 8006268 #endif case OBJECTS_ERROR: break; } return ESRCH; 8006264: 34 0e 00 03 mvi r14,3 } 8006268: b9 c0 08 00 mv r1,r14 800626c: 2b 9d 00 04 lw ra,(sp+4) 8006270: 2b 8b 00 18 lw r11,(sp+24) 8006274: 2b 8c 00 14 lw r12,(sp+20) 8006278: 2b 8d 00 10 lw r13,(sp+16) 800627c: 2b 8e 00 0c lw r14,(sp+12) 8006280: 2b 8f 00 08 lw r15,(sp+8) 8006284: 37 9c 00 24 addi sp,sp,36 8006288: c3 a0 00 00 ret =============================================================================== 080035d0 : * * 18.2.2 Setting Cancelability State, P1003.1c/Draft 10, p. 183 */ void pthread_testcancel( void ) { 80035d0: 37 9c ff f8 addi sp,sp,-8 80035d4: 5b 8b 00 08 sw (sp+8),r11 80035d8: 5b 9d 00 04 sw (sp+4),ra * 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() ) 80035dc: 78 01 08 01 mvhi r1,0x801 80035e0: 38 21 6d 20 ori r1,r1,0x6d20 80035e4: 28 22 00 08 lw r2,(r1+8) 80035e8: 5c 40 00 14 bne r2,r0,8003638 <== NEVER TAKEN return; thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; 80035ec: 28 21 00 0c lw r1,(r1+12) 80035f0: 28 22 01 20 lw r2,(r1+288) 80035f4: 78 01 08 01 mvhi r1,0x801 80035f8: 38 21 68 50 ori r1,r1,0x6850 80035fc: 28 23 00 00 lw r3,(r1+0) 8003600: 34 63 00 01 addi r3,r3,1 8003604: 58 23 00 00 sw (r1+0),r3 _Thread_Disable_dispatch(); if ( thread_support->cancelability_state == PTHREAD_CANCEL_ENABLE && 8003608: 28 41 00 d8 lw r1,(r2+216) */ void pthread_testcancel( void ) { POSIX_API_Control *thread_support; bool cancel = false; 800360c: 34 0b 00 00 mvi r11,0 return; thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; _Thread_Disable_dispatch(); if ( thread_support->cancelability_state == PTHREAD_CANCEL_ENABLE && 8003610: 5c 2b 00 03 bne r1,r11,800361c <== 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)); 8003614: 28 4b 00 e0 lw r11,(r2+224) 8003618: 7d 6b 00 00 cmpnei r11,r11,0 thread_support->cancelation_requested ) cancel = true; _Thread_Enable_dispatch(); 800361c: f8 00 09 f2 calli 8005de4 <_Thread_Enable_dispatch> if ( cancel ) 8003620: 45 60 00 06 be r11,r0,8003638 _POSIX_Thread_Exit( _Thread_Executing, PTHREAD_CANCELED ); 8003624: 78 01 08 01 mvhi r1,0x801 8003628: 38 21 6d 20 ori r1,r1,0x6d20 800362c: 28 21 00 0c lw r1,(r1+12) 8003630: 34 02 ff ff mvi r2,-1 8003634: f8 00 18 e3 calli 80099c0 <_POSIX_Thread_Exit> } 8003638: 2b 9d 00 04 lw ra,(sp+4) 800363c: 2b 8b 00 08 lw r11,(sp+8) 8003640: 37 9c 00 08 addi sp,sp,8 8003644: c3 a0 00 00 ret =============================================================================== 08004198 : * errno - otherwise */ int rtems_aio_enqueue (rtems_aio_request *req) { 8004198: 37 9c ff bc addi sp,sp,-68 800419c: 5b 8b 00 20 sw (sp+32),r11 80041a0: 5b 8c 00 1c sw (sp+28),r12 80041a4: 5b 8d 00 18 sw (sp+24),r13 80041a8: 5b 8e 00 14 sw (sp+20),r14 80041ac: 5b 8f 00 10 sw (sp+16),r15 80041b0: 5b 90 00 0c sw (sp+12),r16 80041b4: 5b 91 00 08 sw (sp+8),r17 80041b8: 5b 9d 00 04 sw (sp+4),ra struct sched_param param; /* The queue should be initialized */ AIO_assert (aio_request_queue.initialized == AIO_QUEUE_INITIALIZED); result = pthread_mutex_lock (&aio_request_queue.mutex); 80041bc: 78 0c 08 01 mvhi r12,0x801 80041c0: 39 8c 77 f8 ori r12,r12,0x77f8 * errno - otherwise */ int rtems_aio_enqueue (rtems_aio_request *req) { 80041c4: b8 20 58 00 mv r11,r1 struct sched_param param; /* The queue should be initialized */ AIO_assert (aio_request_queue.initialized == AIO_QUEUE_INITIALIZED); result = pthread_mutex_lock (&aio_request_queue.mutex); 80041c8: b9 80 08 00 mv r1,r12 80041cc: f8 00 02 b2 calli 8004c94 80041d0: b8 20 70 00 mv r14,r1 if (result != 0) { 80041d4: 44 20 00 04 be r1,r0,80041e4 <== ALWAYS TAKEN free (req); 80041d8: b9 60 08 00 mv r1,r11 <== NOT EXECUTED 80041dc: fb ff f7 e1 calli 8002160 <== NOT EXECUTED return result; 80041e0: e0 00 00 7a bi 80043c8 <== NOT EXECUTED } /* _POSIX_PRIORITIZED_IO and _POSIX_PRIORITY_SCHEDULING are defined, we can use aio_reqprio to lower the priority of the request */ pthread_getschedparam (pthread_self(), &policy, ¶m); 80041e4: f8 00 05 47 calli 8005700 80041e8: 37 82 00 40 addi r2,sp,64 80041ec: 37 83 00 24 addi r3,sp,36 80041f0: f8 00 04 05 calli 8005204 req->caller_thread = pthread_self (); 80041f4: f8 00 05 43 calli 8005700 req->priority = param.sched_priority - req->aiocbp->aio_reqprio; 80041f8: 29 62 00 14 lw r2,(r11+20) /* _POSIX_PRIORITIZED_IO and _POSIX_PRIORITY_SCHEDULING are defined, we can use aio_reqprio to lower the priority of the request */ pthread_getschedparam (pthread_self(), &policy, ¶m); req->caller_thread = pthread_self (); 80041fc: 59 61 00 10 sw (r11+16),r1 req->priority = param.sched_priority - req->aiocbp->aio_reqprio; 8004200: 2b 83 00 24 lw r3,(sp+36) 8004204: 28 41 00 10 lw r1,(r2+16) 8004208: c8 61 08 00 sub r1,r3,r1 800420c: 59 61 00 0c sw (r11+12),r1 req->policy = policy; 8004210: 2b 81 00 40 lw r1,(sp+64) 8004214: 59 61 00 08 sw (r11+8),r1 req->aiocbp->error_code = EINPROGRESS; 8004218: 34 01 00 77 mvi r1,119 800421c: 58 41 00 2c sw (r2+44),r1 req->aiocbp->return_value = 0; if ((aio_request_queue.idle_threads == 0) && 8004220: 29 81 00 68 lw r1,(r12+104) req->caller_thread = pthread_self (); req->priority = param.sched_priority - req->aiocbp->aio_reqprio; req->policy = policy; req->aiocbp->error_code = EINPROGRESS; req->aiocbp->return_value = 0; 8004224: 58 40 00 30 sw (r2+48),r0 if ((aio_request_queue.idle_threads == 0) && 8004228: 5c 2e 00 34 bne r1,r14,80042f8 800422c: 29 83 00 64 lw r3,(r12+100) 8004230: 34 01 00 04 mvi r1,4 8004234: 48 61 00 31 bg r3,r1,80042f8 aio_request_queue.active_threads < AIO_MAX_THREADS) /* we still have empty places on the active_threads chain */ { chain = &aio_request_queue.work_req; r_chain = rtems_aio_search_fd (chain, req->aiocbp->aio_fildes, 1); 8004238: 28 42 00 00 lw r2,(r2+0) 800423c: 78 01 08 01 mvhi r1,0x801 8004240: 38 21 78 40 ori r1,r1,0x7840 8004244: 34 03 00 01 mvi r3,1 8004248: fb ff fe a6 calli 8003ce0 if (r_chain->new_fd == 1) { 800424c: 28 22 00 18 lw r2,(r1+24) if ((aio_request_queue.idle_threads == 0) && aio_request_queue.active_threads < AIO_MAX_THREADS) /* we still have empty places on the active_threads chain */ { chain = &aio_request_queue.work_req; r_chain = rtems_aio_search_fd (chain, req->aiocbp->aio_fildes, 1); 8004250: b8 20 68 00 mv r13,r1 8004254: 34 31 00 08 addi r17,r1,8 8004258: 34 2f 00 1c addi r15,r1,28 800425c: 34 30 00 20 addi r16,r1,32 if (r_chain->new_fd == 1) { 8004260: 34 01 00 01 mvi r1,1 8004264: 5c 41 00 1c bne r2,r1,80042d4 RTEMS_INLINE_ROUTINE void _Chain_Prepend( Chain_Control *the_chain, Chain_Node *the_node ) { _Chain_Insert(_Chain_Head(the_chain), the_node); 8004268: b9 60 10 00 mv r2,r11 800426c: ba 20 08 00 mv r1,r17 8004270: f8 00 08 7c calli 8006460 <_Chain_Insert> rtems_chain_prepend (&r_chain->perfd, &req->next_prio); r_chain->new_fd = 0; pthread_mutex_init (&r_chain->mutex, NULL); 8004274: 34 02 00 00 mvi r2,0 chain = &aio_request_queue.work_req; r_chain = rtems_aio_search_fd (chain, req->aiocbp->aio_fildes, 1); if (r_chain->new_fd == 1) { rtems_chain_prepend (&r_chain->perfd, &req->next_prio); r_chain->new_fd = 0; 8004278: 59 a0 00 18 sw (r13+24),r0 pthread_mutex_init (&r_chain->mutex, NULL); 800427c: b9 e0 08 00 mv r1,r15 8004280: f8 00 02 28 calli 8004b20 pthread_cond_init (&r_chain->cond, NULL); 8004284: 34 02 00 00 mvi r2,0 8004288: ba 00 08 00 mv r1,r16 800428c: f8 00 01 03 calli 8004698 AIO_printf ("New thread \n"); result = pthread_create (&thid, &aio_request_queue.attr, 8004290: 78 02 08 01 mvhi r2,0x801 8004294: 78 03 08 00 mvhi r3,0x800 8004298: 37 81 00 44 addi r1,sp,68 800429c: 38 42 78 00 ori r2,r2,0x7800 80042a0: 38 63 3d b8 ori r3,r3,0x3db8 80042a4: b9 a0 20 00 mv r4,r13 80042a8: f8 00 03 12 calli 8004ef0 80042ac: b8 20 58 00 mv r11,r1 rtems_aio_handle, (void *) r_chain); if (result != 0) { 80042b0: 44 20 00 05 be r1,r0,80042c4 <== ALWAYS TAKEN pthread_mutex_unlock (&aio_request_queue.mutex); 80042b4: b9 80 08 00 mv r1,r12 <== NOT EXECUTED 80042b8: f8 00 02 aa calli 8004d60 <== NOT EXECUTED return result; 80042bc: b9 60 70 00 mv r14,r11 <== NOT EXECUTED 80042c0: e0 00 00 42 bi 80043c8 <== NOT EXECUTED } ++aio_request_queue.active_threads; 80042c4: 29 81 00 64 lw r1,(r12+100) 80042c8: 34 21 00 01 addi r1,r1,1 80042cc: 59 81 00 64 sw (r12+100),r1 80042d0: e0 00 00 3b bi 80043bc } else { /* put request in the fd chain it belongs to */ pthread_mutex_lock (&r_chain->mutex); 80042d4: b9 e0 08 00 mv r1,r15 80042d8: f8 00 02 6f calli 8004c94 rtems_aio_insert_prio (&r_chain->perfd, req); 80042dc: ba 20 08 00 mv r1,r17 80042e0: b9 60 10 00 mv r2,r11 80042e4: fb ff ff 63 calli 8004070 pthread_cond_signal (&r_chain->cond); 80042e8: ba 00 08 00 mv r1,r16 80042ec: f8 00 01 26 calli 8004784 pthread_mutex_unlock (&r_chain->mutex); 80042f0: b9 e0 08 00 mv r1,r15 80042f4: e0 00 00 11 bi 8004338 else { /* the maximum number of threads has been already created even though some of them might be idle. The request belongs to one of the active fd chain */ r_chain = rtems_aio_search_fd (&aio_request_queue.work_req, 80042f8: 28 42 00 00 lw r2,(r2+0) 80042fc: 78 01 08 01 mvhi r1,0x801 8004300: 38 21 78 40 ori r1,r1,0x7840 8004304: 34 03 00 00 mvi r3,0 8004308: fb ff fe 76 calli 8003ce0 800430c: b8 20 60 00 mv r12,r1 req->aiocbp->aio_fildes, 0); if (r_chain != NULL) 8004310: 44 20 00 0c be r1,r0,8004340 <== ALWAYS TAKEN { pthread_mutex_lock (&r_chain->mutex); 8004314: 34 2d 00 1c addi r13,r1,28 <== NOT EXECUTED 8004318: b9 a0 08 00 mv r1,r13 <== NOT EXECUTED 800431c: f8 00 02 5e calli 8004c94 <== NOT EXECUTED rtems_aio_insert_prio (&r_chain->perfd, req); 8004320: 35 81 00 08 addi r1,r12,8 <== NOT EXECUTED 8004324: b9 60 10 00 mv r2,r11 <== NOT EXECUTED 8004328: fb ff ff 52 calli 8004070 <== NOT EXECUTED pthread_cond_signal (&r_chain->cond); 800432c: 35 81 00 20 addi r1,r12,32 <== NOT EXECUTED 8004330: f8 00 01 15 calli 8004784 <== NOT EXECUTED pthread_mutex_unlock (&r_chain->mutex); 8004334: b9 a0 08 00 mv r1,r13 <== NOT EXECUTED 8004338: f8 00 02 8a calli 8004d60 800433c: e0 00 00 20 bi 80043bc } else { /* or to the idle chain */ chain = &aio_request_queue.idle_req; r_chain = rtems_aio_search_fd (chain, req->aiocbp->aio_fildes, 1); 8004340: 29 62 00 14 lw r2,(r11+20) 8004344: 78 01 08 01 mvhi r1,0x801 8004348: 34 03 00 01 mvi r3,1 800434c: 28 42 00 00 lw r2,(r2+0) 8004350: 38 21 78 4c ori r1,r1,0x784c 8004354: fb ff fe 63 calli 8003ce0 if (r_chain->new_fd == 1) { 8004358: 28 23 00 18 lw r3,(r1+24) 800435c: 34 02 00 01 mvi r2,1 } else { /* or to the idle chain */ chain = &aio_request_queue.idle_req; r_chain = rtems_aio_search_fd (chain, req->aiocbp->aio_fildes, 1); 8004360: b8 20 60 00 mv r12,r1 8004364: 34 21 00 08 addi r1,r1,8 if (r_chain->new_fd == 1) { 8004368: 5c 62 00 13 bne r3,r2,80043b4 800436c: b9 60 10 00 mv r2,r11 8004370: f8 00 08 3c calli 8006460 <_Chain_Insert> /* If this is a new fd chain we signal the idle threads that might be waiting for requests */ AIO_printf (" New chain on waiting queue \n "); rtems_chain_prepend (&r_chain->perfd, &req->next_prio); r_chain->new_fd = 0; pthread_mutex_init (&r_chain->mutex, NULL); 8004374: 34 02 00 00 mvi r2,0 if (r_chain->new_fd == 1) { /* If this is a new fd chain we signal the idle threads that might be waiting for requests */ AIO_printf (" New chain on waiting queue \n "); rtems_chain_prepend (&r_chain->perfd, &req->next_prio); r_chain->new_fd = 0; 8004378: 59 80 00 18 sw (r12+24),r0 pthread_mutex_init (&r_chain->mutex, NULL); 800437c: 35 81 00 1c addi r1,r12,28 8004380: f8 00 01 e8 calli 8004b20 pthread_cond_init (&r_chain->cond, NULL); 8004384: 34 02 00 00 mvi r2,0 8004388: 35 81 00 20 addi r1,r12,32 800438c: f8 00 00 c3 calli 8004698 pthread_cond_signal (&aio_request_queue.new_req); 8004390: 78 01 08 01 mvhi r1,0x801 8004394: 38 21 77 fc ori r1,r1,0x77fc 8004398: f8 00 00 fb calli 8004784 ++aio_request_queue.idle_threads; 800439c: 78 02 08 01 mvhi r2,0x801 80043a0: 38 42 77 f8 ori r2,r2,0x77f8 80043a4: 28 41 00 68 lw r1,(r2+104) 80043a8: 34 21 00 01 addi r1,r1,1 80043ac: 58 41 00 68 sw (r2+104),r1 80043b0: e0 00 00 03 bi 80043bc } else /* just insert the request in the existing fd chain */ rtems_aio_insert_prio (&r_chain->perfd, req); 80043b4: b9 60 10 00 mv r2,r11 80043b8: fb ff ff 2e calli 8004070 } } pthread_mutex_unlock (&aio_request_queue.mutex); 80043bc: 78 01 08 01 mvhi r1,0x801 80043c0: 38 21 77 f8 ori r1,r1,0x77f8 80043c4: f8 00 02 67 calli 8004d60 return 0; } 80043c8: b9 c0 08 00 mv r1,r14 80043cc: 2b 9d 00 04 lw ra,(sp+4) 80043d0: 2b 8b 00 20 lw r11,(sp+32) 80043d4: 2b 8c 00 1c lw r12,(sp+28) 80043d8: 2b 8d 00 18 lw r13,(sp+24) 80043dc: 2b 8e 00 14 lw r14,(sp+20) 80043e0: 2b 8f 00 10 lw r15,(sp+16) 80043e4: 2b 90 00 0c lw r16,(sp+12) 80043e8: 2b 91 00 08 lw r17,(sp+8) 80043ec: 37 9c 00 44 addi sp,sp,68 80043f0: c3 a0 00 00 ret =============================================================================== 08003db8 : * NULL - if error */ static void * rtems_aio_handle (void *arg) { 8003db8: 37 9c ff a0 addi sp,sp,-96 <== NOT EXECUTED 8003dbc: 5b 8b 00 38 sw (sp+56),r11 <== NOT EXECUTED 8003dc0: 5b 8c 00 34 sw (sp+52),r12 <== NOT EXECUTED 8003dc4: 5b 8d 00 30 sw (sp+48),r13 <== NOT EXECUTED 8003dc8: 5b 8e 00 2c sw (sp+44),r14 <== NOT EXECUTED 8003dcc: 5b 8f 00 28 sw (sp+40),r15 <== NOT EXECUTED 8003dd0: 5b 90 00 24 sw (sp+36),r16 <== NOT EXECUTED 8003dd4: 5b 91 00 20 sw (sp+32),r17 <== NOT EXECUTED 8003dd8: 5b 92 00 1c sw (sp+28),r18 <== NOT EXECUTED 8003ddc: 5b 93 00 18 sw (sp+24),r19 <== NOT EXECUTED 8003de0: 5b 94 00 14 sw (sp+20),r20 <== NOT EXECUTED 8003de4: 5b 95 00 10 sw (sp+16),r21 <== NOT EXECUTED 8003de8: 5b 96 00 0c sw (sp+12),r22 <== NOT EXECUTED 8003dec: 5b 97 00 08 sw (sp+8),r23 <== NOT EXECUTED 8003df0: 5b 9d 00 04 sw (sp+4),ra <== NOT EXECUTED The fd chain is already unlocked */ struct timespec timeout; pthread_mutex_unlock (&r_chain->mutex); pthread_mutex_lock (&aio_request_queue.mutex); 8003df4: 78 0b 08 01 mvhi r11,0x801 <== NOT EXECUTED pthread_cond_destroy (&r_chain->cond); free (r_chain); /* If the idle chain is empty sleep for 3 seconds and wait for a signal. The thread now becomes idle. */ if (rtems_chain_is_empty (&aio_request_queue.idle_req)) { 8003df8: 78 12 08 01 mvhi r18,0x801 <== NOT EXECUTED ++aio_request_queue.idle_threads; clock_gettime (CLOCK_REALTIME, &timeout); timeout.tv_sec += 3; timeout.tv_nsec = 0; result = pthread_cond_timedwait (&aio_request_queue.new_req, 8003dfc: 78 11 08 01 mvhi r17,0x801 <== NOT EXECUTED /* Otherwise move this chain to the working chain and start the loop all over again */ --aio_request_queue.idle_threads; node = rtems_chain_first (&aio_request_queue.idle_req); rtems_chain_extract (node); r_chain = rtems_aio_search_fd (&aio_request_queue.work_req, 8003e00: 78 10 08 01 mvhi r16,0x801 <== NOT EXECUTED * NULL - if error */ static void * rtems_aio_handle (void *arg) { 8003e04: b8 20 60 00 mv r12,r1 <== NOT EXECUTED The fd chain is already unlocked */ struct timespec timeout; pthread_mutex_unlock (&r_chain->mutex); pthread_mutex_lock (&aio_request_queue.mutex); 8003e08: 39 6b 77 f8 ori r11,r11,0x77f8 <== NOT EXECUTED if (rtems_chain_is_empty (chain)) { clock_gettime (CLOCK_REALTIME, &timeout); 8003e0c: 37 8e 00 58 addi r14,sp,88 <== NOT EXECUTED result = pthread_cond_timedwait (&r_chain->cond, &aio_request_queue.mutex, &timeout); /* If no requests were added to the chain we delete the fd chain from the queue and start working with idle fd chains */ if (result == ETIMEDOUT) { 8003e10: 34 15 00 74 mvi r21,116 <== NOT EXECUTED pthread_cond_destroy (&r_chain->cond); free (r_chain); /* If the idle chain is empty sleep for 3 seconds and wait for a signal. The thread now becomes idle. */ if (rtems_chain_is_empty (&aio_request_queue.idle_req)) { 8003e14: 3a 52 78 50 ori r18,r18,0x7850 <== NOT EXECUTED ++aio_request_queue.idle_threads; clock_gettime (CLOCK_REALTIME, &timeout); timeout.tv_sec += 3; timeout.tv_nsec = 0; result = pthread_cond_timedwait (&aio_request_queue.new_req, 8003e18: 3a 31 77 fc ori r17,r17,0x77fc <== NOT EXECUTED /* Otherwise move this chain to the working chain and start the loop all over again */ --aio_request_queue.idle_threads; node = rtems_chain_first (&aio_request_queue.idle_req); rtems_chain_extract (node); r_chain = rtems_aio_search_fd (&aio_request_queue.work_req, 8003e1c: 3a 10 78 40 ori r16,r16,0x7840 <== NOT EXECUTED node = rtems_chain_first (chain); req = (rtems_aio_request *) node; /* See _POSIX_PRIORITIZE_IO and _POSIX_PRIORITY_SCHEDULING discussion in rtems_aio_enqueue () */ pthread_getschedparam (pthread_self(), &policy, ¶m); 8003e20: 37 94 00 3c addi r20,sp,60 <== NOT EXECUTED rtems_chain_extract (node); pthread_mutex_unlock (&r_chain->mutex); switch (req->aiocbp->aio_lio_opcode) { 8003e24: 34 17 00 02 mvi r23,2 <== NOT EXECUTED default: result = -1; } if (result == -1) { req->aiocbp->return_value = -1; 8003e28: 34 13 ff ff mvi r19,-1 <== NOT EXECUTED rtems_chain_extract (node); pthread_mutex_unlock (&r_chain->mutex); switch (req->aiocbp->aio_lio_opcode) { 8003e2c: 34 16 00 03 mvi r22,3 <== NOT EXECUTED /* acquire the mutex of the current fd chain. we don't need to lock the queue mutex since we can add requests to idle fd chains or even active ones if the working request has been extracted from the chain */ result = pthread_mutex_lock (&r_chain->mutex); 8003e30: 35 8f 00 1c addi r15,r12,28 <== NOT EXECUTED 8003e34: b9 e0 08 00 mv r1,r15 <== NOT EXECUTED 8003e38: f8 00 03 97 calli 8004c94 <== NOT EXECUTED if (result != 0) 8003e3c: 5c 20 00 7c bne r1,r0,800402c <== NOT EXECUTED } AIO_printf ("Thread finished\n"); return NULL; } 8003e40: 29 8d 00 08 lw r13,(r12+8) <== NOT EXECUTED RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 8003e44: 35 81 00 0c addi r1,r12,12 <== NOT EXECUTED /* If the locked chain is not empty, take the first request extract it, unlock the chain and process the request, in this way the user can supply more requests to this fd chain */ if (!rtems_chain_is_empty (chain)) { 8003e48: 45 a1 00 2e be r13,r1,8003f00 <== NOT EXECUTED node = rtems_chain_first (chain); req = (rtems_aio_request *) node; /* See _POSIX_PRIORITIZE_IO and _POSIX_PRIORITY_SCHEDULING discussion in rtems_aio_enqueue () */ pthread_getschedparam (pthread_self(), &policy, ¶m); 8003e4c: f8 00 06 2d calli 8005700 <== NOT EXECUTED 8003e50: 37 82 00 60 addi r2,sp,96 <== NOT EXECUTED 8003e54: ba 80 18 00 mv r3,r20 <== NOT EXECUTED 8003e58: f8 00 04 eb calli 8005204 <== NOT EXECUTED param.sched_priority = req->priority; 8003e5c: 29 a1 00 0c lw r1,(r13+12) <== NOT EXECUTED 8003e60: 5b 81 00 3c sw (sp+60),r1 <== NOT EXECUTED pthread_setschedparam (pthread_self(), req->policy, ¶m); 8003e64: f8 00 06 27 calli 8005700 <== NOT EXECUTED 8003e68: 29 a2 00 08 lw r2,(r13+8) <== NOT EXECUTED 8003e6c: ba 80 18 00 mv r3,r20 <== NOT EXECUTED 8003e70: f8 00 06 29 calli 8005714 <== NOT EXECUTED */ RTEMS_INLINE_ROUTINE void rtems_chain_extract( rtems_chain_node *the_node ) { _Chain_Extract( the_node ); 8003e74: b9 a0 08 00 mv r1,r13 <== NOT EXECUTED 8003e78: f8 00 09 61 calli 80063fc <_Chain_Extract> <== NOT EXECUTED rtems_chain_extract (node); pthread_mutex_unlock (&r_chain->mutex); 8003e7c: b9 e0 08 00 mv r1,r15 <== NOT EXECUTED 8003e80: f8 00 03 b8 calli 8004d60 <== NOT EXECUTED switch (req->aiocbp->aio_lio_opcode) { 8003e84: 29 a4 00 14 lw r4,(r13+20) <== NOT EXECUTED 8003e88: 28 81 00 28 lw r1,(r4+40) <== NOT EXECUTED 8003e8c: 44 37 00 0a be r1,r23,8003eb4 <== NOT EXECUTED 8003e90: 44 36 00 0f be r1,r22,8003ecc <== NOT EXECUTED 8003e94: 34 02 00 01 mvi r2,1 <== NOT EXECUTED 8003e98: 5c 22 00 10 bne r1,r2,8003ed8 <== NOT EXECUTED case LIO_READ: result = pread (req->aiocbp->aio_fildes, 8003e9c: 28 82 00 08 lw r2,(r4+8) <== NOT EXECUTED 8003ea0: 28 83 00 0c lw r3,(r4+12) <== NOT EXECUTED 8003ea4: 28 81 00 00 lw r1,(r4+0) <== NOT EXECUTED 8003ea8: 28 84 00 04 lw r4,(r4+4) <== NOT EXECUTED 8003eac: f8 00 31 47 calli 80103c8 <== NOT EXECUTED (void *) req->aiocbp->aio_buf, req->aiocbp->aio_nbytes, req->aiocbp->aio_offset); break; 8003eb0: e0 00 00 09 bi 8003ed4 <== NOT EXECUTED case LIO_WRITE: result = pwrite (req->aiocbp->aio_fildes, 8003eb4: 28 82 00 08 lw r2,(r4+8) <== NOT EXECUTED 8003eb8: 28 83 00 0c lw r3,(r4+12) <== NOT EXECUTED 8003ebc: 28 81 00 00 lw r1,(r4+0) <== NOT EXECUTED 8003ec0: 28 84 00 04 lw r4,(r4+4) <== NOT EXECUTED 8003ec4: f8 00 31 85 calli 80104d8 <== NOT EXECUTED (void *) req->aiocbp->aio_buf, req->aiocbp->aio_nbytes, req->aiocbp->aio_offset); break; 8003ec8: e0 00 00 03 bi 8003ed4 <== NOT EXECUTED case LIO_SYNC: result = fsync (req->aiocbp->aio_fildes); 8003ecc: 28 81 00 00 lw r1,(r4+0) <== NOT EXECUTED 8003ed0: f8 00 1d 15 calli 800b324 <== NOT EXECUTED break; default: result = -1; } if (result == -1) { 8003ed4: 5c 33 00 07 bne r1,r19,8003ef0 <== NOT EXECUTED req->aiocbp->return_value = -1; 8003ed8: 29 ad 00 14 lw r13,(r13+20) <== NOT EXECUTED 8003edc: 59 b3 00 30 sw (r13+48),r19 <== NOT EXECUTED req->aiocbp->error_code = errno; 8003ee0: f8 00 2d 8b calli 800f50c <__errno> <== NOT EXECUTED 8003ee4: 28 21 00 00 lw r1,(r1+0) <== NOT EXECUTED 8003ee8: 59 a1 00 2c sw (r13+44),r1 <== NOT EXECUTED 8003eec: e3 ff ff d1 bi 8003e30 <== NOT EXECUTED } else { req->aiocbp->return_value = result; 8003ef0: 29 a2 00 14 lw r2,(r13+20) <== NOT EXECUTED 8003ef4: 58 41 00 30 sw (r2+48),r1 <== NOT EXECUTED req->aiocbp->error_code = 0; 8003ef8: 58 40 00 2c sw (r2+44),r0 <== NOT EXECUTED 8003efc: e3 ff ff cd bi 8003e30 <== NOT EXECUTED wait for a signal on chain, this will unlock the queue. The fd chain is already unlocked */ struct timespec timeout; pthread_mutex_unlock (&r_chain->mutex); 8003f00: b9 e0 08 00 mv r1,r15 <== NOT EXECUTED 8003f04: f8 00 03 97 calli 8004d60 <== NOT EXECUTED pthread_mutex_lock (&aio_request_queue.mutex); 8003f08: b9 60 08 00 mv r1,r11 <== NOT EXECUTED 8003f0c: f8 00 03 62 calli 8004c94 <== NOT EXECUTED if (rtems_chain_is_empty (chain)) 8003f10: 29 81 00 08 lw r1,(r12+8) <== NOT EXECUTED 8003f14: 5c 2d ff c7 bne r1,r13,8003e30 <== NOT EXECUTED { clock_gettime (CLOCK_REALTIME, &timeout); 8003f18: b9 c0 10 00 mv r2,r14 <== NOT EXECUTED 8003f1c: 34 01 00 01 mvi r1,1 <== NOT EXECUTED 8003f20: f8 00 01 88 calli 8004540 <== NOT EXECUTED timeout.tv_sec += 3; 8003f24: 2b 81 00 58 lw r1,(sp+88) <== NOT EXECUTED timeout.tv_nsec = 0; result = pthread_cond_timedwait (&r_chain->cond, 8003f28: 35 8d 00 20 addi r13,r12,32 <== NOT EXECUTED 8003f2c: b9 60 10 00 mv r2,r11 <== NOT EXECUTED pthread_mutex_unlock (&r_chain->mutex); pthread_mutex_lock (&aio_request_queue.mutex); if (rtems_chain_is_empty (chain)) { clock_gettime (CLOCK_REALTIME, &timeout); timeout.tv_sec += 3; 8003f30: 34 21 00 03 addi r1,r1,3 <== NOT EXECUTED 8003f34: 5b 81 00 58 sw (sp+88),r1 <== NOT EXECUTED timeout.tv_nsec = 0; result = pthread_cond_timedwait (&r_chain->cond, 8003f38: b9 c0 18 00 mv r3,r14 <== NOT EXECUTED 8003f3c: b9 a0 08 00 mv r1,r13 <== NOT EXECUTED pthread_mutex_lock (&aio_request_queue.mutex); if (rtems_chain_is_empty (chain)) { clock_gettime (CLOCK_REALTIME, &timeout); timeout.tv_sec += 3; timeout.tv_nsec = 0; 8003f40: 5b 80 00 5c sw (sp+92),r0 <== NOT EXECUTED result = pthread_cond_timedwait (&r_chain->cond, 8003f44: f8 00 02 34 calli 8004814 <== NOT EXECUTED &aio_request_queue.mutex, &timeout); /* If no requests were added to the chain we delete the fd chain from the queue and start working with idle fd chains */ if (result == ETIMEDOUT) { 8003f48: 5c 35 ff ba bne r1,r21,8003e30 <== NOT EXECUTED 8003f4c: b9 80 08 00 mv r1,r12 <== NOT EXECUTED 8003f50: f8 00 09 2b calli 80063fc <_Chain_Extract> <== NOT EXECUTED rtems_chain_extract (&r_chain->next_fd); pthread_mutex_destroy (&r_chain->mutex); 8003f54: b9 e0 08 00 mv r1,r15 <== NOT EXECUTED 8003f58: f8 00 02 95 calli 80049ac <== NOT EXECUTED pthread_cond_destroy (&r_chain->cond); 8003f5c: b9 a0 08 00 mv r1,r13 <== NOT EXECUTED 8003f60: f8 00 01 94 calli 80045b0 <== NOT EXECUTED free (r_chain); 8003f64: b9 80 08 00 mv r1,r12 <== NOT EXECUTED 8003f68: fb ff f8 7e calli 8002160 <== NOT EXECUTED /* If the idle chain is empty sleep for 3 seconds and wait for a signal. The thread now becomes idle. */ if (rtems_chain_is_empty (&aio_request_queue.idle_req)) { 8003f6c: 29 61 00 54 lw r1,(r11+84) <== NOT EXECUTED 8003f70: 5c 32 00 2c bne r1,r18,8004020 <== NOT EXECUTED ++aio_request_queue.idle_threads; 8003f74: 29 61 00 68 lw r1,(r11+104) <== NOT EXECUTED clock_gettime (CLOCK_REALTIME, &timeout); 8003f78: b9 c0 10 00 mv r2,r14 <== NOT EXECUTED free (r_chain); /* If the idle chain is empty sleep for 3 seconds and wait for a signal. The thread now becomes idle. */ if (rtems_chain_is_empty (&aio_request_queue.idle_req)) { ++aio_request_queue.idle_threads; 8003f7c: 34 21 00 01 addi r1,r1,1 <== NOT EXECUTED 8003f80: 59 61 00 68 sw (r11+104),r1 <== NOT EXECUTED clock_gettime (CLOCK_REALTIME, &timeout); 8003f84: 34 01 00 01 mvi r1,1 <== NOT EXECUTED 8003f88: f8 00 01 6e calli 8004540 <== NOT EXECUTED timeout.tv_sec += 3; 8003f8c: 2b 81 00 58 lw r1,(sp+88) <== NOT EXECUTED timeout.tv_nsec = 0; result = pthread_cond_timedwait (&aio_request_queue.new_req, 8003f90: b9 60 10 00 mv r2,r11 <== NOT EXECUTED 8003f94: b9 c0 18 00 mv r3,r14 <== NOT EXECUTED /* If the idle chain is empty sleep for 3 seconds and wait for a signal. The thread now becomes idle. */ if (rtems_chain_is_empty (&aio_request_queue.idle_req)) { ++aio_request_queue.idle_threads; clock_gettime (CLOCK_REALTIME, &timeout); timeout.tv_sec += 3; 8003f98: 34 21 00 03 addi r1,r1,3 <== NOT EXECUTED 8003f9c: 5b 81 00 58 sw (sp+88),r1 <== NOT EXECUTED timeout.tv_nsec = 0; result = pthread_cond_timedwait (&aio_request_queue.new_req, 8003fa0: ba 20 08 00 mv r1,r17 <== NOT EXECUTED signal. The thread now becomes idle. */ if (rtems_chain_is_empty (&aio_request_queue.idle_req)) { ++aio_request_queue.idle_threads; clock_gettime (CLOCK_REALTIME, &timeout); timeout.tv_sec += 3; timeout.tv_nsec = 0; 8003fa4: 5b 80 00 5c sw (sp+92),r0 <== NOT EXECUTED result = pthread_cond_timedwait (&aio_request_queue.new_req, 8003fa8: f8 00 02 1b calli 8004814 <== NOT EXECUTED &aio_request_queue.mutex, &timeout); /* If no new fd chain was added in the idle requests then this thread is finished */ if (result == ETIMEDOUT) { 8003fac: 5c 35 00 04 bne r1,r21,8003fbc <== NOT EXECUTED pthread_mutex_unlock (&aio_request_queue.mutex); 8003fb0: b9 60 08 00 mv r1,r11 <== NOT EXECUTED 8003fb4: f8 00 03 6b calli 8004d60 <== NOT EXECUTED return NULL; 8003fb8: e0 00 00 1d bi 800402c <== NOT EXECUTED } /* Otherwise move this chain to the working chain and start the loop all over again */ --aio_request_queue.idle_threads; 8003fbc: 29 61 00 68 lw r1,(r11+104) <== NOT EXECUTED } AIO_printf ("Thread finished\n"); return NULL; } 8003fc0: 29 6d 00 54 lw r13,(r11+84) <== NOT EXECUTED return NULL; } /* Otherwise move this chain to the working chain and start the loop all over again */ --aio_request_queue.idle_threads; 8003fc4: 34 21 ff ff addi r1,r1,-1 <== NOT EXECUTED 8003fc8: 59 61 00 68 sw (r11+104),r1 <== NOT EXECUTED 8003fcc: b9 a0 08 00 mv r1,r13 <== NOT EXECUTED 8003fd0: f8 00 09 0b calli 80063fc <_Chain_Extract> <== NOT EXECUTED node = rtems_chain_first (&aio_request_queue.idle_req); rtems_chain_extract (node); r_chain = rtems_aio_search_fd (&aio_request_queue.work_req, 8003fd4: 29 a2 00 14 lw r2,(r13+20) <== NOT EXECUTED 8003fd8: 34 03 00 01 mvi r3,1 <== NOT EXECUTED 8003fdc: ba 00 08 00 mv r1,r16 <== NOT EXECUTED 8003fe0: fb ff ff 40 calli 8003ce0 <== NOT EXECUTED 8003fe4: b8 20 60 00 mv r12,r1 <== NOT EXECUTED ((rtems_aio_request_chain *)node)->fildes, 1); r_chain->new_fd = 0; 8003fe8: 58 20 00 18 sw (r1+24),r0 <== NOT EXECUTED pthread_mutex_init (&r_chain->mutex, NULL); 8003fec: 34 02 00 00 mvi r2,0 <== NOT EXECUTED 8003ff0: 34 21 00 1c addi r1,r1,28 <== NOT EXECUTED 8003ff4: f8 00 02 cb calli 8004b20 <== NOT EXECUTED pthread_cond_init (&r_chain->cond, NULL); 8003ff8: 34 02 00 00 mvi r2,0 <== NOT EXECUTED 8003ffc: 35 81 00 20 addi r1,r12,32 <== NOT EXECUTED 8004000: f8 00 01 a6 calli 8004698 <== NOT EXECUTED r_chain->perfd = ((rtems_aio_request_chain *)node)->perfd; 8004004: 29 a2 00 08 lw r2,(r13+8) <== NOT EXECUTED 8004008: 29 a1 00 0c lw r1,(r13+12) <== NOT EXECUTED 800400c: 29 a3 00 10 lw r3,(r13+16) <== NOT EXECUTED 8004010: 59 82 00 08 sw (r12+8),r2 <== NOT EXECUTED 8004014: 59 81 00 0c sw (r12+12),r1 <== NOT EXECUTED 8004018: 59 83 00 10 sw (r12+16),r3 <== NOT EXECUTED 800401c: e3 ff ff 85 bi 8003e30 <== NOT EXECUTED } else /* If there was a request added in the initial fd chain then release the mutex and process it */ pthread_mutex_unlock (&aio_request_queue.mutex); 8004020: b9 60 08 00 mv r1,r11 <== NOT EXECUTED 8004024: f8 00 03 4f calli 8004d60 <== NOT EXECUTED 8004028: e3 ff ff 82 bi 8003e30 <== NOT EXECUTED } AIO_printf ("Thread finished\n"); return NULL; } 800402c: 34 01 00 00 mvi r1,0 <== NOT EXECUTED 8004030: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED 8004034: 2b 8b 00 38 lw r11,(sp+56) <== NOT EXECUTED 8004038: 2b 8c 00 34 lw r12,(sp+52) <== NOT EXECUTED 800403c: 2b 8d 00 30 lw r13,(sp+48) <== NOT EXECUTED 8004040: 2b 8e 00 2c lw r14,(sp+44) <== NOT EXECUTED 8004044: 2b 8f 00 28 lw r15,(sp+40) <== NOT EXECUTED 8004048: 2b 90 00 24 lw r16,(sp+36) <== NOT EXECUTED 800404c: 2b 91 00 20 lw r17,(sp+32) <== NOT EXECUTED 8004050: 2b 92 00 1c lw r18,(sp+28) <== NOT EXECUTED 8004054: 2b 93 00 18 lw r19,(sp+24) <== NOT EXECUTED 8004058: 2b 94 00 14 lw r20,(sp+20) <== NOT EXECUTED 800405c: 2b 95 00 10 lw r21,(sp+16) <== NOT EXECUTED 8004060: 2b 96 00 0c lw r22,(sp+12) <== NOT EXECUTED 8004064: 2b 97 00 08 lw r23,(sp+8) <== NOT EXECUTED 8004068: 37 9c 00 60 addi sp,sp,96 <== NOT EXECUTED 800406c: c3 a0 00 00 ret <== NOT EXECUTED =============================================================================== 08003be8 : * 0 - if initialization succeeded */ int rtems_aio_init (void) { 8003be8: 37 9c ff f4 addi sp,sp,-12 8003bec: 5b 8b 00 0c sw (sp+12),r11 8003bf0: 5b 8c 00 08 sw (sp+8),r12 8003bf4: 5b 9d 00 04 sw (sp+4),ra int result = 0; result = pthread_attr_init (&aio_request_queue.attr); 8003bf8: 78 0c 08 01 mvhi r12,0x801 8003bfc: 39 8c 78 00 ori r12,r12,0x7800 8003c00: b9 80 08 00 mv r1,r12 8003c04: f8 00 04 a4 calli 8004e94 8003c08: b8 20 58 00 mv r11,r1 if (result != 0) 8003c0c: 5c 20 00 2f bne r1,r0,8003cc8 <== NEVER TAKEN return result; result = 8003c10: b9 80 08 00 mv r1,r12 8003c14: 34 02 00 00 mvi r2,0 8003c18: f8 00 04 ac calli 8004ec8 pthread_attr_setdetachstate (&aio_request_queue.attr, PTHREAD_CREATE_DETACHED); if (result != 0) 8003c1c: 44 2b 00 03 be r1,r11,8003c28 <== ALWAYS TAKEN pthread_attr_destroy (&aio_request_queue.attr); 8003c20: b9 80 08 00 mv r1,r12 <== NOT EXECUTED 8003c24: f8 00 04 94 calli 8004e74 <== NOT EXECUTED result = pthread_mutex_init (&aio_request_queue.mutex, NULL); 8003c28: 78 01 08 01 mvhi r1,0x801 8003c2c: 38 21 77 f8 ori r1,r1,0x77f8 8003c30: 34 02 00 00 mvi r2,0 8003c34: f8 00 03 bb calli 8004b20 if (result != 0) 8003c38: 44 20 00 04 be r1,r0,8003c48 <== ALWAYS TAKEN pthread_attr_destroy (&aio_request_queue.attr); 8003c3c: 78 01 08 01 mvhi r1,0x801 <== NOT EXECUTED 8003c40: 38 21 78 00 ori r1,r1,0x7800 <== NOT EXECUTED 8003c44: f8 00 04 8c calli 8004e74 <== NOT EXECUTED result = pthread_cond_init (&aio_request_queue.new_req, NULL); 8003c48: 78 01 08 01 mvhi r1,0x801 8003c4c: 38 21 77 fc ori r1,r1,0x77fc 8003c50: 34 02 00 00 mvi r2,0 8003c54: f8 00 02 91 calli 8004698 8003c58: b8 20 58 00 mv r11,r1 if (result != 0) { 8003c5c: 44 20 00 07 be r1,r0,8003c78 <== ALWAYS TAKEN pthread_mutex_destroy (&aio_request_queue.mutex); 8003c60: 78 01 08 01 mvhi r1,0x801 <== NOT EXECUTED 8003c64: 38 21 77 f8 ori r1,r1,0x77f8 <== NOT EXECUTED 8003c68: f8 00 03 51 calli 80049ac <== NOT EXECUTED pthread_attr_destroy (&aio_request_queue.attr); 8003c6c: 78 01 08 01 mvhi r1,0x801 <== NOT EXECUTED 8003c70: 38 21 78 00 ori r1,r1,0x7800 <== NOT EXECUTED 8003c74: f8 00 04 80 calli 8004e74 <== NOT EXECUTED ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; 8003c78: 78 02 08 01 mvhi r2,0x801 8003c7c: 78 01 08 01 mvhi r1,0x801 8003c80: 38 42 77 f8 ori r2,r2,0x77f8 8003c84: 38 21 78 44 ori r1,r1,0x7844 8003c88: 58 41 00 48 sw (r2+72),r1 head->previous = NULL; tail->previous = head; 8003c8c: 78 01 08 01 mvhi r1,0x801 8003c90: 38 21 78 40 ori r1,r1,0x7840 8003c94: 58 41 00 50 sw (r2+80),r1 ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; 8003c98: 78 01 08 01 mvhi r1,0x801 8003c9c: 38 21 78 50 ori r1,r1,0x7850 8003ca0: 58 41 00 54 sw (r2+84),r1 head->previous = NULL; tail->previous = head; 8003ca4: 78 01 08 01 mvhi r1,0x801 8003ca8: 38 21 78 4c ori r1,r1,0x784c 8003cac: 58 41 00 5c sw (r2+92),r1 rtems_chain_initialize_empty (&aio_request_queue.work_req); rtems_chain_initialize_empty (&aio_request_queue.idle_req); aio_request_queue.active_threads = 0; aio_request_queue.idle_threads = 0; aio_request_queue.initialized = AIO_QUEUE_INITIALIZED; 8003cb0: 38 01 b0 0b mvu r1,0xb00b { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; head->previous = NULL; 8003cb4: 58 40 00 4c sw (r2+76),r0 8003cb8: 58 40 00 58 sw (r2+88),r0 } rtems_chain_initialize_empty (&aio_request_queue.work_req); rtems_chain_initialize_empty (&aio_request_queue.idle_req); aio_request_queue.active_threads = 0; 8003cbc: 58 40 00 64 sw (r2+100),r0 aio_request_queue.idle_threads = 0; 8003cc0: 58 40 00 68 sw (r2+104),r0 aio_request_queue.initialized = AIO_QUEUE_INITIALIZED; 8003cc4: 58 41 00 60 sw (r2+96),r1 return result; } 8003cc8: b9 60 08 00 mv r1,r11 8003ccc: 2b 9d 00 04 lw ra,(sp+4) 8003cd0: 2b 8b 00 0c lw r11,(sp+12) 8003cd4: 2b 8c 00 08 lw r12,(sp+8) 8003cd8: 37 9c 00 0c addi sp,sp,12 8003cdc: c3 a0 00 00 ret =============================================================================== 08004070 : * NONE */ void rtems_aio_insert_prio (rtems_chain_control *chain, rtems_aio_request *req) { 8004070: 37 9c ff fc addi sp,sp,-4 8004074: 5b 9d 00 04 sw (sp+4),ra } AIO_printf ("Thread finished\n"); return NULL; } 8004078: 28 23 00 00 lw r3,(r1+0) 800407c: 34 25 00 04 addi r5,r1,4 * NONE */ void rtems_aio_insert_prio (rtems_chain_control *chain, rtems_aio_request *req) { 8004080: b8 40 20 00 mv r4,r2 rtems_chain_node *node; AIO_printf ("FD exists \n"); node = rtems_chain_first (chain); if (rtems_chain_is_empty (chain)) { 8004084: 44 65 00 0d be r3,r5,80040b8 <== NEVER TAKEN AIO_printf ("First in chain \n"); rtems_chain_prepend (chain, &req->next_prio); } else { AIO_printf ("Add by priority \n"); int prio = ((rtems_aio_request *) node)->aiocbp->aio_reqprio; 8004088: 28 61 00 14 lw r1,(r3+20) while (req->aiocbp->aio_reqprio > prio && 800408c: 28 42 00 14 lw r2,(r2+20) if (rtems_chain_is_empty (chain)) { AIO_printf ("First in chain \n"); rtems_chain_prepend (chain, &req->next_prio); } else { AIO_printf ("Add by priority \n"); int prio = ((rtems_aio_request *) node)->aiocbp->aio_reqprio; 8004090: 28 21 00 10 lw r1,(r1+16) while (req->aiocbp->aio_reqprio > prio && 8004094: 28 42 00 10 lw r2,(r2+16) 8004098: e0 00 00 04 bi 80040a8 } AIO_printf ("Thread finished\n"); return NULL; } 800409c: 28 63 00 00 lw r3,(r3+0) <== NOT EXECUTED int prio = ((rtems_aio_request *) node)->aiocbp->aio_reqprio; while (req->aiocbp->aio_reqprio > prio && !rtems_chain_is_tail (chain, node)) { node = rtems_chain_next (node); prio = ((rtems_aio_request *) node)->aiocbp->aio_reqprio; 80040a0: 28 61 00 14 lw r1,(r3+20) <== NOT EXECUTED 80040a4: 28 21 00 10 lw r1,(r1+16) <== NOT EXECUTED rtems_chain_prepend (chain, &req->next_prio); } else { AIO_printf ("Add by priority \n"); int prio = ((rtems_aio_request *) node)->aiocbp->aio_reqprio; while (req->aiocbp->aio_reqprio > prio && 80040a8: 4c 22 00 02 bge r1,r2,80040b0 <== ALWAYS TAKEN 80040ac: 5c 65 ff fc bne r3,r5,800409c <== NOT EXECUTED RTEMS_INLINE_ROUTINE void rtems_chain_insert( rtems_chain_node *after_node, rtems_chain_node *the_node ) { _Chain_Insert( after_node, the_node ); 80040b0: 28 61 00 04 lw r1,(r3+4) 80040b4: b8 80 10 00 mv r2,r4 80040b8: f8 00 08 ea calli 8006460 <_Chain_Insert> } rtems_chain_insert (node->previous, &req->next_prio); } } 80040bc: 2b 9d 00 04 lw ra,(sp+4) 80040c0: 37 9c 00 04 addi sp,sp,4 80040c4: c3 a0 00 00 ret =============================================================================== 080040c8 : * Output parameters: * NONE */ void rtems_aio_remove_fd (rtems_aio_request_chain *r_chain) { 80040c8: 37 9c ff ec addi sp,sp,-20 <== NOT EXECUTED 80040cc: 5b 8b 00 14 sw (sp+20),r11 <== NOT EXECUTED 80040d0: 5b 8c 00 10 sw (sp+16),r12 <== NOT EXECUTED 80040d4: 5b 8d 00 0c sw (sp+12),r13 <== NOT EXECUTED 80040d8: 5b 8e 00 08 sw (sp+8),r14 <== NOT EXECUTED 80040dc: 5b 9d 00 04 sw (sp+4),ra <== NOT EXECUTED while (!rtems_chain_is_tail (chain, node)) { rtems_chain_extract (node); rtems_aio_request *req = (rtems_aio_request *) node; req->aiocbp->error_code = ECANCELED; 80040e0: 34 0d 00 8c mvi r13,140 <== NOT EXECUTED } AIO_printf ("Thread finished\n"); return NULL; } 80040e4: 28 2b 00 08 lw r11,(r1+8) <== NOT EXECUTED RTEMS_INLINE_ROUTINE bool _Chain_Is_tail( Chain_Control *the_chain, const Chain_Node *the_node ) { return (the_node == _Chain_Tail(the_chain)); 80040e8: 34 2e 00 0c addi r14,r1,12 <== NOT EXECUTED while (!rtems_chain_is_tail (chain, node)) { rtems_chain_extract (node); rtems_aio_request *req = (rtems_aio_request *) node; req->aiocbp->error_code = ECANCELED; req->aiocbp->return_value = -1; 80040ec: 34 0c ff ff mvi r12,-1 <== NOT EXECUTED rtems_chain_node *node; chain = &r_chain->perfd; node = rtems_chain_first (chain); while (!rtems_chain_is_tail (chain, node)) 80040f0: e0 00 00 08 bi 8004110 <== NOT EXECUTED */ RTEMS_INLINE_ROUTINE void rtems_chain_extract( rtems_chain_node *the_node ) { _Chain_Extract( the_node ); 80040f4: b9 60 08 00 mv r1,r11 <== NOT EXECUTED 80040f8: f8 00 08 c1 calli 80063fc <_Chain_Extract> <== NOT EXECUTED { rtems_chain_extract (node); rtems_aio_request *req = (rtems_aio_request *) node; req->aiocbp->error_code = ECANCELED; 80040fc: 29 61 00 14 lw r1,(r11+20) <== NOT EXECUTED 8004100: 58 2d 00 2c sw (r1+44),r13 <== NOT EXECUTED req->aiocbp->return_value = -1; 8004104: 58 2c 00 30 sw (r1+48),r12 <== NOT EXECUTED free (req); 8004108: b9 60 08 00 mv r1,r11 <== NOT EXECUTED 800410c: fb ff f8 15 calli 8002160 <== NOT EXECUTED rtems_chain_node *node; chain = &r_chain->perfd; node = rtems_chain_first (chain); while (!rtems_chain_is_tail (chain, node)) 8004110: 5d 6e ff f9 bne r11,r14,80040f4 <== NOT EXECUTED rtems_aio_request *req = (rtems_aio_request *) node; req->aiocbp->error_code = ECANCELED; req->aiocbp->return_value = -1; free (req); } } 8004114: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED 8004118: 2b 8b 00 14 lw r11,(sp+20) <== NOT EXECUTED 800411c: 2b 8c 00 10 lw r12,(sp+16) <== NOT EXECUTED 8004120: 2b 8d 00 0c lw r13,(sp+12) <== NOT EXECUTED 8004124: 2b 8e 00 08 lw r14,(sp+8) <== NOT EXECUTED 8004128: 37 9c 00 14 addi sp,sp,20 <== NOT EXECUTED 800412c: c3 a0 00 00 ret <== NOT EXECUTED =============================================================================== 08004130 : * AIO_NOTCANCELED - if request was not canceled * AIO_CANCELED - if request was canceled */ int rtems_aio_remove_req (rtems_chain_control *chain, struct aiocb *aiocbp) { 8004130: 37 9c ff f8 addi sp,sp,-8 <== NOT EXECUTED 8004134: 5b 8b 00 08 sw (sp+8),r11 <== NOT EXECUTED 8004138: 5b 9d 00 04 sw (sp+4),ra <== NOT EXECUTED } AIO_printf ("Thread finished\n"); return NULL; } 800413c: 28 2b 00 00 lw r11,(r1+0) <== NOT EXECUTED 8004140: 34 21 00 04 addi r1,r1,4 <== NOT EXECUTED rtems_chain_node *node = rtems_chain_first (chain); rtems_aio_request *current; current = (rtems_aio_request *) node; while (!rtems_chain_is_tail (chain, node) && current->aiocbp != aiocbp) { 8004144: e0 00 00 02 bi 800414c <== NOT EXECUTED } AIO_printf ("Thread finished\n"); return NULL; } 8004148: 29 6b 00 00 lw r11,(r11+0) <== NOT EXECUTED rtems_chain_node *node = rtems_chain_first (chain); rtems_aio_request *current; current = (rtems_aio_request *) node; while (!rtems_chain_is_tail (chain, node) && current->aiocbp != aiocbp) { 800414c: 45 61 00 0e be r11,r1,8004184 <== NOT EXECUTED 8004150: 29 63 00 14 lw r3,(r11+20) <== NOT EXECUTED 8004154: 5c 62 ff fd bne r3,r2,8004148 <== NOT EXECUTED 8004158: b9 60 08 00 mv r1,r11 <== NOT EXECUTED 800415c: f8 00 08 a8 calli 80063fc <_Chain_Extract> <== NOT EXECUTED if (rtems_chain_is_tail (chain, node)) return AIO_NOTCANCELED; else { rtems_chain_extract (node); current->aiocbp->error_code = ECANCELED; 8004160: 29 61 00 14 lw r1,(r11+20) <== NOT EXECUTED 8004164: 34 02 00 8c mvi r2,140 <== NOT EXECUTED 8004168: 58 22 00 2c sw (r1+44),r2 <== NOT EXECUTED current->aiocbp->return_value = -1; 800416c: 34 02 ff ff mvi r2,-1 <== NOT EXECUTED 8004170: 58 22 00 30 sw (r1+48),r2 <== NOT EXECUTED free (current); 8004174: b9 60 08 00 mv r1,r11 <== NOT EXECUTED 8004178: fb ff f7 fa calli 8002160 <== NOT EXECUTED } return AIO_CANCELED; 800417c: 34 01 00 00 mvi r1,0 <== NOT EXECUTED 8004180: e0 00 00 02 bi 8004188 <== NOT EXECUTED node = rtems_chain_next (node); current = (rtems_aio_request *) node; } if (rtems_chain_is_tail (chain, node)) return AIO_NOTCANCELED; 8004184: 34 01 00 01 mvi r1,1 <== NOT EXECUTED current->aiocbp->return_value = -1; free (current); } return AIO_CANCELED; } 8004188: 2b 9d 00 04 lw ra,(sp+4) <== NOT EXECUTED 800418c: 2b 8b 00 08 lw r11,(sp+8) <== NOT EXECUTED 8004190: 37 9c 00 08 addi sp,sp,8 <== NOT EXECUTED 8004194: c3 a0 00 00 ret <== NOT EXECUTED =============================================================================== 080036cc : rtems_chain_control *chain, rtems_chain_node *node, rtems_id task, rtems_event_set events ) { 80036cc: 37 9c ff f4 addi sp,sp,-12 80036d0: 5b 8b 00 0c sw (sp+12),r11 80036d4: 5b 8c 00 08 sw (sp+8),r12 80036d8: 5b 9d 00 04 sw (sp+4),ra 80036dc: b8 60 60 00 mv r12,r3 80036e0: b8 80 58 00 mv r11,r4 RTEMS_INLINE_ROUTINE bool rtems_chain_append_with_empty_check( rtems_chain_control *chain, rtems_chain_node *node ) { return _Chain_Append_with_empty_check( chain, node ); 80036e4: f8 00 01 a5 calli 8003d78 <_Chain_Append_with_empty_check> rtems_status_code sc = RTEMS_SUCCESSFUL; 80036e8: 34 05 00 00 mvi r5,0 bool was_empty = rtems_chain_append_with_empty_check( chain, node ); if ( was_empty ) { 80036ec: 44 20 00 05 be r1,r0,8003700 <== NEVER TAKEN sc = rtems_event_send( task, events ); 80036f0: b9 80 08 00 mv r1,r12 80036f4: b9 60 10 00 mv r2,r11 80036f8: f8 00 18 91 calli 800993c 80036fc: b8 20 28 00 mv r5,r1 } return sc; } 8003700: b8 a0 08 00 mv r1,r5 8003704: 2b 9d 00 04 lw ra,(sp+4) 8003708: 2b 8b 00 0c lw r11,(sp+12) 800370c: 2b 8c 00 08 lw r12,(sp+8) 8003710: 37 9c 00 0c addi sp,sp,12 8003714: c3 a0 00 00 ret =============================================================================== 08003768 : rtems_chain_control *chain, rtems_event_set events, rtems_interval timeout, rtems_chain_node **node_ptr ) { 8003768: 37 9c ff e4 addi sp,sp,-28 800376c: 5b 8b 00 18 sw (sp+24),r11 8003770: 5b 8c 00 14 sw (sp+20),r12 8003774: 5b 8d 00 10 sw (sp+16),r13 8003778: 5b 8e 00 0c sw (sp+12),r14 800377c: 5b 8f 00 08 sw (sp+8),r15 8003780: 5b 9d 00 04 sw (sp+4),ra 8003784: b8 20 78 00 mv r15,r1 8003788: b8 40 70 00 mv r14,r2 800378c: b8 60 68 00 mv r13,r3 8003790: b8 80 60 00 mv r12,r4 8003794: e0 00 00 08 bi 80037b4 while ( sc == RTEMS_SUCCESSFUL && (node = rtems_chain_get( chain )) == NULL ) { rtems_event_set out; sc = rtems_event_receive( 8003798: b9 c0 08 00 mv r1,r14 800379c: 34 02 00 00 mvi r2,0 80037a0: b9 a0 18 00 mv r3,r13 80037a4: 37 84 00 1c addi r4,sp,28 80037a8: fb ff fd d2 calli 8002ef0 80037ac: b8 20 28 00 mv r5,r1 ) { rtems_status_code sc = RTEMS_SUCCESSFUL; rtems_chain_node *node = NULL; while ( 80037b0: 5c 2b 00 06 bne r1,r11,80037c8 <== ALWAYS TAKEN */ RTEMS_INLINE_ROUTINE rtems_chain_node *rtems_chain_get( rtems_chain_control *the_chain ) { return _Chain_Get( the_chain ); 80037b4: b9 e0 08 00 mv r1,r15 80037b8: f8 00 01 a6 calli 8003e50 <_Chain_Get> 80037bc: b8 20 58 00 mv r11,r1 sc == RTEMS_SUCCESSFUL && (node = rtems_chain_get( chain )) == NULL 80037c0: 44 20 ff f6 be r1,r0,8003798 80037c4: 34 05 00 00 mvi r5,0 } *node_ptr = node; return sc; } 80037c8: b8 a0 08 00 mv r1,r5 timeout, &out ); } *node_ptr = node; 80037cc: 59 8b 00 00 sw (r12+0),r11 return sc; } 80037d0: 2b 9d 00 04 lw ra,(sp+4) 80037d4: 2b 8b 00 18 lw r11,(sp+24) 80037d8: 2b 8c 00 14 lw r12,(sp+20) 80037dc: 2b 8d 00 10 lw r13,(sp+16) 80037e0: 2b 8e 00 0c lw r14,(sp+12) 80037e4: 2b 8f 00 08 lw r15,(sp+8) 80037e8: 37 9c 00 1c addi sp,sp,28 80037ec: c3 a0 00 00 ret =============================================================================== 080037f0 : rtems_chain_control *chain, rtems_chain_node *node, rtems_id task, rtems_event_set events ) { 80037f0: 37 9c ff f4 addi sp,sp,-12 80037f4: 5b 8b 00 0c sw (sp+12),r11 80037f8: 5b 8c 00 08 sw (sp+8),r12 80037fc: 5b 9d 00 04 sw (sp+4),ra 8003800: b8 60 60 00 mv r12,r3 8003804: b8 80 58 00 mv r11,r4 RTEMS_INLINE_ROUTINE bool rtems_chain_prepend_with_empty_check( rtems_chain_control *chain, rtems_chain_node *node ) { return _Chain_Prepend_with_empty_check( chain, node ); 8003808: f8 00 01 ac calli 8003eb8 <_Chain_Prepend_with_empty_check> rtems_status_code sc = RTEMS_SUCCESSFUL; 800380c: 34 05 00 00 mvi r5,0 bool was_empty = rtems_chain_prepend_with_empty_check( chain, node ); if (was_empty) { 8003810: 44 20 00 05 be r1,r0,8003824 <== NEVER TAKEN sc = rtems_event_send( task, events ); 8003814: b9 80 08 00 mv r1,r12 8003818: b9 60 10 00 mv r2,r11 800381c: f8 00 18 48 calli 800993c 8003820: b8 20 28 00 mv r5,r1 } return sc; } 8003824: b8 a0 08 00 mv r1,r5 8003828: 2b 9d 00 04 lw ra,(sp+4) 800382c: 2b 8b 00 0c lw r11,(sp+12) 8003830: 2b 8c 00 08 lw r12,(sp+8) 8003834: 37 9c 00 0c addi sp,sp,12 8003838: c3 a0 00 00 ret =============================================================================== 08010a00 : * error code - if unsuccessful */ rtems_status_code rtems_clock_set_nanoseconds_extension( rtems_nanoseconds_extension_routine routine ) { 8010a00: b8 20 18 00 mv r3,r1 if ( !routine ) return RTEMS_INVALID_ADDRESS; 8010a04: 34 01 00 09 mvi r1,9 */ rtems_status_code rtems_clock_set_nanoseconds_extension( rtems_nanoseconds_extension_routine routine ) { if ( !routine ) 8010a08: 44 60 00 05 be r3,r0,8010a1c <== ALWAYS TAKEN return RTEMS_INVALID_ADDRESS; _Watchdog_Nanoseconds_since_tick_handler = routine; 8010a0c: 78 02 08 03 mvhi r2,0x803 8010a10: 38 42 fe 2c ori r2,r2,0xfe2c 8010a14: 58 43 00 00 sw (r2+0),r3 return RTEMS_SUCCESSFUL; 8010a18: 34 01 00 00 mvi r1,0 } 8010a1c: c3 a0 00 00 ret =============================================================================== 08006024 : #include #include void rtems_iterate_over_all_threads(rtems_per_thread_routine routine) { 8006024: 37 9c ff e4 addi sp,sp,-28 8006028: 5b 8b 00 1c sw (sp+28),r11 800602c: 5b 8c 00 18 sw (sp+24),r12 8006030: 5b 8d 00 14 sw (sp+20),r13 8006034: 5b 8e 00 10 sw (sp+16),r14 8006038: 5b 8f 00 0c sw (sp+12),r15 800603c: 5b 90 00 08 sw (sp+8),r16 8006040: 5b 9d 00 04 sw (sp+4),ra 8006044: b8 20 78 00 mv r15,r1 uint32_t i; uint32_t api_index; Thread_Control *the_thread; Objects_Information *information; if ( !routine ) 8006048: 44 20 00 17 be r1,r0,80060a4 <== NEVER TAKEN #endif #include #include void rtems_iterate_over_all_threads(rtems_per_thread_routine routine) 800604c: 78 02 08 02 mvhi r2,0x802 uint32_t i; uint32_t api_index; Thread_Control *the_thread; Objects_Information *information; if ( !routine ) 8006050: 78 0b 08 02 mvhi r11,0x802 #endif #include #include void rtems_iterate_over_all_threads(rtems_per_thread_routine routine) 8006054: 38 42 96 34 ori r2,r2,0x9634 uint32_t i; uint32_t api_index; Thread_Control *the_thread; Objects_Information *information; if ( !routine ) 8006058: 39 6b 96 38 ori r11,r11,0x9638 #endif #include #include void rtems_iterate_over_all_threads(rtems_per_thread_routine routine) 800605c: 34 50 00 10 addi r16,r2,16 #if !defined(RTEMS_POSIX_API) || defined(RTEMS_DEBUG) if ( !_Objects_Information_table[ api_index ] ) continue; #endif information = _Objects_Information_table[ api_index ][ 1 ]; 8006060: 29 61 00 00 lw r1,(r11+0) if ( !information ) 8006064: 34 0e 00 04 mvi r14,4 8006068: 34 0d 00 01 mvi r13,1 #if !defined(RTEMS_POSIX_API) || defined(RTEMS_DEBUG) if ( !_Objects_Information_table[ api_index ] ) continue; #endif information = _Objects_Information_table[ api_index ][ 1 ]; 800606c: 28 2c 00 04 lw r12,(r1+4) if ( !information ) 8006070: 5d 80 00 09 bne r12,r0,8006094 8006074: e0 00 00 0a bi 800609c continue; for ( i=1 ; i <= information->maximum ; i++ ) { the_thread = (Thread_Control *)information->local_table[ i ]; 8006078: 29 81 00 1c lw r1,(r12+28) 800607c: b4 2e 08 00 add r1,r1,r14 8006080: 28 21 00 00 lw r1,(r1+0) if ( !the_thread ) 8006084: 44 20 00 02 be r1,r0,800608c continue; (*routine)(the_thread); 8006088: d9 e0 00 00 call r15 information = _Objects_Information_table[ api_index ][ 1 ]; if ( !information ) continue; for ( i=1 ; i <= information->maximum ; i++ ) { 800608c: 35 ad 00 01 addi r13,r13,1 8006090: 35 ce 00 04 addi r14,r14,4 8006094: 2d 81 00 10 lhu r1,(r12+16) 8006098: 50 2d ff f8 bgeu r1,r13,8006078 800609c: 35 6b 00 04 addi r11,r11,4 Objects_Information *information; if ( !routine ) return; for ( api_index = 1 ; api_index <= OBJECTS_APIS_LAST ; api_index++ ) { 80060a0: 5d 70 ff f0 bne r11,r16,8006060 (*routine)(the_thread); } } } 80060a4: 2b 9d 00 04 lw ra,(sp+4) 80060a8: 2b 8b 00 1c lw r11,(sp+28) 80060ac: 2b 8c 00 18 lw r12,(sp+24) 80060b0: 2b 8d 00 14 lw r13,(sp+20) 80060b4: 2b 8e 00 10 lw r14,(sp+16) 80060b8: 2b 8f 00 0c lw r15,(sp+12) 80060bc: 2b 90 00 08 lw r16,(sp+8) 80060c0: 37 9c 00 1c addi sp,sp,28 80060c4: c3 a0 00 00 ret =============================================================================== 0801191c : uint32_t length, uint32_t buffer_size, rtems_attribute attribute_set, rtems_id *id ) { 801191c: 37 9c ff d8 addi sp,sp,-40 8011920: 5b 8b 00 28 sw (sp+40),r11 8011924: 5b 8c 00 24 sw (sp+36),r12 8011928: 5b 8d 00 20 sw (sp+32),r13 801192c: 5b 8e 00 1c sw (sp+28),r14 8011930: 5b 8f 00 18 sw (sp+24),r15 8011934: 5b 90 00 14 sw (sp+20),r16 8011938: 5b 91 00 10 sw (sp+16),r17 801193c: 5b 92 00 0c sw (sp+12),r18 8011940: 5b 93 00 08 sw (sp+8),r19 8011944: 5b 9d 00 04 sw (sp+4),ra register Partition_Control *the_partition; if ( !rtems_is_name_valid( name ) ) return RTEMS_INVALID_NAME; 8011948: 34 07 00 03 mvi r7,3 uint32_t length, uint32_t buffer_size, rtems_attribute attribute_set, rtems_id *id ) { 801194c: b8 20 88 00 mv r17,r1 8011950: b8 40 70 00 mv r14,r2 8011954: b8 60 78 00 mv r15,r3 8011958: b8 80 60 00 mv r12,r4 801195c: b8 a0 98 00 mv r19,r5 8011960: b8 c0 80 00 mv r16,r6 register Partition_Control *the_partition; if ( !rtems_is_name_valid( name ) ) 8011964: 44 20 00 36 be r1,r0,8011a3c return RTEMS_INVALID_NAME; if ( !starting_address ) return RTEMS_INVALID_ADDRESS; 8011968: 34 07 00 09 mvi r7,9 register Partition_Control *the_partition; if ( !rtems_is_name_valid( name ) ) return RTEMS_INVALID_NAME; if ( !starting_address ) 801196c: 44 40 00 34 be r2,r0,8011a3c return RTEMS_INVALID_ADDRESS; if ( !id ) 8011970: 44 c0 00 33 be r6,r0,8011a3c <== NEVER TAKEN return RTEMS_INVALID_ADDRESS; if ( length == 0 || buffer_size == 0 || length < buffer_size || 8011974: 64 82 00 00 cmpei r2,r4,0 8011978: 64 61 00 00 cmpei r1,r3,0 !_Partition_Is_buffer_size_aligned( buffer_size ) ) return RTEMS_INVALID_SIZE; 801197c: 34 07 00 08 mvi r7,8 return RTEMS_INVALID_ADDRESS; if ( !id ) return RTEMS_INVALID_ADDRESS; if ( length == 0 || buffer_size == 0 || length < buffer_size || 8011980: b8 41 08 00 or r1,r2,r1 8011984: 5c 20 00 2e bne r1,r0,8011a3c 8011988: 54 83 00 2d bgu r4,r3,8011a3c */ RTEMS_INLINE_ROUTINE bool _Partition_Is_buffer_size_aligned ( uint32_t buffer_size ) { return ((buffer_size % CPU_PARTITION_ALIGNMENT) == 0); 801198c: 20 81 00 07 andi r1,r4,0x7 8011990: 5c 20 00 2b bne r1,r0,8011a3c ) { #if (CPU_ALIGNMENT == 0) return true; #else return (((uintptr_t)address % CPU_ALIGNMENT) == 0); 8011994: 21 d2 00 07 andi r18,r14,0x7 !_Partition_Is_buffer_size_aligned( buffer_size ) ) return RTEMS_INVALID_SIZE; if ( !_Addresses_Is_aligned( starting_address ) ) return RTEMS_INVALID_ADDRESS; 8011998: 34 07 00 09 mvi r7,9 if ( length == 0 || buffer_size == 0 || length < buffer_size || !_Partition_Is_buffer_size_aligned( buffer_size ) ) return RTEMS_INVALID_SIZE; if ( !_Addresses_Is_aligned( starting_address ) ) 801199c: 5e 41 00 28 bne r18,r1,8011a3c 80119a0: 78 02 08 03 mvhi r2,0x803 80119a4: 38 42 fc b0 ori r2,r2,0xfcb0 80119a8: 28 41 00 00 lw r1,(r2+0) 80119ac: 34 21 00 01 addi r1,r1,1 80119b0: 58 41 00 00 sw (r2+0),r1 * 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 ); 80119b4: 78 0d 08 03 mvhi r13,0x803 80119b8: 39 ad fb 08 ori r13,r13,0xfb08 80119bc: b9 a0 08 00 mv r1,r13 80119c0: f8 00 16 1b calli 801722c <_Objects_Allocate> 80119c4: b8 20 58 00 mv r11,r1 _Thread_Disable_dispatch(); /* prevents deletion */ the_partition = _Partition_Allocate(); if ( !the_partition ) { 80119c8: 5c 32 00 04 bne r1,r18,80119d8 _Thread_Enable_dispatch(); 80119cc: f8 00 1b 8b calli 80187f8 <_Thread_Enable_dispatch> return RTEMS_TOO_MANY; 80119d0: 34 07 00 05 mvi r7,5 80119d4: e0 00 00 1a bi 8011a3c } #endif the_partition->starting_address = starting_address; the_partition->length = length; the_partition->buffer_size = buffer_size; 80119d8: 58 2c 00 18 sw (r1+24),r12 the_partition->attribute_set = attribute_set; the_partition->number_of_used_blocks = 0; _Chain_Initialize( &the_partition->Memory, starting_address, length / buffer_size, buffer_size ); 80119dc: b9 80 10 00 mv r2,r12 _Thread_Enable_dispatch(); return RTEMS_TOO_MANY; } #endif the_partition->starting_address = starting_address; 80119e0: 58 2e 00 10 sw (r1+16),r14 the_partition->length = length; 80119e4: 58 2f 00 14 sw (r1+20),r15 the_partition->buffer_size = buffer_size; the_partition->attribute_set = attribute_set; 80119e8: 58 33 00 1c sw (r1+28),r19 the_partition->number_of_used_blocks = 0; 80119ec: 58 20 00 20 sw (r1+32),r0 _Chain_Initialize( &the_partition->Memory, starting_address, 80119f0: 34 32 00 24 addi r18,r1,36 length / buffer_size, buffer_size ); 80119f4: b9 e0 08 00 mv r1,r15 80119f8: f8 00 7d 29 calli 8030e9c <__udivsi3> 80119fc: b8 20 18 00 mv r3,r1 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, 8011a00: b9 80 20 00 mv r4,r12 8011a04: ba 40 08 00 mv r1,r18 8011a08: b9 c0 10 00 mv r2,r14 8011a0c: f8 00 0f 00 calli 801560c <_Chain_Initialize> Objects_Name name ) { _Objects_Set_local_object( information, _Objects_Get_index( the_object->id ), 8011a10: 29 6c 00 08 lw r12,(r11+8) #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 8011a14: 29 ad 00 1c lw r13,(r13+28) 8011a18: 34 02 00 02 mvi r2,2 8011a1c: 21 81 ff ff andi r1,r12,0xffff 8011a20: fb ff f1 0d calli 800de54 <__ashlsi3> 8011a24: b5 a1 08 00 add r1,r13,r1 8011a28: 58 2b 00 00 sw (r1+0),r11 information, _Objects_Get_index( the_object->id ), the_object ); the_object->name = name; 8011a2c: 59 71 00 0c sw (r11+12),r17 &_Partition_Information, &the_partition->Object, (Objects_Name) name ); *id = the_partition->Object.id; 8011a30: 5a 0c 00 00 sw (r16+0),r12 name, 0 /* Not used */ ); #endif _Thread_Enable_dispatch(); 8011a34: f8 00 1b 71 calli 80187f8 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 8011a38: 34 07 00 00 mvi r7,0 } 8011a3c: b8 e0 08 00 mv r1,r7 8011a40: 2b 9d 00 04 lw ra,(sp+4) 8011a44: 2b 8b 00 28 lw r11,(sp+40) 8011a48: 2b 8c 00 24 lw r12,(sp+36) 8011a4c: 2b 8d 00 20 lw r13,(sp+32) 8011a50: 2b 8e 00 1c lw r14,(sp+28) 8011a54: 2b 8f 00 18 lw r15,(sp+24) 8011a58: 2b 90 00 14 lw r16,(sp+20) 8011a5c: 2b 91 00 10 lw r17,(sp+16) 8011a60: 2b 92 00 0c lw r18,(sp+12) 8011a64: 2b 93 00 08 lw r19,(sp+8) 8011a68: 37 9c 00 28 addi sp,sp,40 8011a6c: c3 a0 00 00 ret =============================================================================== 0800b808 : rtems_status_code rtems_rate_monotonic_get_status( rtems_id id, rtems_rate_monotonic_period_status *status ) { 800b808: 37 9c ff e4 addi sp,sp,-28 800b80c: 5b 8b 00 08 sw (sp+8),r11 800b810: 5b 9d 00 04 sw (sp+4),ra 800b814: b8 20 18 00 mv r3,r1 800b818: b8 40 58 00 mv r11,r2 Rate_monotonic_Period_time_t since_last_period; Rate_monotonic_Control *the_period; bool valid_status; if ( !status ) return RTEMS_INVALID_ADDRESS; 800b81c: 34 01 00 09 mvi r1,9 Objects_Locations location; Rate_monotonic_Period_time_t since_last_period; Rate_monotonic_Control *the_period; bool valid_status; if ( !status ) 800b820: 44 40 00 26 be r2,r0,800b8b8 <== NEVER TAKEN 800b824: 78 01 08 02 mvhi r1,0x802 800b828: b8 60 10 00 mv r2,r3 800b82c: 38 21 08 90 ori r1,r1,0x890 800b830: 37 83 00 1c addi r3,sp,28 800b834: fb ff ec 62 calli 80069bc <_Objects_Get> return RTEMS_INVALID_ADDRESS; the_period = _Rate_monotonic_Get( id, &location ); switch ( location ) { 800b838: 2b 83 00 1c lw r3,(sp+28) 800b83c: 5c 60 00 1e bne r3,r0,800b8b4 case OBJECTS_LOCAL: status->owner = the_period->owner->Object.id; 800b840: 28 24 00 40 lw r4,(r1+64) status->state = the_period->state; 800b844: 28 22 00 38 lw r2,(r1+56) the_period = _Rate_monotonic_Get( id, &location ); switch ( location ) { case OBJECTS_LOCAL: status->owner = the_period->owner->Object.id; 800b848: 28 84 00 08 lw r4,(r4+8) status->state = the_period->state; 800b84c: 59 62 00 04 sw (r11+4),r2 the_period = _Rate_monotonic_Get( id, &location ); switch ( location ) { case OBJECTS_LOCAL: status->owner = the_period->owner->Object.id; 800b850: 59 64 00 00 sw (r11+0),r4 status->state = the_period->state; /* * If the period is inactive, there is no information. */ if ( status->state == RATE_MONOTONIC_INACTIVE ) { 800b854: 5c 43 00 06 bne r2,r3,800b86c #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ _Timespec_Set_to_zero( &status->since_last_period ); 800b858: 59 60 00 08 sw (r11+8),r0 800b85c: 59 60 00 0c sw (r11+12),r0 _Timespec_Set_to_zero( &status->executed_since_last_period ); 800b860: 59 60 00 10 sw (r11+16),r0 800b864: 59 60 00 14 sw (r11+20),r0 800b868: e0 00 00 10 bi 800b8a8 } else { /* * Grab the current status. */ valid_status = 800b86c: 37 82 00 0c addi r2,sp,12 800b870: 37 83 00 14 addi r3,sp,20 800b874: fb ff e1 76 calli 8003e4c <_Rate_monotonic_Get_status> _Rate_monotonic_Get_status( the_period, &since_last_period, &executed ); if (!valid_status) { 800b878: 5c 20 00 04 bne r1,r0,800b888 _Thread_Enable_dispatch(); 800b87c: fb ff ef ac calli 800772c <_Thread_Enable_dispatch> return RTEMS_NOT_DEFINED; 800b880: 34 01 00 0b mvi r1,11 800b884: e0 00 00 0d bi 800b8b8 } #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ _Timestamp_To_timespec( 800b888: 2b 81 00 0c lw r1,(sp+12) 800b88c: 59 61 00 08 sw (r11+8),r1 800b890: 2b 81 00 10 lw r1,(sp+16) 800b894: 59 61 00 0c sw (r11+12),r1 &since_last_period, &status->since_last_period ); _Timestamp_To_timespec( 800b898: 2b 81 00 14 lw r1,(sp+20) 800b89c: 59 61 00 10 sw (r11+16),r1 800b8a0: 2b 81 00 18 lw r1,(sp+24) 800b8a4: 59 61 00 14 sw (r11+20),r1 status->since_last_period = since_last_period; status->executed_since_last_period = executed; #endif } _Thread_Enable_dispatch(); 800b8a8: fb ff ef a1 calli 800772c <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 800b8ac: 34 01 00 00 mvi r1,0 800b8b0: e0 00 00 02 bi 800b8b8 #endif case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 800b8b4: 34 01 00 04 mvi r1,4 } 800b8b8: 2b 9d 00 04 lw ra,(sp+4) 800b8bc: 2b 8b 00 08 lw r11,(sp+8) 800b8c0: 37 9c 00 1c addi sp,sp,28 800b8c4: c3 a0 00 00 ret =============================================================================== 080040c4 : rtems_status_code rtems_rate_monotonic_period( rtems_id id, rtems_interval length ) { 80040c4: 37 9c ff e8 addi sp,sp,-24 80040c8: 5b 8b 00 14 sw (sp+20),r11 80040cc: 5b 8c 00 10 sw (sp+16),r12 80040d0: 5b 8d 00 0c sw (sp+12),r13 80040d4: 5b 8e 00 08 sw (sp+8),r14 80040d8: 5b 9d 00 04 sw (sp+4),ra 80040dc: b8 20 60 00 mv r12,r1 Objects_Id id, Objects_Locations *location ) { return (Rate_monotonic_Control *) _Objects_Get( &_Rate_monotonic_Information, id, location ); 80040e0: 78 01 08 02 mvhi r1,0x802 80040e4: b8 40 68 00 mv r13,r2 80040e8: 38 21 08 90 ori r1,r1,0x890 80040ec: b9 80 10 00 mv r2,r12 80040f0: 37 83 00 18 addi r3,sp,24 80040f4: f8 00 0a 32 calli 80069bc <_Objects_Get> 80040f8: b8 20 58 00 mv r11,r1 rtems_rate_monotonic_period_states local_state; ISR_Level level; the_period = _Rate_monotonic_Get( id, &location ); switch ( location ) { 80040fc: 2b 81 00 18 lw r1,(sp+24) 8004100: 5c 20 00 5f bne r1,r0,800427c RTEMS_INLINE_ROUTINE bool _Thread_Is_executing ( const Thread_Control *the_thread ) { return ( the_thread == _Thread_Executing ); 8004104: 78 03 08 02 mvhi r3,0x802 8004108: 38 63 0e 88 ori r3,r3,0xe88 case OBJECTS_LOCAL: if ( !_Thread_Is_executing( the_period->owner ) ) { 800410c: 29 62 00 40 lw r2,(r11+64) 8004110: 28 61 00 0c lw r1,(r3+12) 8004114: 44 41 00 04 be r2,r1,8004124 _Thread_Enable_dispatch(); 8004118: f8 00 0d 85 calli 800772c <_Thread_Enable_dispatch> return RTEMS_NOT_OWNER_OF_RESOURCE; 800411c: 34 0c 00 17 mvi r12,23 8004120: e0 00 00 58 bi 8004280 } if ( length == RTEMS_PERIOD_STATUS ) { 8004124: 5d a0 00 0d bne r13,r0,8004158 switch ( the_period->state ) { 8004128: 29 61 00 38 lw r1,(r11+56) 800412c: 34 02 00 04 mvi r2,4 8004130: 34 0c 00 00 mvi r12,0 8004134: 54 22 00 07 bgu r1,r2,8004150 <== NEVER TAKEN 8004138: 78 0b 08 01 mvhi r11,0x801 800413c: 34 02 00 02 mvi r2,2 8004140: fb ff f4 53 calli 800128c <__ashlsi3> 8004144: 39 6b e5 80 ori r11,r11,0xe580 8004148: b5 61 08 00 add r1,r11,r1 800414c: 28 2c 00 00 lw r12,(r1+0) case RATE_MONOTONIC_ACTIVE: default: /* unreached -- only to remove warnings */ return_value = RTEMS_SUCCESSFUL; break; } _Thread_Enable_dispatch(); 8004150: f8 00 0d 77 calli 800772c <_Thread_Enable_dispatch> return( return_value ); 8004154: e0 00 00 4b bi 8004280 } _ISR_Disable( level ); 8004158: 90 00 70 00 rcsr r14,IE 800415c: 34 01 ff fe mvi r1,-2 8004160: a1 c1 08 00 and r1,r14,r1 8004164: d0 01 00 00 wcsr IE,r1 if ( the_period->state == RATE_MONOTONIC_INACTIVE ) { 8004168: 29 63 00 38 lw r3,(r11+56) 800416c: 5c 60 00 13 bne r3,r0,80041b8 _ISR_Enable( level ); 8004170: d0 0e 00 00 wcsr IE,r14 /* * Baseline statistics information for the beginning of a period. */ _Rate_monotonic_Initiate_statistics( the_period ); 8004174: b9 60 08 00 mv r1,r11 8004178: fb ff ff 6e calli 8003f30 <_Rate_monotonic_Initiate_statistics> the_period->state = RATE_MONOTONIC_ACTIVE; 800417c: 34 01 00 02 mvi r1,2 Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 8004180: 78 03 08 00 mvhi r3,0x800 8004184: 59 61 00 38 sw (r11+56),r1 8004188: 38 63 46 04 ori r3,r3,0x4604 ) { the_watchdog->initial = units; _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 800418c: 78 01 08 02 mvhi r1,0x802 Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 8004190: 59 60 00 18 sw (r11+24),r0 the_watchdog->routine = routine; 8004194: 59 63 00 2c sw (r11+44),r3 the_watchdog->id = id; 8004198: 59 6c 00 30 sw (r11+48),r12 the_watchdog->user_data = user_data; 800419c: 59 60 00 34 sw (r11+52),r0 _Rate_monotonic_Timeout, id, NULL ); the_period->next_length = length; 80041a0: 59 6d 00 3c sw (r11+60),r13 Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 80041a4: 59 6d 00 1c sw (r11+28),r13 _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 80041a8: 38 21 0a 98 ori r1,r1,0xa98 80041ac: 35 62 00 10 addi r2,r11,16 80041b0: f8 00 12 3a calli 8008a98 <_Watchdog_Insert> 80041b4: e0 00 00 1f bi 8004230 _Watchdog_Insert_ticks( &the_period->Timer, length ); _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } if ( the_period->state == RATE_MONOTONIC_ACTIVE ) { 80041b8: 34 01 00 02 mvi r1,2 80041bc: 5c 61 00 20 bne r3,r1,800423c /* * Update statistics from the concluding period. */ _Rate_monotonic_Update_statistics( the_period ); 80041c0: b9 60 08 00 mv r1,r11 80041c4: fb ff ff 80 calli 8003fc4 <_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; 80041c8: 34 01 00 01 mvi r1,1 80041cc: 59 61 00 38 sw (r11+56),r1 the_period->next_length = length; 80041d0: 59 6d 00 3c sw (r11+60),r13 _ISR_Enable( level ); 80041d4: d0 0e 00 00 wcsr IE,r14 _Thread_Executing->Wait.id = the_period->Object.id; 80041d8: 78 01 08 02 mvhi r1,0x802 80041dc: 38 21 0e 88 ori r1,r1,0xe88 80041e0: 29 62 00 08 lw r2,(r11+8) 80041e4: 28 21 00 0c lw r1,(r1+12) 80041e8: 58 22 00 20 sw (r1+32),r2 _Thread_Set_state( _Thread_Executing, STATES_WAITING_FOR_PERIOD ); 80041ec: 34 02 40 00 mvi r2,16384 80041f0: f8 00 0f f1 calli 80081b4 <_Thread_Set_state> /* * Did the watchdog timer expire while we were actually blocking * on it? */ _ISR_Disable( level ); 80041f4: 90 00 08 00 rcsr r1,IE 80041f8: 34 02 ff fe mvi r2,-2 80041fc: a0 22 10 00 and r2,r1,r2 8004200: d0 02 00 00 wcsr IE,r2 local_state = the_period->state; the_period->state = RATE_MONOTONIC_ACTIVE; 8004204: 34 03 00 02 mvi r3,2 /* * Did the watchdog timer expire while we were actually blocking * on it? */ _ISR_Disable( level ); local_state = the_period->state; 8004208: 29 62 00 38 lw r2,(r11+56) the_period->state = RATE_MONOTONIC_ACTIVE; 800420c: 59 63 00 38 sw (r11+56),r3 _ISR_Enable( level ); 8004210: d0 01 00 00 wcsr IE,r1 /* * 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 ) 8004214: 34 01 00 03 mvi r1,3 8004218: 5c 41 00 06 bne r2,r1,8004230 _Thread_Clear_state( _Thread_Executing, STATES_WAITING_FOR_PERIOD ); 800421c: 78 01 08 02 mvhi r1,0x802 8004220: 38 21 0e 88 ori r1,r1,0xe88 8004224: 28 21 00 0c lw r1,(r1+12) 8004228: 34 02 40 00 mvi r2,16384 800422c: f8 00 0c 7b calli 8007418 <_Thread_Clear_state> _Thread_Enable_dispatch(); 8004230: f8 00 0d 3f calli 800772c <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 8004234: 34 0c 00 00 mvi r12,0 8004238: e0 00 00 12 bi 8004280 #endif case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 800423c: 34 0c 00 04 mvi r12,4 _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } if ( the_period->state == RATE_MONOTONIC_EXPIRED ) { 8004240: 5c 6c 00 10 bne r3,r12,8004280 <== NEVER TAKEN /* * Update statistics from the concluding period */ _Rate_monotonic_Update_statistics( the_period ); 8004244: b9 60 08 00 mv r1,r11 8004248: fb ff ff 5f calli 8003fc4 <_Rate_monotonic_Update_statistics> _ISR_Enable( level ); 800424c: d0 0e 00 00 wcsr IE,r14 the_period->state = RATE_MONOTONIC_ACTIVE; 8004250: 34 01 00 02 mvi r1,2 8004254: 59 61 00 38 sw (r11+56),r1 8004258: 78 01 08 02 mvhi r1,0x802 800425c: 38 21 0a 98 ori r1,r1,0xa98 8004260: 35 62 00 10 addi r2,r11,16 the_period->next_length = length; 8004264: 59 6d 00 3c sw (r11+60),r13 Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 8004268: 59 6d 00 1c sw (r11+28),r13 _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 800426c: f8 00 12 0b calli 8008a98 <_Watchdog_Insert> _Watchdog_Insert_ticks( &the_period->Timer, length ); _Thread_Enable_dispatch(); return RTEMS_TIMEOUT; 8004270: 34 0c 00 06 mvi r12,6 the_period->state = RATE_MONOTONIC_ACTIVE; the_period->next_length = length; _Watchdog_Insert_ticks( &the_period->Timer, length ); _Thread_Enable_dispatch(); 8004274: f8 00 0d 2e calli 800772c <_Thread_Enable_dispatch> return RTEMS_TIMEOUT; 8004278: e0 00 00 02 bi 8004280 #endif case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 800427c: 34 0c 00 04 mvi r12,4 } 8004280: b9 80 08 00 mv r1,r12 8004284: 2b 9d 00 04 lw ra,(sp+4) 8004288: 2b 8b 00 14 lw r11,(sp+20) 800428c: 2b 8c 00 10 lw r12,(sp+16) 8004290: 2b 8d 00 0c lw r13,(sp+12) 8004294: 2b 8e 00 08 lw r14,(sp+8) 8004298: 37 9c 00 18 addi sp,sp,24 800429c: c3 a0 00 00 ret =============================================================================== 080042a0 : */ void rtems_rate_monotonic_report_statistics_with_plugin( void *context, rtems_printk_plugin_t print ) { 80042a0: 37 9c ff 5c addi sp,sp,-164 80042a4: 5b 8b 00 44 sw (sp+68),r11 80042a8: 5b 8c 00 40 sw (sp+64),r12 80042ac: 5b 8d 00 3c sw (sp+60),r13 80042b0: 5b 8e 00 38 sw (sp+56),r14 80042b4: 5b 8f 00 34 sw (sp+52),r15 80042b8: 5b 90 00 30 sw (sp+48),r16 80042bc: 5b 91 00 2c sw (sp+44),r17 80042c0: 5b 92 00 28 sw (sp+40),r18 80042c4: 5b 93 00 24 sw (sp+36),r19 80042c8: 5b 94 00 20 sw (sp+32),r20 80042cc: 5b 95 00 1c sw (sp+28),r21 80042d0: 5b 96 00 18 sw (sp+24),r22 80042d4: 5b 97 00 14 sw (sp+20),r23 80042d8: 5b 98 00 10 sw (sp+16),r24 80042dc: 5b 99 00 0c sw (sp+12),r25 80042e0: 5b 9b 00 08 sw (sp+8),fp 80042e4: 5b 9d 00 04 sw (sp+4),ra 80042e8: b8 20 60 00 mv r12,r1 80042ec: b8 40 58 00 mv r11,r2 rtems_id id; rtems_rate_monotonic_period_statistics the_stats; rtems_rate_monotonic_period_status the_status; char name[5]; if ( !print ) 80042f0: 44 40 00 72 be r2,r0,80044b8 <== NEVER TAKEN return; (*print)( context, "Period information by period\n" ); 80042f4: 78 02 08 01 mvhi r2,0x801 80042f8: 38 42 e5 94 ori r2,r2,0xe594 80042fc: d9 60 00 00 call r11 #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ (*print)( context, "--- CPU times are in seconds ---\n" ); 8004300: 78 02 08 01 mvhi r2,0x801 8004304: 38 42 e5 b4 ori r2,r2,0xe5b4 8004308: b9 80 08 00 mv r1,r12 800430c: d9 60 00 00 call r11 (*print)( context, "--- Wall times are in seconds ---\n" ); 8004310: 78 02 08 01 mvhi r2,0x801 8004314: 38 42 e5 d8 ori r2,r2,0xe5d8 8004318: b9 80 08 00 mv r1,r12 800431c: d9 60 00 00 call r11 Be sure to test the various cases. (*print)( context,"\ 1234567890123456789012345678901234567890123456789012345678901234567890123456789\ \n"); */ (*print)( context, " ID OWNER COUNT MISSED " 8004320: 78 02 08 01 mvhi r2,0x801 8004324: 38 42 e5 fc ori r2,r2,0xe5fc 8004328: b9 80 08 00 mv r1,r12 800432c: d9 60 00 00 call r11 #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ " " #endif " WALL TIME\n" ); (*print)( context, " " 8004330: 78 02 08 01 mvhi r2,0x801 8004334: b9 80 08 00 mv r1,r12 8004338: 38 42 e6 48 ori r2,r2,0xe648 800433c: d9 60 00 00 call r11 /* * 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 ; 8004340: 78 01 08 02 mvhi r1,0x802 8004344: 38 21 08 90 ori r1,r1,0x890 rtems_object_get_name( the_status.owner, sizeof(name), name ); /* * Print part of report line that is not dependent on granularity */ (*print)( context, 8004348: 78 11 08 01 mvhi r17,0x801 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, 800434c: 78 10 08 01 mvhi r16,0x801 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, 8004350: 78 0f 08 01 mvhi r15,0x801 /* * If the count is zero, don't print statistics */ if (the_stats.count == 0) { (*print)( context, "\n" ); 8004354: 78 0e 08 01 mvhi r14,0x801 /* * 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 ; 8004358: 28 2d 00 08 lw r13,(r1+8) id <= _Rate_monotonic_Information.maximum_id ; 800435c: b8 20 a0 00 mv r20,r1 id++ ) { status = rtems_rate_monotonic_get_statistics( id, &the_stats ); 8004360: 37 99 00 48 addi r25,sp,72 #if defined(RTEMS_DEBUG) status = rtems_rate_monotonic_get_status( id, &the_status ); if ( status != RTEMS_SUCCESSFUL ) continue; #else (void) rtems_rate_monotonic_get_status( id, &the_status ); 8004364: 37 98 00 80 addi r24,sp,128 #endif rtems_object_get_name( the_status.owner, sizeof(name), name ); 8004368: 37 93 00 a0 addi r19,sp,160 /* * Print part of report line that is not dependent on granularity */ (*print)( context, 800436c: 3a 31 e6 94 ori r17,r17,0xe694 { #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ 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; 8004370: 37 97 00 60 addi r23,sp,96 _Timespec_Divide_by_integer( total_cpu, the_stats.count, &cpu_average ); 8004374: 37 92 00 98 addi r18,sp,152 (*print)( context, 8004378: 3a 10 e6 ac ori r16,r16,0xe6ac { #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ 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; 800437c: 37 96 00 78 addi r22,sp,120 _Timespec_Divide_by_integer(total_wall, the_stats.count, &wall_average); (*print)( context, 8004380: 39 ef e6 cc ori r15,r15,0xe6cc /* * If the count is zero, don't print statistics */ if (the_stats.count == 0) { (*print)( context, "\n" ); 8004384: 39 ce db d0 ori r14,r14,0xdbd0 /* * 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 ; 8004388: e0 00 00 4a bi 80044b0 id <= _Rate_monotonic_Information.maximum_id ; id++ ) { status = rtems_rate_monotonic_get_statistics( id, &the_stats ); 800438c: b9 a0 08 00 mv r1,r13 8004390: bb 20 10 00 mv r2,r25 8004394: f8 00 1c eb calli 800b740 8004398: b8 20 a8 00 mv r21,r1 if ( status != RTEMS_SUCCESSFUL ) 800439c: 5c 20 00 44 bne r1,r0,80044ac #if defined(RTEMS_DEBUG) status = rtems_rate_monotonic_get_status( id, &the_status ); if ( status != RTEMS_SUCCESSFUL ) continue; #else (void) rtems_rate_monotonic_get_status( id, &the_status ); 80043a0: bb 00 10 00 mv r2,r24 80043a4: b9 a0 08 00 mv r1,r13 80043a8: f8 00 1d 18 calli 800b808 #endif rtems_object_get_name( the_status.owner, sizeof(name), name ); 80043ac: 2b 81 00 80 lw r1,(sp+128) 80043b0: 34 02 00 05 mvi r2,5 80043b4: ba 60 18 00 mv r3,r19 80043b8: f8 00 00 c3 calli 80046c4 /* * Print part of report line that is not dependent on granularity */ (*print)( context, 80043bc: 2b 85 00 48 lw r5,(sp+72) 80043c0: 2b 86 00 4c lw r6,(sp+76) 80043c4: ba 20 10 00 mv r2,r17 80043c8: b9 80 08 00 mv r1,r12 80043cc: b9 a0 18 00 mv r3,r13 80043d0: ba 60 20 00 mv r4,r19 80043d4: d9 60 00 00 call r11 ); /* * If the count is zero, don't print statistics */ if (the_stats.count == 0) { 80043d8: 2b 82 00 48 lw r2,(sp+72) 80043dc: 5c 55 00 05 bne r2,r21,80043f0 (*print)( context, "\n" ); 80043e0: b9 80 08 00 mv r1,r12 80043e4: b9 c0 10 00 mv r2,r14 80043e8: d9 60 00 00 call r11 continue; 80043ec: e0 00 00 30 bi 80044ac 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 ); 80043f0: ba 40 18 00 mv r3,r18 80043f4: ba e0 08 00 mv r1,r23 80043f8: f8 00 10 5e calli 8008570 <_Timespec_Divide_by_integer> (*print)( context, 80043fc: 2b 81 00 54 lw r1,(sp+84) 8004400: 34 02 03 e8 mvi r2,1000 8004404: f8 00 60 ee calli 801c7bc <__divsi3> 8004408: b8 20 d8 00 mv fp,r1 800440c: 2b 81 00 5c lw r1,(sp+92) 8004410: 34 02 03 e8 mvi r2,1000 8004414: f8 00 60 ea calli 801c7bc <__divsi3> 8004418: b8 20 a8 00 mv r21,r1 800441c: 2b 81 00 9c lw r1,(sp+156) 8004420: 34 02 03 e8 mvi r2,1000 8004424: f8 00 60 e6 calli 801c7bc <__divsi3> 8004428: 2b 85 00 58 lw r5,(sp+88) 800442c: 2b 87 00 98 lw r7,(sp+152) 8004430: 2b 83 00 50 lw r3,(sp+80) 8004434: b8 20 40 00 mv r8,r1 8004438: bb 60 20 00 mv r4,fp 800443c: ba a0 30 00 mv r6,r21 8004440: ba 00 10 00 mv r2,r16 8004444: b9 80 08 00 mv r1,r12 8004448: d9 60 00 00 call r11 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); 800444c: 2b 82 00 48 lw r2,(sp+72) 8004450: ba 40 18 00 mv r3,r18 8004454: ba c0 08 00 mv r1,r22 8004458: f8 00 10 46 calli 8008570 <_Timespec_Divide_by_integer> (*print)( context, 800445c: 2b 81 00 6c lw r1,(sp+108) 8004460: 34 02 03 e8 mvi r2,1000 8004464: f8 00 60 d6 calli 801c7bc <__divsi3> 8004468: b8 20 d8 00 mv fp,r1 800446c: 2b 81 00 74 lw r1,(sp+116) 8004470: 34 02 03 e8 mvi r2,1000 8004474: f8 00 60 d2 calli 801c7bc <__divsi3> 8004478: b8 20 a8 00 mv r21,r1 800447c: 2b 81 00 9c lw r1,(sp+156) 8004480: 34 02 03 e8 mvi r2,1000 8004484: f8 00 60 ce calli 801c7bc <__divsi3> 8004488: 2b 83 00 68 lw r3,(sp+104) 800448c: 2b 85 00 70 lw r5,(sp+112) 8004490: 2b 87 00 98 lw r7,(sp+152) 8004494: b8 20 40 00 mv r8,r1 8004498: b9 e0 10 00 mv r2,r15 800449c: b9 80 08 00 mv r1,r12 80044a0: bb 60 20 00 mv r4,fp 80044a4: ba a0 30 00 mv r6,r21 80044a8: d9 60 00 00 call r11 * 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++ ) { 80044ac: 35 ad 00 01 addi r13,r13,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 ; 80044b0: 2a 81 00 0c lw r1,(r20+12) 80044b4: 50 2d ff b6 bgeu r1,r13,800438c the_stats.min_wall_time, the_stats.max_wall_time, ival_wall, fval_wall ); #endif } } } 80044b8: 2b 9d 00 04 lw ra,(sp+4) 80044bc: 2b 8b 00 44 lw r11,(sp+68) 80044c0: 2b 8c 00 40 lw r12,(sp+64) 80044c4: 2b 8d 00 3c lw r13,(sp+60) 80044c8: 2b 8e 00 38 lw r14,(sp+56) 80044cc: 2b 8f 00 34 lw r15,(sp+52) 80044d0: 2b 90 00 30 lw r16,(sp+48) 80044d4: 2b 91 00 2c lw r17,(sp+44) 80044d8: 2b 92 00 28 lw r18,(sp+40) 80044dc: 2b 93 00 24 lw r19,(sp+36) 80044e0: 2b 94 00 20 lw r20,(sp+32) 80044e4: 2b 95 00 1c lw r21,(sp+28) 80044e8: 2b 96 00 18 lw r22,(sp+24) 80044ec: 2b 97 00 14 lw r23,(sp+20) 80044f0: 2b 98 00 10 lw r24,(sp+16) 80044f4: 2b 99 00 0c lw r25,(sp+12) 80044f8: 2b 9b 00 08 lw fp,(sp+8) 80044fc: 37 9c 00 a4 addi sp,sp,164 8004500: c3 a0 00 00 ret =============================================================================== 08013344 : rtems_status_code rtems_signal_send( rtems_id id, rtems_signal_set signal_set ) { 8013344: 37 9c ff f4 addi sp,sp,-12 8013348: 5b 8b 00 08 sw (sp+8),r11 801334c: 5b 9d 00 04 sw (sp+4),ra Objects_Locations location; RTEMS_API_Control *api; ASR_Information *asr; if ( !signal_set ) return RTEMS_INVALID_NUMBER; 8013350: 34 03 00 0a mvi r3,10 rtems_status_code rtems_signal_send( rtems_id id, rtems_signal_set signal_set ) { 8013354: b8 40 58 00 mv r11,r2 register Thread_Control *the_thread; Objects_Locations location; RTEMS_API_Control *api; ASR_Information *asr; if ( !signal_set ) 8013358: 44 40 00 29 be r2,r0,80133fc return RTEMS_INVALID_NUMBER; the_thread = _Thread_Get( id, &location ); 801335c: 37 82 00 0c addi r2,sp,12 8013360: f8 00 15 33 calli 801882c <_Thread_Get> switch ( location ) { 8013364: 2b 82 00 0c lw r2,(sp+12) case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 8013368: 34 03 00 04 mvi r3,4 if ( !signal_set ) return RTEMS_INVALID_NUMBER; the_thread = _Thread_Get( id, &location ); switch ( location ) { 801336c: 5c 40 00 24 bne r2,r0,80133fc case OBJECTS_LOCAL: api = the_thread->API_Extensions[ THREAD_API_RTEMS ]; 8013370: 28 23 01 1c lw r3,(r1+284) asr = &api->Signal; if ( ! _ASR_Is_null_handler( asr->handler ) ) { 8013374: 28 64 00 0c lw r4,(r3+12) 8013378: 44 82 00 1f be r4,r2,80133f4 if ( asr->is_enabled ) { 801337c: 40 62 00 08 lbu r2,(r3+8) 8013380: 44 40 00 12 be r2,r0,80133c8 rtems_signal_set *signal_set ) { ISR_Level _level; _ISR_Disable( _level ); 8013384: 90 00 10 00 rcsr r2,IE 8013388: 34 04 ff fe mvi r4,-2 801338c: a0 44 20 00 and r4,r2,r4 8013390: d0 04 00 00 wcsr IE,r4 *signal_set |= signals; 8013394: 28 64 00 14 lw r4,(r3+20) 8013398: b8 8b 58 00 or r11,r4,r11 801339c: 58 6b 00 14 sw (r3+20),r11 _ISR_Enable( _level ); 80133a0: d0 02 00 00 wcsr IE,r2 _ASR_Post_signals( signal_set, &asr->signals_posted ); if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) 80133a4: 78 02 08 04 mvhi r2,0x804 80133a8: 38 42 01 88 ori r2,r2,0x188 80133ac: 28 43 00 08 lw r3,(r2+8) 80133b0: 44 60 00 0e be r3,r0,80133e8 80133b4: 28 43 00 0c lw r3,(r2+12) 80133b8: 5c 23 00 0c bne r1,r3,80133e8 <== NEVER TAKEN _Thread_Dispatch_necessary = true; 80133bc: 34 01 00 01 mvi r1,1 80133c0: 30 41 00 18 sb (r2+24),r1 80133c4: e0 00 00 09 bi 80133e8 rtems_signal_set *signal_set ) { ISR_Level _level; _ISR_Disable( _level ); 80133c8: 90 00 08 00 rcsr r1,IE 80133cc: 34 02 ff fe mvi r2,-2 80133d0: a0 22 10 00 and r2,r1,r2 80133d4: d0 02 00 00 wcsr IE,r2 *signal_set |= signals; 80133d8: 28 62 00 18 lw r2,(r3+24) 80133dc: b8 4b 58 00 or r11,r2,r11 80133e0: 58 6b 00 18 sw (r3+24),r11 _ISR_Enable( _level ); 80133e4: d0 01 00 00 wcsr IE,r1 } else { _ASR_Post_signals( signal_set, &asr->signals_pending ); } _Thread_Enable_dispatch(); 80133e8: f8 00 15 04 calli 80187f8 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 80133ec: 34 03 00 00 mvi r3,0 80133f0: e0 00 00 03 bi 80133fc } _Thread_Enable_dispatch(); 80133f4: f8 00 15 01 calli 80187f8 <_Thread_Enable_dispatch> return RTEMS_NOT_DEFINED; 80133f8: 34 03 00 0b mvi r3,11 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 80133fc: b8 60 08 00 mv r1,r3 8013400: 2b 9d 00 04 lw ra,(sp+4) 8013404: 2b 8b 00 08 lw r11,(sp+8) 8013408: 37 9c 00 0c addi sp,sp,12 801340c: c3 a0 00 00 ret =============================================================================== 0800def0 : rtems_status_code rtems_task_mode( rtems_mode mode_set, rtems_mode mask, rtems_mode *previous_mode_set ) { 800def0: 37 9c ff e0 addi sp,sp,-32 800def4: 5b 8b 00 20 sw (sp+32),r11 800def8: 5b 8c 00 1c sw (sp+28),r12 800defc: 5b 8d 00 18 sw (sp+24),r13 800df00: 5b 8e 00 14 sw (sp+20),r14 800df04: 5b 8f 00 10 sw (sp+16),r15 800df08: 5b 90 00 0c sw (sp+12),r16 800df0c: 5b 91 00 08 sw (sp+8),r17 800df10: 5b 9d 00 04 sw (sp+4),ra bool is_asr_enabled = false; bool needs_asr_dispatching = false; rtems_mode old_mode; if ( !previous_mode_set ) return RTEMS_INVALID_ADDRESS; 800df14: 34 04 00 09 mvi r4,9 rtems_status_code rtems_task_mode( rtems_mode mode_set, rtems_mode mask, rtems_mode *previous_mode_set ) { 800df18: b8 20 68 00 mv r13,r1 800df1c: b8 40 70 00 mv r14,r2 800df20: b8 60 80 00 mv r16,r3 ASR_Information *asr; bool is_asr_enabled = false; bool needs_asr_dispatching = false; rtems_mode old_mode; if ( !previous_mode_set ) 800df24: 44 60 00 51 be r3,r0,800e068 return RTEMS_INVALID_ADDRESS; executing = _Thread_Executing; 800df28: 78 01 08 01 mvhi r1,0x801 800df2c: 38 21 9d f0 ori r1,r1,0x9df0 800df30: 28 2c 00 0c lw r12,(r1+12) api = executing->API_Extensions[ THREAD_API_RTEMS ]; asr = &api->Signal; old_mode = (executing->is_preemptible) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT; 800df34: 41 8f 00 74 lbu r15,(r12+116) if ( executing->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_NONE ) 800df38: 29 81 00 7c lw r1,(r12+124) if ( !previous_mode_set ) return RTEMS_INVALID_ADDRESS; executing = _Thread_Executing; api = executing->API_Extensions[ THREAD_API_RTEMS ]; 800df3c: 29 8b 01 1c lw r11,(r12+284) asr = &api->Signal; old_mode = (executing->is_preemptible) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT; 800df40: 65 ef 00 00 cmpei r15,r15,0 800df44: c8 0f 78 00 sub r15,r0,r15 800df48: 21 ef 01 00 andi r15,r15,0x100 if ( executing->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_NONE ) 800df4c: 44 20 00 02 be r1,r0,800df54 old_mode |= RTEMS_NO_TIMESLICE; else old_mode |= RTEMS_TIMESLICE; 800df50: 39 ef 02 00 ori r15,r15,0x200 old_mode |= (asr->is_enabled) ? RTEMS_ASR : RTEMS_NO_ASR; 800df54: 41 71 00 08 lbu r17,(r11+8) old_mode |= _ISR_Get_level(); 800df58: fb ff e7 fd calli 8007f4c <_CPU_ISR_Get_level> 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; 800df5c: 66 31 00 00 cmpei r17,r17,0 800df60: c8 11 88 00 sub r17,r0,r17 800df64: 22 31 04 00 andi r17,r17,0x400 800df68: ba 21 08 00 or r1,r17,r1 old_mode |= _ISR_Get_level(); 800df6c: b8 2f 78 00 or r15,r1,r15 *previous_mode_set = old_mode; 800df70: 5a 0f 00 00 sw (r16+0),r15 /* * These are generic thread scheduling characteristics. */ if ( mask & RTEMS_PREEMPT_MASK ) 800df74: 21 c1 01 00 andi r1,r14,0x100 800df78: 44 20 00 04 be r1,r0,800df88 */ RTEMS_INLINE_ROUTINE bool _Modes_Is_preempt ( Modes_Control mode_set ) { return (mode_set & RTEMS_PREEMPT_MASK) == RTEMS_PREEMPT; 800df7c: 21 a1 01 00 andi r1,r13,0x100 executing->is_preemptible = _Modes_Is_preempt(mode_set) ? true : false; 800df80: 64 21 00 00 cmpei r1,r1,0 800df84: 31 81 00 74 sb (r12+116),r1 if ( mask & RTEMS_TIMESLICE_MASK ) { 800df88: 21 c1 02 00 andi r1,r14,0x200 800df8c: 44 20 00 0b be r1,r0,800dfb8 */ RTEMS_INLINE_ROUTINE bool _Modes_Is_timeslice ( Modes_Control mode_set ) { return (mode_set & RTEMS_TIMESLICE_MASK) == RTEMS_TIMESLICE; 800df90: 21 a1 02 00 andi r1,r13,0x200 if ( _Modes_Is_timeslice(mode_set) ) { 800df94: 44 20 00 08 be r1,r0,800dfb4 executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE; 800df98: 34 01 00 01 mvi r1,1 800df9c: 59 81 00 7c sw (r12+124),r1 executing->cpu_time_budget = _Thread_Ticks_per_timeslice; 800dfa0: 78 01 08 01 mvhi r1,0x801 800dfa4: 38 21 98 b8 ori r1,r1,0x98b8 800dfa8: 28 21 00 00 lw r1,(r1+0) 800dfac: 59 81 00 78 sw (r12+120),r1 800dfb0: e0 00 00 02 bi 800dfb8 } else executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE; 800dfb4: 59 80 00 7c sw (r12+124),r0 } /* * Set the new interrupt level */ if ( mask & RTEMS_INTERRUPT_MASK ) 800dfb8: 21 c1 00 01 andi r1,r14,0x1 800dfbc: 44 20 00 04 be r1,r0,800dfcc */ RTEMS_INLINE_ROUTINE ISR_Level _Modes_Get_interrupt_level ( Modes_Control mode_set ) { return ( mode_set & RTEMS_INTERRUPT_MASK ); 800dfc0: 21 a1 00 01 andi r1,r13,0x1 */ RTEMS_INLINE_ROUTINE void _Modes_Set_interrupt_level ( Modes_Control mode_set ) { _ISR_Set_level( _Modes_Get_interrupt_level( mode_set ) ); 800dfc4: 64 21 00 00 cmpei r1,r1,0 800dfc8: d0 01 00 00 wcsr IE,r1 * This is specific to the RTEMS API */ is_asr_enabled = false; needs_asr_dispatching = false; if ( mask & RTEMS_ASR_MASK ) { 800dfcc: 21 ce 04 00 andi r14,r14,0x400 /* * This is specific to the RTEMS API */ is_asr_enabled = false; needs_asr_dispatching = false; 800dfd0: 34 03 00 00 mvi r3,0 if ( mask & RTEMS_ASR_MASK ) { 800dfd4: 45 c0 00 11 be r14,r0,800e018 */ RTEMS_INLINE_ROUTINE bool _Modes_Is_asr_disabled ( Modes_Control mode_set ) { return (mode_set & RTEMS_ASR_MASK) == RTEMS_NO_ASR; 800dfd8: 21 ad 04 00 andi r13,r13,0x400 is_asr_enabled = _Modes_Is_asr_disabled( mode_set ) ? false : true; if ( is_asr_enabled != asr->is_enabled ) { 800dfdc: 41 61 00 08 lbu r1,(r11+8) * Output: * *previous_mode_set - previous mode set * always return RTEMS_SUCCESSFUL; */ rtems_status_code rtems_task_mode( 800dfe0: 65 ad 00 00 cmpei r13,r13,0 is_asr_enabled = false; needs_asr_dispatching = false; if ( mask & RTEMS_ASR_MASK ) { is_asr_enabled = _Modes_Is_asr_disabled( mode_set ) ? false : true; if ( is_asr_enabled != asr->is_enabled ) { 800dfe4: 44 2d 00 0d be r1,r13,800e018 asr->is_enabled = is_asr_enabled; 800dfe8: 31 6d 00 08 sb (r11+8),r13 ) { rtems_signal_set _signals; ISR_Level _level; _ISR_Disable( _level ); 800dfec: 90 00 08 00 rcsr r1,IE 800dff0: 34 02 ff fe mvi r2,-2 800dff4: a0 22 10 00 and r2,r1,r2 800dff8: d0 02 00 00 wcsr IE,r2 _signals = information->signals_pending; 800dffc: 29 62 00 18 lw r2,(r11+24) information->signals_pending = information->signals_posted; 800e000: 29 63 00 14 lw r3,(r11+20) information->signals_posted = _signals; 800e004: 59 62 00 14 sw (r11+20),r2 rtems_signal_set _signals; ISR_Level _level; _ISR_Disable( _level ); _signals = information->signals_pending; information->signals_pending = information->signals_posted; 800e008: 59 63 00 18 sw (r11+24),r3 information->signals_posted = _signals; _ISR_Enable( _level ); 800e00c: d0 01 00 00 wcsr IE,r1 _ASR_Swap_signals( asr ); if ( _ASR_Are_signals_pending( asr ) ) { 800e010: 29 63 00 14 lw r3,(r11+20) /* * This is specific to the RTEMS API */ is_asr_enabled = false; needs_asr_dispatching = false; 800e014: 7c 63 00 00 cmpnei r3,r3,0 needs_asr_dispatching = true; } } } if ( _System_state_Is_up( _System_state_Get() ) ) { 800e018: 78 01 08 01 mvhi r1,0x801 800e01c: 38 21 9a 98 ori r1,r1,0x9a98 800e020: 28 22 00 00 lw r2,(r1+0) 800e024: 34 01 00 03 mvi r1,3 if (_Thread_Evaluate_is_dispatch_needed( needs_asr_dispatching ) ) _Thread_Dispatch(); } return RTEMS_SUCCESSFUL; 800e028: 34 04 00 00 mvi r4,0 needs_asr_dispatching = true; } } } if ( _System_state_Is_up( _System_state_Get() ) ) { 800e02c: 5c 41 00 0f bne r2,r1,800e068 <== NEVER TAKEN bool are_signals_pending ) { Thread_Control *executing; executing = _Thread_Executing; 800e030: 78 01 08 01 mvhi r1,0x801 800e034: 38 21 9d f0 ori r1,r1,0x9df0 800e038: 28 22 00 0c lw r2,(r1+12) if ( are_signals_pending || 800e03c: 5c 60 00 05 bne r3,r0,800e050 800e040: 28 21 00 10 lw r1,(r1+16) 800e044: 44 41 00 09 be r2,r1,800e068 (!_Thread_Is_heir( executing ) && executing->is_preemptible) ) { 800e048: 40 41 00 74 lbu r1,(r2+116) 800e04c: 44 20 00 07 be r1,r0,800e068 <== NEVER TAKEN _Thread_Dispatch_necessary = true; 800e050: 78 01 08 01 mvhi r1,0x801 800e054: 38 21 9d f0 ori r1,r1,0x9df0 800e058: 34 02 00 01 mvi r2,1 800e05c: 30 22 00 18 sb (r1+24),r2 if (_Thread_Evaluate_is_dispatch_needed( needs_asr_dispatching ) ) _Thread_Dispatch(); 800e060: fb ff e1 d6 calli 80067b8 <_Thread_Dispatch> } return RTEMS_SUCCESSFUL; 800e064: 34 04 00 00 mvi r4,0 } 800e068: b8 80 08 00 mv r1,r4 800e06c: 2b 9d 00 04 lw ra,(sp+4) 800e070: 2b 8b 00 20 lw r11,(sp+32) 800e074: 2b 8c 00 1c lw r12,(sp+28) 800e078: 2b 8d 00 18 lw r13,(sp+24) 800e07c: 2b 8e 00 14 lw r14,(sp+20) 800e080: 2b 8f 00 10 lw r15,(sp+16) 800e084: 2b 90 00 0c lw r16,(sp+12) 800e088: 2b 91 00 08 lw r17,(sp+8) 800e08c: 37 9c 00 20 addi sp,sp,32 800e090: c3 a0 00 00 ret =============================================================================== 080055b8 : rtems_status_code rtems_task_set_note( rtems_id id, uint32_t notepad, uint32_t note ) { 80055b8: 37 9c ff ec addi sp,sp,-20 80055bc: 5b 8b 00 10 sw (sp+16),r11 80055c0: 5b 8c 00 0c sw (sp+12),r12 80055c4: 5b 8d 00 08 sw (sp+8),r13 80055c8: 5b 9d 00 04 sw (sp+4),ra 80055cc: b8 40 58 00 mv r11,r2 register Thread_Control *the_thread; Objects_Locations location; RTEMS_API_Control *api; if ( !rtems_configuration_get_notepads_enabled() ) 80055d0: 78 02 08 02 mvhi r2,0x802 80055d4: 38 42 50 8c ori r2,r2,0x508c 80055d8: 40 42 00 04 lbu r2,(r2+4) rtems_status_code rtems_task_set_note( rtems_id id, uint32_t notepad, uint32_t note ) { 80055dc: b8 60 60 00 mv r12,r3 register Thread_Control *the_thread; Objects_Locations location; RTEMS_API_Control *api; if ( !rtems_configuration_get_notepads_enabled() ) return RTEMS_NOT_CONFIGURED; 80055e0: 34 04 00 16 mvi r4,22 { register Thread_Control *the_thread; Objects_Locations location; RTEMS_API_Control *api; if ( !rtems_configuration_get_notepads_enabled() ) 80055e4: 44 40 00 21 be r2,r0,8005668 <== NEVER TAKEN /* * NOTE: There is no check for < RTEMS_NOTEPAD_FIRST because that would * be checking an unsigned number for being negative. */ if ( notepad > RTEMS_NOTEPAD_LAST ) 80055e8: 34 02 00 0f mvi r2,15 return RTEMS_INVALID_NUMBER; 80055ec: 34 04 00 0a mvi r4,10 /* * NOTE: There is no check for < RTEMS_NOTEPAD_FIRST because that would * be checking an unsigned number for being negative. */ if ( notepad > RTEMS_NOTEPAD_LAST ) 80055f0: 55 62 00 1e bgu r11,r2,8005668 /* * Optimize the most likely case to avoid the Thread_Dispatch. */ if ( _Objects_Are_ids_equal( id, OBJECTS_ID_OF_SELF ) || 80055f4: 44 20 00 06 be r1,r0,800560c _Objects_Are_ids_equal( id, _Thread_Executing->Object.id ) ) { 80055f8: 78 02 08 02 mvhi r2,0x802 80055fc: 38 42 60 58 ori r2,r2,0x6058 8005600: 28 42 00 0c lw r2,(r2+12) /* * Optimize the most likely case to avoid the Thread_Dispatch. */ if ( _Objects_Are_ids_equal( id, OBJECTS_ID_OF_SELF ) || 8005604: 28 42 00 08 lw r2,(r2+8) 8005608: 5c 22 00 0b bne r1,r2,8005634 _Objects_Are_ids_equal( id, _Thread_Executing->Object.id ) ) { api = _Thread_Executing->API_Extensions[ THREAD_API_RTEMS ]; 800560c: 78 01 08 02 mvhi r1,0x802 8005610: 38 21 60 58 ori r1,r1,0x6058 8005614: 28 21 00 0c lw r1,(r1+12) api->Notepads[ notepad ] = note; 8005618: 34 02 00 02 mvi r2,2 800561c: 28 2d 01 1c lw r13,(r1+284) 8005620: 35 61 00 08 addi r1,r11,8 8005624: fb ff f3 45 calli 8002338 <__ashlsi3> 8005628: b5 a1 08 00 add r1,r13,r1 800562c: 58 2c 00 00 sw (r1+0),r12 8005630: e0 00 00 0d bi 8005664 return RTEMS_SUCCESSFUL; } the_thread = _Thread_Get( id, &location ); 8005634: 37 82 00 14 addi r2,sp,20 8005638: f8 00 0a a7 calli 80080d4 <_Thread_Get> switch ( location ) { 800563c: 2b 82 00 14 lw r2,(sp+20) case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 8005640: 34 04 00 04 mvi r4,4 api->Notepads[ notepad ] = note; return RTEMS_SUCCESSFUL; } the_thread = _Thread_Get( id, &location ); switch ( location ) { 8005644: 5c 40 00 09 bne r2,r0,8005668 case OBJECTS_LOCAL: api = the_thread->API_Extensions[ THREAD_API_RTEMS ]; api->Notepads[ notepad ] = note; 8005648: 28 2d 01 1c lw r13,(r1+284) 800564c: 34 02 00 02 mvi r2,2 8005650: 35 61 00 08 addi r1,r11,8 8005654: fb ff f3 39 calli 8002338 <__ashlsi3> 8005658: b5 a1 08 00 add r1,r13,r1 800565c: 58 2c 00 00 sw (r1+0),r12 _Thread_Enable_dispatch(); 8005660: f8 00 0a 90 calli 80080a0 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 8005664: 34 04 00 00 mvi r4,0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 8005668: b8 80 08 00 mv r1,r4 800566c: 2b 9d 00 04 lw ra,(sp+4) 8005670: 2b 8b 00 10 lw r11,(sp+16) 8005674: 2b 8c 00 0c lw r12,(sp+12) 8005678: 2b 8d 00 08 lw r13,(sp+8) 800567c: 37 9c 00 14 addi sp,sp,20 8005680: c3 a0 00 00 ret =============================================================================== 08008480 : rtems_status_code rtems_task_set_priority( rtems_id id, rtems_task_priority new_priority, rtems_task_priority *old_priority ) { 8008480: 37 9c ff f0 addi sp,sp,-16 8008484: 5b 8b 00 0c sw (sp+12),r11 8008488: 5b 8c 00 08 sw (sp+8),r12 800848c: 5b 9d 00 04 sw (sp+4),ra 8008490: b8 40 58 00 mv r11,r2 8008494: b8 60 60 00 mv r12,r3 register Thread_Control *the_thread; Objects_Locations location; if ( new_priority != RTEMS_CURRENT_PRIORITY && 8008498: 44 40 00 06 be r2,r0,80084b0 RTEMS_INLINE_ROUTINE bool _RTEMS_tasks_Priority_is_valid ( rtems_task_priority the_priority ) { return ( ( the_priority >= RTEMS_MINIMUM_PRIORITY ) && ( the_priority <= RTEMS_MAXIMUM_PRIORITY ) ); 800849c: 78 02 08 01 mvhi r2,0x801 80084a0: 38 42 a0 c0 ori r2,r2,0xa0c0 80084a4: 40 43 00 00 lbu r3,(r2+0) !_RTEMS_tasks_Priority_is_valid( new_priority ) ) return RTEMS_INVALID_PRIORITY; 80084a8: 34 02 00 13 mvi r2,19 ) { register Thread_Control *the_thread; Objects_Locations location; if ( new_priority != RTEMS_CURRENT_PRIORITY && 80084ac: 55 63 00 16 bgu r11,r3,8008504 !_RTEMS_tasks_Priority_is_valid( new_priority ) ) return RTEMS_INVALID_PRIORITY; if ( !old_priority ) return RTEMS_INVALID_ADDRESS; 80084b0: 34 02 00 09 mvi r2,9 if ( new_priority != RTEMS_CURRENT_PRIORITY && !_RTEMS_tasks_Priority_is_valid( new_priority ) ) return RTEMS_INVALID_PRIORITY; if ( !old_priority ) 80084b4: 45 80 00 14 be r12,r0,8008504 return RTEMS_INVALID_ADDRESS; the_thread = _Thread_Get( id, &location ); 80084b8: 37 82 00 10 addi r2,sp,16 80084bc: f8 00 0a 8b calli 800aee8 <_Thread_Get> switch ( location ) { 80084c0: 2b 82 00 10 lw r2,(sp+16) 80084c4: 5c 40 00 0f bne r2,r0,8008500 case OBJECTS_LOCAL: /* XXX need helper to "convert" from core priority */ *old_priority = the_thread->current_priority; 80084c8: 28 23 00 14 lw r3,(r1+20) 80084cc: 59 83 00 00 sw (r12+0),r3 if ( new_priority != RTEMS_CURRENT_PRIORITY ) { 80084d0: 45 62 00 09 be r11,r2,80084f4 the_thread->real_priority = new_priority; if ( the_thread->resource_count == 0 || 80084d4: 28 22 00 1c lw r2,(r1+28) 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; 80084d8: 58 2b 00 18 sw (r1+24),r11 if ( the_thread->resource_count == 0 || 80084dc: 44 40 00 03 be r2,r0,80084e8 80084e0: 28 22 00 14 lw r2,(r1+20) 80084e4: 51 62 00 04 bgeu r11,r2,80084f4 <== ALWAYS TAKEN the_thread->current_priority > new_priority ) _Thread_Change_priority( the_thread, new_priority, false ); 80084e8: b9 60 10 00 mv r2,r11 80084ec: 34 03 00 00 mvi r3,0 80084f0: f8 00 09 22 calli 800a978 <_Thread_Change_priority> } _Thread_Enable_dispatch(); 80084f4: f8 00 0a 70 calli 800aeb4 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 80084f8: 34 02 00 00 mvi r2,0 80084fc: e0 00 00 02 bi 8008504 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 8008500: 34 02 00 04 mvi r2,4 } 8008504: b8 40 08 00 mv r1,r2 8008508: 2b 9d 00 04 lw ra,(sp+4) 800850c: 2b 8b 00 0c lw r11,(sp+12) 8008510: 2b 8c 00 08 lw r12,(sp+8) 8008514: 37 9c 00 10 addi sp,sp,16 8008518: c3 a0 00 00 ret =============================================================================== 08013e74 : */ rtems_status_code rtems_timer_cancel( rtems_id id ) { 8013e74: 37 9c ff f8 addi sp,sp,-8 8013e78: 5b 9d 00 04 sw (sp+4),ra 8013e7c: b8 20 10 00 mv r2,r1 Objects_Id id, Objects_Locations *location ) { return (Timer_Control *) _Objects_Get( &_Timer_Information, id, location ); 8013e80: 78 01 08 04 mvhi r1,0x804 8013e84: 38 21 05 bc ori r1,r1,0x5bc 8013e88: 37 83 00 08 addi r3,sp,8 8013e8c: f8 00 0e a2 calli 8017914 <_Objects_Get> Timer_Control *the_timer; Objects_Locations location; the_timer = _Timer_Get( id, &location ); switch ( location ) { 8013e90: 2b 82 00 08 lw r2,(sp+8) 8013e94: 5c 40 00 09 bne r2,r0,8013eb8 case OBJECTS_LOCAL: if ( !_Timer_Is_dormant_class( the_timer->the_class ) ) 8013e98: 28 23 00 38 lw r3,(r1+56) 8013e9c: 34 02 00 04 mvi r2,4 8013ea0: 44 62 00 03 be r3,r2,8013eac <== NEVER TAKEN (void) _Watchdog_Remove( &the_timer->Ticker ); 8013ea4: 34 21 00 10 addi r1,r1,16 8013ea8: f8 00 18 41 calli 8019fac <_Watchdog_Remove> _Thread_Enable_dispatch(); 8013eac: f8 00 12 53 calli 80187f8 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 8013eb0: 34 01 00 00 mvi r1,0 8013eb4: e0 00 00 02 bi 8013ebc #endif case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 8013eb8: 34 01 00 04 mvi r1,4 } 8013ebc: 2b 9d 00 04 lw ra,(sp+4) 8013ec0: 37 9c 00 08 addi sp,sp,8 8013ec4: c3 a0 00 00 ret =============================================================================== 08014490 : rtems_id id, rtems_time_of_day *wall_time, rtems_timer_service_routine_entry routine, void *user_data ) { 8014490: 37 9c ff dc addi sp,sp,-36 8014494: 5b 8b 00 20 sw (sp+32),r11 8014498: 5b 8c 00 1c sw (sp+28),r12 801449c: 5b 8d 00 18 sw (sp+24),r13 80144a0: 5b 8e 00 14 sw (sp+20),r14 80144a4: 5b 8f 00 10 sw (sp+16),r15 80144a8: 5b 90 00 0c sw (sp+12),r16 80144ac: 5b 91 00 08 sw (sp+8),r17 80144b0: 5b 9d 00 04 sw (sp+4),ra Timer_Control *the_timer; Objects_Locations location; rtems_interval seconds; Timer_server_Control *timer_server = _Timer_server; 80144b4: 78 05 08 04 mvhi r5,0x804 80144b8: 38 a5 05 fc ori r5,r5,0x5fc 80144bc: 28 ad 00 00 lw r13,(r5+0) rtems_id id, rtems_time_of_day *wall_time, rtems_timer_service_routine_entry routine, void *user_data ) { 80144c0: b8 20 78 00 mv r15,r1 80144c4: b8 40 60 00 mv r12,r2 80144c8: b8 60 80 00 mv r16,r3 80144cc: b8 80 88 00 mv r17,r4 Objects_Locations location; rtems_interval seconds; Timer_server_Control *timer_server = _Timer_server; if ( !timer_server ) return RTEMS_INCORRECT_STATE; 80144d0: 34 0b 00 0e mvi r11,14 Timer_Control *the_timer; Objects_Locations location; rtems_interval seconds; Timer_server_Control *timer_server = _Timer_server; if ( !timer_server ) 80144d4: 45 a0 00 2e be r13,r0,801458c return RTEMS_INCORRECT_STATE; if ( !_TOD_Is_set ) 80144d8: 78 05 08 03 mvhi r5,0x803 80144dc: 38 a5 fc c0 ori r5,r5,0xfcc0 80144e0: 40 a1 00 00 lbu r1,(r5+0) return RTEMS_NOT_DEFINED; 80144e4: 34 0b 00 0b mvi r11,11 Timer_server_Control *timer_server = _Timer_server; if ( !timer_server ) return RTEMS_INCORRECT_STATE; if ( !_TOD_Is_set ) 80144e8: 44 20 00 29 be r1,r0,801458c <== NEVER TAKEN return RTEMS_NOT_DEFINED; if ( !routine ) return RTEMS_INVALID_ADDRESS; 80144ec: 34 0b 00 09 mvi r11,9 return RTEMS_INCORRECT_STATE; if ( !_TOD_Is_set ) return RTEMS_NOT_DEFINED; if ( !routine ) 80144f0: 44 60 00 27 be r3,r0,801458c return RTEMS_INVALID_ADDRESS; if ( !_TOD_Validate( wall_time ) ) 80144f4: b8 40 08 00 mv r1,r2 80144f8: fb ff f1 c1 calli 8010bfc <_TOD_Validate> return RTEMS_INVALID_CLOCK; 80144fc: 34 0b 00 14 mvi r11,20 return RTEMS_NOT_DEFINED; if ( !routine ) return RTEMS_INVALID_ADDRESS; if ( !_TOD_Validate( wall_time ) ) 8014500: 44 20 00 23 be r1,r0,801458c return RTEMS_INVALID_CLOCK; seconds = _TOD_To_seconds( wall_time ); 8014504: b9 80 08 00 mv r1,r12 if ( seconds <= _TOD_Seconds_since_epoch() ) 8014508: 78 0c 08 03 mvhi r12,0x803 return RTEMS_INVALID_ADDRESS; if ( !_TOD_Validate( wall_time ) ) return RTEMS_INVALID_CLOCK; seconds = _TOD_To_seconds( wall_time ); 801450c: fb ff f1 7c calli 8010afc <_TOD_To_seconds> if ( seconds <= _TOD_Seconds_since_epoch() ) 8014510: 39 8c fd 58 ori r12,r12,0xfd58 return RTEMS_INVALID_ADDRESS; if ( !_TOD_Validate( wall_time ) ) return RTEMS_INVALID_CLOCK; seconds = _TOD_To_seconds( wall_time ); 8014514: b8 20 70 00 mv r14,r1 if ( seconds <= _TOD_Seconds_since_epoch() ) 8014518: 29 81 00 00 lw r1,(r12+0) 801451c: 50 2e 00 1c bgeu r1,r14,801458c 8014520: 78 01 08 04 mvhi r1,0x804 8014524: 38 21 05 bc ori r1,r1,0x5bc 8014528: b9 e0 10 00 mv r2,r15 801452c: 37 83 00 24 addi r3,sp,36 8014530: f8 00 0c f9 calli 8017914 <_Objects_Get> 8014534: b8 20 58 00 mv r11,r1 return RTEMS_INVALID_CLOCK; the_timer = _Timer_Get( id, &location ); switch ( location ) { 8014538: 2b 81 00 24 lw r1,(sp+36) 801453c: 5c 20 00 13 bne r1,r0,8014588 case OBJECTS_LOCAL: (void) _Watchdog_Remove( &the_timer->Ticker ); 8014540: 35 61 00 10 addi r1,r11,16 8014544: f8 00 16 9a calli 8019fac <_Watchdog_Remove> the_timer->the_class = TIMER_TIME_OF_DAY_ON_TASK; 8014548: 34 01 00 03 mvi r1,3 801454c: 59 61 00 38 sw (r11+56),r1 _Watchdog_Initialize( &the_timer->Ticker, routine, id, user_data ); the_timer->Ticker.initial = seconds - _TOD_Seconds_since_epoch(); 8014550: 29 81 00 00 lw r1,(r12+0) (*timer_server->schedule_operation)( timer_server, the_timer ); 8014554: 29 a3 00 04 lw r3,(r13+4) 8014558: b9 60 10 00 mv r2,r11 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(); 801455c: c9 c1 70 00 sub r14,r14,r1 Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 8014560: 59 60 00 18 sw (r11+24),r0 the_watchdog->routine = routine; 8014564: 59 70 00 2c sw (r11+44),r16 the_watchdog->id = id; 8014568: 59 6f 00 30 sw (r11+48),r15 the_watchdog->user_data = user_data; 801456c: 59 71 00 34 sw (r11+52),r17 8014570: 59 6e 00 1c sw (r11+28),r14 (*timer_server->schedule_operation)( timer_server, the_timer ); 8014574: b9 a0 08 00 mv r1,r13 8014578: d8 60 00 00 call r3 _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; 801457c: 34 0b 00 00 mvi r11,0 _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 ); _Thread_Enable_dispatch(); 8014580: f8 00 10 9e calli 80187f8 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 8014584: e0 00 00 02 bi 801458c #endif case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 8014588: 34 0b 00 04 mvi r11,4 } 801458c: b9 60 08 00 mv r1,r11 8014590: 2b 9d 00 04 lw ra,(sp+4) 8014594: 2b 8b 00 20 lw r11,(sp+32) 8014598: 2b 8c 00 1c lw r12,(sp+28) 801459c: 2b 8d 00 18 lw r13,(sp+24) 80145a0: 2b 8e 00 14 lw r14,(sp+20) 80145a4: 2b 8f 00 10 lw r15,(sp+16) 80145a8: 2b 90 00 0c lw r16,(sp+12) 80145ac: 2b 91 00 08 lw r17,(sp+8) 80145b0: 37 9c 00 24 addi sp,sp,36 80145b4: c3 a0 00 00 ret =============================================================================== 08003948 : #include int sched_get_priority_max( int policy ) { 8003948: 37 9c ff fc addi sp,sp,-4 800394c: 5b 9d 00 04 sw (sp+4),ra switch ( policy ) { 8003950: 48 01 00 05 bg r0,r1,8003964 8003954: 34 02 00 02 mvi r2,2 8003958: 4c 41 00 08 bge r2,r1,8003978 800395c: 34 02 00 04 mvi r2,4 8003960: 44 22 00 06 be r1,r2,8003978 <== ALWAYS TAKEN case SCHED_RR: case SCHED_SPORADIC: break; default: rtems_set_errno_and_return_minus_one( EINVAL ); 8003964: f8 00 26 80 calli 800d364 <__errno> 8003968: 34 02 00 16 mvi r2,22 800396c: 58 22 00 00 sw (r1+0),r2 8003970: 34 01 ff ff mvi r1,-1 8003974: e0 00 00 05 bi 8003988 } return POSIX_SCHEDULER_MAXIMUM_PRIORITY; 8003978: 78 01 08 01 mvhi r1,0x801 800397c: 38 21 f0 e4 ori r1,r1,0xf0e4 8003980: 40 21 00 00 lbu r1,(r1+0) 8003984: 34 21 ff ff addi r1,r1,-1 } 8003988: 2b 9d 00 04 lw ra,(sp+4) 800398c: 37 9c 00 04 addi sp,sp,4 8003990: c3 a0 00 00 ret =============================================================================== 08003994 : #include int sched_get_priority_min( int policy ) { 8003994: 37 9c ff fc addi sp,sp,-4 8003998: 5b 9d 00 04 sw (sp+4),ra switch ( policy ) { 800399c: 48 01 00 05 bg r0,r1,80039b0 80039a0: 34 02 00 02 mvi r2,2 80039a4: 4c 41 00 08 bge r2,r1,80039c4 <== ALWAYS TAKEN 80039a8: 34 02 00 04 mvi r2,4 80039ac: 44 22 00 06 be r1,r2,80039c4 case SCHED_RR: case SCHED_SPORADIC: break; default: rtems_set_errno_and_return_minus_one( EINVAL ); 80039b0: f8 00 26 6d calli 800d364 <__errno> 80039b4: 34 02 00 16 mvi r2,22 80039b8: 58 22 00 00 sw (r1+0),r2 80039bc: 34 01 ff ff mvi r1,-1 80039c0: e0 00 00 02 bi 80039c8 } return POSIX_SCHEDULER_MINIMUM_PRIORITY; 80039c4: 34 01 00 01 mvi r1,1 } 80039c8: 2b 9d 00 04 lw ra,(sp+4) 80039cc: 37 9c 00 04 addi sp,sp,4 80039d0: c3 a0 00 00 ret =============================================================================== 080039d4 : int sched_rr_get_interval( pid_t pid, struct timespec *interval ) { 80039d4: 37 9c ff f4 addi sp,sp,-12 80039d8: 5b 8b 00 08 sw (sp+8),r11 80039dc: 5b 9d 00 04 sw (sp+4),ra 80039e0: b8 20 58 00 mv r11,r1 /* * Only supported for the "calling process" (i.e. this node). */ if ( pid && pid != getpid() ) 80039e4: 44 20 00 08 be r1,r0,8003a04 <== NEVER TAKEN 80039e8: 5b 82 00 0c sw (sp+12),r2 80039ec: fb ff f8 b0 calli 8001cac 80039f0: 2b 82 00 0c lw r2,(sp+12) 80039f4: 45 61 00 04 be r11,r1,8003a04 rtems_set_errno_and_return_minus_one( ESRCH ); 80039f8: f8 00 26 5b calli 800d364 <__errno> 80039fc: 34 02 00 03 mvi r2,3 8003a00: e0 00 00 04 bi 8003a10 if ( !interval ) 8003a04: 5c 40 00 06 bne r2,r0,8003a1c rtems_set_errno_and_return_minus_one( EINVAL ); 8003a08: f8 00 26 57 calli 800d364 <__errno> 8003a0c: 34 02 00 16 mvi r2,22 8003a10: 58 22 00 00 sw (r1+0),r2 8003a14: 34 01 ff ff mvi r1,-1 8003a18: e0 00 00 06 bi 8003a30 _Timespec_From_ticks( _Thread_Ticks_per_timeslice, interval ); 8003a1c: 78 01 08 01 mvhi r1,0x801 8003a20: 38 21 f7 f0 ori r1,r1,0xf7f0 8003a24: 28 21 00 00 lw r1,(r1+0) 8003a28: f8 00 0e 22 calli 80072b0 <_Timespec_From_ticks> return 0; 8003a2c: 34 01 00 00 mvi r1,0 } 8003a30: 2b 9d 00 04 lw ra,(sp+4) 8003a34: 2b 8b 00 08 lw r11,(sp+8) 8003a38: 37 9c 00 0c addi sp,sp,12 8003a3c: c3 a0 00 00 ret =============================================================================== 08006130 : int oflag, ... /* mode_t mode, */ /* unsigned int value */ ) { 8006130: 37 9c ff c0 addi sp,sp,-64 8006134: 5b 8b 00 18 sw (sp+24),r11 8006138: 5b 8c 00 14 sw (sp+20),r12 800613c: 5b 8d 00 10 sw (sp+16),r13 8006140: 5b 8e 00 0c sw (sp+12),r14 8006144: 5b 8f 00 08 sw (sp+8),r15 8006148: 5b 9d 00 04 sw (sp+4),ra 800614c: 5b 83 00 2c sw (sp+44),r3 rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 8006150: 78 03 08 02 mvhi r3,0x802 8006154: 5b 82 00 28 sw (sp+40),r2 8006158: 5b 84 00 30 sw (sp+48),r4 800615c: 5b 85 00 34 sw (sp+52),r5 8006160: 5b 86 00 38 sw (sp+56),r6 8006164: 5b 87 00 3c sw (sp+60),r7 8006168: 5b 88 00 40 sw (sp+64),r8 800616c: 38 63 4a 50 ori r3,r3,0x4a50 8006170: b8 20 60 00 mv r12,r1 8006174: 28 61 00 00 lw r1,(r3+0) 8006178: b8 40 70 00 mv r14,r2 800617c: 34 21 00 01 addi r1,r1,1 8006180: 58 61 00 00 sw (r3+0),r1 POSIX_Semaphore_Control *the_semaphore; Objects_Locations location; _Thread_Disable_dispatch(); if ( oflag & O_CREAT ) { 8006184: 20 4f 02 00 andi r15,r2,0x200 /* unsigned int value */ ) { va_list arg; mode_t mode; unsigned int value = 0; 8006188: 34 0d 00 00 mvi r13,0 POSIX_Semaphore_Control *the_semaphore; Objects_Locations location; _Thread_Disable_dispatch(); if ( oflag & O_CREAT ) { 800618c: 45 e0 00 02 be r15,r0,8006194 va_start(arg, oflag); mode = (mode_t) va_arg( arg, unsigned int ); value = va_arg( arg, unsigned int ); 8006190: 2b 8d 00 30 lw r13,(sp+48) va_end(arg); } status = _POSIX_Semaphore_Name_to_id( name, &the_semaphore_id ); 8006194: b9 80 08 00 mv r1,r12 8006198: 37 82 00 24 addi r2,sp,36 800619c: f8 00 1b 07 calli 800cdb8 <_POSIX_Semaphore_Name_to_id> 80061a0: b8 20 58 00 mv r11,r1 * 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 ) { 80061a4: 44 20 00 08 be r1,r0,80061c4 /* * 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) ) ) { 80061a8: 34 01 00 02 mvi r1,2 80061ac: 5d 61 00 02 bne r11,r1,80061b4 <== NEVER TAKEN 80061b0: 5d e0 00 1a bne r15,r0,8006218 _Thread_Enable_dispatch(); 80061b4: f8 00 0a bb calli 8008ca0 <_Thread_Enable_dispatch> rtems_set_errno_and_return_minus_one_cast( status, sem_t * ); 80061b8: f8 00 2a 55 calli 8010b0c <__errno> 80061bc: 58 2b 00 00 sw (r1+0),r11 80061c0: e0 00 00 08 bi 80061e0 /* * Check for existence with creation. */ if ( (oflag & (O_CREAT | O_EXCL)) == (O_CREAT | O_EXCL) ) { 80061c4: 21 ce 0a 00 andi r14,r14,0xa00 80061c8: 34 01 0a 00 mvi r1,2560 80061cc: 5d c1 00 07 bne r14,r1,80061e8 _Thread_Enable_dispatch(); 80061d0: f8 00 0a b4 calli 8008ca0 <_Thread_Enable_dispatch> rtems_set_errno_and_return_minus_one_cast( EEXIST, sem_t * ); 80061d4: f8 00 2a 4e calli 8010b0c <__errno> 80061d8: 34 02 00 11 mvi r2,17 80061dc: 58 22 00 00 sw (r1+0),r2 80061e0: 34 01 ff ff mvi r1,-1 80061e4: e0 00 00 18 bi 8006244 80061e8: 2b 82 00 24 lw r2,(sp+36) 80061ec: 78 01 08 02 mvhi r1,0x802 80061f0: 37 83 00 1c addi r3,sp,28 80061f4: 38 21 4c a8 ori r1,r1,0x4ca8 80061f8: f8 00 07 5e calli 8007f70 <_Objects_Get> } the_semaphore = _POSIX_Semaphore_Get( &the_semaphore_id, &location ); the_semaphore->open_count += 1; 80061fc: 28 22 00 18 lw r2,(r1+24) 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 ); 8006200: 5b 81 00 20 sw (sp+32),r1 the_semaphore->open_count += 1; 8006204: 34 42 00 01 addi r2,r2,1 8006208: 58 22 00 18 sw (r1+24),r2 _Thread_Enable_dispatch(); 800620c: f8 00 0a a5 calli 8008ca0 <_Thread_Enable_dispatch> _Thread_Enable_dispatch(); 8006210: f8 00 0a a4 calli 8008ca0 <_Thread_Enable_dispatch> goto return_id; 8006214: e0 00 00 0a bi 800623c /* * 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( 8006218: 34 02 00 00 mvi r2,0 800621c: b9 a0 18 00 mv r3,r13 8006220: 37 84 00 20 addi r4,sp,32 8006224: b9 80 08 00 mv r1,r12 8006228: f8 00 1a 80 calli 800cc28 <_POSIX_Semaphore_Create_support> 800622c: b8 20 58 00 mv r11,r1 /* * errno was set by Create_support, so don't set it again. */ _Thread_Enable_dispatch(); 8006230: f8 00 0a 9c calli 8008ca0 <_Thread_Enable_dispatch> if ( status == -1 ) return SEM_FAILED; 8006234: 34 01 ff ff mvi r1,-1 * errno was set by Create_support, so don't set it again. */ _Thread_Enable_dispatch(); if ( status == -1 ) 8006238: 45 61 00 03 be r11,r1,8006244 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; 800623c: 2b 81 00 20 lw r1,(sp+32) 8006240: 34 21 00 08 addi r1,r1,8 #endif return id; } 8006244: 2b 9d 00 04 lw ra,(sp+4) 8006248: 2b 8b 00 18 lw r11,(sp+24) 800624c: 2b 8c 00 14 lw r12,(sp+20) 8006250: 2b 8d 00 10 lw r13,(sp+16) 8006254: 2b 8e 00 0c lw r14,(sp+12) 8006258: 2b 8f 00 08 lw r15,(sp+8) 800625c: 37 9c 00 40 addi sp,sp,64 8006260: c3 a0 00 00 ret =============================================================================== 08003848 : int sigaction( int sig, const struct sigaction *act, struct sigaction *oact ) { 8003848: 37 9c ff ec addi sp,sp,-20 800384c: 5b 8b 00 14 sw (sp+20),r11 8003850: 5b 8c 00 10 sw (sp+16),r12 8003854: 5b 8d 00 0c sw (sp+12),r13 8003858: 5b 8e 00 08 sw (sp+8),r14 800385c: 5b 9d 00 04 sw (sp+4),ra 8003860: b8 20 58 00 mv r11,r1 8003864: b8 40 60 00 mv r12,r2 8003868: b8 60 68 00 mv r13,r3 ISR_Level level; if ( oact ) 800386c: 44 60 00 0f be r3,r0,80038a8 *oact = _POSIX_signals_Vectors[ sig ]; 8003870: 34 02 00 01 mvi r2,1 8003874: f8 00 65 9b calli 801cee0 <__ashlsi3> 8003878: 34 02 00 02 mvi r2,2 800387c: 78 0e 08 02 mvhi r14,0x802 8003880: b4 2b 08 00 add r1,r1,r11 8003884: f8 00 65 97 calli 801cee0 <__ashlsi3> 8003888: 39 ce 0d d8 ori r14,r14,0xdd8 800388c: b5 c1 08 00 add r1,r14,r1 8003890: 28 23 00 00 lw r3,(r1+0) 8003894: 28 22 00 04 lw r2,(r1+4) 8003898: 28 21 00 08 lw r1,(r1+8) 800389c: 59 a3 00 00 sw (r13+0),r3 80038a0: 59 a2 00 04 sw (r13+4),r2 80038a4: 59 a1 00 08 sw (r13+8),r1 if ( !sig ) 80038a8: 45 60 00 07 be r11,r0,80038c4 static inline bool is_valid_signo( int signo ) { return ((signo) >= 1 && (signo) <= 32 ); 80038ac: 35 61 ff ff addi r1,r11,-1 rtems_set_errno_and_return_minus_one( EINVAL ); if ( !is_valid_signo(sig) ) 80038b0: 34 02 00 1f mvi r2,31 80038b4: 50 41 00 02 bgeu r2,r1,80038bc 80038b8: e0 00 00 03 bi 80038c4 * * NOTE: Solaris documentation claims to "silently enforce" this which * contradicts the POSIX specification. */ if ( sig == SIGKILL ) 80038bc: 34 01 00 09 mvi r1,9 80038c0: 5d 61 00 06 bne r11,r1,80038d8 rtems_set_errno_and_return_minus_one( EINVAL ); 80038c4: f8 00 27 fb calli 800d8b0 <__errno> 80038c8: 34 02 00 16 mvi r2,22 80038cc: 58 22 00 00 sw (r1+0),r2 80038d0: 34 01 ff ff mvi r1,-1 80038d4: e0 00 00 2d bi 8003988 * now (signals not posted when SIG_IGN). * + If we are now ignoring a signal that was previously pending, * we clear the pending signal indicator. */ return 0; 80038d8: 34 01 00 00 mvi r1,0 /* * Evaluate the new action structure and set the global signal vector * appropriately. */ if ( act ) { 80038dc: 45 80 00 2b be r12,r0,8003988 <== NEVER TAKEN /* * Unless the user is installing the default signal actions, then * we can just copy the provided sigaction structure into the vectors. */ _ISR_Disable( level ); 80038e0: 90 00 70 00 rcsr r14,IE 80038e4: 34 01 ff fe mvi r1,-2 80038e8: a1 c1 08 00 and r1,r14,r1 80038ec: d0 01 00 00 wcsr IE,r1 if ( act->sa_handler == SIG_DFL ) { 80038f0: 29 81 00 08 lw r1,(r12+8) 80038f4: 78 0d 08 02 mvhi r13,0x802 80038f8: 39 ad 0d d8 ori r13,r13,0xdd8 80038fc: 5c 20 00 12 bne r1,r0,8003944 _POSIX_signals_Vectors[ sig ] = _POSIX_signals_Default_vectors[ sig ]; 8003900: 34 02 00 01 mvi r2,1 8003904: b9 60 08 00 mv r1,r11 8003908: f8 00 65 76 calli 801cee0 <__ashlsi3> 800390c: 34 02 00 02 mvi r2,2 8003910: b4 2b 08 00 add r1,r1,r11 8003914: f8 00 65 73 calli 801cee0 <__ashlsi3> 8003918: 78 02 08 01 mvhi r2,0x801 800391c: 38 42 e8 e4 ori r2,r2,0xe8e4 8003920: b5 a1 68 00 add r13,r13,r1 8003924: b4 41 08 00 add r1,r2,r1 8003928: 28 23 00 00 lw r3,(r1+0) 800392c: 28 22 00 04 lw r2,(r1+4) 8003930: 28 21 00 08 lw r1,(r1+8) 8003934: 59 a3 00 00 sw (r13+0),r3 8003938: 59 a2 00 04 sw (r13+4),r2 800393c: 59 a1 00 08 sw (r13+8),r1 8003940: e0 00 00 10 bi 8003980 } else { _POSIX_signals_Clear_process_signals( sig ); 8003944: b9 60 08 00 mv r1,r11 8003948: f8 00 18 99 calli 8009bac <_POSIX_signals_Clear_process_signals> _POSIX_signals_Vectors[ sig ] = *act; 800394c: 34 02 00 01 mvi r2,1 8003950: b9 60 08 00 mv r1,r11 8003954: f8 00 65 63 calli 801cee0 <__ashlsi3> 8003958: 34 02 00 02 mvi r2,2 800395c: b4 2b 08 00 add r1,r1,r11 8003960: f8 00 65 60 calli 801cee0 <__ashlsi3> 8003964: 29 83 00 00 lw r3,(r12+0) 8003968: 29 82 00 04 lw r2,(r12+4) 800396c: 29 84 00 08 lw r4,(r12+8) 8003970: b5 a1 08 00 add r1,r13,r1 8003974: 58 23 00 00 sw (r1+0),r3 8003978: 58 22 00 04 sw (r1+4),r2 800397c: 58 24 00 08 sw (r1+8),r4 } _ISR_Enable( level ); 8003980: d0 0e 00 00 wcsr IE,r14 * now (signals not posted when SIG_IGN). * + If we are now ignoring a signal that was previously pending, * we clear the pending signal indicator. */ return 0; 8003984: 34 01 00 00 mvi r1,0 } 8003988: 2b 9d 00 04 lw ra,(sp+4) 800398c: 2b 8b 00 14 lw r11,(sp+20) 8003990: 2b 8c 00 10 lw r12,(sp+16) 8003994: 2b 8d 00 0c lw r13,(sp+12) 8003998: 2b 8e 00 08 lw r14,(sp+8) 800399c: 37 9c 00 14 addi sp,sp,20 80039a0: c3 a0 00 00 ret =============================================================================== 08003e34 : int sigtimedwait( const sigset_t *set, siginfo_t *info, const struct timespec *timeout ) { 8003e34: 37 9c ff dc addi sp,sp,-36 8003e38: 5b 8b 00 18 sw (sp+24),r11 8003e3c: 5b 8c 00 14 sw (sp+20),r12 8003e40: 5b 8d 00 10 sw (sp+16),r13 8003e44: 5b 8e 00 0c sw (sp+12),r14 8003e48: 5b 8f 00 08 sw (sp+8),r15 8003e4c: 5b 9d 00 04 sw (sp+4),ra 8003e50: b8 20 68 00 mv r13,r1 8003e54: b8 40 58 00 mv r11,r2 8003e58: b8 60 60 00 mv r12,r3 ISR_Level level; /* * Error check parameters before disabling interrupts. */ if ( !set ) 8003e5c: 44 20 00 09 be r1,r0,8003e80 /* NOTE: This is very specifically a RELATIVE not ABSOLUTE time * in the Open Group specification. */ interval = 0; if ( timeout ) { 8003e60: 44 60 00 0b be r3,r0,8003e8c if ( !_Timespec_Is_valid( timeout ) ) 8003e64: b8 60 08 00 mv r1,r3 8003e68: f8 00 0e 4a calli 8007790 <_Timespec_Is_valid> 8003e6c: 44 20 00 05 be r1,r0,8003e80 rtems_set_errno_and_return_minus_one( EINVAL ); interval = _Timespec_To_ticks( timeout ); 8003e70: b9 80 08 00 mv r1,r12 8003e74: f8 00 0e 65 calli 8007808 <_Timespec_To_ticks> 8003e78: b8 20 10 00 mv r2,r1 if ( !interval ) 8003e7c: 5c 20 00 05 bne r1,r0,8003e90 <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one( EINVAL ); 8003e80: f8 00 28 58 calli 800dfe0 <__errno> 8003e84: 34 02 00 16 mvi r2,22 8003e88: e0 00 00 61 bi 800400c /* NOTE: This is very specifically a RELATIVE not ABSOLUTE time * in the Open Group specification. */ interval = 0; 8003e8c: 34 02 00 00 mvi r2,0 /* * Initialize local variables. */ the_info = ( info ) ? info : &signal_information; 8003e90: 5d 60 00 02 bne r11,r0,8003e98 8003e94: 37 8b 00 1c addi r11,sp,28 the_thread = _Thread_Executing; 8003e98: 78 01 08 02 mvhi r1,0x802 8003e9c: 38 21 0d 88 ori r1,r1,0xd88 8003ea0: 28 23 00 0c lw r3,(r1+12) api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 8003ea4: 28 6e 01 20 lw r14,(r3+288) * What if they are already pending? */ /* API signals pending? */ _ISR_Disable( level ); 8003ea8: 90 00 78 00 rcsr r15,IE 8003eac: 34 01 ff fe mvi r1,-2 8003eb0: a1 e1 08 00 and r1,r15,r1 8003eb4: d0 01 00 00 wcsr IE,r1 if ( *set & api->signals_pending ) { 8003eb8: 29 a5 00 00 lw r5,(r13+0) 8003ebc: 29 c1 00 d4 lw r1,(r14+212) 8003ec0: a0 a1 20 00 and r4,r5,r1 8003ec4: 44 80 00 0f be r4,r0,8003f00 /* XXX real info later */ the_info->si_signo = _POSIX_signals_Get_lowest( api->signals_pending ); 8003ec8: fb ff ff bc calli 8003db8 <_POSIX_signals_Get_lowest> 8003ecc: b8 20 10 00 mv r2,r1 8003ed0: 59 61 00 00 sw (r11+0),r1 _POSIX_signals_Clear_signals( 8003ed4: b9 60 18 00 mv r3,r11 8003ed8: b9 c0 08 00 mv r1,r14 8003edc: 34 04 00 00 mvi r4,0 8003ee0: 34 05 00 00 mvi r5,0 8003ee4: f8 00 19 b5 calli 800a5b8 <_POSIX_signals_Clear_signals> the_info->si_signo, the_info, false, false ); _ISR_Enable( level ); 8003ee8: d0 0f 00 00 wcsr IE,r15 the_info->si_code = SI_USER; 8003eec: 34 01 00 01 mvi r1,1 8003ef0: 59 61 00 04 sw (r11+4),r1 the_info->si_value.sival_int = 0; 8003ef4: 59 60 00 08 sw (r11+8),r0 return the_info->si_signo; 8003ef8: 29 6c 00 00 lw r12,(r11+0) 8003efc: e0 00 00 46 bi 8004014 } /* Process pending signals? */ if ( *set & _POSIX_signals_Pending ) { 8003f00: 78 01 08 02 mvhi r1,0x802 8003f04: 38 21 0f cc ori r1,r1,0xfcc 8003f08: 28 21 00 00 lw r1,(r1+0) 8003f0c: a0 a1 28 00 and r5,r5,r1 8003f10: 44 a4 00 0f be r5,r4,8003f4c signo = _POSIX_signals_Get_lowest( _POSIX_signals_Pending ); 8003f14: fb ff ff a9 calli 8003db8 <_POSIX_signals_Get_lowest> 8003f18: b8 20 60 00 mv r12,r1 _POSIX_signals_Clear_signals( api, signo, the_info, true, false ); 8003f1c: b9 80 10 00 mv r2,r12 8003f20: b9 c0 08 00 mv r1,r14 8003f24: b9 60 18 00 mv r3,r11 8003f28: 34 04 00 01 mvi r4,1 8003f2c: 34 05 00 00 mvi r5,0 8003f30: f8 00 19 a2 calli 800a5b8 <_POSIX_signals_Clear_signals> _ISR_Enable( level ); 8003f34: d0 0f 00 00 wcsr IE,r15 the_info->si_signo = signo; the_info->si_code = SI_USER; 8003f38: 34 01 00 01 mvi r1,1 if ( *set & _POSIX_signals_Pending ) { signo = _POSIX_signals_Get_lowest( _POSIX_signals_Pending ); _POSIX_signals_Clear_signals( api, signo, the_info, true, false ); _ISR_Enable( level ); the_info->si_signo = signo; 8003f3c: 59 6c 00 00 sw (r11+0),r12 the_info->si_code = SI_USER; 8003f40: 59 61 00 04 sw (r11+4),r1 the_info->si_value.sival_int = 0; 8003f44: 59 60 00 08 sw (r11+8),r0 return signo; 8003f48: e0 00 00 33 bi 8004014 } the_info->si_signo = -1; 8003f4c: 34 01 ff ff mvi r1,-1 8003f50: 59 61 00 00 sw (r11+0),r1 8003f54: 78 01 08 02 mvhi r1,0x802 8003f58: 38 21 08 b8 ori r1,r1,0x8b8 8003f5c: 28 24 00 00 lw r4,(r1+0) 8003f60: 34 84 00 01 addi r4,r4,1 8003f64: 58 24 00 00 sw (r1+0),r4 _Thread_Disable_dispatch(); the_thread->Wait.queue = &_POSIX_signals_Wait_queue; the_thread->Wait.return_code = EINTR; 8003f68: 34 04 00 04 mvi r4,4 8003f6c: 58 64 00 34 sw (r3+52),r4 the_thread->Wait.option = *set; 8003f70: 29 a4 00 00 lw r4,(r13+0) } the_info->si_signo = -1; _Thread_Disable_dispatch(); the_thread->Wait.queue = &_POSIX_signals_Wait_queue; 8003f74: 78 01 08 02 mvhi r1,0x802 8003f78: 38 21 0f 64 ori r1,r1,0xf64 the_thread->Wait.return_code = EINTR; the_thread->Wait.option = *set; 8003f7c: 58 64 00 30 sw (r3+48),r4 the_thread->Wait.return_argument = the_info; 8003f80: 58 6b 00 28 sw (r3+40),r11 } the_info->si_signo = -1; _Thread_Disable_dispatch(); the_thread->Wait.queue = &_POSIX_signals_Wait_queue; 8003f84: 58 61 00 44 sw (r3+68),r1 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; 8003f88: 34 03 00 01 mvi r3,1 8003f8c: 58 23 00 30 sw (r1+48),r3 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 ); 8003f90: d0 0f 00 00 wcsr IE,r15 _Thread_queue_Enqueue( &_POSIX_signals_Wait_queue, interval ); 8003f94: 78 01 08 02 mvhi r1,0x802 8003f98: 78 03 08 00 mvhi r3,0x800 8003f9c: 38 21 0f 64 ori r1,r1,0xf64 8003fa0: 38 63 73 cc ori r3,r3,0x73cc 8003fa4: f8 00 0b e0 calli 8006f24 <_Thread_queue_Enqueue_with_handler> _Thread_Enable_dispatch(); 8003fa8: f8 00 0a af calli 8006a64 <_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 ); 8003fac: 29 62 00 00 lw r2,(r11+0) 8003fb0: b9 c0 08 00 mv r1,r14 8003fb4: b9 60 18 00 mv r3,r11 8003fb8: 34 04 00 00 mvi r4,0 8003fbc: 34 05 00 00 mvi r5,0 8003fc0: f8 00 19 7e calli 800a5b8 <_POSIX_signals_Clear_signals> /* Set errno only if return code is not EINTR or * if EINTR was caused by a signal being caught, which * was not in our set. */ if ( (_Thread_Executing->Wait.return_code != EINTR) 8003fc4: 78 01 08 02 mvhi r1,0x802 8003fc8: 38 21 0d 88 ori r1,r1,0xd88 8003fcc: 28 21 00 0c lw r1,(r1+12) 8003fd0: 28 22 00 34 lw r2,(r1+52) 8003fd4: 34 01 00 04 mvi r1,4 8003fd8: 5c 41 00 08 bne r2,r1,8003ff8 || !(*set & signo_to_mask( the_info->si_signo )) ) { 8003fdc: 29 6c 00 00 lw r12,(r11+0) 8003fe0: 34 01 00 01 mvi r1,1 8003fe4: 35 82 ff ff addi r2,r12,-1 8003fe8: f8 00 65 73 calli 801d5b4 <__ashlsi3> 8003fec: 29 a2 00 00 lw r2,(r13+0) 8003ff0: a0 22 08 00 and r1,r1,r2 8003ff4: 5c 20 00 08 bne r1,r0,8004014 errno = _Thread_Executing->Wait.return_code; 8003ff8: f8 00 27 fa calli 800dfe0 <__errno> 8003ffc: 78 02 08 02 mvhi r2,0x802 8004000: 38 42 0d 88 ori r2,r2,0xd88 8004004: 28 42 00 0c lw r2,(r2+12) 8004008: 28 42 00 34 lw r2,(r2+52) 800400c: 58 22 00 00 sw (r1+0),r2 return -1; 8004010: 34 0c ff ff mvi r12,-1 } return the_info->si_signo; } 8004014: b9 80 08 00 mv r1,r12 8004018: 2b 9d 00 04 lw ra,(sp+4) 800401c: 2b 8b 00 18 lw r11,(sp+24) 8004020: 2b 8c 00 14 lw r12,(sp+20) 8004024: 2b 8d 00 10 lw r13,(sp+16) 8004028: 2b 8e 00 0c lw r14,(sp+12) 800402c: 2b 8f 00 08 lw r15,(sp+8) 8004030: 37 9c 00 24 addi sp,sp,36 8004034: c3 a0 00 00 ret =============================================================================== 080062c8 : int sigwait( const sigset_t *set, int *sig ) { 80062c8: 37 9c ff f8 addi sp,sp,-8 80062cc: 5b 8b 00 08 sw (sp+8),r11 80062d0: 5b 9d 00 04 sw (sp+4),ra int status; status = sigtimedwait( set, NULL, NULL ); 80062d4: 34 03 00 00 mvi r3,0 int sigwait( const sigset_t *set, int *sig ) { 80062d8: b8 40 58 00 mv r11,r2 int status; status = sigtimedwait( set, NULL, NULL ); 80062dc: 34 02 00 00 mvi r2,0 80062e0: fb ff ff 72 calli 80060a8 80062e4: b8 20 18 00 mv r3,r1 if ( status != -1 ) { 80062e8: 34 01 ff ff mvi r1,-1 80062ec: 44 61 00 05 be r3,r1,8006300 if ( sig ) *sig = status; return 0; 80062f0: 34 01 00 00 mvi r1,0 int status; status = sigtimedwait( set, NULL, NULL ); if ( status != -1 ) { if ( sig ) 80062f4: 45 60 00 05 be r11,r0,8006308 <== NEVER TAKEN *sig = status; 80062f8: 59 63 00 00 sw (r11+0),r3 80062fc: e0 00 00 03 bi 8006308 return 0; } return errno; 8006300: f8 00 26 c2 calli 800fe08 <__errno> 8006304: 28 21 00 00 lw r1,(r1+0) } 8006308: 2b 9d 00 04 lw ra,(sp+4) 800630c: 2b 8b 00 08 lw r11,(sp+8) 8006310: 37 9c 00 08 addi sp,sp,8 8006314: c3 a0 00 00 ret =============================================================================== 08002e30 : int timer_create( clockid_t clock_id, struct sigevent *evp, timer_t *timerid ) { 8002e30: 37 9c ff ec addi sp,sp,-20 8002e34: 5b 8b 00 14 sw (sp+20),r11 8002e38: 5b 8c 00 10 sw (sp+16),r12 8002e3c: 5b 8d 00 0c sw (sp+12),r13 8002e40: 5b 8e 00 08 sw (sp+8),r14 8002e44: 5b 9d 00 04 sw (sp+4),ra 8002e48: b8 40 60 00 mv r12,r2 POSIX_Timer_Control *ptimer; if ( clock_id != CLOCK_REALTIME ) 8002e4c: 34 02 00 01 mvi r2,1 int timer_create( clockid_t clock_id, struct sigevent *evp, timer_t *timerid ) { 8002e50: b8 60 68 00 mv r13,r3 POSIX_Timer_Control *ptimer; if ( clock_id != CLOCK_REALTIME ) 8002e54: 5c 22 00 0c bne r1,r2,8002e84 rtems_set_errno_and_return_minus_one( EINVAL ); if ( !timerid ) 8002e58: 44 60 00 0b be r3,r0,8002e84 /* * The data of the structure evp are checked in order to verify if they * are coherent. */ if (evp != NULL) { 8002e5c: 45 80 00 0d be r12,r0,8002e90 /* The structure has data */ if ( ( evp->sigev_notify != SIGEV_NONE ) && 8002e60: 29 82 00 00 lw r2,(r12+0) 8002e64: 34 42 ff ff addi r2,r2,-1 8002e68: 50 22 00 02 bgeu r1,r2,8002e70 <== ALWAYS TAKEN 8002e6c: e0 00 00 06 bi 8002e84 <== NOT EXECUTED ( 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 ) 8002e70: 29 81 00 04 lw r1,(r12+4) 8002e74: 44 20 00 04 be r1,r0,8002e84 <== NEVER TAKEN static inline bool is_valid_signo( int signo ) { return ((signo) >= 1 && (signo) <= 32 ); 8002e78: 34 21 ff ff addi r1,r1,-1 rtems_set_errno_and_return_minus_one( EINVAL ); if ( !is_valid_signo(evp->sigev_signo) ) 8002e7c: 34 02 00 1f mvi r2,31 8002e80: 50 41 00 04 bgeu r2,r1,8002e90 <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one( EINVAL ); 8002e84: f8 00 29 d2 calli 800d5cc <__errno> 8002e88: 34 02 00 16 mvi r2,22 8002e8c: e0 00 00 0e bi 8002ec4 rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 8002e90: 78 01 08 01 mvhi r1,0x801 8002e94: 38 21 f8 b8 ori r1,r1,0xf8b8 8002e98: 28 22 00 00 lw r2,(r1+0) 8002e9c: 34 42 00 01 addi r2,r2,1 8002ea0: 58 22 00 00 sw (r1+0),r2 * 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 ); 8002ea4: 78 01 08 01 mvhi r1,0x801 8002ea8: 38 21 fb 50 ori r1,r1,0xfb50 8002eac: f8 00 07 13 calli 8004af8 <_Objects_Allocate> 8002eb0: b8 20 58 00 mv r11,r1 /* * Allocate a timer */ ptimer = _POSIX_Timer_Allocate(); if ( !ptimer ) { 8002eb4: 5c 20 00 07 bne r1,r0,8002ed0 _Thread_Enable_dispatch(); 8002eb8: f8 00 0b 6f calli 8005c74 <_Thread_Enable_dispatch> rtems_set_errno_and_return_minus_one( EAGAIN ); 8002ebc: f8 00 29 c4 calli 800d5cc <__errno> 8002ec0: 34 02 00 0b mvi r2,11 8002ec4: 58 22 00 00 sw (r1+0),r2 8002ec8: 34 01 ff ff mvi r1,-1 8002ecc: e0 00 00 25 bi 8002f60 } /* The data of the created timer are stored to use them later */ ptimer->state = POSIX_TIMER_STATE_CREATE_NEW; 8002ed0: 34 01 00 02 mvi r1,2 8002ed4: 31 61 00 3c sb (r11+60),r1 ptimer->thread_id = _Thread_Executing->Object.id; 8002ed8: 78 01 08 01 mvhi r1,0x801 8002edc: 38 21 fd 88 ori r1,r1,0xfd88 8002ee0: 28 21 00 0c lw r1,(r1+12) 8002ee4: 28 21 00 08 lw r1,(r1+8) 8002ee8: 59 61 00 38 sw (r11+56),r1 if ( evp != NULL ) { 8002eec: 45 80 00 07 be r12,r0,8002f08 ptimer->inf.sigev_notify = evp->sigev_notify; 8002ef0: 29 81 00 00 lw r1,(r12+0) 8002ef4: 59 61 00 40 sw (r11+64),r1 ptimer->inf.sigev_signo = evp->sigev_signo; 8002ef8: 29 81 00 04 lw r1,(r12+4) 8002efc: 59 61 00 44 sw (r11+68),r1 ptimer->inf.sigev_value = evp->sigev_value; 8002f00: 29 81 00 08 lw r1,(r12+8) 8002f04: 59 61 00 48 sw (r11+72),r1 uint32_t name ) { _Objects_Set_local_object( information, _Objects_Get_index( the_object->id ), 8002f08: 29 6c 00 08 lw r12,(r11+8) _Objects_Open_u32(&_POSIX_Timer_Information, &ptimer->Object, 0); *timerid = ptimer->Object.id; _Thread_Enable_dispatch(); return 0; } 8002f0c: 78 01 08 01 mvhi r1,0x801 8002f10: 38 21 fb 50 ori r1,r1,0xfb50 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 8002f14: 28 2e 00 1c lw r14,(r1+28) 8002f18: 34 02 00 02 mvi r2,2 ptimer->inf.sigev_notify = evp->sigev_notify; ptimer->inf.sigev_signo = evp->sigev_signo; ptimer->inf.sigev_value = evp->sigev_value; } ptimer->overrun = 0; 8002f1c: 59 60 00 68 sw (r11+104),r0 ptimer->timer_data.it_value.tv_sec = 0; 8002f20: 59 60 00 5c sw (r11+92),r0 ptimer->timer_data.it_value.tv_nsec = 0; 8002f24: 59 60 00 60 sw (r11+96),r0 ptimer->timer_data.it_interval.tv_sec = 0; 8002f28: 59 60 00 54 sw (r11+84),r0 ptimer->timer_data.it_interval.tv_nsec = 0; 8002f2c: 59 60 00 58 sw (r11+88),r0 Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 8002f30: 59 60 00 18 sw (r11+24),r0 the_watchdog->routine = routine; 8002f34: 59 60 00 2c sw (r11+44),r0 the_watchdog->id = id; 8002f38: 59 60 00 30 sw (r11+48),r0 the_watchdog->user_data = user_data; 8002f3c: 59 60 00 34 sw (r11+52),r0 8002f40: 21 81 ff ff andi r1,r12,0xffff 8002f44: f8 00 61 8d calli 801b578 <__ashlsi3> 8002f48: b5 c1 08 00 add r1,r14,r1 8002f4c: 58 2b 00 00 sw (r1+0),r11 _Objects_Get_index( the_object->id ), the_object ); /* ASSERT: information->is_string == false */ the_object->name.name_u32 = name; 8002f50: 59 60 00 0c sw (r11+12),r0 _Watchdog_Initialize( &ptimer->Timer, NULL, 0, NULL ); _Objects_Open_u32(&_POSIX_Timer_Information, &ptimer->Object, 0); *timerid = ptimer->Object.id; 8002f54: 59 ac 00 00 sw (r13+0),r12 _Thread_Enable_dispatch(); 8002f58: f8 00 0b 47 calli 8005c74 <_Thread_Enable_dispatch> return 0; 8002f5c: 34 01 00 00 mvi r1,0 } 8002f60: 2b 9d 00 04 lw ra,(sp+4) 8002f64: 2b 8b 00 14 lw r11,(sp+20) 8002f68: 2b 8c 00 10 lw r12,(sp+16) 8002f6c: 2b 8d 00 0c lw r13,(sp+12) 8002f70: 2b 8e 00 08 lw r14,(sp+8) 8002f74: 37 9c 00 14 addi sp,sp,20 8002f78: c3 a0 00 00 ret =============================================================================== 08002f7c : timer_t timerid, int flags, const struct itimerspec *value, struct itimerspec *ovalue ) { 8002f7c: 37 9c ff cc addi sp,sp,-52 8002f80: 5b 8b 00 18 sw (sp+24),r11 8002f84: 5b 8c 00 14 sw (sp+20),r12 8002f88: 5b 8d 00 10 sw (sp+16),r13 8002f8c: 5b 8e 00 0c sw (sp+12),r14 8002f90: 5b 8f 00 08 sw (sp+8),r15 8002f94: 5b 9d 00 04 sw (sp+4),ra 8002f98: b8 20 78 00 mv r15,r1 8002f9c: b8 40 58 00 mv r11,r2 8002fa0: b8 60 60 00 mv r12,r3 8002fa4: b8 80 68 00 mv r13,r4 Objects_Locations location; bool activated; uint32_t initial_period; struct itimerspec normalize; if ( !value ) 8002fa8: 44 60 00 69 be r3,r0,800314c <== NEVER TAKEN /* * First, it verifies if the structure "value" is correct * if the number of nanoseconds is not correct return EINVAL */ if ( !_Timespec_Is_valid( &(value->it_value) ) ) { 8002fac: 34 61 00 08 addi r1,r3,8 8002fb0: f8 00 0e b4 calli 8006a80 <_Timespec_Is_valid> 8002fb4: 44 20 00 66 be r1,r0,800314c rtems_set_errno_and_return_minus_one( EINVAL ); } if ( !_Timespec_Is_valid( &(value->it_interval) ) ) { 8002fb8: b9 80 08 00 mv r1,r12 8002fbc: f8 00 0e b1 calli 8006a80 <_Timespec_Is_valid> 8002fc0: 44 20 00 63 be r1,r0,800314c <== NEVER TAKEN rtems_set_errno_and_return_minus_one( EINVAL ); } if ( flags != TIMER_ABSTIME && flags != POSIX_TIMER_RELATIVE ) { 8002fc4: 7d 62 00 00 cmpnei r2,r11,0 8002fc8: 7d 61 00 04 cmpnei r1,r11,4 8002fcc: a0 41 08 00 and r1,r2,r1 8002fd0: 5c 20 00 5f bne r1,r0,800314c rtems_set_errno_and_return_minus_one( EINVAL ); } normalize = *value; 8002fd4: 29 81 00 0c lw r1,(r12+12) 8002fd8: 29 84 00 00 lw r4,(r12+0) 8002fdc: 29 83 00 04 lw r3,(r12+4) 8002fe0: 29 82 00 08 lw r2,(r12+8) 8002fe4: 5b 81 00 28 sw (sp+40),r1 8002fe8: 5b 84 00 1c sw (sp+28),r4 8002fec: 5b 83 00 20 sw (sp+32),r3 8002ff0: 5b 82 00 24 sw (sp+36),r2 /* Convert absolute to relative time */ if (flags == TIMER_ABSTIME) { 8002ff4: 34 01 00 04 mvi r1,4 8002ff8: 5d 61 00 0d bne r11,r1,800302c struct timespec now; _TOD_Get( &now ); 8002ffc: 37 8b 00 2c addi r11,sp,44 8003000: b9 60 08 00 mv r1,r11 8003004: f8 00 04 f4 calli 80043d4 <_TOD_Get> /* Check for seconds in the past */ if ( _Timespec_Greater_than( &now, &normalize.it_value ) ) 8003008: 37 8e 00 24 addi r14,sp,36 800300c: b9 60 08 00 mv r1,r11 8003010: b9 c0 10 00 mv r2,r14 8003014: f8 00 0e 90 calli 8006a54 <_Timespec_Greater_than> 8003018: 5c 20 00 4d bne r1,r0,800314c rtems_set_errno_and_return_minus_one( EINVAL ); _Timespec_Subtract( &now, &normalize.it_value, &normalize.it_value ); 800301c: b9 60 08 00 mv r1,r11 8003020: b9 c0 10 00 mv r2,r14 8003024: b9 c0 18 00 mv r3,r14 8003028: f8 00 0e a2 calli 8006ab0 <_Timespec_Subtract> timer_t id, Objects_Locations *location ) { return (POSIX_Timer_Control *) _Objects_Get( &_POSIX_Timer_Information, (Objects_Id) id, location ); 800302c: 78 03 08 01 mvhi r3,0x801 8003030: b8 60 08 00 mv r1,r3 8003034: b9 e0 10 00 mv r2,r15 8003038: 38 21 fb 50 ori r1,r1,0xfb50 800303c: 37 83 00 34 addi r3,sp,52 8003040: f8 00 07 fd calli 8005034 <_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 ) { 8003044: 2b 82 00 34 lw r2,(sp+52) 8003048: b8 20 58 00 mv r11,r1 800304c: 5c 40 00 40 bne r2,r0,800314c 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 ) { 8003050: 2b 81 00 24 lw r1,(sp+36) 8003054: 5c 22 00 19 bne r1,r2,80030b8 8003058: 2b 8e 00 28 lw r14,(sp+40) 800305c: 5d c1 00 17 bne r14,r1,80030b8 /* Stop the timer */ (void) _Watchdog_Remove( &ptimer->Timer ); 8003060: 35 61 00 10 addi r1,r11,16 8003064: f8 00 10 08 calli 8007084 <_Watchdog_Remove> /* The old data of the timer are returned */ if ( ovalue ) 8003068: 45 ae 00 09 be r13,r14,800308c *ovalue = ptimer->timer_data; 800306c: 29 64 00 54 lw r4,(r11+84) 8003070: 29 63 00 58 lw r3,(r11+88) 8003074: 29 62 00 5c lw r2,(r11+92) 8003078: 29 61 00 60 lw r1,(r11+96) 800307c: 59 a4 00 00 sw (r13+0),r4 8003080: 59 a3 00 04 sw (r13+4),r3 8003084: 59 a2 00 08 sw (r13+8),r2 8003088: 59 a1 00 0c sw (r13+12),r1 /* The new data are set */ ptimer->timer_data = normalize; 800308c: 2b 81 00 1c lw r1,(sp+28) 8003090: 59 61 00 54 sw (r11+84),r1 8003094: 2b 81 00 20 lw r1,(sp+32) 8003098: 59 61 00 58 sw (r11+88),r1 800309c: 2b 81 00 24 lw r1,(sp+36) 80030a0: 59 61 00 5c sw (r11+92),r1 80030a4: 2b 81 00 28 lw r1,(sp+40) 80030a8: 59 61 00 60 sw (r11+96),r1 /* Indicates that the timer is created and stopped */ ptimer->state = POSIX_TIMER_STATE_CREATE_STOP; 80030ac: 34 01 00 04 mvi r1,4 80030b0: 31 61 00 3c sb (r11+60),r1 80030b4: e0 00 00 23 bi 8003140 _Thread_Enable_dispatch(); return 0; } /* Convert from seconds and nanoseconds to ticks */ ptimer->ticks = _Timespec_To_ticks( &value->it_interval ); 80030b8: b9 80 08 00 mv r1,r12 80030bc: f8 00 0e 8f calli 8006af8 <_Timespec_To_ticks> 80030c0: 59 61 00 64 sw (r11+100),r1 initial_period = _Timespec_To_ticks( &normalize.it_value ); 80030c4: 37 81 00 24 addi r1,sp,36 80030c8: f8 00 0e 8c calli 8006af8 <_Timespec_To_ticks> activated = _POSIX_Timer_Insert_helper( 80030cc: 29 63 00 08 lw r3,(r11+8) 80030d0: 78 04 08 00 mvhi r4,0x800 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 ); 80030d4: b8 20 10 00 mv r2,r1 activated = _POSIX_Timer_Insert_helper( 80030d8: 38 84 31 7c ori r4,r4,0x317c 80030dc: 35 61 00 10 addi r1,r11,16 80030e0: b9 60 28 00 mv r5,r11 80030e4: f8 00 1a a6 calli 8009b7c <_POSIX_Timer_Insert_helper> initial_period, ptimer->Object.id, _POSIX_Timer_TSR, ptimer ); if ( !activated ) { 80030e8: 44 20 00 16 be r1,r0,8003140 /* * The timer has been started and is running. So we return the * old ones in "ovalue" */ if ( ovalue ) 80030ec: 45 a0 00 09 be r13,r0,8003110 *ovalue = ptimer->timer_data; 80030f0: 29 64 00 54 lw r4,(r11+84) 80030f4: 29 63 00 58 lw r3,(r11+88) 80030f8: 29 62 00 5c lw r2,(r11+92) 80030fc: 29 61 00 60 lw r1,(r11+96) 8003100: 59 a4 00 00 sw (r13+0),r4 8003104: 59 a3 00 04 sw (r13+4),r3 8003108: 59 a2 00 08 sw (r13+8),r2 800310c: 59 a1 00 0c sw (r13+12),r1 ptimer->timer_data = normalize; 8003110: 2b 81 00 1c lw r1,(sp+28) 8003114: 59 61 00 54 sw (r11+84),r1 8003118: 2b 81 00 20 lw r1,(sp+32) 800311c: 59 61 00 58 sw (r11+88),r1 8003120: 2b 81 00 24 lw r1,(sp+36) 8003124: 59 61 00 5c sw (r11+92),r1 8003128: 2b 81 00 28 lw r1,(sp+40) 800312c: 59 61 00 60 sw (r11+96),r1 /* Indicate that the time is running */ ptimer->state = POSIX_TIMER_STATE_CREATE_RUN; 8003130: 34 01 00 03 mvi r1,3 8003134: 31 61 00 3c sb (r11+60),r1 _TOD_Get( &ptimer->time ); 8003138: 35 61 00 6c addi r1,r11,108 800313c: f8 00 04 a6 calli 80043d4 <_TOD_Get> _Thread_Enable_dispatch(); 8003140: f8 00 0a cd calli 8005c74 <_Thread_Enable_dispatch> return 0; 8003144: 34 01 00 00 mvi r1,0 8003148: e0 00 00 05 bi 800315c #endif case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( EINVAL ); 800314c: f8 00 29 20 calli 800d5cc <__errno> 8003150: 34 02 00 16 mvi r2,22 8003154: 58 22 00 00 sw (r1+0),r2 8003158: 34 01 ff ff mvi r1,-1 } 800315c: 2b 9d 00 04 lw ra,(sp+4) 8003160: 2b 8b 00 18 lw r11,(sp+24) 8003164: 2b 8c 00 14 lw r12,(sp+20) 8003168: 2b 8d 00 10 lw r13,(sp+16) 800316c: 2b 8e 00 0c lw r14,(sp+12) 8003170: 2b 8f 00 08 lw r15,(sp+8) 8003174: 37 9c 00 34 addi sp,sp,52 8003178: c3 a0 00 00 ret =============================================================================== 08002d34 : useconds_t ualarm( useconds_t useconds, useconds_t interval ) { 8002d34: 37 9c ff e8 addi sp,sp,-24 8002d38: 5b 8b 00 10 sw (sp+16),r11 8002d3c: 5b 8c 00 0c sw (sp+12),r12 8002d40: 5b 8d 00 08 sw (sp+8),r13 8002d44: 5b 9d 00 04 sw (sp+4),ra /* * Initialize the timer used to implement alarm(). */ if ( !the_timer->routine ) { 8002d48: 78 0b 08 01 mvhi r11,0x801 8002d4c: 39 6b 71 60 ori r11,r11,0x7160 useconds_t ualarm( useconds_t useconds, useconds_t interval ) { 8002d50: b8 20 68 00 mv r13,r1 /* * Initialize the timer used to implement alarm(). */ if ( !the_timer->routine ) { 8002d54: 29 61 00 1c lw r1,(r11+28) 8002d58: 5c 20 00 09 bne r1,r0,8002d7c Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 8002d5c: 78 01 08 00 mvhi r1,0x800 8002d60: 38 21 2c ec ori r1,r1,0x2cec Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 8002d64: 59 60 00 08 sw (r11+8),r0 the_watchdog->routine = routine; 8002d68: 59 61 00 1c sw (r11+28),r1 the_watchdog->id = id; 8002d6c: 59 60 00 20 sw (r11+32),r0 the_watchdog->user_data = user_data; 8002d70: 59 60 00 24 sw (r11+36),r0 useconds_t ualarm( useconds_t useconds, useconds_t interval ) { useconds_t remaining = 0; 8002d74: 34 0c 00 00 mvi r12,0 8002d78: e0 00 00 18 bi 8002dd8 if ( !the_timer->routine ) { _Watchdog_Initialize( the_timer, _POSIX_signals_Ualarm_TSR, 0, NULL ); } else { Watchdog_States state; state = _Watchdog_Remove( the_timer ); 8002d7c: b9 60 08 00 mv r1,r11 8002d80: f8 00 0f 27 calli 8006a1c <_Watchdog_Remove> if ( (state == WATCHDOG_ACTIVE) || (state == WATCHDOG_REMOVE_IT) ) { 8002d84: 34 21 ff fe addi r1,r1,-2 8002d88: 34 02 00 01 mvi r2,1 useconds_t ualarm( useconds_t useconds, useconds_t interval ) { useconds_t remaining = 0; 8002d8c: 34 0c 00 00 mvi r12,0 _Watchdog_Initialize( the_timer, _POSIX_signals_Ualarm_TSR, 0, NULL ); } else { Watchdog_States state; state = _Watchdog_Remove( the_timer ); if ( (state == WATCHDOG_ACTIVE) || (state == WATCHDOG_REMOVE_IT) ) { 8002d90: 54 22 00 12 bgu r1,r2,8002dd8 <== 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); 8002d94: 29 61 00 0c lw r1,(r11+12) 8002d98: 29 62 00 14 lw r2,(r11+20) 8002d9c: b4 41 10 00 add r2,r2,r1 8002da0: 29 61 00 18 lw r1,(r11+24) /* remaining is now in ticks */ _Timespec_From_ticks( ticks, &tp ); 8002da4: c8 41 08 00 sub r1,r2,r1 8002da8: 37 82 00 14 addi r2,sp,20 8002dac: f8 00 0d 54 calli 80062fc <_Timespec_From_ticks> remaining = tp.tv_sec * TOD_MICROSECONDS_PER_SECOND; 8002db0: 78 03 08 01 mvhi r3,0x801 8002db4: 38 63 4d 68 ori r3,r3,0x4d68 8002db8: 28 62 00 00 lw r2,(r3+0) 8002dbc: 2b 81 00 14 lw r1,(sp+20) 8002dc0: f8 00 43 32 calli 8013a88 <__mulsi3> 8002dc4: b8 20 60 00 mv r12,r1 remaining += tp.tv_nsec / 1000; 8002dc8: 2b 81 00 18 lw r1,(sp+24) 8002dcc: 34 02 03 e8 mvi r2,1000 8002dd0: f8 00 43 3a calli 8013ab8 <__divsi3> 8002dd4: b4 2c 60 00 add r12,r1,r12 /* * 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 ) { 8002dd8: 45 a0 00 1a be r13,r0,8002e40 Watchdog_Interval ticks; tp.tv_sec = useconds / TOD_MICROSECONDS_PER_SECOND; 8002ddc: 78 03 08 01 mvhi r3,0x801 8002de0: 38 63 4d 68 ori r3,r3,0x4d68 8002de4: 28 62 00 00 lw r2,(r3+0) 8002de8: b9 a0 08 00 mv r1,r13 tp.tv_nsec = (useconds % TOD_MICROSECONDS_PER_SECOND) * 1000; ticks = _Timespec_To_ticks( &tp ); 8002dec: 37 8b 00 14 addi r11,sp,20 * 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; 8002df0: f8 00 43 8b calli 8013c1c <__udivsi3> tp.tv_nsec = (useconds % TOD_MICROSECONDS_PER_SECOND) * 1000; 8002df4: 78 03 08 01 mvhi r3,0x801 8002df8: 38 63 4d 68 ori r3,r3,0x4d68 8002dfc: 28 62 00 00 lw r2,(r3+0) * 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; 8002e00: 5b 81 00 14 sw (sp+20),r1 tp.tv_nsec = (useconds % TOD_MICROSECONDS_PER_SECOND) * 1000; 8002e04: b9 a0 08 00 mv r1,r13 8002e08: f8 00 43 95 calli 8013c5c <__umodsi3> 8002e0c: 34 02 03 e8 mvi r2,1000 8002e10: f8 00 43 1e calli 8013a88 <__mulsi3> 8002e14: 5b 81 00 18 sw (sp+24),r1 ticks = _Timespec_To_ticks( &tp ); 8002e18: b9 60 08 00 mv r1,r11 8002e1c: f8 00 0d 66 calli 80063b4 <_Timespec_To_ticks> if ( ticks == 0 ) ticks = 1; _Watchdog_Insert_ticks( the_timer, _Timespec_To_ticks( &tp ) ); 8002e20: b9 60 08 00 mv r1,r11 8002e24: f8 00 0d 64 calli 80063b4 <_Timespec_To_ticks> Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 8002e28: 78 02 08 01 mvhi r2,0x801 8002e2c: 38 42 71 60 ori r2,r2,0x7160 8002e30: 58 41 00 0c sw (r2+12),r1 _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 8002e34: 78 01 08 01 mvhi r1,0x801 8002e38: 38 21 69 a8 ori r1,r1,0x69a8 8002e3c: f8 00 0e 9b calli 80068a8 <_Watchdog_Insert> } return remaining; } 8002e40: b9 80 08 00 mv r1,r12 8002e44: 2b 9d 00 04 lw ra,(sp+4) 8002e48: 2b 8b 00 10 lw r11,(sp+16) 8002e4c: 2b 8c 00 0c lw r12,(sp+12) 8002e50: 2b 8d 00 08 lw r13,(sp+8) 8002e54: 37 9c 00 18 addi sp,sp,24 8002e58: c3 a0 00 00 ret