=============================================================================== 0010cea0 <_CORE_RWLock_Obtain_for_reading>: Objects_Id id, bool wait, Watchdog_Interval timeout, CORE_RWLock_API_mp_support_callout api_rwlock_mp_support ) { 10cea0: 55 push %ebp 10cea1: 89 e5 mov %esp,%ebp 10cea3: 57 push %edi 10cea4: 56 push %esi 10cea5: 53 push %ebx 10cea6: 83 ec 1c sub $0x1c,%esp 10cea9: 8b 5d 08 mov 0x8(%ebp),%ebx 10ceac: 8b 4d 0c mov 0xc(%ebp),%ecx 10ceaf: 8b 45 14 mov 0x14(%ebp),%eax 10ceb2: 89 45 e4 mov %eax,-0x1c(%ebp) 10ceb5: 8a 55 10 mov 0x10(%ebp),%dl ISR_Level level; Thread_Control *executing = _Thread_Executing; 10ceb8: 8b 35 5c 94 12 00 mov 0x12945c,%esi * If unlocked, then OK to read. * If locked for reading and no waiters, then OK to read. * If any thread is waiting, then we wait. */ _ISR_Disable( level ); 10cebe: 9c pushf 10cebf: fa cli 10cec0: 5f pop %edi switch ( the_rwlock->current_state ) { 10cec1: 8b 43 44 mov 0x44(%ebx),%eax 10cec4: 85 c0 test %eax,%eax 10cec6: 74 05 je 10cecd <_CORE_RWLock_Obtain_for_reading+0x2d> 10cec8: 48 dec %eax 10cec9: 75 3a jne 10cf05 <_CORE_RWLock_Obtain_for_reading+0x65> 10cecb: eb 0e jmp 10cedb <_CORE_RWLock_Obtain_for_reading+0x3b> case CORE_RWLOCK_UNLOCKED: the_rwlock->current_state = CORE_RWLOCK_LOCKED_FOR_READING; 10cecd: c7 43 44 01 00 00 00 movl $0x1,0x44(%ebx) the_rwlock->number_of_readers += 1; 10ced4: ff 43 48 incl 0x48(%ebx) _ISR_Enable( level ); 10ced7: 57 push %edi 10ced8: 9d popf 10ced9: eb 21 jmp 10cefc <_CORE_RWLock_Obtain_for_reading+0x5c> executing->Wait.return_code = CORE_RWLOCK_SUCCESSFUL; return; case CORE_RWLOCK_LOCKED_FOR_READING: { Thread_Control *waiter; waiter = _Thread_queue_First( &the_rwlock->Wait_queue ); 10cedb: 83 ec 0c sub $0xc,%esp 10cede: 53 push %ebx 10cedf: 88 55 dc mov %dl,-0x24(%ebp) 10cee2: 89 4d e0 mov %ecx,-0x20(%ebp) 10cee5: e8 8a 1a 00 00 call 10e974 <_Thread_queue_First> if ( !waiter ) { 10ceea: 83 c4 10 add $0x10,%esp 10ceed: 85 c0 test %eax,%eax 10ceef: 8a 55 dc mov -0x24(%ebp),%dl 10cef2: 8b 4d e0 mov -0x20(%ebp),%ecx 10cef5: 75 0e jne 10cf05 <_CORE_RWLock_Obtain_for_reading+0x65><== NEVER TAKEN the_rwlock->number_of_readers += 1; 10cef7: ff 43 48 incl 0x48(%ebx) _ISR_Enable( level ); 10cefa: 57 push %edi 10cefb: 9d popf executing->Wait.return_code = CORE_RWLOCK_SUCCESSFUL; 10cefc: c7 46 34 00 00 00 00 movl $0x0,0x34(%esi) return; 10cf03: eb 48 jmp 10cf4d <_CORE_RWLock_Obtain_for_reading+0xad> /* * If the thread is not willing to wait, then return immediately. */ if ( !wait ) { 10cf05: 84 d2 test %dl,%dl 10cf07: 75 0b jne 10cf14 <_CORE_RWLock_Obtain_for_reading+0x74> _ISR_Enable( level ); 10cf09: 57 push %edi 10cf0a: 9d popf executing->Wait.return_code = CORE_RWLOCK_UNAVAILABLE; 10cf0b: c7 46 34 02 00 00 00 movl $0x2,0x34(%esi) 10cf12: eb 39 jmp 10cf4d <_CORE_RWLock_Obtain_for_reading+0xad> 10cf14: c7 43 30 01 00 00 00 movl $0x1,0x30(%ebx) /* * We need to wait to enter this critical section */ _Thread_queue_Enter_critical_section( &the_rwlock->Wait_queue ); executing->Wait.queue = &the_rwlock->Wait_queue; 10cf1b: 89 5e 44 mov %ebx,0x44(%esi) executing->Wait.id = id; 10cf1e: 89 4e 20 mov %ecx,0x20(%esi) executing->Wait.option = CORE_RWLOCK_THREAD_WAITING_FOR_READ; 10cf21: c7 46 30 00 00 00 00 movl $0x0,0x30(%esi) executing->Wait.return_code = CORE_RWLOCK_SUCCESSFUL; 10cf28: c7 46 34 00 00 00 00 movl $0x0,0x34(%esi) _ISR_Enable( level ); 10cf2f: 57 push %edi 10cf30: 9d popf _Thread_queue_Enqueue_with_handler( 10cf31: c7 45 10 7c d0 10 00 movl $0x10d07c,0x10(%ebp) 10cf38: 8b 45 e4 mov -0x1c(%ebp),%eax 10cf3b: 89 45 0c mov %eax,0xc(%ebp) 10cf3e: 89 5d 08 mov %ebx,0x8(%ebp) timeout, _CORE_RWLock_Timeout ); /* return to API level so it can dispatch and we block */ } 10cf41: 8d 65 f4 lea -0xc(%ebp),%esp 10cf44: 5b pop %ebx 10cf45: 5e pop %esi 10cf46: 5f pop %edi 10cf47: c9 leave executing->Wait.id = id; executing->Wait.option = CORE_RWLOCK_THREAD_WAITING_FOR_READ; executing->Wait.return_code = CORE_RWLOCK_SUCCESSFUL; _ISR_Enable( level ); _Thread_queue_Enqueue_with_handler( 10cf48: e9 4f 17 00 00 jmp 10e69c <_Thread_queue_Enqueue_with_handler> timeout, _CORE_RWLock_Timeout ); /* return to API level so it can dispatch and we block */ } 10cf4d: 8d 65 f4 lea -0xc(%ebp),%esp 10cf50: 5b pop %ebx 10cf51: 5e pop %esi 10cf52: 5f pop %edi 10cf53: c9 leave 10cf54: c3 ret =============================================================================== 0010cfdc <_CORE_RWLock_Release>: */ CORE_RWLock_Status _CORE_RWLock_Release( CORE_RWLock_Control *the_rwlock ) { 10cfdc: 55 push %ebp 10cfdd: 89 e5 mov %esp,%ebp 10cfdf: 53 push %ebx 10cfe0: 83 ec 04 sub $0x4,%esp 10cfe3: 8b 5d 08 mov 0x8(%ebp),%ebx ISR_Level level; Thread_Control *executing = _Thread_Executing; 10cfe6: 8b 15 5c 94 12 00 mov 0x12945c,%edx * 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 ); 10cfec: 9c pushf 10cfed: fa cli 10cfee: 58 pop %eax if ( the_rwlock->current_state == CORE_RWLOCK_UNLOCKED){ 10cfef: 8b 4b 44 mov 0x44(%ebx),%ecx 10cff2: 85 c9 test %ecx,%ecx 10cff4: 75 0b jne 10d001 <_CORE_RWLock_Release+0x25><== NEVER TAKEN _ISR_Enable( level ); 10cff6: 50 push %eax 10cff7: 9d popf executing->Wait.return_code = CORE_RWLOCK_UNAVAILABLE; 10cff8: c7 42 34 02 00 00 00 movl $0x2,0x34(%edx) return CORE_RWLOCK_SUCCESSFUL; 10cfff: eb 72 jmp 10d073 <_CORE_RWLock_Release+0x97> } if ( the_rwlock->current_state == CORE_RWLOCK_LOCKED_FOR_READING ) { 10d001: 49 dec %ecx 10d002: 75 0f jne 10d013 <_CORE_RWLock_Release+0x37> the_rwlock->number_of_readers -= 1; 10d004: 8b 4b 48 mov 0x48(%ebx),%ecx 10d007: 49 dec %ecx 10d008: 89 4b 48 mov %ecx,0x48(%ebx) if ( the_rwlock->number_of_readers != 0 ) { 10d00b: 85 c9 test %ecx,%ecx 10d00d: 74 04 je 10d013 <_CORE_RWLock_Release+0x37> /* must be unlocked again */ _ISR_Enable( level ); 10d00f: 50 push %eax 10d010: 9d popf return CORE_RWLOCK_SUCCESSFUL; 10d011: eb 60 jmp 10d073 <_CORE_RWLock_Release+0x97> } } /* CORE_RWLOCK_LOCKED_FOR_WRITING or READING with readers */ executing->Wait.return_code = CORE_RWLOCK_SUCCESSFUL; 10d013: c7 42 34 00 00 00 00 movl $0x0,0x34(%edx) /* * Implicitly transition to "unlocked" and find another thread interested * in obtaining this rwlock. */ the_rwlock->current_state = CORE_RWLOCK_UNLOCKED; 10d01a: c7 43 44 00 00 00 00 movl $0x0,0x44(%ebx) _ISR_Enable( level ); 10d021: 50 push %eax 10d022: 9d popf next = _Thread_queue_Dequeue( &the_rwlock->Wait_queue ); 10d023: 83 ec 0c sub $0xc,%esp 10d026: 53 push %ebx 10d027: e8 6c 15 00 00 call 10e598 <_Thread_queue_Dequeue> if ( next ) { 10d02c: 83 c4 10 add $0x10,%esp 10d02f: 85 c0 test %eax,%eax 10d031: 74 40 je 10d073 <_CORE_RWLock_Release+0x97> if ( next->Wait.option == CORE_RWLOCK_THREAD_WAITING_FOR_WRITE ) { 10d033: 83 78 30 01 cmpl $0x1,0x30(%eax) 10d037: 75 09 jne 10d042 <_CORE_RWLock_Release+0x66> the_rwlock->current_state = CORE_RWLOCK_LOCKED_FOR_WRITING; 10d039: c7 43 44 02 00 00 00 movl $0x2,0x44(%ebx) return CORE_RWLOCK_SUCCESSFUL; 10d040: eb 31 jmp 10d073 <_CORE_RWLock_Release+0x97> } /* * Must be CORE_RWLOCK_THREAD_WAITING_FOR_READING */ the_rwlock->number_of_readers += 1; 10d042: ff 43 48 incl 0x48(%ebx) the_rwlock->current_state = CORE_RWLOCK_LOCKED_FOR_READING; 10d045: c7 43 44 01 00 00 00 movl $0x1,0x44(%ebx) /* * Now see if more readers can be let go. */ while ( 1 ) { next = _Thread_queue_First( &the_rwlock->Wait_queue ); 10d04c: 83 ec 0c sub $0xc,%esp 10d04f: 53 push %ebx 10d050: e8 1f 19 00 00 call 10e974 <_Thread_queue_First> if ( !next || 10d055: 83 c4 10 add $0x10,%esp 10d058: 85 c0 test %eax,%eax 10d05a: 74 17 je 10d073 <_CORE_RWLock_Release+0x97> next->Wait.option == CORE_RWLOCK_THREAD_WAITING_FOR_WRITE ) 10d05c: 83 78 30 01 cmpl $0x1,0x30(%eax) 10d060: 74 11 je 10d073 <_CORE_RWLock_Release+0x97><== NEVER TAKEN return CORE_RWLOCK_SUCCESSFUL; the_rwlock->number_of_readers += 1; 10d062: ff 43 48 incl 0x48(%ebx) _Thread_queue_Extract( &the_rwlock->Wait_queue, next ); 10d065: 52 push %edx 10d066: 52 push %edx 10d067: 50 push %eax 10d068: 53 push %ebx 10d069: e8 f6 17 00 00 call 10e864 <_Thread_queue_Extract> } 10d06e: 83 c4 10 add $0x10,%esp 10d071: eb d9 jmp 10d04c <_CORE_RWLock_Release+0x70> } /* indentation is to match _ISR_Disable at top */ return CORE_RWLOCK_SUCCESSFUL; } 10d073: 31 c0 xor %eax,%eax 10d075: 8b 5d fc mov -0x4(%ebp),%ebx 10d078: c9 leave 10d079: c3 ret =============================================================================== 0010d07c <_CORE_RWLock_Timeout>: void _CORE_RWLock_Timeout( Objects_Id id, void *ignored ) { 10d07c: 55 push %ebp 10d07d: 89 e5 mov %esp,%ebp 10d07f: 83 ec 20 sub $0x20,%esp Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); 10d082: 8d 45 f4 lea -0xc(%ebp),%eax 10d085: 50 push %eax 10d086: ff 75 08 pushl 0x8(%ebp) 10d089: e8 7a 11 00 00 call 10e208 <_Thread_Get> switch ( location ) { 10d08e: 83 c4 10 add $0x10,%esp 10d091: 83 7d f4 00 cmpl $0x0,-0xc(%ebp) 10d095: 75 17 jne 10d0ae <_CORE_RWLock_Timeout+0x32><== NEVER TAKEN #if defined(RTEMS_MULTIPROCESSING) case OBJECTS_REMOTE: /* impossible */ #endif break; case OBJECTS_LOCAL: _Thread_queue_Process_timeout( the_thread ); 10d097: 83 ec 0c sub $0xc,%esp 10d09a: 50 push %eax 10d09b: e8 94 19 00 00 call 10ea34 <_Thread_queue_Process_timeout> */ RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void ) { RTEMS_COMPILER_MEMORY_BARRIER(); _Thread_Dispatch_disable_level -= 1; 10d0a0: a1 a0 93 12 00 mov 0x1293a0,%eax 10d0a5: 48 dec %eax 10d0a6: a3 a0 93 12 00 mov %eax,0x1293a0 10d0ab: 83 c4 10 add $0x10,%esp _Thread_Unnest_dispatch(); break; } } 10d0ae: c9 leave 10d0af: c3 ret =============================================================================== 00117ab0 <_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 ) { 117ab0: 55 push %ebp 117ab1: 89 e5 mov %esp,%ebp 117ab3: 57 push %edi 117ab4: 56 push %esi 117ab5: 53 push %ebx 117ab6: 83 ec 1c sub $0x1c,%esp 117ab9: 8b 5d 08 mov 0x8(%ebp),%ebx Thread_Control *the_thread; uint32_t number_broadcasted; Thread_Wait_information *waitp; if ( size > the_message_queue->maximum_message_size ) { 117abc: b8 01 00 00 00 mov $0x1,%eax 117ac1: 8b 55 10 mov 0x10(%ebp),%edx 117ac4: 3b 53 4c cmp 0x4c(%ebx),%edx 117ac7: 77 4c ja 117b15 <_CORE_message_queue_Broadcast+0x65><== NEVER TAKEN * There must be no pending messages if there is a thread waiting to * receive a message. */ number_broadcasted = 0; while ((the_thread = _Thread_queue_Dequeue(&the_message_queue->Wait_queue))) { 117ac9: c7 45 e4 00 00 00 00 movl $0x0,-0x1c(%ebp) * 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 ) { 117ad0: 83 7b 48 00 cmpl $0x0,0x48(%ebx) 117ad4: 74 23 je 117af9 <_CORE_message_queue_Broadcast+0x49> *count = 0; 117ad6: 8b 45 1c mov 0x1c(%ebp),%eax 117ad9: c7 00 00 00 00 00 movl $0x0,(%eax) 117adf: eb 32 jmp 117b13 <_CORE_message_queue_Broadcast+0x63> */ number_broadcasted = 0; while ((the_thread = _Thread_queue_Dequeue(&the_message_queue->Wait_queue))) { waitp = &the_thread->Wait; number_broadcasted += 1; 117ae1: ff 45 e4 incl -0x1c(%ebp) const void *source, void *destination, size_t size ) { memcpy(destination, source, size); 117ae4: 8b 42 2c mov 0x2c(%edx),%eax 117ae7: 89 c7 mov %eax,%edi 117ae9: 8b 75 0c mov 0xc(%ebp),%esi 117aec: 8b 4d 10 mov 0x10(%ebp),%ecx 117aef: f3 a4 rep movsb %ds:(%esi),%es:(%edi) buffer, waitp->return_argument_second.mutable_object, size ); *(size_t *) the_thread->Wait.return_argument = size; 117af1: 8b 42 28 mov 0x28(%edx),%eax 117af4: 8b 55 10 mov 0x10(%ebp),%edx 117af7: 89 10 mov %edx,(%eax) * There must be no pending messages if there is a thread waiting to * receive a message. */ number_broadcasted = 0; while ((the_thread = _Thread_queue_Dequeue(&the_message_queue->Wait_queue))) { 117af9: 83 ec 0c sub $0xc,%esp 117afc: 53 push %ebx 117afd: e8 c2 21 00 00 call 119cc4 <_Thread_queue_Dequeue> 117b02: 89 c2 mov %eax,%edx /* * There must be no pending messages if there is a thread waiting to * receive a message. */ number_broadcasted = 0; while ((the_thread = 117b04: 83 c4 10 add $0x10,%esp 117b07: 85 c0 test %eax,%eax 117b09: 75 d6 jne 117ae1 <_CORE_message_queue_Broadcast+0x31> if ( !_Objects_Is_local_id( the_thread->Object.id ) ) (*api_message_queue_mp_support) ( the_thread, id ); #endif } *count = number_broadcasted; 117b0b: 8b 55 e4 mov -0x1c(%ebp),%edx 117b0e: 8b 45 1c mov 0x1c(%ebp),%eax 117b11: 89 10 mov %edx,(%eax) 117b13: 31 c0 xor %eax,%eax return CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL; } 117b15: 8d 65 f4 lea -0xc(%ebp),%esp 117b18: 5b pop %ebx 117b19: 5e pop %esi 117b1a: 5f pop %edi 117b1b: c9 leave 117b1c: c3 ret =============================================================================== 00112920 <_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 ) { 112920: 55 push %ebp 112921: 89 e5 mov %esp,%ebp 112923: 57 push %edi 112924: 56 push %esi 112925: 53 push %ebx 112926: 83 ec 0c sub $0xc,%esp 112929: 8b 5d 08 mov 0x8(%ebp),%ebx 11292c: 8b 75 10 mov 0x10(%ebp),%esi 11292f: 8b 55 14 mov 0x14(%ebp),%edx size_t message_buffering_required; size_t allocated_message_size; the_message_queue->maximum_pending_messages = maximum_pending_messages; 112932: 89 73 44 mov %esi,0x44(%ebx) the_message_queue->number_of_pending_messages = 0; 112935: c7 43 48 00 00 00 00 movl $0x0,0x48(%ebx) the_message_queue->maximum_message_size = maximum_message_size; 11293c: 89 53 4c mov %edx,0x4c(%ebx) CORE_message_queue_Control *the_message_queue, CORE_message_queue_Notify_Handler the_handler, void *the_argument ) { the_message_queue->notify_handler = the_handler; 11293f: c7 43 60 00 00 00 00 movl $0x0,0x60(%ebx) the_message_queue->notify_argument = the_argument; 112946: c7 43 64 00 00 00 00 movl $0x0,0x64(%ebx) /* * 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)) { 11294d: 89 d0 mov %edx,%eax 11294f: f6 c2 03 test $0x3,%dl 112952: 74 0a je 11295e <_CORE_message_queue_Initialize+0x3e> allocated_message_size += sizeof(uint32_t); 112954: 8d 42 04 lea 0x4(%edx),%eax allocated_message_size &= ~(sizeof(uint32_t) - 1); 112957: 83 e0 fc and $0xfffffffc,%eax } if (allocated_message_size < maximum_message_size) 11295a: 39 d0 cmp %edx,%eax 11295c: 72 5f jb 1129bd <_CORE_message_queue_Initialize+0x9d><== 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)); 11295e: 8d 78 14 lea 0x14(%eax),%edi /* * 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 * 112961: 89 fa mov %edi,%edx 112963: 0f af d6 imul %esi,%edx (allocated_message_size + sizeof(CORE_message_queue_Buffer_control)); if (message_buffering_required < allocated_message_size) 112966: 39 c2 cmp %eax,%edx 112968: 72 53 jb 1129bd <_CORE_message_queue_Initialize+0x9d><== NEVER TAKEN return false; /* * Attempt to allocate the message memory */ the_message_queue->message_buffers = (CORE_message_queue_Buffer *) 11296a: 83 ec 0c sub $0xc,%esp 11296d: 52 push %edx 11296e: e8 91 26 00 00 call 115004 <_Workspace_Allocate> 112973: 89 43 5c mov %eax,0x5c(%ebx) _Workspace_Allocate( message_buffering_required ); if (the_message_queue->message_buffers == 0) 112976: 83 c4 10 add $0x10,%esp 112979: 85 c0 test %eax,%eax 11297b: 74 40 je 1129bd <_CORE_message_queue_Initialize+0x9d> /* * Initialize the pool of inactive messages, pending messages, * and set of waiting threads. */ _Chain_Initialize ( 11297d: 57 push %edi 11297e: 56 push %esi 11297f: 50 push %eax 112980: 8d 43 68 lea 0x68(%ebx),%eax 112983: 50 push %eax 112984: e8 eb 52 00 00 call 117c74 <_Chain_Initialize> */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 112989: 8d 43 54 lea 0x54(%ebx),%eax 11298c: 89 43 50 mov %eax,0x50(%ebx) the_chain->permanent_null = NULL; 11298f: c7 43 54 00 00 00 00 movl $0x0,0x54(%ebx) the_chain->last = _Chain_Head(the_chain); 112996: 8d 43 50 lea 0x50(%ebx),%eax 112999: 89 43 58 mov %eax,0x58(%ebx) allocated_message_size + sizeof( CORE_message_queue_Buffer_control ) ); _Chain_Initialize_empty( &the_message_queue->Pending_messages ); _Thread_queue_Initialize( 11299c: 6a 06 push $0x6 11299e: 68 80 00 00 00 push $0x80 1129a3: 8b 45 0c mov 0xc(%ebp),%eax 1129a6: 83 38 01 cmpl $0x1,(%eax) 1129a9: 0f 94 c0 sete %al 1129ac: 0f b6 c0 movzbl %al,%eax 1129af: 50 push %eax 1129b0: 53 push %ebx 1129b1: e8 26 1d 00 00 call 1146dc <_Thread_queue_Initialize> 1129b6: b0 01 mov $0x1,%al THREAD_QUEUE_DISCIPLINE_PRIORITY : THREAD_QUEUE_DISCIPLINE_FIFO, STATES_WAITING_FOR_MESSAGE, CORE_MESSAGE_QUEUE_STATUS_TIMEOUT ); return true; 1129b8: 83 c4 20 add $0x20,%esp 1129bb: eb 02 jmp 1129bf <_CORE_message_queue_Initialize+0x9f> 1129bd: 31 c0 xor %eax,%eax } 1129bf: 8d 65 f4 lea -0xc(%ebp),%esp 1129c2: 5b pop %ebx 1129c3: 5e pop %esi 1129c4: 5f pop %edi 1129c5: c9 leave 1129c6: c3 ret =============================================================================== 001129c8 <_CORE_message_queue_Seize>: void *buffer, size_t *size_p, bool wait, Watchdog_Interval timeout ) { 1129c8: 55 push %ebp 1129c9: 89 e5 mov %esp,%ebp 1129cb: 57 push %edi 1129cc: 56 push %esi 1129cd: 53 push %ebx 1129ce: 83 ec 2c sub $0x2c,%esp 1129d1: 8b 55 08 mov 0x8(%ebp),%edx 1129d4: 8b 45 0c mov 0xc(%ebp),%eax 1129d7: 89 45 dc mov %eax,-0x24(%ebp) 1129da: 8b 5d 10 mov 0x10(%ebp),%ebx 1129dd: 89 5d e0 mov %ebx,-0x20(%ebp) 1129e0: 8b 4d 14 mov 0x14(%ebp),%ecx 1129e3: 8b 75 1c mov 0x1c(%ebp),%esi 1129e6: 89 75 d4 mov %esi,-0x2c(%ebp) 1129e9: 8a 45 18 mov 0x18(%ebp),%al 1129ec: 88 45 db mov %al,-0x25(%ebp) ISR_Level level; CORE_message_queue_Buffer_control *the_message; Thread_Control *executing; executing = _Thread_Executing; 1129ef: a1 34 e4 12 00 mov 0x12e434,%eax executing->Wait.return_code = CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL; 1129f4: c7 40 34 00 00 00 00 movl $0x0,0x34(%eax) _ISR_Disable( level ); 1129fb: 9c pushf 1129fc: fa cli 1129fd: 8f 45 e4 popl -0x1c(%ebp) */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 112a00: 8b 5a 50 mov 0x50(%edx),%ebx */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 112a03: 8d 72 54 lea 0x54(%edx),%esi 112a06: 39 f3 cmp %esi,%ebx 112a08: 0f 84 8a 00 00 00 je 112a98 <_CORE_message_queue_Seize+0xd0> { Chain_Node *return_node; Chain_Node *new_first; return_node = the_chain->first; new_first = return_node->next; 112a0e: 8b 33 mov (%ebx),%esi the_chain->first = new_first; 112a10: 89 72 50 mov %esi,0x50(%edx) new_first->previous = _Chain_Head(the_chain); 112a13: 8d 7a 50 lea 0x50(%edx),%edi 112a16: 89 7e 04 mov %edi,0x4(%esi) the_message = _CORE_message_queue_Get_pending_message( the_message_queue ); if ( the_message != NULL ) { 112a19: 85 db test %ebx,%ebx 112a1b: 74 7b je 112a98 <_CORE_message_queue_Seize+0xd0><== NEVER TAKEN the_message_queue->number_of_pending_messages -= 1; 112a1d: ff 4a 48 decl 0x48(%edx) _ISR_Enable( level ); 112a20: ff 75 e4 pushl -0x1c(%ebp) 112a23: 9d popf *size_p = the_message->Contents.size; 112a24: 8b 43 0c mov 0xc(%ebx),%eax 112a27: 89 01 mov %eax,(%ecx) _Thread_Executing->Wait.count = 112a29: 8b 73 08 mov 0x8(%ebx),%esi 112a2c: a1 34 e4 12 00 mov 0x12e434,%eax 112a31: 89 70 24 mov %esi,0x24(%eax) _CORE_message_queue_Get_message_priority( the_message ); _CORE_message_queue_Copy_buffer( the_message->Contents.buffer, 112a34: 8d 73 10 lea 0x10(%ebx),%esi 112a37: 89 75 e4 mov %esi,-0x1c(%ebp) const void *source, void *destination, size_t size ) { memcpy(destination, source, size); 112a3a: 8b 09 mov (%ecx),%ecx 112a3c: 8b 7d e0 mov -0x20(%ebp),%edi 112a3f: f3 a4 rep movsb %ds:(%esi),%es:(%edi) * 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 ); 112a41: 83 ec 0c sub $0xc,%esp 112a44: 52 push %edx 112a45: 89 55 d0 mov %edx,-0x30(%ebp) 112a48: e8 73 19 00 00 call 1143c0 <_Thread_queue_Dequeue> if ( !the_thread ) { 112a4d: 83 c4 10 add $0x10,%esp 112a50: 85 c0 test %eax,%eax 112a52: 8b 55 d0 mov -0x30(%ebp),%edx 112a55: 75 15 jne 112a6c <_CORE_message_queue_Seize+0xa4> 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 ); 112a57: 89 5d 0c mov %ebx,0xc(%ebp) 112a5a: 83 c2 68 add $0x68,%edx 112a5d: 89 55 08 mov %edx,0x8(%ebp) 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 ); } 112a60: 8d 65 f4 lea -0xc(%ebp),%esp 112a63: 5b pop %ebx 112a64: 5e pop %esi 112a65: 5f pop %edi 112a66: c9 leave 112a67: e9 34 fe ff ff jmp 1128a0 <_Chain_Append> CORE_message_queue_Buffer_control *the_message, int priority ) { #if defined(RTEMS_SCORE_COREMSG_ENABLE_MESSAGE_PRIORITY) the_message->priority = priority; 112a6c: 8b 48 24 mov 0x24(%eax),%ecx 112a6f: 89 4b 08 mov %ecx,0x8(%ebx) */ _CORE_message_queue_Set_message_priority( the_message, the_thread->Wait.count ); the_message->Contents.size = (size_t) the_thread->Wait.option; 112a72: 8b 48 30 mov 0x30(%eax),%ecx 112a75: 89 4b 0c mov %ecx,0xc(%ebx) const void *source, void *destination, size_t size ) { memcpy(destination, source, size); 112a78: 8b 70 2c mov 0x2c(%eax),%esi 112a7b: 8b 7d e4 mov -0x1c(%ebp),%edi 112a7e: f3 a4 rep movsb %ds:(%esi),%es:(%edi) the_thread->Wait.return_argument_second.immutable_object, the_message->Contents.buffer, the_message->Contents.size ); _CORE_message_queue_Insert_message( 112a80: 8b 43 08 mov 0x8(%ebx),%eax 112a83: 89 45 10 mov %eax,0x10(%ebp) 112a86: 89 5d 0c mov %ebx,0xc(%ebp) 112a89: 89 55 08 mov %edx,0x8(%ebp) 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 ); } 112a8c: 8d 65 f4 lea -0xc(%ebp),%esp 112a8f: 5b pop %ebx 112a90: 5e pop %esi 112a91: 5f pop %edi 112a92: c9 leave the_thread->Wait.return_argument_second.immutable_object, the_message->Contents.buffer, the_message->Contents.size ); _CORE_message_queue_Insert_message( 112a93: e9 fc 52 00 00 jmp 117d94 <_CORE_message_queue_Insert_message> return; } #endif } if ( !wait ) { 112a98: 80 7d db 00 cmpb $0x0,-0x25(%ebp) 112a9c: 75 13 jne 112ab1 <_CORE_message_queue_Seize+0xe9> _ISR_Enable( level ); 112a9e: ff 75 e4 pushl -0x1c(%ebp) 112aa1: 9d popf executing->Wait.return_code = CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED_NOWAIT; 112aa2: c7 40 34 04 00 00 00 movl $0x4,0x34(%eax) 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 ); } 112aa9: 8d 65 f4 lea -0xc(%ebp),%esp 112aac: 5b pop %ebx 112aad: 5e pop %esi 112aae: 5f pop %edi 112aaf: c9 leave 112ab0: c3 ret 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; 112ab1: c7 42 30 01 00 00 00 movl $0x1,0x30(%edx) executing->Wait.return_code = CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED_NOWAIT; return; } _Thread_queue_Enter_critical_section( &the_message_queue->Wait_queue ); executing->Wait.queue = &the_message_queue->Wait_queue; 112ab8: 89 50 44 mov %edx,0x44(%eax) executing->Wait.id = id; 112abb: 8b 5d dc mov -0x24(%ebp),%ebx 112abe: 89 58 20 mov %ebx,0x20(%eax) executing->Wait.return_argument_second.mutable_object = buffer; 112ac1: 8b 75 e0 mov -0x20(%ebp),%esi 112ac4: 89 70 2c mov %esi,0x2c(%eax) executing->Wait.return_argument = size_p; 112ac7: 89 48 28 mov %ecx,0x28(%eax) /* Wait.count will be filled in with the message priority */ _ISR_Enable( level ); 112aca: ff 75 e4 pushl -0x1c(%ebp) 112acd: 9d popf _Thread_queue_Enqueue( &the_message_queue->Wait_queue, timeout ); 112ace: c7 45 10 80 47 11 00 movl $0x114780,0x10(%ebp) 112ad5: 8b 45 d4 mov -0x2c(%ebp),%eax 112ad8: 89 45 0c mov %eax,0xc(%ebp) 112adb: 89 55 08 mov %edx,0x8(%ebp) } 112ade: 8d 65 f4 lea -0xc(%ebp),%esp 112ae1: 5b pop %ebx 112ae2: 5e pop %esi 112ae3: 5f pop %edi 112ae4: c9 leave executing->Wait.return_argument_second.mutable_object = buffer; executing->Wait.return_argument = size_p; /* Wait.count will be filled in with the message priority */ _ISR_Enable( level ); _Thread_queue_Enqueue( &the_message_queue->Wait_queue, timeout ); 112ae5: e9 da 19 00 00 jmp 1144c4 <_Thread_queue_Enqueue_with_handler> =============================================================================== 0010b095 <_CORE_mutex_Seize>: Objects_Id _id, bool _wait, Watchdog_Interval _timeout, ISR_Level _level ) { 10b095: 55 push %ebp 10b096: 89 e5 mov %esp,%ebp 10b098: 53 push %ebx 10b099: 83 ec 14 sub $0x14,%esp 10b09c: 8b 5d 08 mov 0x8(%ebp),%ebx 10b09f: 8a 55 10 mov 0x10(%ebp),%dl _CORE_mutex_Seize_body( _the_mutex, _id, _wait, _timeout, _level ); 10b0a2: a1 08 62 12 00 mov 0x126208,%eax 10b0a7: 85 c0 test %eax,%eax 10b0a9: 74 19 je 10b0c4 <_CORE_mutex_Seize+0x2f> 10b0ab: 84 d2 test %dl,%dl 10b0ad: 74 15 je 10b0c4 <_CORE_mutex_Seize+0x2f><== NEVER TAKEN 10b0af: 83 3d a0 63 12 00 01 cmpl $0x1,0x1263a0 10b0b6: 76 0c jbe 10b0c4 <_CORE_mutex_Seize+0x2f> 10b0b8: 53 push %ebx 10b0b9: 6a 13 push $0x13 10b0bb: 6a 00 push $0x0 10b0bd: 6a 00 push $0x0 10b0bf: e8 bc 05 00 00 call 10b680 <_Internal_error_Occurred> 10b0c4: 51 push %ecx 10b0c5: 51 push %ecx 10b0c6: 8d 45 18 lea 0x18(%ebp),%eax 10b0c9: 50 push %eax 10b0ca: 53 push %ebx 10b0cb: 88 55 f4 mov %dl,-0xc(%ebp) 10b0ce: e8 55 50 00 00 call 110128 <_CORE_mutex_Seize_interrupt_trylock> 10b0d3: 83 c4 10 add $0x10,%esp 10b0d6: 85 c0 test %eax,%eax 10b0d8: 8a 55 f4 mov -0xc(%ebp),%dl 10b0db: 74 48 je 10b125 <_CORE_mutex_Seize+0x90> 10b0dd: 84 d2 test %dl,%dl 10b0df: 75 12 jne 10b0f3 <_CORE_mutex_Seize+0x5e> 10b0e1: ff 75 18 pushl 0x18(%ebp) 10b0e4: 9d popf 10b0e5: a1 c4 62 12 00 mov 0x1262c4,%eax 10b0ea: c7 40 34 01 00 00 00 movl $0x1,0x34(%eax) 10b0f1: eb 32 jmp 10b125 <_CORE_mutex_Seize+0x90> 10b0f3: c7 43 30 01 00 00 00 movl $0x1,0x30(%ebx) 10b0fa: a1 c4 62 12 00 mov 0x1262c4,%eax 10b0ff: 89 58 44 mov %ebx,0x44(%eax) 10b102: 8b 55 0c mov 0xc(%ebp),%edx 10b105: 89 50 20 mov %edx,0x20(%eax) 10b108: a1 08 62 12 00 mov 0x126208,%eax 10b10d: 40 inc %eax 10b10e: a3 08 62 12 00 mov %eax,0x126208 10b113: ff 75 18 pushl 0x18(%ebp) 10b116: 9d popf 10b117: 50 push %eax 10b118: 50 push %eax 10b119: ff 75 14 pushl 0x14(%ebp) 10b11c: 53 push %ebx 10b11d: e8 26 ff ff ff call 10b048 <_CORE_mutex_Seize_interrupt_blocking> 10b122: 83 c4 10 add $0x10,%esp } 10b125: 8b 5d fc mov -0x4(%ebp),%ebx 10b128: c9 leave 10b129: c3 ret =============================================================================== 0010b258 <_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 ) { 10b258: 55 push %ebp 10b259: 89 e5 mov %esp,%ebp 10b25b: 53 push %ebx 10b25c: 83 ec 10 sub $0x10,%esp 10b25f: 8b 5d 08 mov 0x8(%ebp),%ebx ISR_Level level; CORE_semaphore_Status status; status = CORE_SEMAPHORE_STATUS_SUCCESSFUL; if ( (the_thread = _Thread_queue_Dequeue(&the_semaphore->Wait_queue)) ) { 10b262: 53 push %ebx 10b263: e8 68 14 00 00 call 10c6d0 <_Thread_queue_Dequeue> 10b268: 89 c2 mov %eax,%edx 10b26a: 83 c4 10 add $0x10,%esp 10b26d: 31 c0 xor %eax,%eax 10b26f: 85 d2 test %edx,%edx 10b271: 75 15 jne 10b288 <_CORE_semaphore_Surrender+0x30> if ( !_Objects_Is_local_id( the_thread->Object.id ) ) (*api_semaphore_mp_support) ( the_thread, id ); #endif } else { _ISR_Disable( level ); 10b273: 9c pushf 10b274: fa cli 10b275: 59 pop %ecx if ( the_semaphore->count < the_semaphore->Attributes.maximum_count ) 10b276: 8b 53 48 mov 0x48(%ebx),%edx 10b279: b0 04 mov $0x4,%al 10b27b: 3b 53 40 cmp 0x40(%ebx),%edx 10b27e: 73 06 jae 10b286 <_CORE_semaphore_Surrender+0x2e><== NEVER TAKEN the_semaphore->count += 1; 10b280: 42 inc %edx 10b281: 89 53 48 mov %edx,0x48(%ebx) 10b284: 30 c0 xor %al,%al else status = CORE_SEMAPHORE_MAXIMUM_COUNT_EXCEEDED; _ISR_Enable( level ); 10b286: 51 push %ecx 10b287: 9d popf } return status; } 10b288: 8b 5d fc mov -0x4(%ebp),%ebx 10b28b: c9 leave 10b28c: c3 ret =============================================================================== 0010a070 <_Event_Seize>: rtems_event_set event_in, rtems_option option_set, rtems_interval ticks, rtems_event_set *event_out ) { 10a070: 55 push %ebp 10a071: 89 e5 mov %esp,%ebp 10a073: 57 push %edi 10a074: 56 push %esi 10a075: 53 push %ebx 10a076: 83 ec 1c sub $0x1c,%esp 10a079: 8b 45 08 mov 0x8(%ebp),%eax 10a07c: 8b 75 0c mov 0xc(%ebp),%esi 10a07f: 8b 55 10 mov 0x10(%ebp),%edx 10a082: 89 55 dc mov %edx,-0x24(%ebp) 10a085: 8b 4d 14 mov 0x14(%ebp),%ecx rtems_event_set pending_events; ISR_Level level; RTEMS_API_Control *api; Thread_blocking_operation_States sync_state; executing = _Thread_Executing; 10a088: 8b 1d c4 62 12 00 mov 0x1262c4,%ebx executing->Wait.return_code = RTEMS_SUCCESSFUL; 10a08e: c7 43 34 00 00 00 00 movl $0x0,0x34(%ebx) api = executing->API_Extensions[ THREAD_API_RTEMS ]; 10a095: 8b bb f4 00 00 00 mov 0xf4(%ebx),%edi _ISR_Disable( level ); 10a09b: 9c pushf 10a09c: fa cli 10a09d: 8f 45 e4 popl -0x1c(%ebp) pending_events = api->pending_events; 10a0a0: 8b 17 mov (%edi),%edx 10a0a2: 89 55 e0 mov %edx,-0x20(%ebp) seized_events = _Event_sets_Get( pending_events, event_in ); if ( !_Event_sets_Is_empty( seized_events ) && 10a0a5: 21 c2 and %eax,%edx 10a0a7: 74 1b je 10a0c4 <_Event_Seize+0x54> 10a0a9: 39 c2 cmp %eax,%edx 10a0ab: 74 08 je 10a0b5 <_Event_Seize+0x45> 10a0ad: f7 c6 02 00 00 00 test $0x2,%esi 10a0b3: 74 0f je 10a0c4 <_Event_Seize+0x54> <== NEVER TAKEN (seized_events == event_in || _Options_Is_any( option_set )) ) { api->pending_events = 10a0b5: 89 d0 mov %edx,%eax 10a0b7: f7 d0 not %eax 10a0b9: 23 45 e0 and -0x20(%ebp),%eax 10a0bc: 89 07 mov %eax,(%edi) _Event_sets_Clear( pending_events, seized_events ); _ISR_Enable( level ); 10a0be: ff 75 e4 pushl -0x1c(%ebp) 10a0c1: 9d popf 10a0c2: eb 13 jmp 10a0d7 <_Event_Seize+0x67> *event_out = seized_events; return; } if ( _Options_Is_no_wait( option_set ) ) { 10a0c4: f7 c6 01 00 00 00 test $0x1,%esi 10a0ca: 74 12 je 10a0de <_Event_Seize+0x6e> _ISR_Enable( level ); 10a0cc: ff 75 e4 pushl -0x1c(%ebp) 10a0cf: 9d popf executing->Wait.return_code = RTEMS_UNSATISFIED; 10a0d0: c7 43 34 0d 00 00 00 movl $0xd,0x34(%ebx) *event_out = seized_events; 10a0d7: 89 11 mov %edx,(%ecx) return; 10a0d9: e9 91 00 00 00 jmp 10a16f <_Event_Seize+0xff> * set properly when we are marked as in the event critical section. * * NOTE: Since interrupts are disabled, this isn't that much of an * issue but better safe than sorry. */ executing->Wait.option = (uint32_t) option_set; 10a0de: 89 73 30 mov %esi,0x30(%ebx) executing->Wait.count = (uint32_t) event_in; 10a0e1: 89 43 24 mov %eax,0x24(%ebx) executing->Wait.return_argument = event_out; 10a0e4: 89 4b 28 mov %ecx,0x28(%ebx) _Event_Sync_state = THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; 10a0e7: c7 05 48 6b 12 00 01 movl $0x1,0x126b48 10a0ee: 00 00 00 _ISR_Enable( level ); 10a0f1: ff 75 e4 pushl -0x1c(%ebp) 10a0f4: 9d popf if ( ticks ) { 10a0f5: 83 7d dc 00 cmpl $0x0,-0x24(%ebp) 10a0f9: 74 34 je 10a12f <_Event_Seize+0xbf> _Watchdog_Initialize( 10a0fb: 8b 43 08 mov 0x8(%ebx),%eax Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 10a0fe: c7 43 50 00 00 00 00 movl $0x0,0x50(%ebx) the_watchdog->routine = routine; 10a105: c7 43 64 ac a2 10 00 movl $0x10a2ac,0x64(%ebx) the_watchdog->id = id; 10a10c: 89 43 68 mov %eax,0x68(%ebx) the_watchdog->user_data = user_data; 10a10f: c7 43 6c 00 00 00 00 movl $0x0,0x6c(%ebx) Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 10a116: 8b 45 dc mov -0x24(%ebp),%eax 10a119: 89 43 54 mov %eax,0x54(%ebx) _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 10a11c: 52 push %edx 10a11d: 52 push %edx 10a11e: 8d 43 48 lea 0x48(%ebx),%eax 10a121: 50 push %eax 10a122: 68 e4 62 12 00 push $0x1262e4 10a127: e8 d4 2f 00 00 call 10d100 <_Watchdog_Insert> 10a12c: 83 c4 10 add $0x10,%esp NULL ); _Watchdog_Insert_ticks( &executing->Timer, ticks ); } _Thread_Set_state( executing, STATES_WAITING_FOR_EVENT ); 10a12f: 50 push %eax 10a130: 50 push %eax 10a131: 68 00 01 00 00 push $0x100 10a136: 53 push %ebx 10a137: e8 f0 29 00 00 call 10cb2c <_Thread_Set_state> _ISR_Disable( level ); 10a13c: 9c pushf 10a13d: fa cli 10a13e: 5a pop %edx sync_state = _Event_Sync_state; 10a13f: a1 48 6b 12 00 mov 0x126b48,%eax _Event_Sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; 10a144: c7 05 48 6b 12 00 00 movl $0x0,0x126b48 10a14b: 00 00 00 if ( sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) { 10a14e: 83 c4 10 add $0x10,%esp 10a151: 83 f8 01 cmp $0x1,%eax 10a154: 75 04 jne 10a15a <_Event_Seize+0xea> _ISR_Enable( level ); 10a156: 52 push %edx 10a157: 9d popf 10a158: eb 15 jmp 10a16f <_Event_Seize+0xff> * An interrupt completed the thread's blocking request. * The blocking thread was satisfied by an ISR or timed out. * * WARNING! Returning with interrupts disabled! */ _Thread_blocking_operation_Cancel( sync_state, executing, level ); 10a15a: 89 55 10 mov %edx,0x10(%ebp) 10a15d: 89 5d 0c mov %ebx,0xc(%ebp) 10a160: 89 45 08 mov %eax,0x8(%ebp) } 10a163: 8d 65 f4 lea -0xc(%ebp),%esp 10a166: 5b pop %ebx 10a167: 5e pop %esi 10a168: 5f pop %edi 10a169: c9 leave * An interrupt completed the thread's blocking request. * The blocking thread was satisfied by an ISR or timed out. * * WARNING! Returning with interrupts disabled! */ _Thread_blocking_operation_Cancel( sync_state, executing, level ); 10a16a: e9 c5 1c 00 00 jmp 10be34 <_Thread_blocking_operation_Cancel> } 10a16f: 8d 65 f4 lea -0xc(%ebp),%esp 10a172: 5b pop %ebx 10a173: 5e pop %esi 10a174: 5f pop %edi 10a175: c9 leave 10a176: c3 ret =============================================================================== 0010a1c4 <_Event_Surrender>: */ void _Event_Surrender( Thread_Control *the_thread ) { 10a1c4: 55 push %ebp 10a1c5: 89 e5 mov %esp,%ebp 10a1c7: 57 push %edi 10a1c8: 56 push %esi 10a1c9: 53 push %ebx 10a1ca: 83 ec 2c sub $0x2c,%esp 10a1cd: 8b 5d 08 mov 0x8(%ebp),%ebx 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 ]; 10a1d0: 8b bb f4 00 00 00 mov 0xf4(%ebx),%edi option_set = (rtems_option) the_thread->Wait.option; 10a1d6: 8b 43 30 mov 0x30(%ebx),%eax 10a1d9: 89 45 e0 mov %eax,-0x20(%ebp) _ISR_Disable( level ); 10a1dc: 9c pushf 10a1dd: fa cli 10a1de: 58 pop %eax pending_events = api->pending_events; 10a1df: 8b 17 mov (%edi),%edx 10a1e1: 89 55 d4 mov %edx,-0x2c(%ebp) event_condition = (rtems_event_set) the_thread->Wait.count; 10a1e4: 8b 73 24 mov 0x24(%ebx),%esi seized_events = _Event_sets_Get( pending_events, event_condition ); /* * No events were seized in this operation */ if ( _Event_sets_Is_empty( seized_events ) ) { 10a1e7: 21 f2 and %esi,%edx 10a1e9: 75 07 jne 10a1f2 <_Event_Surrender+0x2e> _ISR_Enable( level ); 10a1eb: 50 push %eax 10a1ec: 9d popf return; 10a1ed: e9 b0 00 00 00 jmp 10a2a2 <_Event_Surrender+0xde> /* * 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() && 10a1f2: 8b 0d a0 62 12 00 mov 0x1262a0,%ecx 10a1f8: 85 c9 test %ecx,%ecx 10a1fa: 74 49 je 10a245 <_Event_Surrender+0x81> 10a1fc: 3b 1d c4 62 12 00 cmp 0x1262c4,%ebx 10a202: 75 41 jne 10a245 <_Event_Surrender+0x81> _Thread_Is_executing( the_thread ) && ((_Event_Sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || 10a204: 8b 0d 48 6b 12 00 mov 0x126b48,%ecx /* * 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() && 10a20a: 83 f9 02 cmp $0x2,%ecx 10a20d: 74 09 je 10a218 <_Event_Surrender+0x54> <== NEVER TAKEN _Thread_Is_executing( the_thread ) && ((_Event_Sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || (_Event_Sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED)) ) { 10a20f: 8b 0d 48 6b 12 00 mov 0x126b48,%ecx /* * 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() && 10a215: 49 dec %ecx 10a216: 75 2d jne 10a245 <_Event_Surrender+0x81> _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) ) { 10a218: 39 f2 cmp %esi,%edx 10a21a: 74 06 je 10a222 <_Event_Surrender+0x5e> 10a21c: f6 45 e0 02 testb $0x2,-0x20(%ebp) 10a220: 74 1f je 10a241 <_Event_Surrender+0x7d> <== NEVER TAKEN api->pending_events = _Event_sets_Clear( pending_events,seized_events ); 10a222: 89 d6 mov %edx,%esi 10a224: f7 d6 not %esi 10a226: 23 75 d4 and -0x2c(%ebp),%esi 10a229: 89 37 mov %esi,(%edi) the_thread->Wait.count = 0; 10a22b: c7 43 24 00 00 00 00 movl $0x0,0x24(%ebx) *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 10a232: 8b 4b 28 mov 0x28(%ebx),%ecx 10a235: 89 11 mov %edx,(%ecx) _Event_Sync_state = THREAD_BLOCKING_OPERATION_SATISFIED; 10a237: c7 05 48 6b 12 00 03 movl $0x3,0x126b48 10a23e: 00 00 00 } _ISR_Enable( level ); 10a241: 50 push %eax 10a242: 9d popf return; 10a243: eb 5d jmp 10a2a2 <_Event_Surrender+0xde> } /* * Otherwise, this is a normal send to another thread */ if ( _States_Is_waiting_for_event( the_thread->current_state ) ) { 10a245: f6 43 11 01 testb $0x1,0x11(%ebx) 10a249: 74 55 je 10a2a0 <_Event_Surrender+0xdc> if ( seized_events == event_condition || _Options_Is_any( option_set ) ) { 10a24b: 39 f2 cmp %esi,%edx 10a24d: 74 06 je 10a255 <_Event_Surrender+0x91> 10a24f: f6 45 e0 02 testb $0x2,-0x20(%ebp) 10a253: 74 4b je 10a2a0 <_Event_Surrender+0xdc> <== NEVER TAKEN api->pending_events = _Event_sets_Clear( pending_events, seized_events ); 10a255: 89 d6 mov %edx,%esi 10a257: f7 d6 not %esi 10a259: 23 75 d4 and -0x2c(%ebp),%esi 10a25c: 89 37 mov %esi,(%edi) the_thread->Wait.count = 0; 10a25e: c7 43 24 00 00 00 00 movl $0x0,0x24(%ebx) *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 10a265: 8b 4b 28 mov 0x28(%ebx),%ecx 10a268: 89 11 mov %edx,(%ecx) _ISR_Flash( level ); 10a26a: 50 push %eax 10a26b: 9d popf 10a26c: fa cli if ( !_Watchdog_Is_active( &the_thread->Timer ) ) { 10a26d: 83 7b 50 02 cmpl $0x2,0x50(%ebx) 10a271: 74 06 je 10a279 <_Event_Surrender+0xb5> _ISR_Enable( level ); 10a273: 50 push %eax 10a274: 9d popf RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 10a275: 51 push %ecx 10a276: 51 push %ecx 10a277: eb 17 jmp 10a290 <_Event_Surrender+0xcc> RTEMS_INLINE_ROUTINE void _Watchdog_Deactivate( Watchdog_Control *the_watchdog ) { the_watchdog->state = WATCHDOG_REMOVE_IT; 10a279: c7 43 50 03 00 00 00 movl $0x3,0x50(%ebx) _Thread_Unblock( the_thread ); } else { _Watchdog_Deactivate( &the_thread->Timer ); _ISR_Enable( level ); 10a280: 50 push %eax 10a281: 9d popf (void) _Watchdog_Remove( &the_thread->Timer ); 10a282: 83 ec 0c sub $0xc,%esp 10a285: 8d 43 48 lea 0x48(%ebx),%eax 10a288: 50 push %eax 10a289: e8 8a 2f 00 00 call 10d218 <_Watchdog_Remove> 10a28e: 58 pop %eax 10a28f: 5a pop %edx 10a290: 68 f8 ff 03 10 push $0x1003fff8 10a295: 53 push %ebx 10a296: e8 05 1d 00 00 call 10bfa0 <_Thread_Clear_state> 10a29b: 83 c4 10 add $0x10,%esp 10a29e: eb 02 jmp 10a2a2 <_Event_Surrender+0xde> _Thread_Unblock( the_thread ); } return; } } _ISR_Enable( level ); 10a2a0: 50 push %eax 10a2a1: 9d popf } 10a2a2: 8d 65 f4 lea -0xc(%ebp),%esp 10a2a5: 5b pop %ebx 10a2a6: 5e pop %esi 10a2a7: 5f pop %edi 10a2a8: c9 leave 10a2a9: c3 ret =============================================================================== 0010a2ac <_Event_Timeout>: void _Event_Timeout( Objects_Id id, void *ignored ) { 10a2ac: 55 push %ebp 10a2ad: 89 e5 mov %esp,%ebp 10a2af: 83 ec 20 sub $0x20,%esp Thread_Control *the_thread; Objects_Locations location; ISR_Level level; the_thread = _Thread_Get( id, &location ); 10a2b2: 8d 45 f4 lea -0xc(%ebp),%eax 10a2b5: 50 push %eax 10a2b6: ff 75 08 pushl 0x8(%ebp) 10a2b9: e8 82 20 00 00 call 10c340 <_Thread_Get> switch ( location ) { 10a2be: 83 c4 10 add $0x10,%esp 10a2c1: 83 7d f4 00 cmpl $0x0,-0xc(%ebp) 10a2c5: 75 49 jne 10a310 <_Event_Timeout+0x64> <== 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 ); 10a2c7: 9c pushf 10a2c8: fa cli 10a2c9: 5a pop %edx _ISR_Enable( level ); return; } #endif the_thread->Wait.count = 0; 10a2ca: c7 40 24 00 00 00 00 movl $0x0,0x24(%eax) if ( _Thread_Is_executing( the_thread ) ) { 10a2d1: 3b 05 c4 62 12 00 cmp 0x1262c4,%eax 10a2d7: 75 13 jne 10a2ec <_Event_Timeout+0x40> if ( _Event_Sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) 10a2d9: 8b 0d 48 6b 12 00 mov 0x126b48,%ecx 10a2df: 49 dec %ecx 10a2e0: 75 0a jne 10a2ec <_Event_Timeout+0x40> _Event_Sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT; 10a2e2: c7 05 48 6b 12 00 02 movl $0x2,0x126b48 10a2e9: 00 00 00 } the_thread->Wait.return_code = RTEMS_TIMEOUT; 10a2ec: c7 40 34 06 00 00 00 movl $0x6,0x34(%eax) _ISR_Enable( level ); 10a2f3: 52 push %edx 10a2f4: 9d popf 10a2f5: 52 push %edx 10a2f6: 52 push %edx 10a2f7: 68 f8 ff 03 10 push $0x1003fff8 10a2fc: 50 push %eax 10a2fd: e8 9e 1c 00 00 call 10bfa0 <_Thread_Clear_state> */ RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void ) { RTEMS_COMPILER_MEMORY_BARRIER(); _Thread_Dispatch_disable_level -= 1; 10a302: a1 08 62 12 00 mov 0x126208,%eax 10a307: 48 dec %eax 10a308: a3 08 62 12 00 mov %eax,0x126208 10a30d: 83 c4 10 add $0x10,%esp case OBJECTS_REMOTE: /* impossible */ #endif case OBJECTS_ERROR: break; } } 10a310: c9 leave 10a311: c3 ret =============================================================================== 00110264 <_Heap_Allocate_aligned_with_boundary>: Heap_Control *heap, uintptr_t alloc_size, uintptr_t alignment, uintptr_t boundary ) { 110264: 55 push %ebp 110265: 89 e5 mov %esp,%ebp 110267: 57 push %edi 110268: 56 push %esi 110269: 53 push %ebx 11026a: 83 ec 2c sub $0x2c,%esp 11026d: 8b 75 08 mov 0x8(%ebp),%esi return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next; 110270: 8b 4e 08 mov 0x8(%esi),%ecx Heap_Statistics *const stats = &heap->stats; Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); Heap_Block *block = _Heap_Free_list_first( heap ); uintptr_t const block_size_floor = alloc_size + HEAP_BLOCK_HEADER_SIZE - HEAP_BLOCK_SIZE_OFFSET; uintptr_t const page_size = heap->page_size; 110273: 8b 46 10 mov 0x10(%esi),%eax 110276: 89 45 e0 mov %eax,-0x20(%ebp) uintptr_t alloc_begin = 0; uint32_t search_count = 0; if ( block_size_floor < alloc_size ) { 110279: 8b 45 0c mov 0xc(%ebp),%eax 11027c: 83 c0 04 add $0x4,%eax 11027f: 89 45 cc mov %eax,-0x34(%ebp) 110282: 0f 82 2f 01 00 00 jb 1103b7 <_Heap_Allocate_aligned_with_boundary+0x153> /* Integer overflow occured */ return NULL; } if ( boundary != 0 ) { 110288: 83 7d 14 00 cmpl $0x0,0x14(%ebp) 11028c: 74 18 je 1102a6 <_Heap_Allocate_aligned_with_boundary+0x42> if ( boundary < alloc_size ) { 11028e: 8b 45 0c mov 0xc(%ebp),%eax 110291: 39 45 14 cmp %eax,0x14(%ebp) 110294: 0f 82 1d 01 00 00 jb 1103b7 <_Heap_Allocate_aligned_with_boundary+0x153> return NULL; } if ( alignment == 0 ) { 11029a: 83 7d 10 00 cmpl $0x0,0x10(%ebp) 11029e: 75 06 jne 1102a6 <_Heap_Allocate_aligned_with_boundary+0x42> 1102a0: 8b 45 e0 mov -0x20(%ebp),%eax 1102a3: 89 45 10 mov %eax,0x10(%ebp) 1102a6: c7 45 e4 00 00 00 00 movl $0x0,-0x1c(%ebp) uintptr_t const block_size = _Heap_Block_size( block ); uintptr_t const block_end = block_begin + block_size; uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block ); uintptr_t const alloc_begin_ceiling = block_end - min_block_size + HEAP_BLOCK_HEADER_SIZE + page_size - 1; 1102ad: 8b 45 e0 mov -0x20(%ebp),%eax 1102b0: 83 c0 07 add $0x7,%eax 1102b3: 89 45 c8 mov %eax,-0x38(%ebp) uintptr_t alloc_end = block_end + HEAP_BLOCK_SIZE_OFFSET; uintptr_t alloc_begin = alloc_end - alloc_size; 1102b6: c7 45 d8 04 00 00 00 movl $0x4,-0x28(%ebp) 1102bd: 8b 45 0c mov 0xc(%ebp),%eax 1102c0: 29 45 d8 sub %eax,-0x28(%ebp) 1102c3: 89 f7 mov %esi,%edi 1102c5: e9 ba 00 00 00 jmp 110384 <_Heap_Allocate_aligned_with_boundary+0x120> while ( block != free_list_tail ) { _HAssert( _Heap_Is_prev_used( block ) ); /* Statistics */ ++search_count; 1102ca: ff 45 e4 incl -0x1c(%ebp) /* * The HEAP_PREV_BLOCK_USED flag is always set in the block size_and_flag * field. Thus the value is about one unit larger than the real block * size. The greater than operator takes this into account. */ if ( block->size_and_flag > block_size_floor ) { 1102cd: 8b 59 04 mov 0x4(%ecx),%ebx 1102d0: 3b 5d cc cmp -0x34(%ebp),%ebx 1102d3: 0f 86 a8 00 00 00 jbe 110381 <_Heap_Allocate_aligned_with_boundary+0x11d> if ( alignment == 0 ) { 1102d9: 83 7d 10 00 cmpl $0x0,0x10(%ebp) 1102dd: 8d 41 08 lea 0x8(%ecx),%eax 1102e0: 89 45 dc mov %eax,-0x24(%ebp) 1102e3: 75 07 jne 1102ec <_Heap_Allocate_aligned_with_boundary+0x88> RTEMS_INLINE_ROUTINE uintptr_t _Heap_Alloc_area_of_block( const Heap_Block *block ) { return (uintptr_t) block + HEAP_BLOCK_HEADER_SIZE; 1102e5: 89 c3 mov %eax,%ebx 1102e7: e9 91 00 00 00 jmp 11037d <_Heap_Allocate_aligned_with_boundary+0x119> uintptr_t alignment, uintptr_t boundary ) { uintptr_t const page_size = heap->page_size; uintptr_t const min_block_size = heap->min_block_size; 1102ec: 8b 47 14 mov 0x14(%edi),%eax 1102ef: 89 45 d4 mov %eax,-0x2c(%ebp) uintptr_t const block_begin = (uintptr_t) block; uintptr_t const block_size = _Heap_Block_size( block ); uintptr_t const block_end = block_begin + block_size; 1102f2: 83 e3 fe and $0xfffffffe,%ebx 1102f5: 8d 1c 19 lea (%ecx,%ebx,1),%ebx uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block ); uintptr_t const alloc_begin_ceiling = block_end - min_block_size + HEAP_BLOCK_HEADER_SIZE + page_size - 1; 1102f8: 8b 75 c8 mov -0x38(%ebp),%esi 1102fb: 29 c6 sub %eax,%esi 1102fd: 01 de add %ebx,%esi uintptr_t alloc_end = block_end + HEAP_BLOCK_SIZE_OFFSET; uintptr_t alloc_begin = alloc_end - alloc_size; 1102ff: 03 5d d8 add -0x28(%ebp),%ebx RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 110302: 89 d8 mov %ebx,%eax 110304: 31 d2 xor %edx,%edx 110306: f7 75 10 divl 0x10(%ebp) 110309: 29 d3 sub %edx,%ebx alloc_begin = _Heap_Align_down( alloc_begin, alignment ); /* Ensure that the we have a valid new block at the end */ if ( alloc_begin > alloc_begin_ceiling ) { 11030b: 39 f3 cmp %esi,%ebx 11030d: 76 0b jbe 11031a <_Heap_Allocate_aligned_with_boundary+0xb6> 11030f: 89 f0 mov %esi,%eax 110311: 31 d2 xor %edx,%edx 110313: f7 75 10 divl 0x10(%ebp) 110316: 89 f3 mov %esi,%ebx 110318: 29 d3 sub %edx,%ebx } alloc_end = alloc_begin + alloc_size; /* Ensure boundary constaint */ if ( boundary != 0 ) { 11031a: 83 7d 14 00 cmpl $0x0,0x14(%ebp) 11031e: 74 3f je 11035f <_Heap_Allocate_aligned_with_boundary+0xfb> /* Ensure that the we have a valid new block at the end */ if ( alloc_begin > alloc_begin_ceiling ) { alloc_begin = _Heap_Align_down( alloc_begin_ceiling, alignment ); } alloc_end = alloc_begin + alloc_size; 110320: 8b 45 0c mov 0xc(%ebp),%eax 110323: 8d 34 03 lea (%ebx,%eax,1),%esi /* Ensure boundary constaint */ if ( boundary != 0 ) { uintptr_t const boundary_floor = alloc_begin_floor + alloc_size; 110326: 8b 45 dc mov -0x24(%ebp),%eax 110329: 03 45 0c add 0xc(%ebp),%eax 11032c: 89 45 d0 mov %eax,-0x30(%ebp) 11032f: eb 19 jmp 11034a <_Heap_Allocate_aligned_with_boundary+0xe6> uintptr_t boundary_line = _Heap_Align_down( alloc_end, boundary ); while ( alloc_begin < boundary_line && boundary_line < alloc_end ) { if ( boundary_line < boundary_floor ) { 110331: 3b 55 d0 cmp -0x30(%ebp),%edx 110334: 72 4b jb 110381 <_Heap_Allocate_aligned_with_boundary+0x11d> return 0; } alloc_begin = boundary_line - alloc_size; 110336: 89 d3 mov %edx,%ebx 110338: 2b 5d 0c sub 0xc(%ebp),%ebx 11033b: 89 d8 mov %ebx,%eax 11033d: 31 d2 xor %edx,%edx 11033f: f7 75 10 divl 0x10(%ebp) 110342: 29 d3 sub %edx,%ebx alloc_begin = _Heap_Align_down( alloc_begin, alignment ); alloc_end = alloc_begin + alloc_size; 110344: 8b 45 0c mov 0xc(%ebp),%eax 110347: 8d 34 03 lea (%ebx,%eax,1),%esi 11034a: 89 f0 mov %esi,%eax 11034c: 31 d2 xor %edx,%edx 11034e: f7 75 14 divl 0x14(%ebp) 110351: 89 f0 mov %esi,%eax 110353: 29 d0 sub %edx,%eax 110355: 89 c2 mov %eax,%edx /* Ensure boundary constaint */ if ( boundary != 0 ) { uintptr_t const boundary_floor = alloc_begin_floor + alloc_size; uintptr_t boundary_line = _Heap_Align_down( alloc_end, boundary ); while ( alloc_begin < boundary_line && boundary_line < alloc_end ) { 110357: 39 f0 cmp %esi,%eax 110359: 73 04 jae 11035f <_Heap_Allocate_aligned_with_boundary+0xfb> 11035b: 39 c3 cmp %eax,%ebx 11035d: 72 d2 jb 110331 <_Heap_Allocate_aligned_with_boundary+0xcd> boundary_line = _Heap_Align_down( alloc_end, boundary ); } } /* Ensure that the we have a valid new block at the beginning */ if ( alloc_begin >= alloc_begin_floor ) { 11035f: 3b 5d dc cmp -0x24(%ebp),%ebx 110362: 72 1d jb 110381 <_Heap_Allocate_aligned_with_boundary+0x11d> uintptr_t const alloc_block_begin = (uintptr_t) _Heap_Block_of_alloc_area( alloc_begin, page_size ); uintptr_t const free_size = alloc_block_begin - block_begin; 110364: be f8 ff ff ff mov $0xfffffff8,%esi 110369: 29 ce sub %ecx,%esi 11036b: 01 de add %ebx,%esi 11036d: 89 d8 mov %ebx,%eax 11036f: 31 d2 xor %edx,%edx 110371: f7 75 e0 divl -0x20(%ebp) if ( free_size >= min_block_size || free_size == 0 ) { 110374: 29 d6 sub %edx,%esi 110376: 74 05 je 11037d <_Heap_Allocate_aligned_with_boundary+0x119> 110378: 3b 75 d4 cmp -0x2c(%ebp),%esi 11037b: 72 04 jb 110381 <_Heap_Allocate_aligned_with_boundary+0x11d> boundary ); } } if ( alloc_begin != 0 ) { 11037d: 85 db test %ebx,%ebx 11037f: 75 11 jne 110392 <_Heap_Allocate_aligned_with_boundary+0x12e><== ALWAYS TAKEN break; } block = block->next; 110381: 8b 49 08 mov 0x8(%ecx),%ecx if ( alignment == 0 ) { alignment = page_size; } } while ( block != free_list_tail ) { 110384: 39 f9 cmp %edi,%ecx 110386: 0f 85 3e ff ff ff jne 1102ca <_Heap_Allocate_aligned_with_boundary+0x66> 11038c: 89 fe mov %edi,%esi 11038e: 31 db xor %ebx,%ebx 110390: eb 16 jmp 1103a8 <_Heap_Allocate_aligned_with_boundary+0x144> 110392: 89 fe mov %edi,%esi block = block->next; } if ( alloc_begin != 0 ) { /* Statistics */ stats->searches += search_count; 110394: 8b 45 e4 mov -0x1c(%ebp),%eax 110397: 01 47 4c add %eax,0x4c(%edi) block = _Heap_Block_allocate( heap, block, alloc_begin, alloc_size ); 11039a: ff 75 0c pushl 0xc(%ebp) 11039d: 53 push %ebx 11039e: 51 push %ecx 11039f: 57 push %edi 1103a0: e8 ff b1 ff ff call 10b5a4 <_Heap_Block_allocate> 1103a5: 83 c4 10 add $0x10,%esp uintptr_t alloc_size, uintptr_t alignment, uintptr_t boundary ) { Heap_Statistics *const stats = &heap->stats; 1103a8: 8b 45 e4 mov -0x1c(%ebp),%eax 1103ab: 39 46 44 cmp %eax,0x44(%esi) 1103ae: 73 03 jae 1103b3 <_Heap_Allocate_aligned_with_boundary+0x14f> ); } /* Statistics */ if ( stats->max_search < search_count ) { stats->max_search = search_count; 1103b0: 89 46 44 mov %eax,0x44(%esi) } return (void *) alloc_begin; 1103b3: 89 d8 mov %ebx,%eax 1103b5: eb 02 jmp 1103b9 <_Heap_Allocate_aligned_with_boundary+0x155> 1103b7: 31 c0 xor %eax,%eax } 1103b9: 8d 65 f4 lea -0xc(%ebp),%esp 1103bc: 5b pop %ebx 1103bd: 5e pop %esi 1103be: 5f pop %edi 1103bf: c9 leave 1103c0: c3 ret =============================================================================== 001136ac <_Heap_Extend>: Heap_Control *heap, void *area_begin_ptr, uintptr_t area_size, uintptr_t *amount_extended ) { 1136ac: 55 push %ebp 1136ad: 89 e5 mov %esp,%ebp 1136af: 56 push %esi 1136b0: 53 push %ebx 1136b1: 8b 4d 08 mov 0x8(%ebp),%ecx 1136b4: 8b 55 0c mov 0xc(%ebp),%edx Heap_Statistics *const stats = &heap->stats; uintptr_t const area_begin = (uintptr_t) area_begin_ptr; uintptr_t const heap_area_begin = heap->area_begin; uintptr_t const heap_area_end = heap->area_end; 1136b7: 8b 71 1c mov 0x1c(%ecx),%esi uintptr_t const new_heap_area_end = heap_area_end + area_size; uintptr_t extend_size = 0; Heap_Block *const last_block = heap->last_block; 1136ba: 8b 59 24 mov 0x24(%ecx),%ebx * 5. non-contiguous higher address (NOT SUPPORTED) * * As noted, this code only supports (4). */ if ( area_begin >= heap_area_begin && area_begin < heap_area_end ) { 1136bd: 39 f2 cmp %esi,%edx 1136bf: 73 0a jae 1136cb <_Heap_Extend+0x1f> uintptr_t *amount_extended ) { Heap_Statistics *const stats = &heap->stats; uintptr_t const area_begin = (uintptr_t) area_begin_ptr; uintptr_t const heap_area_begin = heap->area_begin; 1136c1: b8 01 00 00 00 mov $0x1,%eax 1136c6: 3b 51 18 cmp 0x18(%ecx),%edx 1136c9: 73 5f jae 11372a <_Heap_Extend+0x7e> * As noted, this code only supports (4). */ if ( area_begin >= heap_area_begin && area_begin < heap_area_end ) { return HEAP_EXTEND_ERROR; /* case 3 */ } else if ( area_begin != heap_area_end ) { 1136cb: b8 02 00 00 00 mov $0x2,%eax 1136d0: 39 f2 cmp %esi,%edx 1136d2: 75 56 jne 11372a <_Heap_Extend+0x7e> { Heap_Statistics *const stats = &heap->stats; uintptr_t const area_begin = (uintptr_t) area_begin_ptr; uintptr_t const heap_area_begin = heap->area_begin; uintptr_t const heap_area_end = heap->area_end; uintptr_t const new_heap_area_end = heap_area_end + area_size; 1136d4: 03 55 10 add 0x10(%ebp),%edx * Currently only case 4 should make it to this point. * The basic trick is to make the extend area look like a used * block and free it. */ heap->area_end = new_heap_area_end; 1136d7: 89 51 1c mov %edx,0x1c(%ecx) extend_size = new_heap_area_end 1136da: 29 da sub %ebx,%edx 1136dc: 8d 72 f8 lea -0x8(%edx),%esi RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 1136df: 89 f0 mov %esi,%eax 1136e1: 31 d2 xor %edx,%edx 1136e3: f7 71 10 divl 0x10(%ecx) 1136e6: 29 d6 sub %edx,%esi - (uintptr_t) last_block - HEAP_BLOCK_HEADER_SIZE; extend_size = _Heap_Align_down( extend_size, heap->page_size ); *amount_extended = extend_size; 1136e8: 8b 45 14 mov 0x14(%ebp),%eax 1136eb: 89 30 mov %esi,(%eax) if( extend_size >= heap->min_block_size ) { 1136ed: 31 c0 xor %eax,%eax 1136ef: 3b 71 14 cmp 0x14(%ecx),%esi 1136f2: 72 36 jb 11372a <_Heap_Extend+0x7e> <== NEVER TAKEN RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 1136f4: 8d 14 1e lea (%esi,%ebx,1),%edx uintptr_t size ) { uintptr_t flag = block->size_and_flag & HEAP_PREV_BLOCK_USED; block->size_and_flag = size | flag; 1136f7: 8b 43 04 mov 0x4(%ebx),%eax 1136fa: 83 e0 01 and $0x1,%eax 1136fd: 09 f0 or %esi,%eax 1136ff: 89 43 04 mov %eax,0x4(%ebx) Heap_Block *const new_last_block = _Heap_Block_at( last_block, extend_size ); _Heap_Block_set_size( last_block, extend_size ); new_last_block->size_and_flag = 113702: 8b 41 20 mov 0x20(%ecx),%eax 113705: 29 d0 sub %edx,%eax 113707: 83 c8 01 or $0x1,%eax 11370a: 89 42 04 mov %eax,0x4(%edx) ((uintptr_t) heap->first_block - (uintptr_t) new_last_block) | HEAP_PREV_BLOCK_USED; heap->last_block = new_last_block; 11370d: 89 51 24 mov %edx,0x24(%ecx) /* Statistics */ stats->size += extend_size; 113710: 01 71 2c add %esi,0x2c(%ecx) ++stats->used_blocks; 113713: ff 41 40 incl 0x40(%ecx) --stats->frees; /* Do not count subsequent call as actual free() */ 113716: ff 49 50 decl 0x50(%ecx) _Heap_Free( heap, (void *) _Heap_Alloc_area_of_block( last_block )); 113719: 50 push %eax 11371a: 50 push %eax 11371b: 83 c3 08 add $0x8,%ebx 11371e: 53 push %ebx 11371f: 51 push %ecx 113720: e8 6f a8 ff ff call 10df94 <_Heap_Free> 113725: 31 c0 xor %eax,%eax 113727: 83 c4 10 add $0x10,%esp } return HEAP_EXTEND_SUCCESSFUL; } 11372a: 8d 65 f8 lea -0x8(%ebp),%esp 11372d: 5b pop %ebx 11372e: 5e pop %esi 11372f: c9 leave 113730: c3 ret =============================================================================== 001103c4 <_Heap_Free>: #include #include #include bool _Heap_Free( Heap_Control *heap, void *alloc_begin_ptr ) { 1103c4: 55 push %ebp 1103c5: 89 e5 mov %esp,%ebp 1103c7: 57 push %edi 1103c8: 56 push %esi 1103c9: 53 push %ebx 1103ca: 83 ec 14 sub $0x14,%esp 1103cd: 8b 4d 08 mov 0x8(%ebp),%ecx 1103d0: 8b 45 0c mov 0xc(%ebp),%eax 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 ) 1103d3: 8d 58 f8 lea -0x8(%eax),%ebx 1103d6: 31 d2 xor %edx,%edx 1103d8: f7 71 10 divl 0x10(%ecx) 1103db: 29 d3 sub %edx,%ebx 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; 1103dd: 8b 41 20 mov 0x20(%ecx),%eax 1103e0: 89 45 f0 mov %eax,-0x10(%ebp) 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 1103e3: 31 c0 xor %eax,%eax 1103e5: 3b 5d f0 cmp -0x10(%ebp),%ebx 1103e8: 72 08 jb 1103f2 <_Heap_Free+0x2e> 1103ea: 31 c0 xor %eax,%eax 1103ec: 39 59 24 cmp %ebx,0x24(%ecx) 1103ef: 0f 93 c0 setae %al Heap_Block *next_block = NULL; uintptr_t block_size = 0; uintptr_t next_block_size = 0; bool next_is_free = false; if ( !_Heap_Is_block_in_heap( heap, block ) ) { 1103f2: 85 c0 test %eax,%eax 1103f4: 0f 84 2d 01 00 00 je 110527 <_Heap_Free+0x163> - 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; 1103fa: 8b 7b 04 mov 0x4(%ebx),%edi 1103fd: 89 fa mov %edi,%edx 1103ff: 83 e2 fe and $0xfffffffe,%edx 110402: 89 55 e0 mov %edx,-0x20(%ebp) RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 110405: 8d 04 13 lea (%ebx,%edx,1),%eax 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 110408: 31 f6 xor %esi,%esi 11040a: 3b 45 f0 cmp -0x10(%ebp),%eax 11040d: 72 0e jb 11041d <_Heap_Free+0x59> <== NEVER TAKEN 11040f: 39 41 24 cmp %eax,0x24(%ecx) 110412: 0f 93 c2 setae %dl 110415: 89 d6 mov %edx,%esi 110417: 81 e6 ff 00 00 00 and $0xff,%esi } block_size = _Heap_Block_size( block ); next_block = _Heap_Block_at( block, block_size ); if ( !_Heap_Is_block_in_heap( heap, next_block ) ) { 11041d: 85 f6 test %esi,%esi 11041f: 0f 84 02 01 00 00 je 110527 <_Heap_Free+0x163> <== 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; 110425: 8b 70 04 mov 0x4(%eax),%esi _HAssert( false ); return false; } if ( !_Heap_Is_prev_used( next_block ) ) { 110428: f7 c6 01 00 00 00 test $0x1,%esi 11042e: 0f 84 f3 00 00 00 je 110527 <_Heap_Free+0x163> <== 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; 110434: 83 e6 fe and $0xfffffffe,%esi 110437: 89 75 e8 mov %esi,-0x18(%ebp) return false; } next_block_size = _Heap_Block_size( next_block ); next_is_free = next_block != heap->last_block && !_Heap_Is_prev_used( _Heap_Block_at( next_block, next_block_size )); 11043a: 8b 51 24 mov 0x24(%ecx),%edx 11043d: 89 55 e4 mov %edx,-0x1c(%ebp) _HAssert( false ); return false; } next_block_size = _Heap_Block_size( next_block ); next_is_free = next_block != heap->last_block 110440: 31 f6 xor %esi,%esi 110442: 39 d0 cmp %edx,%eax 110444: 74 0d je 110453 <_Heap_Free+0x8f> 110446: 8b 55 e8 mov -0x18(%ebp),%edx 110449: 8b 74 10 04 mov 0x4(%eax,%edx,1),%esi 11044d: 83 e6 01 and $0x1,%esi 110450: 83 f6 01 xor $0x1,%esi && !_Heap_Is_prev_used( _Heap_Block_at( next_block, next_block_size )); if ( !_Heap_Is_prev_used( block ) ) { 110453: 83 e7 01 and $0x1,%edi 110456: 75 64 jne 1104bc <_Heap_Free+0xf8> uintptr_t const prev_size = block->prev_size; 110458: 8b 13 mov (%ebx),%edx 11045a: 89 55 ec mov %edx,-0x14(%ebp) RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 11045d: 29 d3 sub %edx,%ebx 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 11045f: 31 ff xor %edi,%edi 110461: 3b 5d f0 cmp -0x10(%ebp),%ebx 110464: 72 0e jb 110474 <_Heap_Free+0xb0> <== NEVER TAKEN 110466: 39 5d e4 cmp %ebx,-0x1c(%ebp) 110469: 0f 93 c2 setae %dl 11046c: 89 d7 mov %edx,%edi 11046e: 81 e7 ff 00 00 00 and $0xff,%edi Heap_Block * const prev_block = _Heap_Block_at( block, -prev_size ); if ( !_Heap_Is_block_in_heap( heap, prev_block ) ) { 110474: 85 ff test %edi,%edi 110476: 0f 84 ab 00 00 00 je 110527 <_Heap_Free+0x163> <== NEVER TAKEN return( false ); } /* As we always coalesce free blocks, the block that preceedes prev_block must have been used. */ if ( !_Heap_Is_prev_used ( prev_block) ) { 11047c: f6 43 04 01 testb $0x1,0x4(%ebx) 110480: 0f 84 a1 00 00 00 je 110527 <_Heap_Free+0x163> <== NEVER TAKEN _HAssert( false ); return( false ); } if ( next_is_free ) { /* coalesce both */ 110486: 89 f2 mov %esi,%edx 110488: 84 d2 test %dl,%dl 11048a: 74 1a je 1104a6 <_Heap_Free+0xe2> uintptr_t const size = block_size + prev_size + next_block_size; 11048c: 8b 75 e0 mov -0x20(%ebp),%esi 11048f: 03 75 e8 add -0x18(%ebp),%esi 110492: 03 75 ec add -0x14(%ebp),%esi return _Heap_Free_list_tail(heap)->prev; } RTEMS_INLINE_ROUTINE void _Heap_Free_list_remove( Heap_Block *block ) { Heap_Block *next = block->next; 110495: 8b 78 08 mov 0x8(%eax),%edi Heap_Block *prev = block->prev; 110498: 8b 40 0c mov 0xc(%eax),%eax prev->next = next; 11049b: 89 78 08 mov %edi,0x8(%eax) next->prev = prev; 11049e: 89 47 0c mov %eax,0xc(%edi) _Heap_Free_list_remove( next_block ); stats->free_blocks -= 1; 1104a1: ff 49 38 decl 0x38(%ecx) 1104a4: eb 34 jmp 1104da <_Heap_Free+0x116> prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; next_block = _Heap_Block_at( prev_block, size ); _HAssert(!_Heap_Is_prev_used( next_block)); next_block->prev_size = size; } else { /* coalesce prev */ uintptr_t const size = block_size + prev_size; 1104a6: 8b 75 e0 mov -0x20(%ebp),%esi 1104a9: 03 75 ec add -0x14(%ebp),%esi prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 1104ac: 89 f7 mov %esi,%edi 1104ae: 83 cf 01 or $0x1,%edi 1104b1: 89 7b 04 mov %edi,0x4(%ebx) next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 1104b4: 83 60 04 fe andl $0xfffffffe,0x4(%eax) next_block->prev_size = size; 1104b8: 89 30 mov %esi,(%eax) 1104ba: eb 5b jmp 110517 <_Heap_Free+0x153> } } else if ( next_is_free ) { /* coalesce next */ 1104bc: 89 f2 mov %esi,%edx 1104be: 84 d2 test %dl,%dl 1104c0: 74 25 je 1104e7 <_Heap_Free+0x123> uintptr_t const size = block_size + next_block_size; 1104c2: 8b 75 e8 mov -0x18(%ebp),%esi 1104c5: 03 75 e0 add -0x20(%ebp),%esi RTEMS_INLINE_ROUTINE void _Heap_Free_list_replace( Heap_Block *old_block, Heap_Block *new_block ) { Heap_Block *next = old_block->next; 1104c8: 8b 78 08 mov 0x8(%eax),%edi Heap_Block *prev = old_block->prev; 1104cb: 8b 40 0c mov 0xc(%eax),%eax new_block->next = next; 1104ce: 89 7b 08 mov %edi,0x8(%ebx) new_block->prev = prev; 1104d1: 89 43 0c mov %eax,0xc(%ebx) next->prev = new_block; 1104d4: 89 5f 0c mov %ebx,0xc(%edi) prev->next = new_block; 1104d7: 89 58 08 mov %ebx,0x8(%eax) _Heap_Free_list_replace( next_block, block ); block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 1104da: 89 f0 mov %esi,%eax 1104dc: 83 c8 01 or $0x1,%eax 1104df: 89 43 04 mov %eax,0x4(%ebx) next_block = _Heap_Block_at( block, size ); next_block->prev_size = size; 1104e2: 89 34 33 mov %esi,(%ebx,%esi,1) 1104e5: eb 30 jmp 110517 <_Heap_Free+0x153> RTEMS_INLINE_ROUTINE void _Heap_Free_list_insert_after( Heap_Block *block_before, Heap_Block *new_block ) { Heap_Block *next = block_before->next; 1104e7: 8b 71 08 mov 0x8(%ecx),%esi new_block->next = next; 1104ea: 89 73 08 mov %esi,0x8(%ebx) new_block->prev = block_before; 1104ed: 89 4b 0c mov %ecx,0xc(%ebx) block_before->next = new_block; 1104f0: 89 59 08 mov %ebx,0x8(%ecx) next->prev = new_block; 1104f3: 89 5e 0c mov %ebx,0xc(%esi) } 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; 1104f6: 8b 75 e0 mov -0x20(%ebp),%esi 1104f9: 83 ce 01 or $0x1,%esi 1104fc: 89 73 04 mov %esi,0x4(%ebx) next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 1104ff: 83 60 04 fe andl $0xfffffffe,0x4(%eax) next_block->prev_size = block_size; 110503: 8b 55 e0 mov -0x20(%ebp),%edx 110506: 89 10 mov %edx,(%eax) /* Statistics */ ++stats->free_blocks; 110508: 8b 41 38 mov 0x38(%ecx),%eax 11050b: 40 inc %eax 11050c: 89 41 38 mov %eax,0x38(%ecx) #include #include bool _Heap_Free( Heap_Control *heap, void *alloc_begin_ptr ) { Heap_Statistics *const stats = &heap->stats; 11050f: 39 41 3c cmp %eax,0x3c(%ecx) 110512: 73 03 jae 110517 <_Heap_Free+0x153> next_block->prev_size = block_size; /* Statistics */ ++stats->free_blocks; if ( stats->max_free_blocks < stats->free_blocks ) { stats->max_free_blocks = stats->free_blocks; 110514: 89 41 3c mov %eax,0x3c(%ecx) } } /* Statistics */ --stats->used_blocks; 110517: ff 49 40 decl 0x40(%ecx) ++stats->frees; 11051a: ff 41 50 incl 0x50(%ecx) stats->free_size += block_size; 11051d: 8b 45 e0 mov -0x20(%ebp),%eax 110520: 01 41 30 add %eax,0x30(%ecx) 110523: b0 01 mov $0x1,%al return( true ); 110525: eb 02 jmp 110529 <_Heap_Free+0x165> 110527: 31 c0 xor %eax,%eax } 110529: 83 c4 14 add $0x14,%esp 11052c: 5b pop %ebx 11052d: 5e pop %esi 11052e: 5f pop %edi 11052f: c9 leave 110530: c3 ret =============================================================================== 0011e5f4 <_Heap_Size_of_alloc_area>: bool _Heap_Size_of_alloc_area( Heap_Control *heap, void *alloc_begin_ptr, uintptr_t *alloc_size ) { 11e5f4: 55 push %ebp 11e5f5: 89 e5 mov %esp,%ebp 11e5f7: 56 push %esi 11e5f8: 53 push %ebx 11e5f9: 8b 5d 08 mov 0x8(%ebp),%ebx 11e5fc: 8b 75 0c mov 0xc(%ebp),%esi 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 ) 11e5ff: 8d 4e f8 lea -0x8(%esi),%ecx 11e602: 89 f0 mov %esi,%eax 11e604: 31 d2 xor %edx,%edx 11e606: f7 73 10 divl 0x10(%ebx) 11e609: 29 d1 sub %edx,%ecx 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; 11e60b: 8b 53 20 mov 0x20(%ebx),%edx 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 11e60e: 31 c0 xor %eax,%eax 11e610: 39 d1 cmp %edx,%ecx 11e612: 72 08 jb 11e61c <_Heap_Size_of_alloc_area+0x28> 11e614: 31 c0 xor %eax,%eax 11e616: 39 4b 24 cmp %ecx,0x24(%ebx) 11e619: 0f 93 c0 setae %al 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 ) ) { 11e61c: 85 c0 test %eax,%eax 11e61e: 74 2e je 11e64e <_Heap_Size_of_alloc_area+0x5a> RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 11e620: 8b 41 04 mov 0x4(%ecx),%eax 11e623: 83 e0 fe and $0xfffffffe,%eax 11e626: 01 c1 add %eax,%ecx 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 11e628: 31 c0 xor %eax,%eax 11e62a: 39 d1 cmp %edx,%ecx 11e62c: 72 08 jb 11e636 <_Heap_Size_of_alloc_area+0x42><== NEVER TAKEN 11e62e: 31 c0 xor %eax,%eax 11e630: 39 4b 24 cmp %ecx,0x24(%ebx) 11e633: 0f 93 c0 setae %al } block_size = _Heap_Block_size( block ); next_block = _Heap_Block_at( block, block_size ); if ( 11e636: 85 c0 test %eax,%eax 11e638: 74 14 je 11e64e <_Heap_Size_of_alloc_area+0x5a><== NEVER TAKEN 11e63a: f6 41 04 01 testb $0x1,0x4(%ecx) 11e63e: 74 0e je 11e64e <_Heap_Size_of_alloc_area+0x5a><== NEVER TAKEN || !_Heap_Is_prev_used( next_block ) ) { return false; } *alloc_size = (uintptr_t) next_block + HEAP_BLOCK_SIZE_OFFSET - alloc_begin; 11e640: 29 f1 sub %esi,%ecx 11e642: 8d 51 04 lea 0x4(%ecx),%edx 11e645: 8b 45 10 mov 0x10(%ebp),%eax 11e648: 89 10 mov %edx,(%eax) 11e64a: b0 01 mov $0x1,%al return true; 11e64c: eb 02 jmp 11e650 <_Heap_Size_of_alloc_area+0x5c> 11e64e: 31 c0 xor %eax,%eax } 11e650: 5b pop %ebx 11e651: 5e pop %esi 11e652: c9 leave 11e653: c3 ret =============================================================================== 0010c091 <_Heap_Walk>: bool _Heap_Walk( Heap_Control *heap, int source, bool dump ) { 10c091: 55 push %ebp 10c092: 89 e5 mov %esp,%ebp 10c094: 57 push %edi 10c095: 56 push %esi 10c096: 53 push %ebx 10c097: 83 ec 4c sub $0x4c,%esp 10c09a: 8b 7d 08 mov 0x8(%ebp),%edi 10c09d: 8b 75 0c mov 0xc(%ebp),%esi uintptr_t const page_size = heap->page_size; 10c0a0: 8b 4f 10 mov 0x10(%edi),%ecx uintptr_t const min_block_size = heap->min_block_size; 10c0a3: 8b 47 14 mov 0x14(%edi),%eax 10c0a6: 89 45 dc mov %eax,-0x24(%ebp) Heap_Block *const last_block = heap->last_block; 10c0a9: 8b 57 24 mov 0x24(%edi),%edx 10c0ac: 89 55 d0 mov %edx,-0x30(%ebp) Heap_Block *block = heap->first_block; 10c0af: 8b 5f 20 mov 0x20(%edi),%ebx Heap_Walk_printer printer = dump ? _Heap_Walk_print : _Heap_Walk_print_nothing; 10c0b2: c7 45 e4 a3 c3 10 00 movl $0x10c3a3,-0x1c(%ebp) 10c0b9: 80 7d 10 00 cmpb $0x0,0x10(%ebp) 10c0bd: 75 07 jne 10c0c6 <_Heap_Walk+0x35> 10c0bf: c7 45 e4 8c c0 10 00 movl $0x10c08c,-0x1c(%ebp) if ( !_System_state_Is_up( _System_state_Get() ) ) { 10c0c6: 83 3d 28 84 12 00 03 cmpl $0x3,0x128428 10c0cd: 0f 85 c6 02 00 00 jne 10c399 <_Heap_Walk+0x308> 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)( 10c0d3: 50 push %eax 10c0d4: ff 77 0c pushl 0xc(%edi) 10c0d7: ff 77 08 pushl 0x8(%edi) 10c0da: ff 75 d0 pushl -0x30(%ebp) 10c0dd: 53 push %ebx 10c0de: ff 77 1c pushl 0x1c(%edi) 10c0e1: ff 77 18 pushl 0x18(%edi) 10c0e4: ff 75 dc pushl -0x24(%ebp) 10c0e7: 51 push %ecx 10c0e8: 68 20 11 12 00 push $0x121120 10c0ed: 6a 00 push $0x0 10c0ef: 56 push %esi 10c0f0: 89 4d bc mov %ecx,-0x44(%ebp) 10c0f3: ff 55 e4 call *-0x1c(%ebp) heap->area_begin, heap->area_end, first_block, last_block, first_free_block, last_free_block ); if ( page_size == 0 ) { 10c0f6: 83 c4 30 add $0x30,%esp 10c0f9: 8b 4d bc mov -0x44(%ebp),%ecx 10c0fc: 85 c9 test %ecx,%ecx 10c0fe: 75 0b jne 10c10b <_Heap_Walk+0x7a> (*printer)( source, true, "page size is zero\n" ); 10c100: 53 push %ebx 10c101: 68 b1 11 12 00 push $0x1211b1 10c106: e9 5b 02 00 00 jmp 10c366 <_Heap_Walk+0x2d5> return false; } if ( !_Addresses_Is_aligned( (void *) page_size ) ) { 10c10b: f6 c1 03 test $0x3,%cl 10c10e: 74 0b je 10c11b <_Heap_Walk+0x8a> (*printer)( 10c110: 51 push %ecx 10c111: 68 c4 11 12 00 push $0x1211c4 10c116: e9 4b 02 00 00 jmp 10c366 <_Heap_Walk+0x2d5> ); return false; } if ( !_Heap_Is_aligned( min_block_size, page_size ) ) { 10c11b: 8b 45 dc mov -0x24(%ebp),%eax 10c11e: 31 d2 xor %edx,%edx 10c120: f7 f1 div %ecx 10c122: 85 d2 test %edx,%edx 10c124: 74 0d je 10c133 <_Heap_Walk+0xa2> (*printer)( 10c126: ff 75 dc pushl -0x24(%ebp) 10c129: 68 e2 11 12 00 push $0x1211e2 10c12e: e9 33 02 00 00 jmp 10c366 <_Heap_Walk+0x2d5> ); return false; } if ( 10c133: 8d 43 08 lea 0x8(%ebx),%eax 10c136: 31 d2 xor %edx,%edx 10c138: f7 f1 div %ecx 10c13a: 85 d2 test %edx,%edx 10c13c: 74 0b je 10c149 <_Heap_Walk+0xb8> !_Heap_Is_aligned( _Heap_Alloc_area_of_block( first_block ), page_size ) ) { (*printer)( 10c13e: 53 push %ebx 10c13f: 68 06 12 12 00 push $0x121206 10c144: e9 1d 02 00 00 jmp 10c366 <_Heap_Walk+0x2d5> ); return false; } if ( !_Heap_Is_prev_used( first_block ) ) { 10c149: f6 43 04 01 testb $0x1,0x4(%ebx) 10c14d: 75 0b jne 10c15a <_Heap_Walk+0xc9> (*printer)( 10c14f: 51 push %ecx 10c150: 68 37 12 12 00 push $0x121237 10c155: e9 0c 02 00 00 jmp 10c366 <_Heap_Walk+0x2d5> ); return false; } if ( first_block->prev_size != page_size ) { 10c15a: 8b 03 mov (%ebx),%eax 10c15c: 89 45 d4 mov %eax,-0x2c(%ebp) 10c15f: 39 c8 cmp %ecx,%eax 10c161: 74 0f je 10c172 <_Heap_Walk+0xe1> (*printer)( 10c163: 83 ec 0c sub $0xc,%esp 10c166: 51 push %ecx 10c167: 50 push %eax 10c168: 68 65 12 12 00 push $0x121265 10c16d: e9 3d 01 00 00 jmp 10c2af <_Heap_Walk+0x21e> ); return false; } if ( _Heap_Is_free( last_block ) ) { 10c172: 8b 55 d0 mov -0x30(%ebp),%edx 10c175: 8b 42 04 mov 0x4(%edx),%eax 10c178: 83 e0 fe and $0xfffffffe,%eax 10c17b: f6 44 02 04 01 testb $0x1,0x4(%edx,%eax,1) 10c180: 75 0b jne 10c18d <_Heap_Walk+0xfc> (*printer)( 10c182: 52 push %edx 10c183: 68 90 12 12 00 push $0x121290 10c188: e9 d9 01 00 00 jmp 10c366 <_Heap_Walk+0x2d5> int source, Heap_Walk_printer printer, Heap_Control *heap ) { uintptr_t const page_size = heap->page_size; 10c18d: 8b 4f 10 mov 0x10(%edi),%ecx 10c190: 89 4d d8 mov %ecx,-0x28(%ebp) return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next; 10c193: 8b 4f 08 mov 0x8(%edi),%ecx 10c196: 89 7d e0 mov %edi,-0x20(%ebp) 10c199: eb 6a jmp 10c205 <_Heap_Walk+0x174> 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 10c19b: 31 c0 xor %eax,%eax 10c19d: 39 4f 20 cmp %ecx,0x20(%edi) 10c1a0: 77 08 ja 10c1aa <_Heap_Walk+0x119> 10c1a2: 31 c0 xor %eax,%eax 10c1a4: 39 4f 24 cmp %ecx,0x24(%edi) 10c1a7: 0f 93 c0 setae %al 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 ) ) { 10c1aa: 85 c0 test %eax,%eax 10c1ac: 75 0b jne 10c1b9 <_Heap_Walk+0x128> (*printer)( 10c1ae: 51 push %ecx 10c1af: 68 a5 12 12 00 push $0x1212a5 10c1b4: e9 ad 01 00 00 jmp 10c366 <_Heap_Walk+0x2d5> ); return false; } if ( 10c1b9: 8d 41 08 lea 0x8(%ecx),%eax 10c1bc: 31 d2 xor %edx,%edx 10c1be: f7 75 d8 divl -0x28(%ebp) 10c1c1: 85 d2 test %edx,%edx 10c1c3: 74 0b je 10c1d0 <_Heap_Walk+0x13f> !_Heap_Is_aligned( _Heap_Alloc_area_of_block( free_block ), page_size ) ) { (*printer)( 10c1c5: 51 push %ecx 10c1c6: 68 c5 12 12 00 push $0x1212c5 10c1cb: e9 96 01 00 00 jmp 10c366 <_Heap_Walk+0x2d5> ); return false; } if ( _Heap_Is_used( free_block ) ) { 10c1d0: 8b 41 04 mov 0x4(%ecx),%eax 10c1d3: 83 e0 fe and $0xfffffffe,%eax 10c1d6: f6 44 01 04 01 testb $0x1,0x4(%ecx,%eax,1) 10c1db: 74 0b je 10c1e8 <_Heap_Walk+0x157> (*printer)( 10c1dd: 51 push %ecx 10c1de: 68 f5 12 12 00 push $0x1212f5 10c1e3: e9 7e 01 00 00 jmp 10c366 <_Heap_Walk+0x2d5> ); return false; } if ( free_block->prev != prev_block ) { 10c1e8: 8b 41 0c mov 0xc(%ecx),%eax 10c1eb: 3b 45 e0 cmp -0x20(%ebp),%eax 10c1ee: 74 0f je 10c1ff <_Heap_Walk+0x16e> (*printer)( 10c1f0: 83 ec 0c sub $0xc,%esp 10c1f3: 50 push %eax 10c1f4: 51 push %ecx 10c1f5: 68 11 13 12 00 push $0x121311 10c1fa: e9 b0 00 00 00 jmp 10c2af <_Heap_Walk+0x21e> return false; } prev_block = free_block; free_block = free_block->next; 10c1ff: 89 4d e0 mov %ecx,-0x20(%ebp) 10c202: 8b 49 08 mov 0x8(%ecx),%ecx 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 ) { 10c205: 39 f9 cmp %edi,%ecx 10c207: 75 92 jne 10c19b <_Heap_Walk+0x10a> 10c209: 89 75 e0 mov %esi,-0x20(%ebp) 10c20c: e9 7f 01 00 00 jmp 10c390 <_Heap_Walk+0x2ff> - 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; 10c211: 8b 43 04 mov 0x4(%ebx),%eax 10c214: 89 c1 mov %eax,%ecx 10c216: 83 e1 fe and $0xfffffffe,%ecx RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 10c219: 8d 34 0b lea (%ebx,%ecx,1),%esi uintptr_t const block_size = _Heap_Block_size( block ); bool const prev_used = _Heap_Is_prev_used( block ); Heap_Block *const next_block = _Heap_Block_at( block, block_size ); uintptr_t const next_block_begin = (uintptr_t) next_block; if ( prev_used ) { 10c21c: a8 01 test $0x1,%al 10c21e: 74 0c je 10c22c <_Heap_Walk+0x19b> (*printer)( 10c220: 83 ec 0c sub $0xc,%esp 10c223: 51 push %ecx 10c224: 53 push %ebx 10c225: 68 43 13 12 00 push $0x121343 10c22a: eb 0b jmp 10c237 <_Heap_Walk+0x1a6> "block 0x%08x: size %u\n", block, block_size ); } else { (*printer)( 10c22c: 50 push %eax 10c22d: 50 push %eax 10c22e: ff 33 pushl (%ebx) 10c230: 51 push %ecx 10c231: 53 push %ebx 10c232: 68 5a 13 12 00 push $0x12135a 10c237: 6a 00 push $0x0 10c239: ff 75 e0 pushl -0x20(%ebp) 10c23c: 89 4d bc mov %ecx,-0x44(%ebp) 10c23f: ff 55 e4 call *-0x1c(%ebp) 10c242: 83 c4 20 add $0x20,%esp 10c245: 8b 4d bc mov -0x44(%ebp),%ecx 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 10c248: 31 c0 xor %eax,%eax 10c24a: 39 77 20 cmp %esi,0x20(%edi) 10c24d: 77 08 ja 10c257 <_Heap_Walk+0x1c6> <== NEVER TAKEN 10c24f: 31 c0 xor %eax,%eax 10c251: 39 77 24 cmp %esi,0x24(%edi) 10c254: 0f 93 c0 setae %al block_size, block->prev_size ); } if ( !_Heap_Is_block_in_heap( heap, next_block ) ) { 10c257: 85 c0 test %eax,%eax 10c259: 75 11 jne 10c26c <_Heap_Walk+0x1db> 10c25b: 89 f1 mov %esi,%ecx 10c25d: 8b 75 e0 mov -0x20(%ebp),%esi (*printer)( 10c260: 83 ec 0c sub $0xc,%esp 10c263: 51 push %ecx 10c264: 53 push %ebx 10c265: 68 7f 13 12 00 push $0x12137f 10c26a: eb 43 jmp 10c2af <_Heap_Walk+0x21e> ); return false; } if ( !_Heap_Is_aligned( block_size, page_size ) ) { 10c26c: 89 c8 mov %ecx,%eax 10c26e: 31 d2 xor %edx,%edx 10c270: f7 75 d4 divl -0x2c(%ebp) 10c273: 85 d2 test %edx,%edx 10c275: 74 0f je 10c286 <_Heap_Walk+0x1f5> 10c277: 8b 75 e0 mov -0x20(%ebp),%esi (*printer)( 10c27a: 83 ec 0c sub $0xc,%esp 10c27d: 51 push %ecx 10c27e: 53 push %ebx 10c27f: 68 ac 13 12 00 push $0x1213ac 10c284: eb 29 jmp 10c2af <_Heap_Walk+0x21e> ); return false; } if ( block_size < min_block_size ) { 10c286: 3b 4d dc cmp -0x24(%ebp),%ecx 10c289: 73 11 jae 10c29c <_Heap_Walk+0x20b> 10c28b: 8b 75 e0 mov -0x20(%ebp),%esi (*printer)( 10c28e: 57 push %edi 10c28f: 57 push %edi 10c290: ff 75 dc pushl -0x24(%ebp) 10c293: 51 push %ecx 10c294: 53 push %ebx 10c295: 68 da 13 12 00 push $0x1213da 10c29a: eb 13 jmp 10c2af <_Heap_Walk+0x21e> ); return false; } if ( next_block_begin <= block_begin ) { 10c29c: 39 de cmp %ebx,%esi 10c29e: 77 1f ja 10c2bf <_Heap_Walk+0x22e> 10c2a0: 89 f1 mov %esi,%ecx 10c2a2: 8b 75 e0 mov -0x20(%ebp),%esi (*printer)( 10c2a5: 83 ec 0c sub $0xc,%esp 10c2a8: 51 push %ecx 10c2a9: 53 push %ebx 10c2aa: 68 05 14 12 00 push $0x121405 10c2af: 6a 01 push $0x1 10c2b1: 56 push %esi 10c2b2: ff 55 e4 call *-0x1c(%ebp) 10c2b5: 31 c0 xor %eax,%eax "block 0x%08x: next block 0x%08x is not a successor\n", block, next_block ); return false; 10c2b7: 83 c4 20 add $0x20,%esp 10c2ba: e9 dc 00 00 00 jmp 10c39b <_Heap_Walk+0x30a> } if ( !_Heap_Is_prev_used( next_block ) ) { 10c2bf: f6 46 04 01 testb $0x1,0x4(%esi) 10c2c3: 0f 85 c5 00 00 00 jne 10c38e <_Heap_Walk+0x2fd> return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next; 10c2c9: 8b 47 08 mov 0x8(%edi),%eax 10c2cc: 89 45 c0 mov %eax,-0x40(%ebp) 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; 10c2cf: 8b 53 04 mov 0x4(%ebx),%edx 10c2d2: 89 55 c4 mov %edx,-0x3c(%ebp) - 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; 10c2d5: 83 e2 fe and $0xfffffffe,%edx 10c2d8: 89 55 cc mov %edx,-0x34(%ebp) RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 10c2db: 01 da add %ebx,%edx 10c2dd: 89 55 c8 mov %edx,-0x38(%ebp) 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)( 10c2e0: 8b 4b 08 mov 0x8(%ebx),%ecx 10c2e3: 89 4d b4 mov %ecx,-0x4c(%ebp) return _Heap_Free_list_head(heap)->next; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_last( Heap_Control *heap ) { return _Heap_Free_list_tail(heap)->prev; 10c2e6: ba 39 14 12 00 mov $0x121439,%edx 10c2eb: 3b 4f 0c cmp 0xc(%edi),%ecx 10c2ee: 74 0e je 10c2fe <_Heap_Walk+0x26d> " (= first)" : (block->prev == free_list_head ? " (= head)" : ""), block->next, block->next == last_free_block ? " (= last)" : (block->next == free_list_tail ? " (= tail)" : "") 10c2f0: ba 43 14 12 00 mov $0x121443,%edx 10c2f5: 39 f9 cmp %edi,%ecx 10c2f7: 74 05 je 10c2fe <_Heap_Walk+0x26d> 10c2f9: ba 6d 10 12 00 mov $0x12106d,%edx 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)( 10c2fe: 8b 43 0c mov 0xc(%ebx),%eax 10c301: 89 45 d8 mov %eax,-0x28(%ebp) 10c304: b8 4d 14 12 00 mov $0x12144d,%eax 10c309: 8b 4d c0 mov -0x40(%ebp),%ecx 10c30c: 39 4d d8 cmp %ecx,-0x28(%ebp) 10c30f: 74 0f je 10c320 <_Heap_Walk+0x28f> "block 0x%08x: prev 0x%08x%s, next 0x%08x%s\n", block, block->prev, block->prev == first_free_block ? " (= first)" : (block->prev == free_list_head ? " (= head)" : ""), 10c311: b8 58 14 12 00 mov $0x121458,%eax 10c316: 39 7d d8 cmp %edi,-0x28(%ebp) 10c319: 74 05 je 10c320 <_Heap_Walk+0x28f> 10c31b: b8 6d 10 12 00 mov $0x12106d,%eax 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)( 10c320: 52 push %edx 10c321: ff 75 b4 pushl -0x4c(%ebp) 10c324: 50 push %eax 10c325: ff 75 d8 pushl -0x28(%ebp) 10c328: 53 push %ebx 10c329: 68 62 14 12 00 push $0x121462 10c32e: 6a 00 push $0x0 10c330: ff 75 e0 pushl -0x20(%ebp) 10c333: ff 55 e4 call *-0x1c(%ebp) block->next == last_free_block ? " (= last)" : (block->next == free_list_tail ? " (= tail)" : "") ); if ( block_size != next_block->prev_size ) { 10c336: 8b 55 c8 mov -0x38(%ebp),%edx 10c339: 8b 02 mov (%edx),%eax 10c33b: 83 c4 20 add $0x20,%esp 10c33e: 39 45 cc cmp %eax,-0x34(%ebp) 10c341: 74 14 je 10c357 <_Heap_Walk+0x2c6> 10c343: 8b 75 e0 mov -0x20(%ebp),%esi (*printer)( 10c346: 51 push %ecx 10c347: 52 push %edx 10c348: 50 push %eax 10c349: ff 75 cc pushl -0x34(%ebp) 10c34c: 53 push %ebx 10c34d: 68 8e 14 12 00 push $0x12148e 10c352: e9 58 ff ff ff jmp 10c2af <_Heap_Walk+0x21e> ); return false; } if ( !prev_used ) { 10c357: f6 45 c4 01 testb $0x1,-0x3c(%ebp) 10c35b: 75 16 jne 10c373 <_Heap_Walk+0x2e2> 10c35d: 8b 75 e0 mov -0x20(%ebp),%esi (*printer)( 10c360: 53 push %ebx 10c361: 68 c7 14 12 00 push $0x1214c7 10c366: 6a 01 push $0x1 10c368: 56 push %esi 10c369: ff 55 e4 call *-0x1c(%ebp) 10c36c: 31 c0 xor %eax,%eax 10c36e: 83 c4 10 add $0x10,%esp 10c371: eb 28 jmp 10c39b <_Heap_Walk+0x30a> return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next; 10c373: 8b 47 08 mov 0x8(%edi),%eax 10c376: eb 07 jmp 10c37f <_Heap_Walk+0x2ee> { 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 ) { 10c378: 39 d8 cmp %ebx,%eax 10c37a: 74 12 je 10c38e <_Heap_Walk+0x2fd> return true; } free_block = free_block->next; 10c37c: 8b 40 08 mov 0x8(%eax),%eax ) { 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 ) { 10c37f: 39 f8 cmp %edi,%eax 10c381: 75 f5 jne 10c378 <_Heap_Walk+0x2e7> 10c383: 8b 75 e0 mov -0x20(%ebp),%esi return false; } if ( !_Heap_Walk_is_in_free_list( heap, block ) ) { (*printer)( 10c386: 53 push %ebx 10c387: 68 f6 14 12 00 push $0x1214f6 10c38c: eb d8 jmp 10c366 <_Heap_Walk+0x2d5> ) { 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 ) { 10c38e: 89 f3 mov %esi,%ebx if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; } while ( block != last_block ) { 10c390: 3b 5d d0 cmp -0x30(%ebp),%ebx 10c393: 0f 85 78 fe ff ff jne 10c211 <_Heap_Walk+0x180> 10c399: b0 01 mov $0x1,%al block = next_block; } return true; } 10c39b: 8d 65 f4 lea -0xc(%ebp),%esp 10c39e: 5b pop %ebx 10c39f: 5e pop %esi 10c3a0: 5f pop %edi 10c3a1: c9 leave 10c3a2: c3 ret =============================================================================== 0010b680 <_Internal_error_Occurred>: void _Internal_error_Occurred( Internal_errors_Source the_source, bool is_internal, Internal_errors_t the_error ) { 10b680: 55 push %ebp 10b681: 89 e5 mov %esp,%ebp 10b683: 53 push %ebx 10b684: 83 ec 08 sub $0x8,%esp 10b687: 8b 45 08 mov 0x8(%ebp),%eax 10b68a: 8b 55 0c mov 0xc(%ebp),%edx 10b68d: 8b 5d 10 mov 0x10(%ebp),%ebx _Internal_errors_What_happened.the_source = the_source; 10b690: a3 ac 62 12 00 mov %eax,0x1262ac _Internal_errors_What_happened.is_internal = is_internal; 10b695: 88 15 b0 62 12 00 mov %dl,0x1262b0 _Internal_errors_What_happened.the_error = the_error; 10b69b: 89 1d b4 62 12 00 mov %ebx,0x1262b4 _User_extensions_Fatal( the_source, is_internal, the_error ); 10b6a1: 53 push %ebx 10b6a2: 0f b6 d2 movzbl %dl,%edx 10b6a5: 52 push %edx 10b6a6: 50 push %eax 10b6a7: e8 37 19 00 00 call 10cfe3 <_User_extensions_Fatal> RTEMS_INLINE_ROUTINE void _System_state_Set ( System_state_Codes state ) { _System_state_Current = state; 10b6ac: c7 05 a0 63 12 00 05 movl $0x5,0x1263a0 <== NOT EXECUTED 10b6b3: 00 00 00 _System_state_Set( SYSTEM_STATE_FAILED ); _CPU_Fatal_halt( the_error ); 10b6b6: fa cli <== NOT EXECUTED 10b6b7: 89 d8 mov %ebx,%eax <== NOT EXECUTED 10b6b9: f4 hlt <== NOT EXECUTED 10b6ba: 83 c4 10 add $0x10,%esp <== NOT EXECUTED 10b6bd: eb fe jmp 10b6bd <_Internal_error_Occurred+0x3d><== NOT EXECUTED =============================================================================== 0010b718 <_Objects_Allocate>: */ Objects_Control *_Objects_Allocate( Objects_Information *information ) { 10b718: 55 push %ebp 10b719: 89 e5 mov %esp,%ebp 10b71b: 56 push %esi 10b71c: 53 push %ebx 10b71d: 8b 5d 08 mov 0x8(%ebp),%ebx * 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 ) 10b720: 31 c9 xor %ecx,%ecx 10b722: 83 7b 18 00 cmpl $0x0,0x18(%ebx) 10b726: 74 53 je 10b77b <_Objects_Allocate+0x63><== 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 ); 10b728: 8d 73 20 lea 0x20(%ebx),%esi 10b72b: 83 ec 0c sub $0xc,%esp 10b72e: 56 push %esi 10b72f: e8 50 f7 ff ff call 10ae84 <_Chain_Get> 10b734: 89 c1 mov %eax,%ecx if ( information->auto_extend ) { 10b736: 83 c4 10 add $0x10,%esp 10b739: 80 7b 12 00 cmpb $0x0,0x12(%ebx) 10b73d: 74 3c je 10b77b <_Objects_Allocate+0x63> /* * If the list is empty then we are out of objects and need to * extend information base. */ if ( !the_object ) { 10b73f: 85 c0 test %eax,%eax 10b741: 75 1a jne 10b75d <_Objects_Allocate+0x45> _Objects_Extend_information( information ); 10b743: 83 ec 0c sub $0xc,%esp 10b746: 53 push %ebx 10b747: e8 60 00 00 00 call 10b7ac <_Objects_Extend_information> the_object = (Objects_Control *) _Chain_Get( &information->Inactive ); 10b74c: 89 34 24 mov %esi,(%esp) 10b74f: e8 30 f7 ff ff call 10ae84 <_Chain_Get> 10b754: 89 c1 mov %eax,%ecx } if ( the_object ) { 10b756: 83 c4 10 add $0x10,%esp 10b759: 85 c0 test %eax,%eax 10b75b: 74 1e je 10b77b <_Objects_Allocate+0x63> uint32_t block; block = (uint32_t) _Objects_Get_index( the_object->id ) - 10b75d: 0f b7 41 08 movzwl 0x8(%ecx),%eax 10b761: 0f b7 53 08 movzwl 0x8(%ebx),%edx 10b765: 29 d0 sub %edx,%eax _Objects_Get_index( information->minimum_id ); block /= information->allocation_size; information->inactive_per_block[ block ]--; 10b767: 0f b7 73 14 movzwl 0x14(%ebx),%esi 10b76b: 31 d2 xor %edx,%edx 10b76d: f7 f6 div %esi 10b76f: c1 e0 02 shl $0x2,%eax 10b772: 03 43 30 add 0x30(%ebx),%eax 10b775: ff 08 decl (%eax) information->inactive--; 10b777: 66 ff 4b 2c decw 0x2c(%ebx) } } return the_object; } 10b77b: 89 c8 mov %ecx,%eax 10b77d: 8d 65 f8 lea -0x8(%ebp),%esp 10b780: 5b pop %ebx 10b781: 5e pop %esi 10b782: c9 leave 10b783: c3 ret =============================================================================== 0010b7ac <_Objects_Extend_information>: */ void _Objects_Extend_information( Objects_Information *information ) { 10b7ac: 55 push %ebp 10b7ad: 89 e5 mov %esp,%ebp 10b7af: 57 push %edi 10b7b0: 56 push %esi 10b7b1: 53 push %ebx 10b7b2: 83 ec 4c sub $0x4c,%esp 10b7b5: 8b 5d 08 mov 0x8(%ebp),%ebx /* * Search for a free block of indexes. The block variable ends up set * to block_count + 1 if the table needs to be extended. */ minimum_index = _Objects_Get_index( information->minimum_id ); 10b7b8: 0f b7 43 08 movzwl 0x8(%ebx),%eax 10b7bc: 89 45 c8 mov %eax,-0x38(%ebp) index_base = minimum_index; block = 0; /* if ( information->maximum < minimum_index ) */ if ( information->object_blocks == NULL ) 10b7bf: 8b 4b 34 mov 0x34(%ebx),%ecx 10b7c2: 85 c9 test %ecx,%ecx 10b7c4: 75 0e jne 10b7d4 <_Objects_Extend_information+0x28> 10b7c6: 89 45 d4 mov %eax,-0x2c(%ebp) 10b7c9: c7 45 cc 00 00 00 00 movl $0x0,-0x34(%ebp) 10b7d0: 31 d2 xor %edx,%edx 10b7d2: eb 31 jmp 10b805 <_Objects_Extend_information+0x59> block_count = 0; else { block_count = information->maximum / information->allocation_size; 10b7d4: 0f b7 73 14 movzwl 0x14(%ebx),%esi 10b7d8: 8b 43 10 mov 0x10(%ebx),%eax 10b7db: 31 d2 xor %edx,%edx 10b7dd: 66 f7 f6 div %si 10b7e0: 0f b7 d0 movzwl %ax,%edx 10b7e3: 8b 7d c8 mov -0x38(%ebp),%edi 10b7e6: 89 7d d4 mov %edi,-0x2c(%ebp) 10b7e9: c7 45 cc 00 00 00 00 movl $0x0,-0x34(%ebp) 10b7f0: 31 c0 xor %eax,%eax for ( ; block < block_count; block++ ) { 10b7f2: eb 0a jmp 10b7fe <_Objects_Extend_information+0x52> if ( information->object_blocks[ block ] == NULL ) 10b7f4: 83 3c 81 00 cmpl $0x0,(%ecx,%eax,4) 10b7f8: 74 08 je 10b802 <_Objects_Extend_information+0x56> 10b7fa: 01 75 d4 add %esi,-0x2c(%ebp) if ( information->object_blocks == NULL ) block_count = 0; else { block_count = information->maximum / information->allocation_size; for ( ; block < block_count; block++ ) { 10b7fd: 40 inc %eax 10b7fe: 39 d0 cmp %edx,%eax 10b800: 72 f2 jb 10b7f4 <_Objects_Extend_information+0x48> 10b802: 89 45 cc mov %eax,-0x34(%ebp) else index_base += information->allocation_size; } } maximum = (uint32_t) information->maximum + information->allocation_size; 10b805: 0f b7 43 14 movzwl 0x14(%ebx),%eax 10b809: 0f b7 4b 10 movzwl 0x10(%ebx),%ecx 10b80d: 8d 0c 08 lea (%eax,%ecx,1),%ecx 10b810: 89 4d b8 mov %ecx,-0x48(%ebp) /* * We need to limit the number of objects to the maximum number * representable in the index portion of the object Id. In the * case of 16-bit Ids, this is only 256 object instances. */ if ( maximum > OBJECTS_ID_FINAL_INDEX ) { 10b813: 81 f9 ff ff 00 00 cmp $0xffff,%ecx 10b819: 0f 87 db 01 00 00 ja 10b9fa <_Objects_Extend_information+0x24e><== NEVER TAKEN /* * Allocate the name table, and the objects and if it fails either return or * generate a fatal error depending on auto-extending being active. */ block_size = information->allocation_size * information->size; 10b81f: 0f af 43 18 imul 0x18(%ebx),%eax if ( information->auto_extend ) { 10b823: 80 7b 12 00 cmpb $0x0,0x12(%ebx) 10b827: 74 1e je 10b847 <_Objects_Extend_information+0x9b> new_object_block = _Workspace_Allocate( block_size ); 10b829: 83 ec 0c sub $0xc,%esp 10b82c: 50 push %eax 10b82d: 89 55 b4 mov %edx,-0x4c(%ebp) 10b830: e8 df 1a 00 00 call 10d314 <_Workspace_Allocate> 10b835: 89 45 bc mov %eax,-0x44(%ebp) if ( !new_object_block ) 10b838: 83 c4 10 add $0x10,%esp 10b83b: 85 c0 test %eax,%eax 10b83d: 8b 55 b4 mov -0x4c(%ebp),%edx 10b840: 75 1a jne 10b85c <_Objects_Extend_information+0xb0> 10b842: e9 b3 01 00 00 jmp 10b9fa <_Objects_Extend_information+0x24e> return; } else { new_object_block = _Workspace_Allocate_or_fatal_error( block_size ); 10b847: 83 ec 0c sub $0xc,%esp 10b84a: 50 push %eax 10b84b: 89 55 b4 mov %edx,-0x4c(%ebp) 10b84e: e8 95 1a 00 00 call 10d2e8 <_Workspace_Allocate_or_fatal_error> 10b853: 89 45 bc mov %eax,-0x44(%ebp) 10b856: 83 c4 10 add $0x10,%esp 10b859: 8b 55 b4 mov -0x4c(%ebp),%edx } /* * If the index_base is the maximum we need to grow the tables. */ if (index_base >= information->maximum ) { 10b85c: 0f b7 43 10 movzwl 0x10(%ebx),%eax 10b860: 39 45 d4 cmp %eax,-0x2c(%ebp) 10b863: 0f 82 14 01 00 00 jb 10b97d <_Objects_Extend_information+0x1d1> */ /* * Up the block count and maximum */ block_count++; 10b869: 8d 72 01 lea 0x1(%edx),%esi * Allocate the tables and break it up. */ block_size = block_count * (sizeof(void *) + sizeof(uint32_t) + sizeof(Objects_Name *)) + ((maximum + minimum_index) * sizeof(Objects_Control *)); object_blocks = (void**) _Workspace_Allocate( block_size ); 10b86c: 83 ec 0c sub $0xc,%esp 10b86f: 8b 4d b8 mov -0x48(%ebp),%ecx 10b872: 03 4d c8 add -0x38(%ebp),%ecx 10b875: 8d 04 76 lea (%esi,%esi,2),%eax 10b878: 8d 04 01 lea (%ecx,%eax,1),%eax 10b87b: c1 e0 02 shl $0x2,%eax 10b87e: 50 push %eax 10b87f: 89 55 b4 mov %edx,-0x4c(%ebp) 10b882: e8 8d 1a 00 00 call 10d314 <_Workspace_Allocate> if ( !object_blocks ) { 10b887: 83 c4 10 add $0x10,%esp 10b88a: 85 c0 test %eax,%eax 10b88c: 8b 55 b4 mov -0x4c(%ebp),%edx 10b88f: 75 13 jne 10b8a4 <_Objects_Extend_information+0xf8> _Workspace_Free( new_object_block ); 10b891: 83 ec 0c sub $0xc,%esp 10b894: ff 75 bc pushl -0x44(%ebp) 10b897: e8 91 1a 00 00 call 10d32d <_Workspace_Free> return; 10b89c: 83 c4 10 add $0x10,%esp 10b89f: e9 56 01 00 00 jmp 10b9fa <_Objects_Extend_information+0x24e> RTEMS_INLINE_ROUTINE void *_Addresses_Add_offset ( const void *base, uintptr_t offset ) { return (void *)((uintptr_t)base + offset); 10b8a4: 8d 0c b0 lea (%eax,%esi,4),%ecx 10b8a7: 89 4d c0 mov %ecx,-0x40(%ebp) 10b8aa: 8d 34 f0 lea (%eax,%esi,8),%esi 10b8ad: 89 75 c4 mov %esi,-0x3c(%ebp) * Take the block count down. Saves all the (block_count - 1) * in the copies. */ block_count--; if ( information->maximum > minimum_index ) { 10b8b0: 0f b7 73 10 movzwl 0x10(%ebx),%esi 10b8b4: 31 c9 xor %ecx,%ecx 10b8b6: 3b 75 c8 cmp -0x38(%ebp),%esi 10b8b9: 76 3e jbe 10b8f9 <_Objects_Extend_information+0x14d> /* * Copy each section of the table over. This has to be performed as * separate parts as size of each block has changed. */ memcpy( object_blocks, 10b8bb: 8d 34 95 00 00 00 00 lea 0x0(,%edx,4),%esi 10b8c2: 89 75 d0 mov %esi,-0x30(%ebp) 10b8c5: 8b 73 34 mov 0x34(%ebx),%esi 10b8c8: 89 c7 mov %eax,%edi 10b8ca: 8b 4d d0 mov -0x30(%ebp),%ecx 10b8cd: f3 a4 rep movsb %ds:(%esi),%es:(%edi) information->object_blocks, block_count * sizeof(void*) ); memcpy( inactive_per_block, 10b8cf: 8b 73 30 mov 0x30(%ebx),%esi 10b8d2: 8b 7d c0 mov -0x40(%ebp),%edi 10b8d5: 8b 4d d0 mov -0x30(%ebp),%ecx 10b8d8: f3 a4 rep movsb %ds:(%esi),%es:(%edi) information->inactive_per_block, block_count * sizeof(uint32_t) ); memcpy( local_table, 10b8da: 0f b7 4b 10 movzwl 0x10(%ebx),%ecx 10b8de: 03 4d c8 add -0x38(%ebp),%ecx 10b8e1: c1 e1 02 shl $0x2,%ecx 10b8e4: 8b 73 1c mov 0x1c(%ebx),%esi 10b8e7: 8b 7d c4 mov -0x3c(%ebp),%edi 10b8ea: f3 a4 rep movsb %ds:(%esi),%es:(%edi) 10b8ec: eb 10 jmp 10b8fe <_Objects_Extend_information+0x152> /* * Deal with the special case of the 0 to minimum_index */ for ( index = 0; index < minimum_index; index++ ) { local_table[ index ] = NULL; 10b8ee: 8b 7d c4 mov -0x3c(%ebp),%edi 10b8f1: c7 04 8f 00 00 00 00 movl $0x0,(%edi,%ecx,4) } else { /* * Deal with the special case of the 0 to minimum_index */ for ( index = 0; index < minimum_index; index++ ) { 10b8f8: 41 inc %ecx 10b8f9: 3b 4d c8 cmp -0x38(%ebp),%ecx 10b8fc: 72 f0 jb 10b8ee <_Objects_Extend_information+0x142> } /* * Initialise the new entries in the table. */ object_blocks[block_count] = NULL; 10b8fe: c7 04 90 00 00 00 00 movl $0x0,(%eax,%edx,4) inactive_per_block[block_count] = 0; 10b905: 8b 4d c0 mov -0x40(%ebp),%ecx 10b908: c7 04 91 00 00 00 00 movl $0x0,(%ecx,%edx,4) for ( index=index_base ; index < ( information->allocation_size + index_base ); 10b90f: 0f b7 53 14 movzwl 0x14(%ebx),%edx 10b913: 8b 75 d4 mov -0x2c(%ebp),%esi 10b916: 01 d6 add %edx,%esi 10b918: 8b 7d d4 mov -0x2c(%ebp),%edi 10b91b: 8b 55 c4 mov -0x3c(%ebp),%edx 10b91e: 8d 0c ba lea (%edx,%edi,4),%ecx 10b921: 89 fa mov %edi,%edx * Initialise the new entries in the table. */ object_blocks[block_count] = NULL; inactive_per_block[block_count] = 0; for ( index=index_base ; 10b923: eb 0a jmp 10b92f <_Objects_Extend_information+0x183> index < ( information->allocation_size + index_base ); index++ ) { local_table[ index ] = NULL; 10b925: c7 01 00 00 00 00 movl $0x0,(%ecx) object_blocks[block_count] = NULL; inactive_per_block[block_count] = 0; for ( index=index_base ; index < ( information->allocation_size + index_base ); index++ ) { 10b92b: 42 inc %edx 10b92c: 83 c1 04 add $0x4,%ecx * Initialise the new entries in the table. */ object_blocks[block_count] = NULL; inactive_per_block[block_count] = 0; for ( index=index_base ; 10b92f: 39 f2 cmp %esi,%edx 10b931: 72 f2 jb 10b925 <_Objects_Extend_information+0x179> index < ( information->allocation_size + index_base ); index++ ) { local_table[ index ] = NULL; } _ISR_Disable( level ); 10b933: 9c pushf 10b934: fa cli 10b935: 5e pop %esi old_tables = information->object_blocks; 10b936: 8b 53 34 mov 0x34(%ebx),%edx information->object_blocks = object_blocks; 10b939: 89 43 34 mov %eax,0x34(%ebx) information->inactive_per_block = inactive_per_block; 10b93c: 8b 4d c0 mov -0x40(%ebp),%ecx 10b93f: 89 4b 30 mov %ecx,0x30(%ebx) information->local_table = local_table; 10b942: 8b 7d c4 mov -0x3c(%ebp),%edi 10b945: 89 7b 1c mov %edi,0x1c(%ebx) information->maximum = (Objects_Maximum) maximum; 10b948: 8b 45 b8 mov -0x48(%ebp),%eax 10b94b: 66 89 43 10 mov %ax,0x10(%ebx) information->maximum_id = _Objects_Build_id( 10b94f: 8b 03 mov (%ebx),%eax 10b951: c1 e0 18 shl $0x18,%eax 10b954: 0d 00 00 01 00 or $0x10000,%eax 10b959: 0f b7 4b 04 movzwl 0x4(%ebx),%ecx 10b95d: c1 e1 1b shl $0x1b,%ecx 10b960: 09 c8 or %ecx,%eax 10b962: 0f b7 4d b8 movzwl -0x48(%ebp),%ecx 10b966: 09 c8 or %ecx,%eax 10b968: 89 43 0c mov %eax,0xc(%ebx) information->the_class, _Objects_Local_node, information->maximum ); _ISR_Enable( level ); 10b96b: 56 push %esi 10b96c: 9d popf if ( old_tables ) 10b96d: 85 d2 test %edx,%edx 10b96f: 74 0c je 10b97d <_Objects_Extend_information+0x1d1> _Workspace_Free( old_tables ); 10b971: 83 ec 0c sub $0xc,%esp 10b974: 52 push %edx 10b975: e8 b3 19 00 00 call 10d32d <_Workspace_Free> 10b97a: 83 c4 10 add $0x10,%esp } /* * Assign the new object block to the object block table. */ information->object_blocks[ block ] = new_object_block; 10b97d: 8b 55 cc mov -0x34(%ebp),%edx 10b980: c1 e2 02 shl $0x2,%edx 10b983: 89 55 d0 mov %edx,-0x30(%ebp) 10b986: 8b 43 34 mov 0x34(%ebx),%eax 10b989: 8b 75 bc mov -0x44(%ebp),%esi 10b98c: 8b 4d cc mov -0x34(%ebp),%ecx 10b98f: 89 34 88 mov %esi,(%eax,%ecx,4) /* * Initialize objects .. add to a local chain first. */ _Chain_Initialize( 10b992: ff 73 18 pushl 0x18(%ebx) 10b995: 0f b7 53 14 movzwl 0x14(%ebx),%edx 10b999: 52 push %edx 10b99a: ff 34 88 pushl (%eax,%ecx,4) 10b99d: 8d 45 dc lea -0x24(%ebp),%eax 10b9a0: 50 push %eax 10b9a1: 89 45 b4 mov %eax,-0x4c(%ebp) 10b9a4: e8 c7 45 00 00 call 10ff70 <_Chain_Initialize> information->the_class, _Objects_Local_node, index ); _Chain_Append( &information->Inactive, &the_object->Node ); 10b9a9: 8d 7b 20 lea 0x20(%ebx),%edi 10b9ac: 8b 75 d4 mov -0x2c(%ebp),%esi 10b9af: eb 23 jmp 10b9d4 <_Objects_Extend_information+0x228> */ index = index_base; while ((the_object = (Objects_Control *) _Chain_Get( &Inactive )) != NULL ) { the_object->id = _Objects_Build_id( 10b9b1: 8b 13 mov (%ebx),%edx 10b9b3: c1 e2 18 shl $0x18,%edx 10b9b6: 81 ca 00 00 01 00 or $0x10000,%edx 10b9bc: 0f b7 4b 04 movzwl 0x4(%ebx),%ecx 10b9c0: c1 e1 1b shl $0x1b,%ecx 10b9c3: 09 ca or %ecx,%edx 10b9c5: 09 f2 or %esi,%edx 10b9c7: 89 50 08 mov %edx,0x8(%eax) information->the_class, _Objects_Local_node, index ); _Chain_Append( &information->Inactive, &the_object->Node ); 10b9ca: 52 push %edx 10b9cb: 52 push %edx 10b9cc: 50 push %eax 10b9cd: 57 push %edi 10b9ce: e8 75 f4 ff ff call 10ae48 <_Chain_Append> index++; 10b9d3: 46 inc %esi /* * Move from the local chain, initialise, then append to the inactive chain */ index = index_base; while ((the_object = (Objects_Control *) _Chain_Get( &Inactive )) != NULL ) { 10b9d4: 8d 45 dc lea -0x24(%ebp),%eax 10b9d7: 89 04 24 mov %eax,(%esp) 10b9da: e8 a5 f4 ff ff call 10ae84 <_Chain_Get> 10b9df: 83 c4 10 add $0x10,%esp 10b9e2: 85 c0 test %eax,%eax 10b9e4: 75 cb jne 10b9b1 <_Objects_Extend_information+0x205> _Chain_Append( &information->Inactive, &the_object->Node ); index++; } information->inactive_per_block[ block ] = information->allocation_size; 10b9e6: 8b 43 30 mov 0x30(%ebx),%eax 10b9e9: 0f b7 53 14 movzwl 0x14(%ebx),%edx 10b9ed: 8b 4d d0 mov -0x30(%ebp),%ecx 10b9f0: 89 14 08 mov %edx,(%eax,%ecx,1) information->inactive = 10b9f3: 8b 43 14 mov 0x14(%ebx),%eax 10b9f6: 66 01 43 2c add %ax,0x2c(%ebx) (Objects_Maximum)(information->inactive + information->allocation_size); } 10b9fa: 8d 65 f4 lea -0xc(%ebp),%esp 10b9fd: 5b pop %ebx 10b9fe: 5e pop %esi 10b9ff: 5f pop %edi 10ba00: c9 leave 10ba01: c3 ret =============================================================================== 0010ba94 <_Objects_Get_information>: Objects_Information *_Objects_Get_information( Objects_APIs the_api, uint32_t the_class ) { 10ba94: 55 push %ebp 10ba95: 89 e5 mov %esp,%ebp 10ba97: 56 push %esi 10ba98: 53 push %ebx 10ba99: 8b 75 08 mov 0x8(%ebp),%esi 10ba9c: 8b 5d 0c mov 0xc(%ebp),%ebx Objects_Information *info; int the_class_api_maximum; if ( !the_class ) 10ba9f: 85 db test %ebx,%ebx 10baa1: 74 2d je 10bad0 <_Objects_Get_information+0x3c> /* * 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 ); 10baa3: 83 ec 0c sub $0xc,%esp 10baa6: 56 push %esi 10baa7: e8 88 4a 00 00 call 110534 <_Objects_API_maximum_class> if ( the_class_api_maximum == 0 ) 10baac: 83 c4 10 add $0x10,%esp 10baaf: 85 c0 test %eax,%eax 10bab1: 74 1d je 10bad0 <_Objects_Get_information+0x3c> return NULL; if ( the_class > (uint32_t) the_class_api_maximum ) 10bab3: 39 c3 cmp %eax,%ebx 10bab5: 77 19 ja 10bad0 <_Objects_Get_information+0x3c> return NULL; if ( !_Objects_Information_table[ the_api ] ) 10bab7: 8b 04 b5 dc 61 12 00 mov 0x1261dc(,%esi,4),%eax 10babe: 85 c0 test %eax,%eax 10bac0: 74 0e je 10bad0 <_Objects_Get_information+0x3c><== NEVER TAKEN return NULL; info = _Objects_Information_table[ the_api ][ the_class ]; 10bac2: 8b 04 98 mov (%eax,%ebx,4),%eax if ( !info ) 10bac5: 85 c0 test %eax,%eax 10bac7: 74 09 je 10bad2 <_Objects_Get_information+0x3e><== 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 ) 10bac9: 66 83 78 10 00 cmpw $0x0,0x10(%eax) 10bace: 75 02 jne 10bad2 <_Objects_Get_information+0x3e> 10bad0: 31 c0 xor %eax,%eax return NULL; #endif return info; } 10bad2: 8d 65 f8 lea -0x8(%ebp),%esp 10bad5: 5b pop %ebx 10bad6: 5e pop %esi 10bad7: c9 leave 10bad8: c3 ret =============================================================================== 00119044 <_Objects_Get_no_protection>: Objects_Control *_Objects_Get_no_protection( Objects_Information *information, Objects_Id id, Objects_Locations *location ) { 119044: 55 push %ebp 119045: 89 e5 mov %esp,%ebp 119047: 53 push %ebx 119048: 8b 55 08 mov 0x8(%ebp),%edx 11904b: 8b 4d 10 mov 0x10(%ebp),%ecx /* * 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; 11904e: b8 01 00 00 00 mov $0x1,%eax 119053: 2b 42 08 sub 0x8(%edx),%eax 119056: 03 45 0c add 0xc(%ebp),%eax if ( information->maximum >= index ) { 119059: 0f b7 5a 10 movzwl 0x10(%edx),%ebx 11905d: 39 c3 cmp %eax,%ebx 11905f: 72 12 jb 119073 <_Objects_Get_no_protection+0x2f> if ( (the_object = information->local_table[ index ]) != NULL ) { 119061: 8b 52 1c mov 0x1c(%edx),%edx 119064: 8b 04 82 mov (%edx,%eax,4),%eax 119067: 85 c0 test %eax,%eax 119069: 74 08 je 119073 <_Objects_Get_no_protection+0x2f><== NEVER TAKEN *location = OBJECTS_LOCAL; 11906b: c7 01 00 00 00 00 movl $0x0,(%ecx) return the_object; 119071: eb 08 jmp 11907b <_Objects_Get_no_protection+0x37> /* * This isn't supported or required yet for Global objects so * if it isn't local, we don't find it. */ *location = OBJECTS_ERROR; 119073: c7 01 01 00 00 00 movl $0x1,(%ecx) 119079: 31 c0 xor %eax,%eax return NULL; } 11907b: 5b pop %ebx 11907c: c9 leave 11907d: c3 ret =============================================================================== 0010cc80 <_Objects_Id_to_name>: */ Objects_Name_or_id_lookup_errors _Objects_Id_to_name ( Objects_Id id, Objects_Name *name ) { 10cc80: 55 push %ebp 10cc81: 89 e5 mov %esp,%ebp 10cc83: 83 ec 18 sub $0x18,%esp /* * Caller is trusted for name != NULL. */ tmpId = (id == OBJECTS_ID_OF_SELF) ? _Thread_Executing->Object.id : id; 10cc86: 8b 45 08 mov 0x8(%ebp),%eax 10cc89: 85 c0 test %eax,%eax 10cc8b: 75 08 jne 10cc95 <_Objects_Id_to_name+0x15> 10cc8d: a1 10 83 12 00 mov 0x128310,%eax 10cc92: 8b 40 08 mov 0x8(%eax),%eax */ RTEMS_INLINE_ROUTINE Objects_APIs _Objects_Get_API( Objects_Id id ) { return (Objects_APIs) ((id >> OBJECTS_API_START_BIT) & OBJECTS_API_VALID_BITS); 10cc95: 89 c2 mov %eax,%edx 10cc97: c1 ea 18 shr $0x18,%edx 10cc9a: 83 e2 07 and $0x7,%edx */ RTEMS_INLINE_ROUTINE bool _Objects_Is_api_valid( uint32_t the_api ) { if ( !the_api || the_api > OBJECTS_APIS_LAST ) 10cc9d: 8d 4a ff lea -0x1(%edx),%ecx 10cca0: 83 f9 03 cmp $0x3,%ecx 10cca3: 77 38 ja 10ccdd <_Objects_Id_to_name+0x5d> 10cca5: eb 3d jmp 10cce4 <_Objects_Id_to_name+0x64> if ( !_Objects_Information_table[ the_api ] ) return OBJECTS_INVALID_ID; the_class = _Objects_Get_class( tmpId ); information = _Objects_Information_table[ the_api ][ the_class ]; 10cca7: 89 c1 mov %eax,%ecx 10cca9: c1 e9 1b shr $0x1b,%ecx 10ccac: 8b 14 8a mov (%edx,%ecx,4),%edx if ( !information ) 10ccaf: 85 d2 test %edx,%edx 10ccb1: 74 2a je 10ccdd <_Objects_Id_to_name+0x5d><== NEVER TAKEN return OBJECTS_INVALID_ID; #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES) if ( information->is_string ) 10ccb3: 80 7a 38 00 cmpb $0x0,0x38(%edx) 10ccb7: 75 24 jne 10ccdd <_Objects_Id_to_name+0x5d><== NEVER TAKEN return OBJECTS_INVALID_ID; #endif the_object = _Objects_Get( information, tmpId, &ignored_location ); 10ccb9: 51 push %ecx 10ccba: 8d 4d f4 lea -0xc(%ebp),%ecx 10ccbd: 51 push %ecx 10ccbe: 50 push %eax 10ccbf: 52 push %edx 10ccc0: e8 63 ff ff ff call 10cc28 <_Objects_Get> if ( !the_object ) 10ccc5: 83 c4 10 add $0x10,%esp 10ccc8: 85 c0 test %eax,%eax 10ccca: 74 11 je 10ccdd <_Objects_Id_to_name+0x5d> return OBJECTS_INVALID_ID; *name = the_object->name; 10cccc: 8b 50 0c mov 0xc(%eax),%edx 10cccf: 8b 45 0c mov 0xc(%ebp),%eax 10ccd2: 89 10 mov %edx,(%eax) _Thread_Enable_dispatch(); 10ccd4: e8 b4 07 00 00 call 10d48d <_Thread_Enable_dispatch> 10ccd9: 31 c0 xor %eax,%eax return OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL; 10ccdb: eb 05 jmp 10cce2 <_Objects_Id_to_name+0x62> 10ccdd: b8 03 00 00 00 mov $0x3,%eax } 10cce2: c9 leave 10cce3: c3 ret the_api = _Objects_Get_API( tmpId ); if ( !_Objects_Is_api_valid( the_api ) ) return OBJECTS_INVALID_ID; if ( !_Objects_Information_table[ the_api ] ) 10cce4: 8b 14 95 28 82 12 00 mov 0x128228(,%edx,4),%edx 10cceb: 85 d2 test %edx,%edx 10cced: 75 b8 jne 10cca7 <_Objects_Id_to_name+0x27> 10ccef: eb ec jmp 10ccdd <_Objects_Id_to_name+0x5d> =============================================================================== 0010c304 <_Objects_Set_name>: bool _Objects_Set_name( Objects_Information *information, Objects_Control *the_object, const char *name ) { 10c304: 55 push %ebp 10c305: 89 e5 mov %esp,%ebp 10c307: 57 push %edi 10c308: 56 push %esi 10c309: 53 push %ebx 10c30a: 83 ec 34 sub $0x34,%esp 10c30d: 8b 55 08 mov 0x8(%ebp),%edx 10c310: 8b 7d 0c mov 0xc(%ebp),%edi 10c313: 8b 5d 10 mov 0x10(%ebp),%ebx size_t length; const char *s; s = name; length = strnlen( name, information->name_length ); 10c316: 0f b7 42 3a movzwl 0x3a(%edx),%eax 10c31a: 50 push %eax 10c31b: 53 push %ebx 10c31c: 89 55 d4 mov %edx,-0x2c(%ebp) 10c31f: e8 90 82 00 00 call 1145b4 10c324: 89 c6 mov %eax,%esi #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES) if ( information->is_string ) { 10c326: 83 c4 10 add $0x10,%esp 10c329: 8b 55 d4 mov -0x2c(%ebp),%edx 10c32c: 80 7a 38 00 cmpb $0x0,0x38(%edx) 10c330: 74 54 je 10c386 <_Objects_Set_name+0x82> char *d; d = _Workspace_Allocate( length + 1 ); 10c332: 83 ec 0c sub $0xc,%esp 10c335: 8d 40 01 lea 0x1(%eax),%eax 10c338: 50 push %eax 10c339: e8 a2 16 00 00 call 10d9e0 <_Workspace_Allocate> 10c33e: 89 c2 mov %eax,%edx if ( !d ) 10c340: 83 c4 10 add $0x10,%esp 10c343: 31 c0 xor %eax,%eax 10c345: 85 d2 test %edx,%edx 10c347: 74 79 je 10c3c2 <_Objects_Set_name+0xbe><== NEVER TAKEN return false; if ( the_object->name.name_p ) { 10c349: 8b 47 0c mov 0xc(%edi),%eax 10c34c: 85 c0 test %eax,%eax 10c34e: 74 19 je 10c369 <_Objects_Set_name+0x65> _Workspace_Free( (void *)the_object->name.name_p ); 10c350: 83 ec 0c sub $0xc,%esp 10c353: 50 push %eax 10c354: 89 55 d4 mov %edx,-0x2c(%ebp) 10c357: e8 9d 16 00 00 call 10d9f9 <_Workspace_Free> the_object->name.name_p = NULL; 10c35c: c7 47 0c 00 00 00 00 movl $0x0,0xc(%edi) 10c363: 83 c4 10 add $0x10,%esp 10c366: 8b 55 d4 mov -0x2c(%ebp),%edx } strncpy( d, name, length ); 10c369: 50 push %eax 10c36a: 56 push %esi 10c36b: 53 push %ebx 10c36c: 52 push %edx 10c36d: 89 55 d4 mov %edx,-0x2c(%ebp) 10c370: e8 c3 81 00 00 call 114538 d[length] = '\0'; 10c375: 8b 55 d4 mov -0x2c(%ebp),%edx 10c378: c6 04 32 00 movb $0x0,(%edx,%esi,1) the_object->name.name_p = d; 10c37c: 89 57 0c mov %edx,0xc(%edi) 10c37f: b0 01 mov $0x1,%al 10c381: 83 c4 10 add $0x10,%esp 10c384: eb 3c jmp 10c3c2 <_Objects_Set_name+0xbe> } else #endif { the_object->name.name_u32 = _Objects_Build_name( 10c386: 8a 03 mov (%ebx),%al 10c388: 88 45 d8 mov %al,-0x28(%ebp) 10c38b: 83 fe 01 cmp $0x1,%esi 10c38e: 76 3a jbe 10c3ca <_Objects_Set_name+0xc6> 10c390: 0f be 53 01 movsbl 0x1(%ebx),%edx 10c394: c1 e2 10 shl $0x10,%edx 10c397: 83 fe 02 cmp $0x2,%esi 10c39a: 76 33 jbe 10c3cf <_Objects_Set_name+0xcb> 10c39c: 0f be 43 02 movsbl 0x2(%ebx),%eax 10c3a0: c1 e0 08 shl $0x8,%eax 10c3a3: b9 20 00 00 00 mov $0x20,%ecx 10c3a8: 83 fe 03 cmp $0x3,%esi 10c3ab: 76 04 jbe 10c3b1 <_Objects_Set_name+0xad> 10c3ad: 0f be 4b 03 movsbl 0x3(%ebx),%ecx 10c3b1: 8a 5d d8 mov -0x28(%ebp),%bl 10c3b4: c1 e3 18 shl $0x18,%ebx 10c3b7: 09 d3 or %edx,%ebx 10c3b9: 09 c3 or %eax,%ebx 10c3bb: 09 cb or %ecx,%ebx 10c3bd: 89 5f 0c mov %ebx,0xc(%edi) 10c3c0: b0 01 mov $0x1,%al ); } return true; } 10c3c2: 8d 65 f4 lea -0xc(%ebp),%esp 10c3c5: 5b pop %ebx 10c3c6: 5e pop %esi 10c3c7: 5f pop %edi 10c3c8: c9 leave 10c3c9: c3 ret d[length] = '\0'; the_object->name.name_p = d; } else #endif { the_object->name.name_u32 = _Objects_Build_name( 10c3ca: ba 00 00 20 00 mov $0x200000,%edx 10c3cf: b8 00 20 00 00 mov $0x2000,%eax 10c3d4: b9 20 00 00 00 mov $0x20,%ecx 10c3d9: eb d6 jmp 10c3b1 <_Objects_Set_name+0xad> =============================================================================== 0010b20c <_POSIX_Condition_variables_Wait_support>: pthread_cond_t *cond, pthread_mutex_t *mutex, Watchdog_Interval timeout, bool already_timedout ) { 10b20c: 55 push %ebp 10b20d: 89 e5 mov %esp,%ebp 10b20f: 57 push %edi 10b210: 56 push %esi 10b211: 53 push %ebx 10b212: 83 ec 34 sub $0x34,%esp 10b215: 8b 7d 08 mov 0x8(%ebp),%edi 10b218: 8b 75 0c mov 0xc(%ebp),%esi 10b21b: 8a 45 14 mov 0x14(%ebp),%al 10b21e: 88 45 d7 mov %al,-0x29(%ebp) register POSIX_Condition_variables_Control *the_cond; Objects_Locations location; int status; int mutex_status; if ( !_POSIX_Mutex_Get( mutex, &location ) ) { 10b221: 8d 5d e4 lea -0x1c(%ebp),%ebx 10b224: 53 push %ebx 10b225: 56 push %esi 10b226: e8 82 01 00 00 call 10b3ad <_POSIX_Mutex_Get> 10b22b: 83 c4 10 add $0x10,%esp 10b22e: 85 c0 test %eax,%eax 10b230: 0f 84 ae 00 00 00 je 10b2e4 <_POSIX_Condition_variables_Wait_support+0xd8> */ RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void ) { RTEMS_COMPILER_MEMORY_BARRIER(); _Thread_Dispatch_disable_level -= 1; 10b236: a1 08 82 12 00 mov 0x128208,%eax 10b23b: 48 dec %eax 10b23c: a3 08 82 12 00 mov %eax,0x128208 return EINVAL; } _Thread_Unnest_dispatch(); the_cond = _POSIX_Condition_variables_Get( cond, &location ); 10b241: 52 push %edx 10b242: 52 push %edx 10b243: 53 push %ebx 10b244: 57 push %edi 10b245: e8 16 fe ff ff call 10b060 <_POSIX_Condition_variables_Get> 10b24a: 89 c3 mov %eax,%ebx switch ( location ) { 10b24c: 83 c4 10 add $0x10,%esp 10b24f: 83 7d e4 00 cmpl $0x0,-0x1c(%ebp) 10b253: 0f 85 8b 00 00 00 jne 10b2e4 <_POSIX_Condition_variables_Wait_support+0xd8> case OBJECTS_LOCAL: if ( the_cond->Mutex && ( the_cond->Mutex != *mutex ) ) { 10b259: 8b 40 14 mov 0x14(%eax),%eax 10b25c: 85 c0 test %eax,%eax 10b25e: 74 0b je 10b26b <_POSIX_Condition_variables_Wait_support+0x5f> 10b260: 3b 06 cmp (%esi),%eax 10b262: 74 07 je 10b26b <_POSIX_Condition_variables_Wait_support+0x5f> _Thread_Enable_dispatch(); 10b264: e8 3c 2d 00 00 call 10dfa5 <_Thread_Enable_dispatch> 10b269: eb 79 jmp 10b2e4 <_POSIX_Condition_variables_Wait_support+0xd8> return EINVAL; } (void) pthread_mutex_unlock( mutex ); 10b26b: 83 ec 0c sub $0xc,%esp 10b26e: 56 push %esi 10b26f: e8 20 03 00 00 call 10b594 _Thread_Enable_dispatch(); return EINVAL; } */ if ( !already_timedout ) { 10b274: 83 c4 10 add $0x10,%esp 10b277: 80 7d d7 00 cmpb $0x0,-0x29(%ebp) 10b27b: 75 4d jne 10b2ca <_POSIX_Condition_variables_Wait_support+0xbe> the_cond->Mutex = *mutex; 10b27d: 8b 06 mov (%esi),%eax 10b27f: 89 43 14 mov %eax,0x14(%ebx) 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; 10b282: c7 43 48 01 00 00 00 movl $0x1,0x48(%ebx) _Thread_queue_Enter_critical_section( &the_cond->Wait_queue ); _Thread_Executing->Wait.return_code = 0; 10b289: a1 c4 82 12 00 mov 0x1282c4,%eax 10b28e: c7 40 34 00 00 00 00 movl $0x0,0x34(%eax) _Thread_Executing->Wait.queue = &the_cond->Wait_queue; 10b295: 83 c3 18 add $0x18,%ebx 10b298: 89 58 44 mov %ebx,0x44(%eax) _Thread_Executing->Wait.id = *cond; 10b29b: 8b 17 mov (%edi),%edx 10b29d: 89 50 20 mov %edx,0x20(%eax) _Thread_queue_Enqueue( &the_cond->Wait_queue, timeout ); 10b2a0: 50 push %eax 10b2a1: 68 60 e7 10 00 push $0x10e760 10b2a6: ff 75 10 pushl 0x10(%ebp) 10b2a9: 53 push %ebx 10b2aa: e8 ad 31 00 00 call 10e45c <_Thread_queue_Enqueue_with_handler> _Thread_Enable_dispatch(); 10b2af: e8 f1 2c 00 00 call 10dfa5 <_Thread_Enable_dispatch> /* * Switch ourself out because we blocked as a result of the * _Thread_queue_Enqueue. */ status = _Thread_Executing->Wait.return_code; 10b2b4: a1 c4 82 12 00 mov 0x1282c4,%eax 10b2b9: 8b 58 34 mov 0x34(%eax),%ebx if ( status && status != ETIMEDOUT ) 10b2bc: 83 c4 10 add $0x10,%esp 10b2bf: 83 fb 74 cmp $0x74,%ebx 10b2c2: 74 10 je 10b2d4 <_POSIX_Condition_variables_Wait_support+0xc8> 10b2c4: 85 db test %ebx,%ebx 10b2c6: 74 0c je 10b2d4 <_POSIX_Condition_variables_Wait_support+0xc8><== ALWAYS TAKEN 10b2c8: eb 1f jmp 10b2e9 <_POSIX_Condition_variables_Wait_support+0xdd><== NOT EXECUTED return status; } else { _Thread_Enable_dispatch(); 10b2ca: e8 d6 2c 00 00 call 10dfa5 <_Thread_Enable_dispatch> 10b2cf: bb 74 00 00 00 mov $0x74,%ebx /* * When we get here the dispatch disable level is 0. */ mutex_status = pthread_mutex_lock( mutex ); 10b2d4: 83 ec 0c sub $0xc,%esp 10b2d7: 56 push %esi 10b2d8: e8 37 02 00 00 call 10b514 if ( mutex_status ) 10b2dd: 83 c4 10 add $0x10,%esp 10b2e0: 85 c0 test %eax,%eax 10b2e2: 74 05 je 10b2e9 <_POSIX_Condition_variables_Wait_support+0xdd> 10b2e4: bb 16 00 00 00 mov $0x16,%ebx case OBJECTS_ERROR: break; } return EINVAL; } 10b2e9: 89 d8 mov %ebx,%eax 10b2eb: 8d 65 f4 lea -0xc(%ebp),%esp 10b2ee: 5b pop %ebx 10b2ef: 5e pop %esi 10b2f0: 5f pop %edi 10b2f1: c9 leave 10b2f2: c3 ret =============================================================================== 0010e708 <_POSIX_Message_queue_Receive_support>: size_t msg_len, unsigned int *msg_prio, bool wait, Watchdog_Interval timeout ) { 10e708: 55 push %ebp 10e709: 89 e5 mov %esp,%ebp 10e70b: 57 push %edi 10e70c: 56 push %esi 10e70d: 53 push %ebx 10e70e: 83 ec 30 sub $0x30,%esp 10e711: 8b 75 08 mov 0x8(%ebp),%esi 10e714: 8b 5d 14 mov 0x14(%ebp),%ebx 10e717: 8a 55 18 mov 0x18(%ebp),%dl 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( 10e71a: 8d 45 e4 lea -0x1c(%ebp),%eax 10e71d: 50 push %eax 10e71e: 56 push %esi 10e71f: 68 3c f1 12 00 push $0x12f13c 10e724: 88 55 d4 mov %dl,-0x2c(%ebp) 10e727: e8 9c 2a 00 00 call 1111c8 <_Objects_Get> Objects_Locations location; size_t length_out; bool do_wait; the_mq_fd = _POSIX_Message_queue_Get_fd( mqdes, &location ); switch ( location ) { 10e72c: 83 c4 10 add $0x10,%esp 10e72f: 83 7d e4 00 cmpl $0x0,-0x1c(%ebp) 10e733: 8a 55 d4 mov -0x2c(%ebp),%dl 10e736: 0f 85 af 00 00 00 jne 10e7eb <_POSIX_Message_queue_Receive_support+0xe3> case OBJECTS_LOCAL: if ( (the_mq_fd->oflag & O_ACCMODE) == O_WRONLY ) { 10e73c: 8b 78 14 mov 0x14(%eax),%edi 10e73f: 89 f9 mov %edi,%ecx 10e741: 83 e1 03 and $0x3,%ecx 10e744: 49 dec %ecx 10e745: 75 0a jne 10e751 <_POSIX_Message_queue_Receive_support+0x49> _Thread_Enable_dispatch(); 10e747: e8 b5 32 00 00 call 111a01 <_Thread_Enable_dispatch> 10e74c: e9 9a 00 00 00 jmp 10e7eb <_POSIX_Message_queue_Receive_support+0xe3> rtems_set_errno_and_return_minus_one( EBADF ); } the_mq = the_mq_fd->Queue; 10e751: 8b 48 10 mov 0x10(%eax),%ecx if ( msg_len < the_mq->Message_queue.maximum_message_size ) { 10e754: 8b 45 10 mov 0x10(%ebp),%eax 10e757: 3b 41 68 cmp 0x68(%ecx),%eax 10e75a: 73 15 jae 10e771 <_POSIX_Message_queue_Receive_support+0x69> _Thread_Enable_dispatch(); 10e75c: e8 a0 32 00 00 call 111a01 <_Thread_Enable_dispatch> rtems_set_errno_and_return_minus_one( EMSGSIZE ); 10e761: e8 32 9b 00 00 call 118298 <__errno> 10e766: c7 00 7a 00 00 00 movl $0x7a,(%eax) 10e76c: e9 85 00 00 00 jmp 10e7f6 <_POSIX_Message_queue_Receive_support+0xee> length_out = -1; /* * A timed receive with a bad time will do a poll regardless. */ if ( wait ) 10e771: 31 c0 xor %eax,%eax 10e773: 84 d2 test %dl,%dl 10e775: 74 0b je 10e782 <_POSIX_Message_queue_Receive_support+0x7a><== NEVER TAKEN do_wait = (the_mq_fd->oflag & O_NONBLOCK) ? false : true; 10e777: 89 f8 mov %edi,%eax 10e779: c1 e8 0e shr $0xe,%eax 10e77c: 83 f0 01 xor $0x1,%eax 10e77f: 83 e0 01 and $0x1,%eax /* * Now if something goes wrong, we return a "length" of -1 * to indicate an error. */ length_out = -1; 10e782: c7 45 e0 ff ff ff ff movl $0xffffffff,-0x20(%ebp) do_wait = wait; /* * Now perform the actual message receive */ _CORE_message_queue_Seize( 10e789: 52 push %edx 10e78a: 52 push %edx 10e78b: ff 75 1c pushl 0x1c(%ebp) 10e78e: 0f b6 c0 movzbl %al,%eax 10e791: 50 push %eax 10e792: 8d 45 e0 lea -0x20(%ebp),%eax 10e795: 50 push %eax 10e796: ff 75 0c pushl 0xc(%ebp) 10e799: 56 push %esi 10e79a: 83 c1 1c add $0x1c,%ecx 10e79d: 51 push %ecx 10e79e: e8 59 1c 00 00 call 1103fc <_CORE_message_queue_Seize> &length_out, do_wait, timeout ); _Thread_Enable_dispatch(); 10e7a3: 83 c4 20 add $0x20,%esp 10e7a6: e8 56 32 00 00 call 111a01 <_Thread_Enable_dispatch> *msg_prio = _POSIX_Message_queue_Priority_from_core(_Thread_Executing->Wait.count); 10e7ab: a1 04 ed 12 00 mov 0x12ed04,%eax do_wait, timeout ); _Thread_Enable_dispatch(); *msg_prio = 10e7b0: 8b 50 24 mov 0x24(%eax),%edx 10e7b3: c1 fa 1f sar $0x1f,%edx 10e7b6: 8b 48 24 mov 0x24(%eax),%ecx 10e7b9: 31 d1 xor %edx,%ecx 10e7bb: 89 0b mov %ecx,(%ebx) 10e7bd: 29 13 sub %edx,(%ebx) _POSIX_Message_queue_Priority_from_core(_Thread_Executing->Wait.count); if ( !_Thread_Executing->Wait.return_code ) 10e7bf: 83 78 34 00 cmpl $0x0,0x34(%eax) 10e7c3: 75 05 jne 10e7ca <_POSIX_Message_queue_Receive_support+0xc2> return length_out; 10e7c5: 8b 45 e0 mov -0x20(%ebp),%eax 10e7c8: eb 2f jmp 10e7f9 <_POSIX_Message_queue_Receive_support+0xf1> rtems_set_errno_and_return_minus_one( 10e7ca: e8 c9 9a 00 00 call 118298 <__errno> 10e7cf: 89 c3 mov %eax,%ebx 10e7d1: 83 ec 0c sub $0xc,%esp 10e7d4: a1 04 ed 12 00 mov 0x12ed04,%eax 10e7d9: ff 70 34 pushl 0x34(%eax) 10e7dc: e8 ff 01 00 00 call 10e9e0 <_POSIX_Message_queue_Translate_core_message_queue_return_code> 10e7e1: 89 03 mov %eax,(%ebx) 10e7e3: 83 c8 ff or $0xffffffff,%eax 10e7e6: 83 c4 10 add $0x10,%esp 10e7e9: eb 0e jmp 10e7f9 <_POSIX_Message_queue_Receive_support+0xf1> #endif case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( EBADF ); 10e7eb: e8 a8 9a 00 00 call 118298 <__errno> 10e7f0: c7 00 09 00 00 00 movl $0x9,(%eax) 10e7f6: 83 c8 ff or $0xffffffff,%eax } 10e7f9: 8d 65 f4 lea -0xc(%ebp),%esp 10e7fc: 5b pop %ebx 10e7fd: 5e pop %esi 10e7fe: 5f pop %edi 10e7ff: c9 leave 10e800: c3 ret =============================================================================== 0010f664 <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch>: #include void _POSIX_Thread_Evaluate_cancellation_and_enable_dispatch( Thread_Control *the_thread ) { 10f664: 55 push %ebp 10f665: 89 e5 mov %esp,%ebp 10f667: 83 ec 08 sub $0x8,%esp 10f66a: 8b 55 08 mov 0x8(%ebp),%edx POSIX_API_Control *thread_support; thread_support = the_thread->API_Extensions[ THREAD_API_POSIX ]; 10f66d: 8b 82 f8 00 00 00 mov 0xf8(%edx),%eax if ( thread_support->cancelability_state == PTHREAD_CANCEL_ENABLE && 10f673: 83 b8 d4 00 00 00 00 cmpl $0x0,0xd4(%eax) 10f67a: 75 2c jne 10f6a8 <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch+0x44><== NEVER TAKEN thread_support->cancelability_type == PTHREAD_CANCEL_ASYNCHRONOUS && 10f67c: 83 b8 d8 00 00 00 01 cmpl $0x1,0xd8(%eax) 10f683: 75 23 jne 10f6a8 <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch+0x44> thread_support->cancelation_requested ) { 10f685: 83 b8 dc 00 00 00 00 cmpl $0x0,0xdc(%eax) 10f68c: 74 1a je 10f6a8 <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch+0x44> */ RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void ) { RTEMS_COMPILER_MEMORY_BARRIER(); _Thread_Dispatch_disable_level -= 1; 10f68e: a1 00 72 12 00 mov 0x127200,%eax 10f693: 48 dec %eax 10f694: a3 00 72 12 00 mov %eax,0x127200 _Thread_Unnest_dispatch(); _POSIX_Thread_Exit( the_thread, PTHREAD_CANCELED ); 10f699: 50 push %eax 10f69a: 50 push %eax 10f69b: 6a ff push $0xffffffff 10f69d: 52 push %edx 10f69e: e8 e9 05 00 00 call 10fc8c <_POSIX_Thread_Exit> { POSIX_API_Control *thread_support; thread_support = the_thread->API_Extensions[ THREAD_API_POSIX ]; if ( thread_support->cancelability_state == PTHREAD_CANCEL_ENABLE && 10f6a3: 83 c4 10 add $0x10,%esp _Thread_Unnest_dispatch(); _POSIX_Thread_Exit( the_thread, PTHREAD_CANCELED ); } else _Thread_Enable_dispatch(); } 10f6a6: c9 leave 10f6a7: c3 ret 10f6a8: c9 leave thread_support->cancelability_type == PTHREAD_CANCEL_ASYNCHRONOUS && thread_support->cancelation_requested ) { _Thread_Unnest_dispatch(); _POSIX_Thread_Exit( the_thread, PTHREAD_CANCELED ); } else _Thread_Enable_dispatch(); 10f6a9: e9 1b d0 ff ff jmp 10c6c9 <_Thread_Enable_dispatch> =============================================================================== 0011066c <_POSIX_Thread_Translate_sched_param>: int policy, struct sched_param *param, Thread_CPU_budget_algorithms *budget_algorithm, Thread_CPU_budget_algorithm_callout *budget_callout ) { 11066c: 55 push %ebp 11066d: 89 e5 mov %esp,%ebp 11066f: 57 push %edi 110670: 56 push %esi 110671: 53 push %ebx 110672: 83 ec 18 sub $0x18,%esp 110675: 8b 7d 08 mov 0x8(%ebp),%edi 110678: 8b 5d 0c mov 0xc(%ebp),%ebx 11067b: 8b 75 10 mov 0x10(%ebp),%esi if ( !_POSIX_Priority_Is_valid( param->sched_priority ) ) 11067e: ff 33 pushl (%ebx) 110680: e8 c7 ff ff ff call 11064c <_POSIX_Priority_Is_valid> 110685: 83 c4 10 add $0x10,%esp 110688: 84 c0 test %al,%al 11068a: 0f 84 97 00 00 00 je 110727 <_POSIX_Thread_Translate_sched_param+0xbb><== NEVER TAKEN return EINVAL; *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE; 110690: c7 06 00 00 00 00 movl $0x0,(%esi) *budget_callout = NULL; 110696: 8b 45 14 mov 0x14(%ebp),%eax 110699: c7 00 00 00 00 00 movl $0x0,(%eax) if ( policy == SCHED_OTHER ) { 11069f: 85 ff test %edi,%edi 1106a1: 75 08 jne 1106ab <_POSIX_Thread_Translate_sched_param+0x3f> *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE; 1106a3: c7 06 01 00 00 00 movl $0x1,(%esi) 1106a9: eb 18 jmp 1106c3 <_POSIX_Thread_Translate_sched_param+0x57> return 0; } if ( policy == SCHED_FIFO ) { 1106ab: 83 ff 01 cmp $0x1,%edi 1106ae: 75 08 jne 1106b8 <_POSIX_Thread_Translate_sched_param+0x4c> *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE; 1106b0: c7 06 00 00 00 00 movl $0x0,(%esi) 1106b6: eb 0b jmp 1106c3 <_POSIX_Thread_Translate_sched_param+0x57> return 0; } if ( policy == SCHED_RR ) { 1106b8: 83 ff 02 cmp $0x2,%edi 1106bb: 75 0a jne 1106c7 <_POSIX_Thread_Translate_sched_param+0x5b> *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_EXHAUST_TIMESLICE; 1106bd: c7 06 02 00 00 00 movl $0x2,(%esi) 1106c3: 31 c0 xor %eax,%eax return 0; 1106c5: eb 65 jmp 11072c <_POSIX_Thread_Translate_sched_param+0xc0> } if ( policy == SCHED_SPORADIC ) { 1106c7: 83 ff 04 cmp $0x4,%edi 1106ca: 75 5b jne 110727 <_POSIX_Thread_Translate_sched_param+0xbb> if ( (param->sched_ss_repl_period.tv_sec == 0) && 1106cc: 83 7b 08 00 cmpl $0x0,0x8(%ebx) 1106d0: 75 06 jne 1106d8 <_POSIX_Thread_Translate_sched_param+0x6c> (param->sched_ss_repl_period.tv_nsec == 0) ) 1106d2: 83 7b 0c 00 cmpl $0x0,0xc(%ebx) 1106d6: 74 4f je 110727 <_POSIX_Thread_Translate_sched_param+0xbb> return EINVAL; if ( (param->sched_ss_init_budget.tv_sec == 0) && 1106d8: 83 7b 10 00 cmpl $0x0,0x10(%ebx) 1106dc: 75 06 jne 1106e4 <_POSIX_Thread_Translate_sched_param+0x78> (param->sched_ss_init_budget.tv_nsec == 0) ) 1106de: 83 7b 14 00 cmpl $0x0,0x14(%ebx) 1106e2: 74 43 je 110727 <_POSIX_Thread_Translate_sched_param+0xbb> return EINVAL; if ( _Timespec_To_ticks( ¶m->sched_ss_repl_period ) < 1106e4: 83 ec 0c sub $0xc,%esp 1106e7: 8d 43 08 lea 0x8(%ebx),%eax 1106ea: 50 push %eax 1106eb: e8 18 d7 ff ff call 10de08 <_Timespec_To_ticks> 1106f0: 89 c7 mov %eax,%edi 1106f2: 8d 43 10 lea 0x10(%ebx),%eax 1106f5: 89 04 24 mov %eax,(%esp) 1106f8: e8 0b d7 ff ff call 10de08 <_Timespec_To_ticks> 1106fd: 83 c4 10 add $0x10,%esp 110700: 39 c7 cmp %eax,%edi 110702: 72 23 jb 110727 <_POSIX_Thread_Translate_sched_param+0xbb> _Timespec_To_ticks( ¶m->sched_ss_init_budget ) ) return EINVAL; if ( !_POSIX_Priority_Is_valid( param->sched_ss_low_priority ) ) 110704: 83 ec 0c sub $0xc,%esp 110707: ff 73 04 pushl 0x4(%ebx) 11070a: e8 3d ff ff ff call 11064c <_POSIX_Priority_Is_valid> 11070f: 83 c4 10 add $0x10,%esp 110712: 84 c0 test %al,%al 110714: 74 11 je 110727 <_POSIX_Thread_Translate_sched_param+0xbb> return EINVAL; *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_CALLOUT; 110716: c7 06 03 00 00 00 movl $0x3,(%esi) *budget_callout = _POSIX_Threads_Sporadic_budget_callout; 11071c: 8b 45 14 mov 0x14(%ebp),%eax 11071f: c7 00 0b ac 10 00 movl $0x10ac0b,(%eax) 110725: eb 9c jmp 1106c3 <_POSIX_Thread_Translate_sched_param+0x57> return 0; 110727: b8 16 00 00 00 mov $0x16,%eax } return EINVAL; } 11072c: 8d 65 f4 lea -0xc(%ebp),%esp 11072f: 5b pop %ebx 110730: 5e pop %esi 110731: 5f pop %edi 110732: c9 leave 110733: c3 ret =============================================================================== 0010a948 <_POSIX_Threads_Initialize_user_threads_body>: * * Output parameters: NONE */ void _POSIX_Threads_Initialize_user_threads_body(void) { 10a948: 55 push %ebp 10a949: 89 e5 mov %esp,%ebp 10a94b: 57 push %edi 10a94c: 56 push %esi 10a94d: 53 push %ebx 10a94e: 83 ec 5c sub $0x5c,%esp 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; 10a951: 8b 3d 10 32 12 00 mov 0x123210,%edi maximum = Configuration_POSIX_API.number_of_initialization_threads; 10a957: 8b 15 0c 32 12 00 mov 0x12320c,%edx if ( !user_threads || maximum == 0 ) 10a95d: 85 d2 test %edx,%edx 10a95f: 74 54 je 10a9b5 <_POSIX_Threads_Initialize_user_threads_body+0x6d><== NEVER TAKEN 10a961: 85 ff test %edi,%edi 10a963: 74 50 je 10a9b5 <_POSIX_Threads_Initialize_user_threads_body+0x6d><== NEVER TAKEN 10a965: 31 db xor %ebx,%ebx for ( index=0 ; index < maximum ; index++ ) { /* * There is no way for these calls to fail in this situation. */ (void) pthread_attr_init( &attr ); 10a967: 8d 75 a8 lea -0x58(%ebp),%esi 10a96a: 83 ec 0c sub $0xc,%esp 10a96d: 56 push %esi 10a96e: 89 55 a4 mov %edx,-0x5c(%ebp) 10a971: e8 be 5d 00 00 call 110734 (void) pthread_attr_setinheritsched( &attr, PTHREAD_EXPLICIT_SCHED ); 10a976: 5a pop %edx 10a977: 59 pop %ecx 10a978: 6a 02 push $0x2 10a97a: 56 push %esi 10a97b: e8 dc 5d 00 00 call 11075c (void) pthread_attr_setstacksize(&attr, user_threads[ index ].stack_size); 10a980: 59 pop %ecx 10a981: 58 pop %eax 10a982: ff 74 df 04 pushl 0x4(%edi,%ebx,8) 10a986: 56 push %esi 10a987: e8 00 5e 00 00 call 11078c status = pthread_create( 10a98c: 6a 00 push $0x0 10a98e: ff 34 df pushl (%edi,%ebx,8) 10a991: 56 push %esi 10a992: 8d 45 e4 lea -0x1c(%ebp),%eax 10a995: 50 push %eax 10a996: e8 e9 fc ff ff call 10a684 &thread_id, &attr, user_threads[ index ].thread_entry, NULL ); if ( status ) 10a99b: 83 c4 20 add $0x20,%esp 10a99e: 85 c0 test %eax,%eax 10a9a0: 8b 55 a4 mov -0x5c(%ebp),%edx 10a9a3: 74 0b je 10a9b0 <_POSIX_Threads_Initialize_user_threads_body+0x68> _Internal_error_Occurred( INTERNAL_ERROR_POSIX_API, true, status ); 10a9a5: 52 push %edx 10a9a6: 50 push %eax 10a9a7: 6a 01 push $0x1 10a9a9: 6a 02 push $0x2 10a9ab: e8 b4 1b 00 00 call 10c564 <_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++ ) { 10a9b0: 43 inc %ebx 10a9b1: 39 d3 cmp %edx,%ebx 10a9b3: 72 b5 jb 10a96a <_POSIX_Threads_Initialize_user_threads_body+0x22><== NEVER TAKEN NULL ); if ( status ) _Internal_error_Occurred( INTERNAL_ERROR_POSIX_API, true, status ); } } 10a9b5: 8d 65 f4 lea -0xc(%ebp),%esp 10a9b8: 5b pop %ebx 10a9b9: 5e pop %esi 10a9ba: 5f pop %edi 10a9bb: c9 leave 10a9bc: c3 ret =============================================================================== 0010f85f <_POSIX_Threads_Sporadic_budget_TSR>: */ void _POSIX_Threads_Sporadic_budget_TSR( Objects_Id id __attribute__((unused)), void *argument ) { 10f85f: 55 push %ebp 10f860: 89 e5 mov %esp,%ebp 10f862: 56 push %esi 10f863: 53 push %ebx 10f864: 8b 5d 0c mov 0xc(%ebp),%ebx Thread_Control *the_thread; POSIX_API_Control *api; the_thread = argument; api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 10f867: 8b b3 f8 00 00 00 mov 0xf8(%ebx),%esi /* ticks is guaranteed to be at least one */ ticks = _Timespec_To_ticks( &api->schedparam.sched_ss_init_budget ); 10f86d: 83 ec 0c sub $0xc,%esp 10f870: 8d 86 94 00 00 00 lea 0x94(%esi),%eax 10f876: 50 push %eax 10f877: e8 00 11 00 00 call 11097c <_Timespec_To_ticks> the_thread->cpu_time_budget = ticks; 10f87c: 89 43 78 mov %eax,0x78(%ebx) 10f87f: 0f b6 05 f4 21 12 00 movzbl 0x1221f4,%eax 10f886: 2b 86 84 00 00 00 sub 0x84(%esi),%eax new_priority = _POSIX_Priority_To_core( api->schedparam.sched_priority ); the_thread->real_priority = new_priority; 10f88c: 89 43 18 mov %eax,0x18(%ebx) */ #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 ) { 10f88f: 83 c4 10 add $0x10,%esp 10f892: 83 7b 1c 00 cmpl $0x0,0x1c(%ebx) 10f896: 75 12 jne 10f8aa <_POSIX_Threads_Sporadic_budget_TSR+0x4b><== NEVER TAKEN /* * If this would make them less important, then do not change it. */ if ( the_thread->current_priority > new_priority ) { 10f898: 39 43 14 cmp %eax,0x14(%ebx) 10f89b: 76 0d jbe 10f8aa <_POSIX_Threads_Sporadic_budget_TSR+0x4b> _Thread_Change_priority( the_thread, new_priority, true ); 10f89d: 52 push %edx 10f89e: 6a 01 push $0x1 10f8a0: 50 push %eax 10f8a1: 53 push %ebx 10f8a2: e8 d9 c5 ff ff call 10be80 <_Thread_Change_priority> 10f8a7: 83 c4 10 add $0x10,%esp #endif } } /* ticks is guaranteed to be at least one */ ticks = _Timespec_To_ticks( &api->schedparam.sched_ss_repl_period ); 10f8aa: 83 ec 0c sub $0xc,%esp 10f8ad: 8d 86 8c 00 00 00 lea 0x8c(%esi),%eax 10f8b3: 50 push %eax 10f8b4: e8 c3 10 00 00 call 11097c <_Timespec_To_ticks> Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 10f8b9: 89 86 b0 00 00 00 mov %eax,0xb0(%esi) _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 10f8bf: 83 c4 10 add $0x10,%esp 10f8c2: 81 c6 a4 00 00 00 add $0xa4,%esi 10f8c8: 89 75 0c mov %esi,0xc(%ebp) 10f8cb: c7 45 08 e4 62 12 00 movl $0x1262e4,0x8(%ebp) _Watchdog_Insert_ticks( &api->Sporadic_timer, ticks ); } 10f8d2: 8d 65 f8 lea -0x8(%ebp),%esp 10f8d5: 5b pop %ebx 10f8d6: 5e pop %esi 10f8d7: c9 leave 10f8d8: e9 23 d8 ff ff jmp 10d100 <_Watchdog_Insert> =============================================================================== 0010f81f <_POSIX_Threads_Sporadic_budget_callout>: * _POSIX_Threads_Sporadic_budget_callout */ void _POSIX_Threads_Sporadic_budget_callout( Thread_Control *the_thread ) { 10f81f: 55 push %ebp 10f820: 89 e5 mov %esp,%ebp 10f822: 83 ec 08 sub $0x8,%esp 10f825: 8b 45 08 mov 0x8(%ebp),%eax POSIX_API_Control *api; uint32_t new_priority; api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 10f828: 8b 88 f8 00 00 00 mov 0xf8(%eax),%ecx /* * 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 */ 10f82e: c7 40 78 ff ff ff ff movl $0xffffffff,0x78(%eax) RTEMS_INLINE_ROUTINE Priority_Control _POSIX_Priority_To_core( int priority ) { return (Priority_Control) (POSIX_SCHEDULER_MAXIMUM_PRIORITY - priority + 1); 10f835: 0f b6 15 f4 21 12 00 movzbl 0x1221f4,%edx 10f83c: 2b 91 88 00 00 00 sub 0x88(%ecx),%edx new_priority = _POSIX_Priority_To_core(api->schedparam.sched_ss_low_priority); the_thread->real_priority = new_priority; 10f842: 89 50 18 mov %edx,0x18(%eax) */ #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 ) { 10f845: 83 78 1c 00 cmpl $0x0,0x1c(%eax) 10f849: 75 12 jne 10f85d <_POSIX_Threads_Sporadic_budget_callout+0x3e><== 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 ) { 10f84b: 39 50 14 cmp %edx,0x14(%eax) 10f84e: 73 0d jae 10f85d <_POSIX_Threads_Sporadic_budget_callout+0x3e><== NEVER TAKEN _Thread_Change_priority( the_thread, new_priority, true ); 10f850: 51 push %ecx 10f851: 6a 01 push $0x1 10f853: 52 push %edx 10f854: 50 push %eax 10f855: e8 26 c6 ff ff call 10be80 <_Thread_Change_priority> 10f85a: 83 c4 10 add $0x10,%esp #if 0 printk( "lower priority\n" ); #endif } } } 10f85d: c9 leave 10f85e: c3 ret =============================================================================== 0010a6f4 <_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) { 10a6f4: 55 push %ebp 10a6f5: 89 e5 mov %esp,%ebp 10a6f7: 53 push %ebx 10a6f8: 83 ec 04 sub $0x4,%esp 10a6fb: 8b 5d 0c mov 0xc(%ebp),%ebx bool activated; ptimer = (POSIX_Timer_Control *)data; /* Increment the number of expirations. */ ptimer->overrun = ptimer->overrun + 1; 10a6fe: ff 43 68 incl 0x68(%ebx) /* The timer must be reprogrammed */ if ( ( ptimer->timer_data.it_interval.tv_sec != 0 ) || 10a701: 83 7b 54 00 cmpl $0x0,0x54(%ebx) 10a705: 75 06 jne 10a70d <_POSIX_Timer_TSR+0x19> ( ptimer->timer_data.it_interval.tv_nsec != 0 ) ) { 10a707: 83 7b 58 00 cmpl $0x0,0x58(%ebx) 10a70b: 74 34 je 10a741 <_POSIX_Timer_TSR+0x4d> <== NEVER TAKEN activated = _POSIX_Timer_Insert_helper( 10a70d: 83 ec 0c sub $0xc,%esp 10a710: 53 push %ebx 10a711: 68 f4 a6 10 00 push $0x10a6f4 10a716: ff 73 08 pushl 0x8(%ebx) 10a719: ff 73 64 pushl 0x64(%ebx) 10a71c: 8d 43 10 lea 0x10(%ebx),%eax 10a71f: 50 push %eax 10a720: e8 b7 5c 00 00 call 1103dc <_POSIX_Timer_Insert_helper> ptimer->ticks, ptimer->Object.id, _POSIX_Timer_TSR, ptimer ); if ( !activated ) 10a725: 83 c4 20 add $0x20,%esp 10a728: 84 c0 test %al,%al 10a72a: 74 30 je 10a75c <_POSIX_Timer_TSR+0x68> <== NEVER TAKEN return; /* Store the time when the timer was started again */ _TOD_Get( &ptimer->time ); 10a72c: 83 ec 0c sub $0xc,%esp 10a72f: 8d 43 6c lea 0x6c(%ebx),%eax 10a732: 50 push %eax 10a733: e8 4c 14 00 00 call 10bb84 <_TOD_Get> /* The state really did not change but just to be safe */ ptimer->state = POSIX_TIMER_STATE_CREATE_RUN; 10a738: c6 43 3c 03 movb $0x3,0x3c(%ebx) /* Increment the number of expirations. */ ptimer->overrun = ptimer->overrun + 1; /* The timer must be reprogrammed */ if ( ( ptimer->timer_data.it_interval.tv_sec != 0 ) || 10a73c: 83 c4 10 add $0x10,%esp 10a73f: eb 04 jmp 10a745 <_POSIX_Timer_TSR+0x51> /* The state really did not change but just to be safe */ ptimer->state = POSIX_TIMER_STATE_CREATE_RUN; } else { /* Indicates that the timer is stopped */ ptimer->state = POSIX_TIMER_STATE_CREATE_STOP; 10a741: c6 43 3c 04 movb $0x4,0x3c(%ebx) /* * 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 ) ) { 10a745: 50 push %eax 10a746: 50 push %eax 10a747: ff 73 44 pushl 0x44(%ebx) 10a74a: ff 73 38 pushl 0x38(%ebx) 10a74d: e8 5a 58 00 00 call 10ffac } /* After the signal handler returns, the count of expirations of the * timer must be set to 0. */ ptimer->overrun = 0; 10a752: c7 43 68 00 00 00 00 movl $0x0,0x68(%ebx) 10a759: 83 c4 10 add $0x10,%esp } 10a75c: 8b 5d fc mov -0x4(%ebp),%ebx 10a75f: c9 leave 10a760: c3 ret =============================================================================== 001121f4 <_POSIX_signals_Check_signal>: bool _POSIX_signals_Check_signal( POSIX_API_Control *api, int signo, bool is_global ) { 1121f4: 55 push %ebp 1121f5: 89 e5 mov %esp,%ebp 1121f7: 57 push %edi 1121f8: 56 push %esi 1121f9: 53 push %ebx 1121fa: 83 ec 38 sub $0x38,%esp 1121fd: 8b 5d 08 mov 0x8(%ebp),%ebx 112200: 8b 75 0c mov 0xc(%ebp),%esi siginfo_t siginfo_struct; sigset_t saved_signals_blocked; if ( ! _POSIX_signals_Clear_signals( api, signo, &siginfo_struct, 112203: 6a 01 push $0x1 112205: 0f b6 45 10 movzbl 0x10(%ebp),%eax 112209: 50 push %eax 11220a: 8d 7d dc lea -0x24(%ebp),%edi 11220d: 57 push %edi 11220e: 56 push %esi 11220f: 53 push %ebx 112210: e8 5b 00 00 00 call 112270 <_POSIX_signals_Clear_signals> 112215: 83 c4 20 add $0x20,%esp 112218: 84 c0 test %al,%al 11221a: 74 48 je 112264 <_POSIX_signals_Check_signal+0x70> #endif /* * Just to prevent sending a signal which is currently being ignored. */ if ( _POSIX_signals_Vectors[ signo ].sa_handler == SIG_IGN ) 11221c: 6b d6 0c imul $0xc,%esi,%edx 11221f: 8b 82 70 67 12 00 mov 0x126770(%edx),%eax 112225: 83 f8 01 cmp $0x1,%eax 112228: 74 3a je 112264 <_POSIX_signals_Check_signal+0x70><== NEVER TAKEN return false; /* * Block the signals requested in sa_mask */ saved_signals_blocked = api->signals_blocked; 11222a: 8b 8b cc 00 00 00 mov 0xcc(%ebx),%ecx 112230: 89 4d d4 mov %ecx,-0x2c(%ebp) api->signals_blocked |= _POSIX_signals_Vectors[ signo ].sa_mask; 112233: 0b 8a 6c 67 12 00 or 0x12676c(%edx),%ecx 112239: 89 8b cc 00 00 00 mov %ecx,0xcc(%ebx) /* * Here, the signal handler function executes */ switch ( _POSIX_signals_Vectors[ signo ].sa_flags ) { 11223f: 83 ba 68 67 12 00 02 cmpl $0x2,0x126768(%edx) 112246: 75 06 jne 11224e <_POSIX_signals_Check_signal+0x5a> case SA_SIGINFO: (*_POSIX_signals_Vectors[ signo ].sa_sigaction)( 112248: 52 push %edx 112249: 6a 00 push $0x0 11224b: 57 push %edi 11224c: eb 03 jmp 112251 <_POSIX_signals_Check_signal+0x5d> &siginfo_struct, NULL /* context is undefined per 1003.1b-1993, p. 66 */ ); break; default: (*_POSIX_signals_Vectors[ signo ].sa_handler)( signo ); 11224e: 83 ec 0c sub $0xc,%esp 112251: 56 push %esi 112252: ff d0 call *%eax 112254: 83 c4 10 add $0x10,%esp } /* * Restore the previous set of blocked signals */ api->signals_blocked = saved_signals_blocked; 112257: 8b 45 d4 mov -0x2c(%ebp),%eax 11225a: 89 83 cc 00 00 00 mov %eax,0xcc(%ebx) 112260: b0 01 mov $0x1,%al return true; 112262: eb 02 jmp 112266 <_POSIX_signals_Check_signal+0x72> 112264: 31 c0 xor %eax,%eax } 112266: 8d 65 f4 lea -0xc(%ebp),%esp 112269: 5b pop %ebx 11226a: 5e pop %esi 11226b: 5f pop %edi 11226c: c9 leave 11226d: c3 ret =============================================================================== 00112978 <_POSIX_signals_Clear_process_signals>: */ void _POSIX_signals_Clear_process_signals( int signo ) { 112978: 55 push %ebp 112979: 89 e5 mov %esp,%ebp 11297b: 53 push %ebx 11297c: 8b 4d 08 mov 0x8(%ebp),%ecx clear_signal = true; mask = signo_to_mask( signo ); ISR_Level level; _ISR_Disable( level ); 11297f: 9c pushf 112980: fa cli 112981: 5a pop %edx if ( _POSIX_signals_Vectors[ signo ].sa_flags == SA_SIGINFO ) { 112982: 6b c1 0c imul $0xc,%ecx,%eax 112985: 83 b8 68 67 12 00 02 cmpl $0x2,0x126768(%eax) 11298c: 75 0e jne 11299c <_POSIX_signals_Clear_process_signals+0x24> */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 11298e: 8d 98 64 69 12 00 lea 0x126964(%eax),%ebx 112994: 39 98 60 69 12 00 cmp %ebx,0x126960(%eax) 11299a: 75 1d jne 1129b9 <_POSIX_signals_Clear_process_signals+0x41><== NEVER TAKEN if ( !_Chain_Is_empty( &_POSIX_signals_Siginfo[ signo ] ) ) clear_signal = false; } if ( clear_signal ) { _POSIX_signals_Pending &= ~mask; 11299c: 49 dec %ecx 11299d: b8 fe ff ff ff mov $0xfffffffe,%eax 1129a2: d3 c0 rol %cl,%eax 1129a4: 23 05 5c 69 12 00 and 0x12695c,%eax 1129aa: a3 5c 69 12 00 mov %eax,0x12695c if ( !_POSIX_signals_Pending ) 1129af: 85 c0 test %eax,%eax 1129b1: 75 06 jne 1129b9 <_POSIX_signals_Clear_process_signals+0x41><== NEVER TAKEN _Thread_Do_post_task_switch_extension--; 1129b3: ff 0d a8 62 12 00 decl 0x1262a8 } _ISR_Enable( level ); 1129b9: 52 push %edx 1129ba: 9d popf } 1129bb: 5b pop %ebx 1129bc: c9 leave 1129bd: c3 ret =============================================================================== 0010afcc <_POSIX_signals_Get_highest>: #include int _POSIX_signals_Get_highest( sigset_t set ) { 10afcc: 55 push %ebp 10afcd: 89 e5 mov %esp,%ebp 10afcf: 56 push %esi 10afd0: 53 push %ebx 10afd1: 8b 55 08 mov 0x8(%ebp),%edx 10afd4: b8 1b 00 00 00 mov $0x1b,%eax int signo; for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) { if ( set & signo_to_mask( signo ) ) { 10afd9: bb 01 00 00 00 mov $0x1,%ebx 10afde: 8d 48 ff lea -0x1(%eax),%ecx 10afe1: 89 de mov %ebx,%esi 10afe3: d3 e6 shl %cl,%esi 10afe5: 85 d6 test %edx,%esi 10afe7: 75 1e jne 10b007 <_POSIX_signals_Get_highest+0x3b><== NEVER TAKEN sigset_t set ) { int signo; for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) { 10afe9: 40 inc %eax 10afea: 83 f8 20 cmp $0x20,%eax 10afed: 75 ef jne 10afde <_POSIX_signals_Get_highest+0x12> 10afef: b0 01 mov $0x1,%al #if (SIGHUP != 1) #error "Assumption that SIGHUP==1 violated!!" #endif for ( signo = SIGHUP ; signo <= __SIGLASTNOTRT ; signo++ ) { if ( set & signo_to_mask( signo ) ) { 10aff1: bb 01 00 00 00 mov $0x1,%ebx 10aff6: 8d 48 ff lea -0x1(%eax),%ecx 10aff9: 89 de mov %ebx,%esi 10affb: d3 e6 shl %cl,%esi 10affd: 85 d6 test %edx,%esi 10afff: 75 06 jne 10b007 <_POSIX_signals_Get_highest+0x3b> */ #if (SIGHUP != 1) #error "Assumption that SIGHUP==1 violated!!" #endif for ( signo = SIGHUP ; signo <= __SIGLASTNOTRT ; signo++ ) { 10b001: 40 inc %eax 10b002: 83 f8 1b cmp $0x1b,%eax 10b005: 75 ef jne 10aff6 <_POSIX_signals_Get_highest+0x2a><== 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; } 10b007: 5b pop %ebx 10b008: 5e pop %esi 10b009: c9 leave 10b00a: c3 ret =============================================================================== 0010f519 <_POSIX_signals_Post_switch_extension>: */ void _POSIX_signals_Post_switch_extension( Thread_Control *the_thread ) { 10f519: 55 push %ebp 10f51a: 89 e5 mov %esp,%ebp 10f51c: 56 push %esi 10f51d: 53 push %ebx POSIX_API_Control *api; int signo; ISR_Level level; api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 10f51e: 8b 45 08 mov 0x8(%ebp),%eax 10f521: 8b 98 f8 00 00 00 mov 0xf8(%eax),%ebx /* * api may be NULL in case of a thread close in progress */ if ( !api ) 10f527: 85 db test %ebx,%ebx 10f529: 74 6a je 10f595 <_POSIX_signals_Post_switch_extension+0x7c><== NEVER TAKEN * * The first thing done is to check there are any signals to be * processed at all. No point in doing this loop otherwise. */ while (1) { _ISR_Disable( level ); 10f52b: 9c pushf 10f52c: fa cli 10f52d: 59 pop %ecx if ( !(~api->signals_blocked & (api->signals_pending | _POSIX_signals_Pending)) ) { 10f52e: 8b 15 5c 69 12 00 mov 0x12695c,%edx 10f534: 0b 93 d0 00 00 00 or 0xd0(%ebx),%edx * The first thing done is to check there are any signals to be * processed at all. No point in doing this loop otherwise. */ while (1) { _ISR_Disable( level ); if ( !(~api->signals_blocked & 10f53a: 8b 83 cc 00 00 00 mov 0xcc(%ebx),%eax 10f540: f7 d0 not %eax 10f542: 85 c2 test %eax,%edx 10f544: 75 04 jne 10f54a <_POSIX_signals_Post_switch_extension+0x31> (api->signals_pending | _POSIX_signals_Pending)) ) { _ISR_Enable( level ); 10f546: 51 push %ecx 10f547: 9d popf 10f548: eb 4b jmp 10f595 <_POSIX_signals_Post_switch_extension+0x7c> break; } _ISR_Enable( level ); 10f54a: 51 push %ecx 10f54b: 9d popf 10f54c: be 1b 00 00 00 mov $0x1b,%esi for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) { _POSIX_signals_Check_signal( api, signo, false ); 10f551: 52 push %edx 10f552: 6a 00 push $0x0 10f554: 56 push %esi 10f555: 53 push %ebx 10f556: e8 99 2c 00 00 call 1121f4 <_POSIX_signals_Check_signal> _POSIX_signals_Check_signal( api, signo, true ); 10f55b: 83 c4 0c add $0xc,%esp 10f55e: 6a 01 push $0x1 10f560: 56 push %esi 10f561: 53 push %ebx 10f562: e8 8d 2c 00 00 call 1121f4 <_POSIX_signals_Check_signal> _ISR_Enable( level ); break; } _ISR_Enable( level ); for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) { 10f567: 46 inc %esi 10f568: 83 c4 10 add $0x10,%esp 10f56b: 83 fe 20 cmp $0x20,%esi 10f56e: 75 e1 jne 10f551 <_POSIX_signals_Post_switch_extension+0x38> 10f570: 66 be 01 00 mov $0x1,%si _POSIX_signals_Check_signal( api, signo, true ); } /* Unfortunately - nothing like __SIGFIRSTNOTRT in newlib signal .h */ for ( signo = SIGHUP ; signo <= __SIGLASTNOTRT ; signo++ ) { _POSIX_signals_Check_signal( api, signo, false ); 10f574: 50 push %eax 10f575: 6a 00 push $0x0 10f577: 56 push %esi 10f578: 53 push %ebx 10f579: e8 76 2c 00 00 call 1121f4 <_POSIX_signals_Check_signal> _POSIX_signals_Check_signal( api, signo, true ); 10f57e: 83 c4 0c add $0xc,%esp 10f581: 6a 01 push $0x1 10f583: 56 push %esi 10f584: 53 push %ebx 10f585: e8 6a 2c 00 00 call 1121f4 <_POSIX_signals_Check_signal> _POSIX_signals_Check_signal( api, signo, false ); _POSIX_signals_Check_signal( api, signo, true ); } /* Unfortunately - nothing like __SIGFIRSTNOTRT in newlib signal .h */ for ( signo = SIGHUP ; signo <= __SIGLASTNOTRT ; signo++ ) { 10f58a: 46 inc %esi 10f58b: 83 c4 10 add $0x10,%esp 10f58e: 83 fe 1b cmp $0x1b,%esi 10f591: 75 e1 jne 10f574 <_POSIX_signals_Post_switch_extension+0x5b> 10f593: eb 96 jmp 10f52b <_POSIX_signals_Post_switch_extension+0x12> _POSIX_signals_Check_signal( api, signo, false ); _POSIX_signals_Check_signal( api, signo, true ); } } } 10f595: 8d 65 f8 lea -0x8(%ebp),%esp 10f598: 5b pop %ebx 10f599: 5e pop %esi 10f59a: c9 leave 10f59b: c3 ret =============================================================================== 00112380 <_POSIX_signals_Unblock_thread>: bool _POSIX_signals_Unblock_thread( Thread_Control *the_thread, int signo, siginfo_t *info ) { 112380: 55 push %ebp 112381: 89 e5 mov %esp,%ebp 112383: 57 push %edi 112384: 56 push %esi 112385: 53 push %ebx 112386: 83 ec 0c sub $0xc,%esp 112389: 8b 5d 08 mov 0x8(%ebp),%ebx 11238c: 8b 55 0c mov 0xc(%ebp),%edx POSIX_API_Control *api; sigset_t mask; siginfo_t *the_info = NULL; api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 11238f: 8b b3 f8 00 00 00 mov 0xf8(%ebx),%esi 112395: 8d 4a ff lea -0x1(%edx),%ecx 112398: b8 01 00 00 00 mov $0x1,%eax 11239d: d3 e0 shl %cl,%eax /* * Is the thread is specifically waiting for a signal? */ if ( _States_Is_interruptible_signal( the_thread->current_state ) ) { 11239f: 8b 4b 10 mov 0x10(%ebx),%ecx 1123a2: 89 cf mov %ecx,%edi 1123a4: 81 e7 00 80 00 10 and $0x10008000,%edi 1123aa: 81 ff 00 80 00 10 cmp $0x10008000,%edi 1123b0: 75 50 jne 112402 <_POSIX_signals_Unblock_thread+0x82> if ( (the_thread->Wait.option & mask) || (~api->signals_blocked & mask) ) { 1123b2: 85 43 30 test %eax,0x30(%ebx) 1123b5: 75 10 jne 1123c7 <_POSIX_signals_Unblock_thread+0x47> 1123b7: 8b 8e cc 00 00 00 mov 0xcc(%esi),%ecx 1123bd: f7 d1 not %ecx 1123bf: 85 c8 test %ecx,%eax 1123c1: 0f 84 a4 00 00 00 je 11246b <_POSIX_signals_Unblock_thread+0xeb> the_thread->Wait.return_code = EINTR; 1123c7: c7 43 34 04 00 00 00 movl $0x4,0x34(%ebx) the_info = (siginfo_t *) the_thread->Wait.return_argument; 1123ce: 8b 43 28 mov 0x28(%ebx),%eax if ( !info ) { 1123d1: 83 7d 10 00 cmpl $0x0,0x10(%ebp) 1123d5: 75 12 jne 1123e9 <_POSIX_signals_Unblock_thread+0x69> the_info->si_signo = signo; 1123d7: 89 10 mov %edx,(%eax) the_info->si_code = SI_USER; 1123d9: c7 40 04 01 00 00 00 movl $0x1,0x4(%eax) the_info->si_value.sival_int = 0; 1123e0: c7 40 08 00 00 00 00 movl $0x0,0x8(%eax) 1123e7: eb 0c jmp 1123f5 <_POSIX_signals_Unblock_thread+0x75> } else { *the_info = *info; 1123e9: b9 03 00 00 00 mov $0x3,%ecx 1123ee: 89 c7 mov %eax,%edi 1123f0: 8b 75 10 mov 0x10(%ebp),%esi 1123f3: f3 a5 rep movsl %ds:(%esi),%es:(%edi) } _Thread_queue_Extract_with_proxy( the_thread ); 1123f5: 83 ec 0c sub $0xc,%esp 1123f8: 53 push %ebx 1123f9: e8 9e a5 ff ff call 10c99c <_Thread_queue_Extract_with_proxy> 1123fe: b0 01 mov $0x1,%al 112400: eb 48 jmp 11244a <_POSIX_signals_Unblock_thread+0xca> } /* * Thread is not waiting due to a sigwait. */ if ( ~api->signals_blocked & mask ) { 112402: 8b 96 cc 00 00 00 mov 0xcc(%esi),%edx 112408: f7 d2 not %edx 11240a: 85 d0 test %edx,%eax 11240c: 74 5d je 11246b <_POSIX_signals_Unblock_thread+0xeb> * it is not blocked, THEN * we need to dispatch at the end of this ISR. * + Any other combination, do nothing. */ the_thread->do_post_task_switch_extension = true; 11240e: c6 43 74 01 movb $0x1,0x74(%ebx) if ( the_thread->current_state & STATES_INTERRUPTIBLE_BY_SIGNAL ) { 112412: f7 c1 00 00 00 10 test $0x10000000,%ecx 112418: 74 35 je 11244f <_POSIX_signals_Unblock_thread+0xcf> the_thread->Wait.return_code = EINTR; 11241a: c7 43 34 04 00 00 00 movl $0x4,0x34(%ebx) #if 0 if ( _States_Is_waiting_on_thread_queue(the_thread->current_state) ) _Thread_queue_Extract_with_proxy( the_thread ); else #endif if ( _States_Is_delaying(the_thread->current_state) ){ 112421: 80 e1 08 and $0x8,%cl 112424: 74 45 je 11246b <_POSIX_signals_Unblock_thread+0xeb><== NEVER TAKEN if ( _Watchdog_Is_active( &the_thread->Timer ) ) 112426: 83 7b 50 02 cmpl $0x2,0x50(%ebx) 11242a: 75 0f jne 11243b <_POSIX_signals_Unblock_thread+0xbb><== NEVER TAKEN (void) _Watchdog_Remove( &the_thread->Timer ); 11242c: 83 ec 0c sub $0xc,%esp 11242f: 8d 43 48 lea 0x48(%ebx),%eax 112432: 50 push %eax 112433: e8 e0 ad ff ff call 10d218 <_Watchdog_Remove> 112438: 83 c4 10 add $0x10,%esp RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 11243b: 50 push %eax 11243c: 50 push %eax 11243d: 68 f8 ff 03 10 push $0x1003fff8 112442: 53 push %ebx 112443: e8 58 9b ff ff call 10bfa0 <_Thread_Clear_state> 112448: 31 c0 xor %eax,%eax 11244a: 83 c4 10 add $0x10,%esp 11244d: eb 1e jmp 11246d <_POSIX_signals_Unblock_thread+0xed> _Thread_Unblock( the_thread ); } } else if ( the_thread->current_state == STATES_READY ) { 11244f: 85 c9 test %ecx,%ecx 112451: 75 18 jne 11246b <_POSIX_signals_Unblock_thread+0xeb><== NEVER TAKEN if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) 112453: a1 a0 62 12 00 mov 0x1262a0,%eax 112458: 85 c0 test %eax,%eax 11245a: 74 0f je 11246b <_POSIX_signals_Unblock_thread+0xeb> 11245c: 3b 1d c4 62 12 00 cmp 0x1262c4,%ebx 112462: 75 07 jne 11246b <_POSIX_signals_Unblock_thread+0xeb><== NEVER TAKEN _ISR_Signals_to_thread_executing = true; 112464: c6 05 58 63 12 00 01 movb $0x1,0x126358 11246b: 31 c0 xor %eax,%eax } } return false; } 11246d: 8d 65 f4 lea -0xc(%ebp),%esp 112470: 5b pop %ebx 112471: 5e pop %esi 112472: 5f pop %edi 112473: c9 leave 112474: c3 ret =============================================================================== 0010fd32 <_RTEMS_tasks_Post_switch_extension>: */ void _RTEMS_tasks_Post_switch_extension( Thread_Control *executing ) { 10fd32: 55 push %ebp 10fd33: 89 e5 mov %esp,%ebp 10fd35: 57 push %edi 10fd36: 56 push %esi 10fd37: 53 push %ebx 10fd38: 83 ec 1c sub $0x1c,%esp RTEMS_API_Control *api; ASR_Information *asr; rtems_signal_set signal_set; Modes_Control prev_mode; api = executing->API_Extensions[ THREAD_API_RTEMS ]; 10fd3b: 8b 45 08 mov 0x8(%ebp),%eax 10fd3e: 8b 98 f4 00 00 00 mov 0xf4(%eax),%ebx if ( !api ) 10fd44: 85 db test %ebx,%ebx 10fd46: 74 45 je 10fd8d <_RTEMS_tasks_Post_switch_extension+0x5b><== NEVER TAKEN * Signal Processing */ asr = &api->Signal; _ISR_Disable( level ); 10fd48: 9c pushf 10fd49: fa cli 10fd4a: 58 pop %eax signal_set = asr->signals_posted; 10fd4b: 8b 7b 14 mov 0x14(%ebx),%edi asr->signals_posted = 0; 10fd4e: c7 43 14 00 00 00 00 movl $0x0,0x14(%ebx) _ISR_Enable( level ); 10fd55: 50 push %eax 10fd56: 9d popf if ( !signal_set ) /* similar to _ASR_Are_signals_pending( asr ) */ 10fd57: 85 ff test %edi,%edi 10fd59: 74 32 je 10fd8d <_RTEMS_tasks_Post_switch_extension+0x5b> return; asr->nest_level += 1; 10fd5b: ff 43 1c incl 0x1c(%ebx) rtems_task_mode( asr->mode_set, RTEMS_ALL_MODE_MASKS, &prev_mode ); 10fd5e: 50 push %eax 10fd5f: 8d 75 e4 lea -0x1c(%ebp),%esi 10fd62: 56 push %esi 10fd63: 68 ff ff 00 00 push $0xffff 10fd68: ff 73 10 pushl 0x10(%ebx) 10fd6b: e8 54 28 00 00 call 1125c4 (*asr->handler)( signal_set ); 10fd70: 89 3c 24 mov %edi,(%esp) 10fd73: ff 53 0c call *0xc(%ebx) asr->nest_level -= 1; 10fd76: ff 4b 1c decl 0x1c(%ebx) rtems_task_mode( prev_mode, RTEMS_ALL_MODE_MASKS, &prev_mode ); 10fd79: 83 c4 0c add $0xc,%esp 10fd7c: 56 push %esi 10fd7d: 68 ff ff 00 00 push $0xffff 10fd82: ff 75 e4 pushl -0x1c(%ebp) 10fd85: e8 3a 28 00 00 call 1125c4 10fd8a: 83 c4 10 add $0x10,%esp } 10fd8d: 8d 65 f4 lea -0xc(%ebp),%esp 10fd90: 5b pop %ebx 10fd91: 5e pop %esi 10fd92: 5f pop %edi 10fd93: c9 leave 10fd94: c3 ret =============================================================================== 0010b7e0 <_Rate_monotonic_Timeout>: void _Rate_monotonic_Timeout( Objects_Id id, void *ignored ) { 10b7e0: 55 push %ebp 10b7e1: 89 e5 mov %esp,%ebp 10b7e3: 53 push %ebx 10b7e4: 83 ec 18 sub $0x18,%esp 10b7e7: 8d 45 f4 lea -0xc(%ebp),%eax 10b7ea: 50 push %eax 10b7eb: ff 75 08 pushl 0x8(%ebp) 10b7ee: 68 14 92 12 00 push $0x129214 10b7f3: e8 78 1a 00 00 call 10d270 <_Objects_Get> 10b7f8: 89 c3 mov %eax,%ebx /* * 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 ) { 10b7fa: 83 c4 10 add $0x10,%esp 10b7fd: 83 7d f4 00 cmpl $0x0,-0xc(%ebp) 10b801: 75 64 jne 10b867 <_Rate_monotonic_Timeout+0x87><== NEVER TAKEN case OBJECTS_LOCAL: the_thread = the_period->owner; 10b803: 8b 40 40 mov 0x40(%eax),%eax if ( _States_Is_waiting_for_period( the_thread->current_state ) && 10b806: f6 40 11 40 testb $0x40,0x11(%eax) 10b80a: 74 18 je 10b824 <_Rate_monotonic_Timeout+0x44> the_thread->Wait.id == the_period->Object.id ) { 10b80c: 8b 50 20 mov 0x20(%eax),%edx 10b80f: 3b 53 08 cmp 0x8(%ebx),%edx 10b812: 75 10 jne 10b824 <_Rate_monotonic_Timeout+0x44> RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 10b814: 52 push %edx 10b815: 52 push %edx 10b816: 68 f8 ff 03 10 push $0x1003fff8 10b81b: 50 push %eax 10b81c: e8 c3 1e 00 00 call 10d6e4 <_Thread_Clear_state> _Thread_Unblock( the_thread ); _Rate_monotonic_Initiate_statistics( the_period ); 10b821: 59 pop %ecx 10b822: eb 10 jmp 10b834 <_Rate_monotonic_Timeout+0x54> _Watchdog_Insert_ticks( &the_period->Timer, the_period->next_length ); } else if ( the_period->state == RATE_MONOTONIC_OWNER_IS_BLOCKING ) { 10b824: 83 7b 38 01 cmpl $0x1,0x38(%ebx) 10b828: 75 2b jne 10b855 <_Rate_monotonic_Timeout+0x75> the_period->state = RATE_MONOTONIC_EXPIRED_WHILE_BLOCKING; 10b82a: c7 43 38 03 00 00 00 movl $0x3,0x38(%ebx) _Rate_monotonic_Initiate_statistics( the_period ); 10b831: 83 ec 0c sub $0xc,%esp 10b834: 53 push %ebx 10b835: e8 56 fa ff ff call 10b290 <_Rate_monotonic_Initiate_statistics> Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 10b83a: 8b 43 3c mov 0x3c(%ebx),%eax 10b83d: 89 43 1c mov %eax,0x1c(%ebx) _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 10b840: 58 pop %eax 10b841: 5a pop %edx 10b842: 83 c3 10 add $0x10,%ebx 10b845: 53 push %ebx 10b846: 68 e8 93 12 00 push $0x1293e8 10b84b: e8 b8 31 00 00 call 10ea08 <_Watchdog_Insert> 10b850: 83 c4 10 add $0x10,%esp 10b853: eb 07 jmp 10b85c <_Rate_monotonic_Timeout+0x7c> _Watchdog_Insert_ticks( &the_period->Timer, the_period->next_length ); } else the_period->state = RATE_MONOTONIC_EXPIRED; 10b855: c7 43 38 04 00 00 00 movl $0x4,0x38(%ebx) */ RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void ) { RTEMS_COMPILER_MEMORY_BARRIER(); _Thread_Dispatch_disable_level -= 1; 10b85c: a1 0c 93 12 00 mov 0x12930c,%eax 10b861: 48 dec %eax 10b862: a3 0c 93 12 00 mov %eax,0x12930c case OBJECTS_REMOTE: /* impossible */ #endif case OBJECTS_ERROR: break; } } 10b867: 8b 5d fc mov -0x4(%ebp),%ebx 10b86a: c9 leave 10b86b: c3 ret =============================================================================== 0010b108 <_TOD_Validate>: */ bool _TOD_Validate( const rtems_time_of_day *the_tod ) { 10b108: 55 push %ebp 10b109: 89 e5 mov %esp,%ebp 10b10b: 53 push %ebx 10b10c: 8b 4d 08 mov 0x8(%ebp),%ecx uint32_t days_in_month; uint32_t ticks_per_second; ticks_per_second = TOD_MICROSECONDS_PER_SECOND / rtems_configuration_get_microseconds_per_tick(); 10b10f: 8b 1d 44 5b 12 00 mov 0x125b44,%ebx if ((!the_tod) || 10b115: 85 c9 test %ecx,%ecx 10b117: 74 59 je 10b172 <_TOD_Validate+0x6a> <== NEVER TAKEN (the_tod->ticks >= ticks_per_second) || 10b119: b8 40 42 0f 00 mov $0xf4240,%eax 10b11e: 31 d2 xor %edx,%edx 10b120: f7 f3 div %ebx 10b122: 39 41 18 cmp %eax,0x18(%ecx) 10b125: 73 4b jae 10b172 <_TOD_Validate+0x6a> (the_tod->second >= TOD_SECONDS_PER_MINUTE) || 10b127: 83 79 14 3b cmpl $0x3b,0x14(%ecx) 10b12b: 77 45 ja 10b172 <_TOD_Validate+0x6a> (the_tod->minute >= TOD_MINUTES_PER_HOUR) || 10b12d: 83 79 10 3b cmpl $0x3b,0x10(%ecx) 10b131: 77 3f ja 10b172 <_TOD_Validate+0x6a> (the_tod->hour >= TOD_HOURS_PER_DAY) || 10b133: 83 79 0c 17 cmpl $0x17,0xc(%ecx) 10b137: 77 39 ja 10b172 <_TOD_Validate+0x6a> (the_tod->month == 0) || 10b139: 8b 41 04 mov 0x4(%ecx),%eax 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) || 10b13c: 85 c0 test %eax,%eax 10b13e: 74 32 je 10b172 <_TOD_Validate+0x6a> <== NEVER TAKEN 10b140: 83 f8 0c cmp $0xc,%eax 10b143: 77 2d ja 10b172 <_TOD_Validate+0x6a> (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) || 10b145: 8b 19 mov (%ecx),%ebx 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) || 10b147: 81 fb c3 07 00 00 cmp $0x7c3,%ebx 10b14d: 76 23 jbe 10b172 <_TOD_Validate+0x6a> (the_tod->minute >= TOD_MINUTES_PER_HOUR) || (the_tod->hour >= TOD_HOURS_PER_DAY) || (the_tod->month == 0) || (the_tod->month > TOD_MONTHS_PER_YEAR) || (the_tod->year < TOD_BASE_YEAR) || (the_tod->day == 0) ) 10b14f: 8b 51 08 mov 0x8(%ecx),%edx 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) || 10b152: 85 d2 test %edx,%edx 10b154: 74 1c je 10b172 <_TOD_Validate+0x6a> <== NEVER TAKEN (the_tod->month > TOD_MONTHS_PER_YEAR) || (the_tod->year < TOD_BASE_YEAR) || (the_tod->day == 0) ) return false; if ( (the_tod->year % 4) == 0 ) 10b156: 80 e3 03 and $0x3,%bl 10b159: 75 09 jne 10b164 <_TOD_Validate+0x5c> days_in_month = _TOD_Days_per_month[ 1 ][ the_tod->month ]; 10b15b: 8b 04 85 08 2a 12 00 mov 0x122a08(,%eax,4),%eax 10b162: eb 07 jmp 10b16b <_TOD_Validate+0x63> else days_in_month = _TOD_Days_per_month[ 0 ][ the_tod->month ]; 10b164: 8b 04 85 d4 29 12 00 mov 0x1229d4(,%eax,4),%eax * false - if the the_tod is invalid * * NOTE: This routine only works for leap-years through 2099. */ bool _TOD_Validate( 10b16b: 39 c2 cmp %eax,%edx 10b16d: 0f 96 c0 setbe %al 10b170: eb 02 jmp 10b174 <_TOD_Validate+0x6c> 10b172: 31 c0 xor %eax,%eax if ( the_tod->day > days_in_month ) return false; return true; } 10b174: 5b pop %ebx 10b175: c9 leave 10b176: c3 ret =============================================================================== 0010be80 <_Thread_Change_priority>: void _Thread_Change_priority( Thread_Control *the_thread, Priority_Control new_priority, bool prepend_it ) { 10be80: 55 push %ebp 10be81: 89 e5 mov %esp,%ebp 10be83: 57 push %edi 10be84: 56 push %esi 10be85: 53 push %ebx 10be86: 83 ec 28 sub $0x28,%esp 10be89: 8b 5d 08 mov 0x8(%ebp),%ebx 10be8c: 8b 7d 0c mov 0xc(%ebp),%edi 10be8f: 8a 45 10 mov 0x10(%ebp),%al 10be92: 88 45 e7 mov %al,-0x19(%ebp) */ /* * Save original state */ original_state = the_thread->current_state; 10be95: 8b 73 10 mov 0x10(%ebx),%esi /* * 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 ); 10be98: 53 push %ebx 10be99: e8 5e 0d 00 00 call 10cbfc <_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 ) 10be9e: 83 c4 10 add $0x10,%esp 10bea1: 39 7b 14 cmp %edi,0x14(%ebx) 10bea4: 74 0c je 10beb2 <_Thread_Change_priority+0x32> _Thread_Set_priority( the_thread, new_priority ); 10bea6: 50 push %eax 10bea7: 50 push %eax 10bea8: 57 push %edi 10bea9: 53 push %ebx 10beaa: e8 15 0c 00 00 call 10cac4 <_Thread_Set_priority> 10beaf: 83 c4 10 add $0x10,%esp _ISR_Disable( level ); 10beb2: 9c pushf 10beb3: fa cli 10beb4: 59 pop %ecx /* * 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; 10beb5: 8b 43 10 mov 0x10(%ebx),%eax if ( state != STATES_TRANSIENT ) { 10beb8: 83 f8 04 cmp $0x4,%eax 10bebb: 74 2f je 10beec <_Thread_Change_priority+0x6c> /* Only clear the transient state if it wasn't set already */ if ( ! _States_Is_transient( original_state ) ) 10bebd: 83 e6 04 and $0x4,%esi 10bec0: 75 08 jne 10beca <_Thread_Change_priority+0x4a><== NEVER TAKEN the_thread->current_state = _States_Clear( STATES_TRANSIENT, state ); 10bec2: 89 c2 mov %eax,%edx 10bec4: 83 e2 fb and $0xfffffffb,%edx 10bec7: 89 53 10 mov %edx,0x10(%ebx) _ISR_Enable( level ); 10beca: 51 push %ecx 10becb: 9d popf if ( _States_Is_waiting_on_thread_queue( state ) ) { 10becc: a9 e0 be 03 00 test $0x3bee0,%eax 10bed1: 0f 84 c0 00 00 00 je 10bf97 <_Thread_Change_priority+0x117> _Thread_queue_Requeue( the_thread->Wait.queue, the_thread ); 10bed7: 89 5d 0c mov %ebx,0xc(%ebp) 10beda: 8b 43 44 mov 0x44(%ebx),%eax 10bedd: 89 45 08 mov %eax,0x8(%ebp) if ( !_Thread_Is_executing_also_the_heir() && _Thread_Executing->is_preemptible ) _Context_Switch_necessary = true; _ISR_Enable( level ); } 10bee0: 8d 65 f4 lea -0xc(%ebp),%esp 10bee3: 5b pop %ebx 10bee4: 5e pop %esi 10bee5: 5f pop %edi 10bee6: c9 leave /* Only clear the transient state if it wasn't set already */ if ( ! _States_Is_transient( original_state ) ) the_thread->current_state = _States_Clear( STATES_TRANSIENT, state ); _ISR_Enable( level ); if ( _States_Is_waiting_on_thread_queue( state ) ) { _Thread_queue_Requeue( the_thread->Wait.queue, the_thread ); 10bee7: e9 50 0b 00 00 jmp 10ca3c <_Thread_queue_Requeue> } return; } /* Only clear the transient state if it wasn't set already */ if ( ! _States_Is_transient( original_state ) ) { 10beec: 83 e6 04 and $0x4,%esi 10beef: 75 53 jne 10bf44 <_Thread_Change_priority+0xc4><== NEVER TAKEN * Interrupts are STILL disabled. * We now know the thread will be in the READY state when we remove * the TRANSIENT state. So we have to place it on the appropriate * Ready Queue with interrupts off. */ the_thread->current_state = _States_Clear( STATES_TRANSIENT, state ); 10bef1: c7 43 10 00 00 00 00 movl $0x0,0x10(%ebx) RTEMS_INLINE_ROUTINE void _Priority_Add_to_bit_map ( Priority_Information *the_priority_map ) { *the_priority_map->minor |= the_priority_map->ready_minor; 10bef8: 8b 83 90 00 00 00 mov 0x90(%ebx),%eax 10befe: 66 8b 93 96 00 00 00 mov 0x96(%ebx),%dx 10bf05: 66 09 10 or %dx,(%eax) _Priority_Major_bit_map |= the_priority_map->ready_major; 10bf08: 66 a1 b8 62 12 00 mov 0x1262b8,%ax 10bf0e: 0b 83 94 00 00 00 or 0x94(%ebx),%eax 10bf14: 66 a3 b8 62 12 00 mov %ax,0x1262b8 _Priority_Add_to_bit_map( &the_thread->Priority_map ); if ( prepend_it ) 10bf1a: 80 7d e7 00 cmpb $0x0,-0x19(%ebp) 10bf1e: 8b 83 8c 00 00 00 mov 0x8c(%ebx),%eax 10bf24: 74 0e je 10bf34 <_Thread_Change_priority+0xb4> Chain_Node *the_node ) { Chain_Node *before_node; the_node->previous = after_node; 10bf26: 89 43 04 mov %eax,0x4(%ebx) before_node = after_node->next; 10bf29: 8b 10 mov (%eax),%edx after_node->next = the_node; 10bf2b: 89 18 mov %ebx,(%eax) the_node->next = before_node; 10bf2d: 89 13 mov %edx,(%ebx) before_node->previous = the_node; 10bf2f: 89 5a 04 mov %ebx,0x4(%edx) 10bf32: eb 10 jmp 10bf44 <_Thread_Change_priority+0xc4> Chain_Node *the_node ) { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); 10bf34: 8d 50 04 lea 0x4(%eax),%edx 10bf37: 89 13 mov %edx,(%ebx) old_last_node = the_chain->last; 10bf39: 8b 50 08 mov 0x8(%eax),%edx the_chain->last = the_node; 10bf3c: 89 58 08 mov %ebx,0x8(%eax) old_last_node->next = the_node; 10bf3f: 89 1a mov %ebx,(%edx) the_node->previous = old_last_node; 10bf41: 89 53 04 mov %edx,0x4(%ebx) _Chain_Prepend_unprotected( the_thread->ready, &the_thread->Object.Node ); else _Chain_Append_unprotected( the_thread->ready, &the_thread->Object.Node ); } _ISR_Flash( level ); 10bf44: 51 push %ecx 10bf45: 9d popf 10bf46: fa cli RTEMS_INLINE_ROUTINE Priority_Control _Priority_Get_highest( void ) { Priority_Bit_map_control minor; Priority_Bit_map_control major; _Bitfield_Find_first_bit( _Priority_Major_bit_map, major ); 10bf47: 66 8b 1d b8 62 12 00 mov 0x1262b8,%bx 10bf4e: 31 c0 xor %eax,%eax 10bf50: 89 c2 mov %eax,%edx 10bf52: 66 0f bc d3 bsf %bx,%dx _Bitfield_Find_first_bit( _Priority_Bit_map[major], minor ); 10bf56: 0f b7 d2 movzwl %dx,%edx 10bf59: 66 8b 9c 12 30 63 12 mov 0x126330(%edx,%edx,1),%bx 10bf60: 00 10bf61: 66 0f bc c3 bsf %bx,%ax * ready thread. */ RTEMS_INLINE_ROUTINE void _Thread_Calculate_heir( void ) { _Thread_Heir = (Thread_Control *) 10bf65: c1 e2 04 shl $0x4,%edx 10bf68: 0f b7 c0 movzwl %ax,%eax 10bf6b: 01 c2 add %eax,%edx 10bf6d: 6b d2 0c imul $0xc,%edx,%edx 10bf70: 8b 1d d0 61 12 00 mov 0x1261d0,%ebx 10bf76: 8b 14 1a mov (%edx,%ebx,1),%edx 10bf79: 89 15 94 62 12 00 mov %edx,0x126294 * is also the heir thread, and false otherwise. */ RTEMS_INLINE_ROUTINE bool _Thread_Is_executing_also_the_heir( void ) { return ( _Thread_Executing == _Thread_Heir ); 10bf7f: a1 c4 62 12 00 mov 0x1262c4,%eax * We altered the set of thread priorities. So let's figure out * who is the heir and if we need to switch to them. */ _Thread_Calculate_heir(); if ( !_Thread_Is_executing_also_the_heir() && 10bf84: 39 d0 cmp %edx,%eax 10bf86: 74 0d je 10bf95 <_Thread_Change_priority+0x115> _Thread_Executing->is_preemptible ) 10bf88: 80 78 75 00 cmpb $0x0,0x75(%eax) 10bf8c: 74 07 je 10bf95 <_Thread_Change_priority+0x115> _Context_Switch_necessary = true; 10bf8e: c6 05 d4 62 12 00 01 movb $0x1,0x1262d4 _ISR_Enable( level ); 10bf95: 51 push %ecx 10bf96: 9d popf } 10bf97: 8d 65 f4 lea -0xc(%ebp),%esp 10bf9a: 5b pop %ebx 10bf9b: 5e pop %esi 10bf9c: 5f pop %edi 10bf9d: c9 leave 10bf9e: c3 ret =============================================================================== 0010bfa0 <_Thread_Clear_state>: void _Thread_Clear_state( Thread_Control *the_thread, States_Control state ) { 10bfa0: 55 push %ebp 10bfa1: 89 e5 mov %esp,%ebp 10bfa3: 53 push %ebx 10bfa4: 8b 45 08 mov 0x8(%ebp),%eax 10bfa7: 8b 55 0c mov 0xc(%ebp),%edx ISR_Level level; States_Control current_state; _ISR_Disable( level ); 10bfaa: 9c pushf 10bfab: fa cli 10bfac: 59 pop %ecx current_state = the_thread->current_state; 10bfad: 8b 58 10 mov 0x10(%eax),%ebx if ( current_state & state ) { 10bfb0: 85 da test %ebx,%edx 10bfb2: 74 71 je 10c025 <_Thread_Clear_state+0x85> RTEMS_INLINE_ROUTINE States_Control _States_Clear ( States_Control states_to_clear, States_Control current_state ) { return (current_state & ~states_to_clear); 10bfb4: f7 d2 not %edx 10bfb6: 21 da and %ebx,%edx current_state = 10bfb8: 89 50 10 mov %edx,0x10(%eax) the_thread->current_state = _States_Clear( state, current_state ); if ( _States_Is_ready( current_state ) ) { 10bfbb: 85 d2 test %edx,%edx 10bfbd: 75 66 jne 10c025 <_Thread_Clear_state+0x85> RTEMS_INLINE_ROUTINE void _Priority_Add_to_bit_map ( Priority_Information *the_priority_map ) { *the_priority_map->minor |= the_priority_map->ready_minor; 10bfbf: 8b 90 90 00 00 00 mov 0x90(%eax),%edx 10bfc5: 66 8b 98 96 00 00 00 mov 0x96(%eax),%bx 10bfcc: 66 09 1a or %bx,(%edx) _Priority_Major_bit_map |= the_priority_map->ready_major; 10bfcf: 66 8b 15 b8 62 12 00 mov 0x1262b8,%dx 10bfd6: 0b 90 94 00 00 00 or 0x94(%eax),%edx 10bfdc: 66 89 15 b8 62 12 00 mov %dx,0x1262b8 _Priority_Add_to_bit_map( &the_thread->Priority_map ); _Chain_Append_unprotected(the_thread->ready, &the_thread->Object.Node); 10bfe3: 8b 90 8c 00 00 00 mov 0x8c(%eax),%edx Chain_Node *the_node ) { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); 10bfe9: 8d 5a 04 lea 0x4(%edx),%ebx 10bfec: 89 18 mov %ebx,(%eax) old_last_node = the_chain->last; 10bfee: 8b 5a 08 mov 0x8(%edx),%ebx the_chain->last = the_node; 10bff1: 89 42 08 mov %eax,0x8(%edx) old_last_node->next = the_node; 10bff4: 89 03 mov %eax,(%ebx) the_node->previous = old_last_node; 10bff6: 89 58 04 mov %ebx,0x4(%eax) _ISR_Flash( level ); 10bff9: 51 push %ecx 10bffa: 9d popf 10bffb: fa cli * a context switch. * Pseudo-ISR case: * Even if the thread isn't preemptible, if the new heir is * a pseudo-ISR system task, we need to do a context switch. */ if ( the_thread->current_priority < _Thread_Heir->current_priority ) { 10bffc: 8b 50 14 mov 0x14(%eax),%edx 10bfff: 8b 1d 94 62 12 00 mov 0x126294,%ebx 10c005: 3b 53 14 cmp 0x14(%ebx),%edx 10c008: 73 1b jae 10c025 <_Thread_Clear_state+0x85> _Thread_Heir = the_thread; 10c00a: a3 94 62 12 00 mov %eax,0x126294 if ( _Thread_Executing->is_preemptible || 10c00f: a1 c4 62 12 00 mov 0x1262c4,%eax 10c014: 80 78 75 00 cmpb $0x0,0x75(%eax) 10c018: 75 04 jne 10c01e <_Thread_Clear_state+0x7e> 10c01a: 85 d2 test %edx,%edx 10c01c: 75 07 jne 10c025 <_Thread_Clear_state+0x85><== ALWAYS TAKEN the_thread->current_priority == 0 ) _Context_Switch_necessary = true; 10c01e: c6 05 d4 62 12 00 01 movb $0x1,0x1262d4 } } } _ISR_Enable( level ); 10c025: 51 push %ecx 10c026: 9d popf } 10c027: 5b pop %ebx 10c028: c9 leave 10c029: c3 ret =============================================================================== 0010c1a0 <_Thread_Delay_ended>: void _Thread_Delay_ended( Objects_Id id, void *ignored __attribute__((unused)) ) { 10c1a0: 55 push %ebp 10c1a1: 89 e5 mov %esp,%ebp 10c1a3: 83 ec 20 sub $0x20,%esp Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); 10c1a6: 8d 45 f4 lea -0xc(%ebp),%eax 10c1a9: 50 push %eax 10c1aa: ff 75 08 pushl 0x8(%ebp) 10c1ad: e8 8e 01 00 00 call 10c340 <_Thread_Get> switch ( location ) { 10c1b2: 83 c4 10 add $0x10,%esp 10c1b5: 83 7d f4 00 cmpl $0x0,-0xc(%ebp) 10c1b9: 75 1b jne 10c1d6 <_Thread_Delay_ended+0x36><== NEVER TAKEN #if defined(RTEMS_MULTIPROCESSING) case OBJECTS_REMOTE: /* impossible */ #endif break; case OBJECTS_LOCAL: _Thread_Clear_state( 10c1bb: 52 push %edx 10c1bc: 52 push %edx 10c1bd: 68 18 00 00 10 push $0x10000018 10c1c2: 50 push %eax 10c1c3: e8 d8 fd ff ff call 10bfa0 <_Thread_Clear_state> 10c1c8: a1 08 62 12 00 mov 0x126208,%eax 10c1cd: 48 dec %eax 10c1ce: a3 08 62 12 00 mov %eax,0x126208 10c1d3: 83 c4 10 add $0x10,%esp | STATES_INTERRUPTIBLE_BY_SIGNAL ); _Thread_Unnest_dispatch(); break; } } 10c1d6: c9 leave 10c1d7: c3 ret =============================================================================== 0010c1d8 <_Thread_Dispatch>: * dispatch thread * no dispatch thread */ void _Thread_Dispatch( void ) { 10c1d8: 55 push %ebp 10c1d9: 89 e5 mov %esp,%ebp 10c1db: 57 push %edi 10c1dc: 56 push %esi 10c1dd: 53 push %ebx 10c1de: 83 ec 1c sub $0x1c,%esp Thread_Control *executing; Thread_Control *heir; ISR_Level level; executing = _Thread_Executing; 10c1e1: 8b 1d c4 62 12 00 mov 0x1262c4,%ebx _ISR_Disable( level ); 10c1e7: 9c pushf 10c1e8: fa cli 10c1e9: 58 pop %eax #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ { Timestamp_Control uptime, ran; _TOD_Get_uptime( &uptime ); _Timestamp_Subtract( 10c1ea: 8d 7d d8 lea -0x28(%ebp),%edi Thread_Control *heir; ISR_Level level; executing = _Thread_Executing; _ISR_Disable( level ); while ( _Context_Switch_necessary == true ) { 10c1ed: e9 f1 00 00 00 jmp 10c2e3 <_Thread_Dispatch+0x10b> heir = _Thread_Heir; 10c1f2: 8b 35 94 62 12 00 mov 0x126294,%esi _Thread_Dispatch_disable_level = 1; 10c1f8: c7 05 08 62 12 00 01 movl $0x1,0x126208 10c1ff: 00 00 00 _Context_Switch_necessary = false; 10c202: c6 05 d4 62 12 00 00 movb $0x0,0x1262d4 _Thread_Executing = heir; 10c209: 89 35 c4 62 12 00 mov %esi,0x1262c4 #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 ) 10c20f: 83 7e 7c 01 cmpl $0x1,0x7c(%esi) 10c213: 75 09 jne 10c21e <_Thread_Dispatch+0x46> heir->cpu_time_budget = _Thread_Ticks_per_timeslice; 10c215: 8b 15 d4 61 12 00 mov 0x1261d4,%edx 10c21b: 89 56 78 mov %edx,0x78(%esi) _ISR_Enable( level ); 10c21e: 50 push %eax 10c21f: 9d popf #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ { Timestamp_Control uptime, ran; _TOD_Get_uptime( &uptime ); 10c220: 83 ec 0c sub $0xc,%esp 10c223: 8d 45 e0 lea -0x20(%ebp),%eax 10c226: 50 push %eax 10c227: e8 dc 3f 00 00 call 110208 <_TOD_Get_uptime> _Timestamp_Subtract( 10c22c: 83 c4 0c add $0xc,%esp 10c22f: 57 push %edi 10c230: 8d 45 e0 lea -0x20(%ebp),%eax 10c233: 50 push %eax 10c234: 68 cc 62 12 00 push $0x1262cc 10c239: e8 5e 0c 00 00 call 10ce9c <_Timespec_Subtract> &_Thread_Time_of_last_context_switch, &uptime, &ran ); _Timestamp_Add_to( &executing->cpu_time_used, &ran ); 10c23e: 58 pop %eax 10c23f: 5a pop %edx 10c240: 57 push %edi 10c241: 8d 83 84 00 00 00 lea 0x84(%ebx),%eax 10c247: 50 push %eax 10c248: e8 1f 0c 00 00 call 10ce6c <_Timespec_Add_to> _Thread_Time_of_last_context_switch = uptime; 10c24d: 8b 45 e0 mov -0x20(%ebp),%eax 10c250: 8b 55 e4 mov -0x1c(%ebp),%edx 10c253: a3 cc 62 12 00 mov %eax,0x1262cc 10c258: 89 15 d0 62 12 00 mov %edx,0x1262d0 #endif /* * Switch libc's task specific data. */ if ( _Thread_libc_reent ) { 10c25e: a1 90 62 12 00 mov 0x126290,%eax 10c263: 83 c4 10 add $0x10,%esp 10c266: 85 c0 test %eax,%eax 10c268: 74 10 je 10c27a <_Thread_Dispatch+0xa2> <== NEVER TAKEN executing->libc_reent = *_Thread_libc_reent; 10c26a: 8b 10 mov (%eax),%edx 10c26c: 89 93 f0 00 00 00 mov %edx,0xf0(%ebx) *_Thread_libc_reent = heir->libc_reent; 10c272: 8b 96 f0 00 00 00 mov 0xf0(%esi),%edx 10c278: 89 10 mov %edx,(%eax) } _User_extensions_Thread_switch( executing, heir ); 10c27a: 51 push %ecx 10c27b: 51 push %ecx 10c27c: 56 push %esi 10c27d: 53 push %ebx 10c27e: e8 49 0e 00 00 call 10d0cc <_User_extensions_Thread_switch> if ( executing->fp_context != NULL ) _Context_Save_fp( &executing->fp_context ); #endif #endif _Context_Switch( &executing->Registers, &heir->Registers ); 10c283: 58 pop %eax 10c284: 5a pop %edx 10c285: 81 c6 d4 00 00 00 add $0xd4,%esi 10c28b: 56 push %esi 10c28c: 8d 83 d4 00 00 00 lea 0xd4(%ebx),%eax 10c292: 50 push %eax 10c293: e8 f8 10 00 00 call 10d390 <_CPU_Context_switch> #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) #if ( CPU_USE_DEFERRED_FP_SWITCH == TRUE ) if ( (executing->fp_context != NULL) && 10c298: 83 c4 10 add $0x10,%esp 10c29b: 83 bb ec 00 00 00 00 cmpl $0x0,0xec(%ebx) 10c2a2: 74 36 je 10c2da <_Thread_Dispatch+0x102> #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) RTEMS_INLINE_ROUTINE bool _Thread_Is_allocated_fp ( const Thread_Control *the_thread ) { return ( the_thread == _Thread_Allocated_fp ); 10c2a4: a1 8c 62 12 00 mov 0x12628c,%eax 10c2a9: 39 c3 cmp %eax,%ebx 10c2ab: 74 2d je 10c2da <_Thread_Dispatch+0x102> !_Thread_Is_allocated_fp( executing ) ) { if ( _Thread_Allocated_fp != NULL ) 10c2ad: 85 c0 test %eax,%eax 10c2af: 74 11 je 10c2c2 <_Thread_Dispatch+0xea> _Context_Save_fp( &_Thread_Allocated_fp->fp_context ); 10c2b1: 83 ec 0c sub $0xc,%esp 10c2b4: 05 ec 00 00 00 add $0xec,%eax 10c2b9: 50 push %eax 10c2ba: e8 05 11 00 00 call 10d3c4 <_CPU_Context_save_fp> 10c2bf: 83 c4 10 add $0x10,%esp _Context_Restore_fp( &executing->fp_context ); 10c2c2: 83 ec 0c sub $0xc,%esp 10c2c5: 8d 83 ec 00 00 00 lea 0xec(%ebx),%eax 10c2cb: 50 push %eax 10c2cc: e8 fd 10 00 00 call 10d3ce <_CPU_Context_restore_fp> _Thread_Allocated_fp = executing; 10c2d1: 89 1d 8c 62 12 00 mov %ebx,0x12628c 10c2d7: 83 c4 10 add $0x10,%esp if ( executing->fp_context != NULL ) _Context_Restore_fp( &executing->fp_context ); #endif #endif executing = _Thread_Executing; 10c2da: 8b 1d c4 62 12 00 mov 0x1262c4,%ebx _ISR_Disable( level ); 10c2e0: 9c pushf 10c2e1: fa cli 10c2e2: 58 pop %eax Thread_Control *heir; ISR_Level level; executing = _Thread_Executing; _ISR_Disable( level ); while ( _Context_Switch_necessary == true ) { 10c2e3: 8a 15 d4 62 12 00 mov 0x1262d4,%dl 10c2e9: 84 d2 test %dl,%dl 10c2eb: 0f 85 01 ff ff ff jne 10c1f2 <_Thread_Dispatch+0x1a> executing = _Thread_Executing; _ISR_Disable( level ); } _Thread_Dispatch_disable_level = 0; 10c2f1: c7 05 08 62 12 00 00 movl $0x0,0x126208 10c2f8: 00 00 00 _ISR_Enable( level ); 10c2fb: 50 push %eax 10c2fc: 9d popf if ( _Thread_Do_post_task_switch_extension || 10c2fd: 83 3d a8 62 12 00 00 cmpl $0x0,0x1262a8 10c304: 75 06 jne 10c30c <_Thread_Dispatch+0x134> executing->do_post_task_switch_extension ) { 10c306: 80 7b 74 00 cmpb $0x0,0x74(%ebx) 10c30a: 74 09 je 10c315 <_Thread_Dispatch+0x13d> executing->do_post_task_switch_extension = false; 10c30c: c6 43 74 00 movb $0x0,0x74(%ebx) _API_extensions_Run_postswitch(); 10c310: e8 1e ea ff ff call 10ad33 <_API_extensions_Run_postswitch> } } 10c315: 8d 65 f4 lea -0xc(%ebp),%esp 10c318: 5b pop %ebx 10c319: 5e pop %esi 10c31a: 5f pop %edi 10c31b: c9 leave 10c31c: c3 ret =============================================================================== 001127e0 <_Thread_Evaluate_mode>: * * XXX */ bool _Thread_Evaluate_mode( void ) { 1127e0: 55 push %ebp 1127e1: 89 e5 mov %esp,%ebp Thread_Control *executing; executing = _Thread_Executing; 1127e3: a1 c4 62 12 00 mov 0x1262c4,%eax if ( !_States_Is_ready( executing->current_state ) || 1127e8: 83 78 10 00 cmpl $0x0,0x10(%eax) 1127ec: 75 0e jne 1127fc <_Thread_Evaluate_mode+0x1c><== NEVER TAKEN 1127ee: 3b 05 94 62 12 00 cmp 0x126294,%eax 1127f4: 74 11 je 112807 <_Thread_Evaluate_mode+0x27> ( !_Thread_Is_heir( executing ) && executing->is_preemptible ) ) { 1127f6: 80 78 75 00 cmpb $0x0,0x75(%eax) 1127fa: 74 0b je 112807 <_Thread_Evaluate_mode+0x27><== NEVER TAKEN _Context_Switch_necessary = true; 1127fc: c6 05 d4 62 12 00 01 movb $0x1,0x1262d4 112803: b0 01 mov $0x1,%al return true; 112805: eb 02 jmp 112809 <_Thread_Evaluate_mode+0x29> 112807: 31 c0 xor %eax,%eax } return false; } 112809: c9 leave 11280a: c3 ret =============================================================================== 0011280c <_Thread_Handler>: * * Output parameters: NONE */ void _Thread_Handler( void ) { 11280c: 55 push %ebp 11280d: 89 e5 mov %esp,%ebp 11280f: 53 push %ebx 112810: 83 ec 14 sub $0x14,%esp #if defined(EXECUTE_GLOBAL_CONSTRUCTORS) static char doneConstructors; char doneCons; #endif executing = _Thread_Executing; 112813: 8b 1d c4 62 12 00 mov 0x1262c4,%ebx /* * have to put level into a register for those cpu's that use * inline asm here */ level = executing->Start.isr_level; 112819: 8b 83 b8 00 00 00 mov 0xb8(%ebx),%eax _ISR_Set_level(level); 11281f: 85 c0 test %eax,%eax 112821: 74 03 je 112826 <_Thread_Handler+0x1a> 112823: fa cli 112824: eb 01 jmp 112827 <_Thread_Handler+0x1b> 112826: fb sti #if defined(EXECUTE_GLOBAL_CONSTRUCTORS) doneCons = doneConstructors; 112827: a0 c4 5e 12 00 mov 0x125ec4,%al 11282c: 88 45 f7 mov %al,-0x9(%ebp) doneConstructors = 1; 11282f: c6 05 c4 5e 12 00 01 movb $0x1,0x125ec4 #endif #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) #if ( CPU_USE_DEFERRED_FP_SWITCH == TRUE ) if ( (executing->fp_context != NULL) && 112836: 83 bb ec 00 00 00 00 cmpl $0x0,0xec(%ebx) 11283d: 74 24 je 112863 <_Thread_Handler+0x57> #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) RTEMS_INLINE_ROUTINE bool _Thread_Is_allocated_fp ( const Thread_Control *the_thread ) { return ( the_thread == _Thread_Allocated_fp ); 11283f: a1 8c 62 12 00 mov 0x12628c,%eax 112844: 39 c3 cmp %eax,%ebx 112846: 74 1b je 112863 <_Thread_Handler+0x57> !_Thread_Is_allocated_fp( executing ) ) { if ( _Thread_Allocated_fp != NULL ) 112848: 85 c0 test %eax,%eax 11284a: 74 11 je 11285d <_Thread_Handler+0x51> _Context_Save_fp( &_Thread_Allocated_fp->fp_context ); 11284c: 83 ec 0c sub $0xc,%esp 11284f: 05 ec 00 00 00 add $0xec,%eax 112854: 50 push %eax 112855: e8 6a ab ff ff call 10d3c4 <_CPU_Context_save_fp> 11285a: 83 c4 10 add $0x10,%esp _Thread_Allocated_fp = executing; 11285d: 89 1d 8c 62 12 00 mov %ebx,0x12628c /* * 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 ); 112863: 83 ec 0c sub $0xc,%esp 112866: 53 push %ebx 112867: e8 14 a7 ff ff call 10cf80 <_User_extensions_Thread_begin> /* * At this point, the dispatch disable level BETTER be 1. */ _Thread_Enable_dispatch(); 11286c: e8 ac 9a ff ff call 10c31d <_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) */ { 112871: 83 c4 10 add $0x10,%esp 112874: 80 7d f7 00 cmpb $0x0,-0x9(%ebp) 112878: 75 05 jne 11287f <_Thread_Handler+0x73> INIT_NAME (); 11287a: e8 e1 bf 00 00 call 11e860 <__start_set_sysctl_set> } #endif if ( executing->Start.prototype == THREAD_START_NUMERIC ) { 11287f: 8b 83 a0 00 00 00 mov 0xa0(%ebx),%eax 112885: 85 c0 test %eax,%eax 112887: 75 0b jne 112894 <_Thread_Handler+0x88> executing->Wait.return_argument = (*(Thread_Entry_numeric) executing->Start.entry_point)( 112889: 83 ec 0c sub $0xc,%esp 11288c: ff b3 a8 00 00 00 pushl 0xa8(%ebx) 112892: eb 0c jmp 1128a0 <_Thread_Handler+0x94> executing->Start.numeric_argument ); } #if defined(RTEMS_POSIX_API) else if ( executing->Start.prototype == THREAD_START_POINTER ) { 112894: 48 dec %eax 112895: 75 15 jne 1128ac <_Thread_Handler+0xa0> <== NEVER TAKEN executing->Wait.return_argument = (*(Thread_Entry_pointer) executing->Start.entry_point)( 112897: 83 ec 0c sub $0xc,%esp 11289a: ff b3 a4 00 00 00 pushl 0xa4(%ebx) 1128a0: ff 93 9c 00 00 00 call *0x9c(%ebx) executing->Start.numeric_argument ); } #if defined(RTEMS_POSIX_API) else if ( executing->Start.prototype == THREAD_START_POINTER ) { executing->Wait.return_argument = 1128a6: 89 43 28 mov %eax,0x28(%ebx) 1128a9: 83 c4 10 add $0x10,%esp * 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 ); 1128ac: 83 ec 0c sub $0xc,%esp 1128af: 53 push %ebx 1128b0: e8 fc a6 ff ff call 10cfb1 <_User_extensions_Thread_exitted> _Internal_error_Occurred( 1128b5: 83 c4 0c add $0xc,%esp 1128b8: 6a 06 push $0x6 1128ba: 6a 01 push $0x1 1128bc: 6a 00 push $0x0 1128be: e8 bd 8d ff ff call 10b680 <_Internal_error_Occurred> =============================================================================== 0010c3b4 <_Thread_Initialize>: Thread_CPU_budget_algorithms budget_algorithm, Thread_CPU_budget_algorithm_callout budget_callout, uint32_t isr_level, Objects_Name name ) { 10c3b4: 55 push %ebp 10c3b5: 89 e5 mov %esp,%ebp 10c3b7: 57 push %edi 10c3b8: 56 push %esi 10c3b9: 53 push %ebx 10c3ba: 83 ec 1c sub $0x1c,%esp 10c3bd: 8b 5d 0c mov 0xc(%ebp),%ebx 10c3c0: 8b 4d 10 mov 0x10(%ebp),%ecx 10c3c3: 8b 75 14 mov 0x14(%ebp),%esi 10c3c6: 8a 55 18 mov 0x18(%ebp),%dl 10c3c9: 8a 45 20 mov 0x20(%ebp),%al 10c3cc: 88 45 e7 mov %al,-0x19(%ebp) /* * Zero out all the allocated memory fields */ for ( i=0 ; i <= THREAD_API_LAST ; i++ ) the_thread->API_Extensions[i] = NULL; 10c3cf: c7 83 f4 00 00 00 00 movl $0x0,0xf4(%ebx) 10c3d6: 00 00 00 10c3d9: c7 83 f8 00 00 00 00 movl $0x0,0xf8(%ebx) 10c3e0: 00 00 00 10c3e3: c7 83 fc 00 00 00 00 movl $0x0,0xfc(%ebx) 10c3ea: 00 00 00 extensions_area = NULL; the_thread->libc_reent = NULL; 10c3ed: c7 83 f0 00 00 00 00 movl $0x0,0xf0(%ebx) 10c3f4: 00 00 00 if ( !actual_stack_size || actual_stack_size < stack_size ) return false; /* stack allocation failed */ stack = the_thread->Start.stack; #else if ( !stack_area ) { 10c3f7: 85 c9 test %ecx,%ecx 10c3f9: 75 30 jne 10c42b <_Thread_Initialize+0x77> actual_stack_size = _Thread_Stack_Allocate( the_thread, stack_size ); 10c3fb: 51 push %ecx 10c3fc: 51 push %ecx 10c3fd: 56 push %esi 10c3fe: 53 push %ebx 10c3ff: 88 55 e0 mov %dl,-0x20(%ebp) 10c402: e8 69 08 00 00 call 10cc70 <_Thread_Stack_Allocate> if ( !actual_stack_size || actual_stack_size < stack_size ) 10c407: 83 c4 10 add $0x10,%esp 10c40a: 39 f0 cmp %esi,%eax 10c40c: 8a 55 e0 mov -0x20(%ebp),%dl 10c40f: 72 04 jb 10c415 <_Thread_Initialize+0x61> 10c411: 85 c0 test %eax,%eax 10c413: 75 07 jne 10c41c <_Thread_Initialize+0x68><== ALWAYS TAKEN 10c415: 31 c0 xor %eax,%eax 10c417: e9 d9 01 00 00 jmp 10c5f5 <_Thread_Initialize+0x241> return false; /* stack allocation failed */ stack = the_thread->Start.stack; 10c41c: 8b 8b d0 00 00 00 mov 0xd0(%ebx),%ecx the_thread->Start.core_allocated_stack = true; 10c422: c6 83 c0 00 00 00 01 movb $0x1,0xc0(%ebx) 10c429: eb 09 jmp 10c434 <_Thread_Initialize+0x80> } else { stack = stack_area; actual_stack_size = stack_size; the_thread->Start.core_allocated_stack = false; 10c42b: c6 83 c0 00 00 00 00 movb $0x0,0xc0(%ebx) 10c432: 89 f0 mov %esi,%eax Stack_Control *the_stack, void *starting_address, size_t size ) { the_stack->area = starting_address; 10c434: 89 8b c8 00 00 00 mov %ecx,0xc8(%ebx) the_stack->size = size; 10c43a: 89 83 c4 00 00 00 mov %eax,0xc4(%ebx) /* * Allocate the floating point area for this thread */ #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) if ( is_fp ) { 10c440: 31 ff xor %edi,%edi 10c442: 84 d2 test %dl,%dl 10c444: 74 19 je 10c45f <_Thread_Initialize+0xab> fp_area = _Workspace_Allocate( CONTEXT_FP_SIZE ); 10c446: 83 ec 0c sub $0xc,%esp 10c449: 6a 6c push $0x6c 10c44b: e8 c4 0e 00 00 call 10d314 <_Workspace_Allocate> 10c450: 89 c7 mov %eax,%edi if ( !fp_area ) 10c452: 83 c4 10 add $0x10,%esp 10c455: 31 f6 xor %esi,%esi 10c457: 85 c0 test %eax,%eax 10c459: 0f 84 10 01 00 00 je 10c56f <_Thread_Initialize+0x1bb> goto failed; fp_area = _Context_Fp_start( fp_area, 0 ); } the_thread->fp_context = fp_area; 10c45f: 89 bb ec 00 00 00 mov %edi,0xec(%ebx) the_thread->Start.fp_context = fp_area; 10c465: 89 bb cc 00 00 00 mov %edi,0xcc(%ebx) Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 10c46b: c7 43 50 00 00 00 00 movl $0x0,0x50(%ebx) the_watchdog->routine = routine; 10c472: c7 43 64 00 00 00 00 movl $0x0,0x64(%ebx) the_watchdog->id = id; 10c479: c7 43 68 00 00 00 00 movl $0x0,0x68(%ebx) the_watchdog->user_data = user_data; 10c480: c7 43 6c 00 00 00 00 movl $0x0,0x6c(%ebx) #endif /* * Allocate the extensions area for this thread */ if ( _Thread_Maximum_extensions ) { 10c487: a1 a4 62 12 00 mov 0x1262a4,%eax 10c48c: 31 f6 xor %esi,%esi 10c48e: 85 c0 test %eax,%eax 10c490: 74 1d je 10c4af <_Thread_Initialize+0xfb> extensions_area = _Workspace_Allocate( 10c492: 83 ec 0c sub $0xc,%esp 10c495: 8d 04 85 04 00 00 00 lea 0x4(,%eax,4),%eax 10c49c: 50 push %eax 10c49d: e8 72 0e 00 00 call 10d314 <_Workspace_Allocate> 10c4a2: 89 c6 mov %eax,%esi (_Thread_Maximum_extensions + 1) * sizeof( void * ) ); if ( !extensions_area ) 10c4a4: 83 c4 10 add $0x10,%esp 10c4a7: 85 c0 test %eax,%eax 10c4a9: 0f 84 c0 00 00 00 je 10c56f <_Thread_Initialize+0x1bb> goto failed; } the_thread->extensions = (void **) extensions_area; 10c4af: 89 b3 00 01 00 00 mov %esi,0x100(%ebx) * if they are linked to the thread. An extension user may * create the extension long after tasks have been created * so they cannot rely on the thread create user extension * call. */ if ( the_thread->extensions ) { 10c4b5: 85 f6 test %esi,%esi 10c4b7: 74 1c je 10c4d5 <_Thread_Initialize+0x121> for ( i = 0; i <= _Thread_Maximum_extensions ; i++ ) 10c4b9: 8b 0d a4 62 12 00 mov 0x1262a4,%ecx 10c4bf: 31 c0 xor %eax,%eax 10c4c1: eb 0e jmp 10c4d1 <_Thread_Initialize+0x11d> the_thread->extensions[i] = NULL; 10c4c3: 8b 93 00 01 00 00 mov 0x100(%ebx),%edx 10c4c9: c7 04 82 00 00 00 00 movl $0x0,(%edx,%eax,4) * create the extension long after tasks have been created * so they cannot rely on the thread create user extension * call. */ if ( the_thread->extensions ) { for ( i = 0; i <= _Thread_Maximum_extensions ; i++ ) 10c4d0: 40 inc %eax 10c4d1: 39 c8 cmp %ecx,%eax 10c4d3: 76 ee jbe 10c4c3 <_Thread_Initialize+0x10f> /* * General initialization */ the_thread->Start.is_preemptible = is_preemptible; 10c4d5: 8a 45 e7 mov -0x19(%ebp),%al 10c4d8: 88 83 ac 00 00 00 mov %al,0xac(%ebx) the_thread->Start.budget_algorithm = budget_algorithm; 10c4de: 8b 45 24 mov 0x24(%ebp),%eax 10c4e1: 89 83 b0 00 00 00 mov %eax,0xb0(%ebx) the_thread->Start.budget_callout = budget_callout; 10c4e7: 8b 45 28 mov 0x28(%ebp),%eax 10c4ea: 89 83 b4 00 00 00 mov %eax,0xb4(%ebx) switch ( budget_algorithm ) { 10c4f0: 83 7d 24 02 cmpl $0x2,0x24(%ebp) 10c4f4: 75 08 jne 10c4fe <_Thread_Initialize+0x14a> case THREAD_CPU_BUDGET_ALGORITHM_NONE: case THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE: break; #if defined(RTEMS_SCORE_THREAD_ENABLE_EXHAUST_TIMESLICE) case THREAD_CPU_BUDGET_ALGORITHM_EXHAUST_TIMESLICE: the_thread->cpu_time_budget = _Thread_Ticks_per_timeslice; 10c4f6: a1 d4 61 12 00 mov 0x1261d4,%eax 10c4fb: 89 43 78 mov %eax,0x78(%ebx) case THREAD_CPU_BUDGET_ALGORITHM_CALLOUT: break; #endif } the_thread->Start.isr_level = isr_level; 10c4fe: 8b 45 2c mov 0x2c(%ebp),%eax 10c501: 89 83 b8 00 00 00 mov %eax,0xb8(%ebx) the_thread->current_state = STATES_DORMANT; 10c507: c7 43 10 01 00 00 00 movl $0x1,0x10(%ebx) the_thread->Wait.queue = NULL; 10c50e: c7 43 44 00 00 00 00 movl $0x0,0x44(%ebx) the_thread->resource_count = 0; 10c515: c7 43 1c 00 00 00 00 movl $0x0,0x1c(%ebx) #if defined(RTEMS_ITRON_API) the_thread->suspend_count = 0; #endif the_thread->real_priority = priority; 10c51c: 8b 45 1c mov 0x1c(%ebp),%eax 10c51f: 89 43 18 mov %eax,0x18(%ebx) the_thread->Start.initial_priority = priority; 10c522: 89 83 bc 00 00 00 mov %eax,0xbc(%ebx) _Thread_Set_priority( the_thread, priority ); 10c528: 52 push %edx 10c529: 52 push %edx 10c52a: 50 push %eax 10c52b: 53 push %ebx 10c52c: e8 93 05 00 00 call 10cac4 <_Thread_Set_priority> /* * Initialize the CPU usage statistics */ #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ _Timestamp_Set_to_zero( &the_thread->cpu_time_used ); 10c531: c7 83 84 00 00 00 00 movl $0x0,0x84(%ebx) 10c538: 00 00 00 10c53b: c7 83 88 00 00 00 00 movl $0x0,0x88(%ebx) 10c542: 00 00 00 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 10c545: 0f b7 53 08 movzwl 0x8(%ebx),%edx 10c549: 8b 45 08 mov 0x8(%ebp),%eax 10c54c: 8b 40 1c mov 0x1c(%eax),%eax 10c54f: 89 1c 90 mov %ebx,(%eax,%edx,4) information, _Objects_Get_index( the_object->id ), the_object ); the_object->name = name; 10c552: 8b 45 30 mov 0x30(%ebp),%eax 10c555: 89 43 0c mov %eax,0xc(%ebx) * enabled when we get here. We want to be able to run the * user extensions with dispatching enabled. The Allocator * Mutex provides sufficient protection to let the user extensions * run safely. */ extension_status = _User_extensions_Thread_create( the_thread ); 10c558: 89 1c 24 mov %ebx,(%esp) 10c55b: e8 c0 0a 00 00 call 10d020 <_User_extensions_Thread_create> 10c560: 88 c2 mov %al,%dl if ( extension_status ) 10c562: 83 c4 10 add $0x10,%esp 10c565: b0 01 mov $0x1,%al 10c567: 84 d2 test %dl,%dl 10c569: 0f 85 86 00 00 00 jne 10c5f5 <_Thread_Initialize+0x241> return true; failed: if ( the_thread->libc_reent ) 10c56f: 8b 83 f0 00 00 00 mov 0xf0(%ebx),%eax 10c575: 85 c0 test %eax,%eax 10c577: 74 0c je 10c585 <_Thread_Initialize+0x1d1> _Workspace_Free( the_thread->libc_reent ); 10c579: 83 ec 0c sub $0xc,%esp 10c57c: 50 push %eax 10c57d: e8 ab 0d 00 00 call 10d32d <_Workspace_Free> 10c582: 83 c4 10 add $0x10,%esp for ( i=0 ; i <= THREAD_API_LAST ; i++ ) if ( the_thread->API_Extensions[i] ) 10c585: 8b 83 f4 00 00 00 mov 0xf4(%ebx),%eax 10c58b: 85 c0 test %eax,%eax 10c58d: 74 0c je 10c59b <_Thread_Initialize+0x1e7> _Workspace_Free( the_thread->API_Extensions[i] ); 10c58f: 83 ec 0c sub $0xc,%esp 10c592: 50 push %eax 10c593: e8 95 0d 00 00 call 10d32d <_Workspace_Free> 10c598: 83 c4 10 add $0x10,%esp failed: if ( the_thread->libc_reent ) _Workspace_Free( the_thread->libc_reent ); for ( i=0 ; i <= THREAD_API_LAST ; i++ ) if ( the_thread->API_Extensions[i] ) 10c59b: 8b 83 f8 00 00 00 mov 0xf8(%ebx),%eax 10c5a1: 85 c0 test %eax,%eax 10c5a3: 74 0c je 10c5b1 <_Thread_Initialize+0x1fd> _Workspace_Free( the_thread->API_Extensions[i] ); 10c5a5: 83 ec 0c sub $0xc,%esp 10c5a8: 50 push %eax 10c5a9: e8 7f 0d 00 00 call 10d32d <_Workspace_Free> 10c5ae: 83 c4 10 add $0x10,%esp failed: if ( the_thread->libc_reent ) _Workspace_Free( the_thread->libc_reent ); for ( i=0 ; i <= THREAD_API_LAST ; i++ ) if ( the_thread->API_Extensions[i] ) 10c5b1: 8b 83 fc 00 00 00 mov 0xfc(%ebx),%eax 10c5b7: 85 c0 test %eax,%eax 10c5b9: 74 0c je 10c5c7 <_Thread_Initialize+0x213><== ALWAYS TAKEN _Workspace_Free( the_thread->API_Extensions[i] ); 10c5bb: 83 ec 0c sub $0xc,%esp <== NOT EXECUTED 10c5be: 50 push %eax <== NOT EXECUTED 10c5bf: e8 69 0d 00 00 call 10d32d <_Workspace_Free> <== NOT EXECUTED 10c5c4: 83 c4 10 add $0x10,%esp <== NOT EXECUTED if ( extensions_area ) 10c5c7: 85 f6 test %esi,%esi 10c5c9: 74 0c je 10c5d7 <_Thread_Initialize+0x223> (void) _Workspace_Free( extensions_area ); 10c5cb: 83 ec 0c sub $0xc,%esp 10c5ce: 56 push %esi 10c5cf: e8 59 0d 00 00 call 10d32d <_Workspace_Free> 10c5d4: 83 c4 10 add $0x10,%esp #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) if ( fp_area ) 10c5d7: 85 ff test %edi,%edi 10c5d9: 74 0c je 10c5e7 <_Thread_Initialize+0x233> (void) _Workspace_Free( fp_area ); 10c5db: 83 ec 0c sub $0xc,%esp 10c5de: 57 push %edi 10c5df: e8 49 0d 00 00 call 10d32d <_Workspace_Free> 10c5e4: 83 c4 10 add $0x10,%esp #endif _Thread_Stack_Free( the_thread ); 10c5e7: 83 ec 0c sub $0xc,%esp 10c5ea: 53 push %ebx 10c5eb: e8 d0 06 00 00 call 10ccc0 <_Thread_Stack_Free> 10c5f0: 31 c0 xor %eax,%eax return false; 10c5f2: 83 c4 10 add $0x10,%esp } 10c5f5: 8d 65 f4 lea -0xc(%ebp),%esp 10c5f8: 5b pop %ebx 10c5f9: 5e pop %esi 10c5fa: 5f pop %edi 10c5fb: c9 leave 10c5fc: c3 ret =============================================================================== 0010f8d4 <_Thread_Resume>: void _Thread_Resume( Thread_Control *the_thread, bool force ) { 10f8d4: 55 push %ebp 10f8d5: 89 e5 mov %esp,%ebp 10f8d7: 53 push %ebx 10f8d8: 8b 45 08 mov 0x8(%ebp),%eax ISR_Level level; States_Control current_state; _ISR_Disable( level ); 10f8db: 9c pushf 10f8dc: fa cli 10f8dd: 59 pop %ecx _ISR_Enable( level ); return; } #endif current_state = the_thread->current_state; 10f8de: 8b 50 10 mov 0x10(%eax),%edx if ( current_state & STATES_SUSPENDED ) { 10f8e1: f6 c2 02 test $0x2,%dl 10f8e4: 74 70 je 10f956 <_Thread_Resume+0x82> <== NEVER TAKEN 10f8e6: 83 e2 fd and $0xfffffffd,%edx current_state = 10f8e9: 89 50 10 mov %edx,0x10(%eax) the_thread->current_state = _States_Clear(STATES_SUSPENDED, current_state); if ( _States_Is_ready( current_state ) ) { 10f8ec: 85 d2 test %edx,%edx 10f8ee: 75 66 jne 10f956 <_Thread_Resume+0x82> RTEMS_INLINE_ROUTINE void _Priority_Add_to_bit_map ( Priority_Information *the_priority_map ) { *the_priority_map->minor |= the_priority_map->ready_minor; 10f8f0: 8b 90 90 00 00 00 mov 0x90(%eax),%edx 10f8f6: 66 8b 98 96 00 00 00 mov 0x96(%eax),%bx 10f8fd: 66 09 1a or %bx,(%edx) _Priority_Major_bit_map |= the_priority_map->ready_major; 10f900: 66 8b 15 88 93 12 00 mov 0x129388,%dx 10f907: 0b 90 94 00 00 00 or 0x94(%eax),%edx 10f90d: 66 89 15 88 93 12 00 mov %dx,0x129388 _Priority_Add_to_bit_map( &the_thread->Priority_map ); _Chain_Append_unprotected(the_thread->ready, &the_thread->Object.Node); 10f914: 8b 90 8c 00 00 00 mov 0x8c(%eax),%edx Chain_Node *the_node ) { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); 10f91a: 8d 5a 04 lea 0x4(%edx),%ebx 10f91d: 89 18 mov %ebx,(%eax) old_last_node = the_chain->last; 10f91f: 8b 5a 08 mov 0x8(%edx),%ebx the_chain->last = the_node; 10f922: 89 42 08 mov %eax,0x8(%edx) old_last_node->next = the_node; 10f925: 89 03 mov %eax,(%ebx) the_node->previous = old_last_node; 10f927: 89 58 04 mov %ebx,0x4(%eax) _ISR_Flash( level ); 10f92a: 51 push %ecx 10f92b: 9d popf 10f92c: fa cli if ( the_thread->current_priority < _Thread_Heir->current_priority ) { 10f92d: 8b 50 14 mov 0x14(%eax),%edx 10f930: 8b 1d 64 93 12 00 mov 0x129364,%ebx 10f936: 3b 53 14 cmp 0x14(%ebx),%edx 10f939: 73 1b jae 10f956 <_Thread_Resume+0x82> _Thread_Heir = the_thread; 10f93b: a3 64 93 12 00 mov %eax,0x129364 if ( _Thread_Executing->is_preemptible || 10f940: a1 94 93 12 00 mov 0x129394,%eax 10f945: 80 78 75 00 cmpb $0x0,0x75(%eax) 10f949: 75 04 jne 10f94f <_Thread_Resume+0x7b> 10f94b: 85 d2 test %edx,%edx 10f94d: 75 07 jne 10f956 <_Thread_Resume+0x82> <== ALWAYS TAKEN the_thread->current_priority == 0 ) _Context_Switch_necessary = true; 10f94f: c6 05 a4 93 12 00 01 movb $0x1,0x1293a4 } } } _ISR_Enable( level ); 10f956: 51 push %ecx 10f957: 9d popf } 10f958: 5b pop %ebx 10f959: c9 leave 10f95a: c3 ret =============================================================================== 0010cda8 <_Thread_Tickle_timeslice>: * * Output parameters: NONE */ void _Thread_Tickle_timeslice( void ) { 10cda8: 55 push %ebp 10cda9: 89 e5 mov %esp,%ebp 10cdab: 53 push %ebx 10cdac: 83 ec 04 sub $0x4,%esp Thread_Control *executing; executing = _Thread_Executing; 10cdaf: 8b 1d c4 62 12 00 mov 0x1262c4,%ebx /* * If the thread is not preemptible or is not ready, then * just return. */ if ( !executing->is_preemptible ) 10cdb5: 80 7b 75 00 cmpb $0x0,0x75(%ebx) 10cdb9: 74 4c je 10ce07 <_Thread_Tickle_timeslice+0x5f> return; if ( !_States_Is_ready( executing->current_state ) ) 10cdbb: 83 7b 10 00 cmpl $0x0,0x10(%ebx) 10cdbf: 75 46 jne 10ce07 <_Thread_Tickle_timeslice+0x5f> /* * The cpu budget algorithm determines what happens next. */ switch ( executing->budget_algorithm ) { 10cdc1: 8b 43 7c mov 0x7c(%ebx),%eax 10cdc4: 83 f8 01 cmp $0x1,%eax 10cdc7: 72 3e jb 10ce07 <_Thread_Tickle_timeslice+0x5f> 10cdc9: 83 f8 02 cmp $0x2,%eax 10cdcc: 76 07 jbe 10cdd5 <_Thread_Tickle_timeslice+0x2d> 10cdce: 83 f8 03 cmp $0x3,%eax 10cdd1: 75 34 jne 10ce07 <_Thread_Tickle_timeslice+0x5f><== NEVER TAKEN 10cdd3: eb 1a jmp 10cdef <_Thread_Tickle_timeslice+0x47> 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 ) { 10cdd5: 8b 43 78 mov 0x78(%ebx),%eax 10cdd8: 48 dec %eax 10cdd9: 89 43 78 mov %eax,0x78(%ebx) 10cddc: 85 c0 test %eax,%eax 10cdde: 7f 27 jg 10ce07 <_Thread_Tickle_timeslice+0x5f> _Thread_Reset_timeslice(); 10cde0: e8 6f 3a 00 00 call 110854 <_Thread_Reset_timeslice> executing->cpu_time_budget = _Thread_Ticks_per_timeslice; 10cde5: a1 d4 61 12 00 mov 0x1261d4,%eax 10cdea: 89 43 78 mov %eax,0x78(%ebx) 10cded: eb 18 jmp 10ce07 <_Thread_Tickle_timeslice+0x5f> } break; #if defined(RTEMS_SCORE_THREAD_ENABLE_SCHEDULER_CALLOUT) case THREAD_CPU_BUDGET_ALGORITHM_CALLOUT: if ( --executing->cpu_time_budget == 0 ) 10cdef: 8b 43 78 mov 0x78(%ebx),%eax 10cdf2: 48 dec %eax 10cdf3: 89 43 78 mov %eax,0x78(%ebx) 10cdf6: 85 c0 test %eax,%eax 10cdf8: 75 0d jne 10ce07 <_Thread_Tickle_timeslice+0x5f> (*executing->budget_callout)( executing ); 10cdfa: 83 ec 0c sub $0xc,%esp 10cdfd: 53 push %ebx 10cdfe: ff 93 80 00 00 00 call *0x80(%ebx) 10ce04: 83 c4 10 add $0x10,%esp break; #endif } } 10ce07: 8b 5d fc mov -0x4(%ebp),%ebx 10ce0a: c9 leave 10ce0b: c3 ret =============================================================================== 0010ce0c <_Thread_Yield_processor>: * ready chain * select heir */ void _Thread_Yield_processor( void ) { 10ce0c: 55 push %ebp 10ce0d: 89 e5 mov %esp,%ebp 10ce0f: 56 push %esi 10ce10: 53 push %ebx ISR_Level level; Thread_Control *executing; Chain_Control *ready; executing = _Thread_Executing; 10ce11: a1 c4 62 12 00 mov 0x1262c4,%eax ready = executing->ready; 10ce16: 8b 90 8c 00 00 00 mov 0x8c(%eax),%edx _ISR_Disable( level ); 10ce1c: 9c pushf 10ce1d: fa cli 10ce1e: 59 pop %ecx if ( !_Chain_Has_only_one_node( ready ) ) { 10ce1f: 8b 1a mov (%edx),%ebx 10ce21: 3b 5a 08 cmp 0x8(%edx),%ebx 10ce24: 74 2e je 10ce54 <_Thread_Yield_processor+0x48> ) { Chain_Node *next; Chain_Node *previous; next = the_node->next; 10ce26: 8b 30 mov (%eax),%esi previous = the_node->previous; 10ce28: 8b 58 04 mov 0x4(%eax),%ebx next->previous = previous; 10ce2b: 89 5e 04 mov %ebx,0x4(%esi) previous->next = next; 10ce2e: 89 33 mov %esi,(%ebx) Chain_Node *the_node ) { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); 10ce30: 8d 5a 04 lea 0x4(%edx),%ebx 10ce33: 89 18 mov %ebx,(%eax) old_last_node = the_chain->last; 10ce35: 8b 5a 08 mov 0x8(%edx),%ebx the_chain->last = the_node; 10ce38: 89 42 08 mov %eax,0x8(%edx) old_last_node->next = the_node; 10ce3b: 89 03 mov %eax,(%ebx) the_node->previous = old_last_node; 10ce3d: 89 58 04 mov %ebx,0x4(%eax) _Chain_Extract_unprotected( &executing->Object.Node ); _Chain_Append_unprotected( ready, &executing->Object.Node ); _ISR_Flash( level ); 10ce40: 51 push %ecx 10ce41: 9d popf 10ce42: fa cli if ( _Thread_Is_heir( executing ) ) 10ce43: 3b 05 94 62 12 00 cmp 0x126294,%eax 10ce49: 75 11 jne 10ce5c <_Thread_Yield_processor+0x50><== NEVER TAKEN _Thread_Heir = (Thread_Control *) ready->first; 10ce4b: 8b 02 mov (%edx),%eax 10ce4d: a3 94 62 12 00 mov %eax,0x126294 10ce52: eb 08 jmp 10ce5c <_Thread_Yield_processor+0x50> _Context_Switch_necessary = true; } else if ( !_Thread_Is_heir( executing ) ) 10ce54: 3b 05 94 62 12 00 cmp 0x126294,%eax 10ce5a: 74 07 je 10ce63 <_Thread_Yield_processor+0x57><== ALWAYS TAKEN _Context_Switch_necessary = true; 10ce5c: c6 05 d4 62 12 00 01 movb $0x1,0x1262d4 _ISR_Enable( level ); 10ce63: 51 push %ecx 10ce64: 9d popf } 10ce65: 5b pop %ebx 10ce66: 5e pop %esi 10ce67: c9 leave 10ce68: c3 ret =============================================================================== 0010c860 <_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 ) { 10c860: 55 push %ebp 10c861: 89 e5 mov %esp,%ebp 10c863: 57 push %edi 10c864: 56 push %esi 10c865: 53 push %ebx 10c866: 83 ec 10 sub $0x10,%esp 10c869: 8b 4d 08 mov 0x8(%ebp),%ecx 10c86c: 8b 45 0c mov 0xc(%ebp),%eax */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 10c86f: 8d 50 3c lea 0x3c(%eax),%edx 10c872: 89 50 38 mov %edx,0x38(%eax) the_chain->permanent_null = NULL; 10c875: c7 40 3c 00 00 00 00 movl $0x0,0x3c(%eax) the_chain->last = _Chain_Head(the_chain); 10c87c: 8d 50 38 lea 0x38(%eax),%edx 10c87f: 89 50 40 mov %edx,0x40(%eax) Priority_Control priority; States_Control block_state; _Chain_Initialize_empty( &the_thread->Wait.Block2n ); priority = the_thread->current_priority; 10c882: 8b 58 14 mov 0x14(%eax),%ebx header_index = _Thread_queue_Header_number( priority ); header = &the_thread_queue->Queues.Priority[ header_index ]; 10c885: 89 de mov %ebx,%esi 10c887: c1 ee 06 shr $0x6,%esi 10c88a: 6b f6 0c imul $0xc,%esi,%esi 10c88d: 8d 34 31 lea (%ecx,%esi,1),%esi block_state = the_thread_queue->state; 10c890: 8b 79 38 mov 0x38(%ecx),%edi if ( _Thread_queue_Is_reverse_search( priority ) ) 10c893: f6 c3 20 test $0x20,%bl 10c896: 75 70 jne 10c908 <_Thread_queue_Enqueue_priority+0xa8> */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 10c898: 8d 56 04 lea 0x4(%esi),%edx 10c89b: 89 55 e8 mov %edx,-0x18(%ebp) goto restart_reverse_search; restart_forward_search: search_priority = PRIORITY_MINIMUM - 1; _ISR_Disable( level ); 10c89e: 9c pushf 10c89f: fa cli 10c8a0: 8f 45 f0 popl -0x10(%ebp) search_thread = (Thread_Control *) header->first; 10c8a3: 8b 16 mov (%esi),%edx 10c8a5: c7 45 ec ff ff ff ff movl $0xffffffff,-0x14(%ebp) 10c8ac: 89 75 e4 mov %esi,-0x1c(%ebp) while ( !_Chain_Is_tail( header, (Chain_Node *)search_thread ) ) { 10c8af: eb 1f jmp 10c8d0 <_Thread_queue_Enqueue_priority+0x70> search_priority = search_thread->current_priority; 10c8b1: 8b 72 14 mov 0x14(%edx),%esi 10c8b4: 89 75 ec mov %esi,-0x14(%ebp) if ( priority <= search_priority ) 10c8b7: 39 f3 cmp %esi,%ebx 10c8b9: 76 1a jbe 10c8d5 <_Thread_queue_Enqueue_priority+0x75> break; search_priority = search_thread->current_priority; if ( priority <= search_priority ) break; #endif _ISR_Flash( level ); 10c8bb: ff 75 f0 pushl -0x10(%ebp) 10c8be: 9d popf 10c8bf: fa cli if ( !_States_Are_set( search_thread->current_state, block_state) ) { 10c8c0: 85 7a 10 test %edi,0x10(%edx) 10c8c3: 75 09 jne 10c8ce <_Thread_queue_Enqueue_priority+0x6e><== ALWAYS TAKEN 10c8c5: 8b 75 e4 mov -0x1c(%ebp),%esi <== NOT EXECUTED _ISR_Enable( level ); 10c8c8: ff 75 f0 pushl -0x10(%ebp) <== NOT EXECUTED 10c8cb: 9d popf <== NOT EXECUTED goto restart_forward_search; 10c8cc: eb d0 jmp 10c89e <_Thread_queue_Enqueue_priority+0x3e><== NOT EXECUTED } search_thread = (Thread_Control *)search_thread->Object.Node.next; 10c8ce: 8b 12 mov (%edx),%edx restart_forward_search: search_priority = PRIORITY_MINIMUM - 1; _ISR_Disable( level ); search_thread = (Thread_Control *) header->first; while ( !_Chain_Is_tail( header, (Chain_Node *)search_thread ) ) { 10c8d0: 3b 55 e8 cmp -0x18(%ebp),%edx 10c8d3: 75 dc jne 10c8b1 <_Thread_queue_Enqueue_priority+0x51> 10c8d5: 8b 75 f0 mov -0x10(%ebp),%esi } search_thread = (Thread_Control *)search_thread->Object.Node.next; } if ( the_thread_queue->sync_state != 10c8d8: 83 79 30 01 cmpl $0x1,0x30(%ecx) 10c8dc: 0f 85 a9 00 00 00 jne 10c98b <_Thread_queue_Enqueue_priority+0x12b> THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) goto synchronize; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; 10c8e2: c7 41 30 00 00 00 00 movl $0x0,0x30(%ecx) if ( priority == search_priority ) 10c8e9: 3b 5d ec cmp -0x14(%ebp),%ebx 10c8ec: 0f 84 82 00 00 00 je 10c974 <_Thread_queue_Enqueue_priority+0x114> goto equal_priority; search_node = (Chain_Node *) search_thread; previous_node = search_node->previous; 10c8f2: 8b 5a 04 mov 0x4(%edx),%ebx the_node = (Chain_Node *) the_thread; the_node->next = search_node; 10c8f5: 89 10 mov %edx,(%eax) the_node->previous = previous_node; 10c8f7: 89 58 04 mov %ebx,0x4(%eax) previous_node->next = the_node; 10c8fa: 89 03 mov %eax,(%ebx) search_node->previous = the_node; 10c8fc: 89 42 04 mov %eax,0x4(%edx) the_thread->Wait.queue = the_thread_queue; 10c8ff: 89 48 44 mov %ecx,0x44(%eax) _ISR_Enable( level ); 10c902: ff 75 f0 pushl -0x10(%ebp) 10c905: 9d popf 10c906: eb 65 jmp 10c96d <_Thread_queue_Enqueue_priority+0x10d> return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; restart_reverse_search: search_priority = PRIORITY_MAXIMUM + 1; 10c908: 0f b6 15 f4 21 12 00 movzbl 0x1221f4,%edx 10c90f: 42 inc %edx 10c910: 89 55 ec mov %edx,-0x14(%ebp) _ISR_Disable( level ); 10c913: 9c pushf 10c914: fa cli 10c915: 8f 45 f0 popl -0x10(%ebp) search_thread = (Thread_Control *) header->last; 10c918: 8b 56 08 mov 0x8(%esi),%edx 10c91b: 89 75 e8 mov %esi,-0x18(%ebp) while ( !_Chain_Is_head( header, (Chain_Node *)search_thread ) ) { 10c91e: eb 20 jmp 10c940 <_Thread_queue_Enqueue_priority+0xe0> search_priority = search_thread->current_priority; 10c920: 8b 72 14 mov 0x14(%edx),%esi 10c923: 89 75 ec mov %esi,-0x14(%ebp) if ( priority >= search_priority ) 10c926: 39 f3 cmp %esi,%ebx 10c928: 73 1b jae 10c945 <_Thread_queue_Enqueue_priority+0xe5> break; search_priority = search_thread->current_priority; if ( priority >= search_priority ) break; #endif _ISR_Flash( level ); 10c92a: ff 75 f0 pushl -0x10(%ebp) 10c92d: 9d popf 10c92e: fa cli if ( !_States_Are_set( search_thread->current_state, block_state) ) { 10c92f: 85 7a 10 test %edi,0x10(%edx) 10c932: 75 09 jne 10c93d <_Thread_queue_Enqueue_priority+0xdd> 10c934: 8b 75 e8 mov -0x18(%ebp),%esi _ISR_Enable( level ); 10c937: ff 75 f0 pushl -0x10(%ebp) 10c93a: 9d popf goto restart_reverse_search; 10c93b: eb cb jmp 10c908 <_Thread_queue_Enqueue_priority+0xa8> } search_thread = (Thread_Control *) 10c93d: 8b 52 04 mov 0x4(%edx),%edx restart_reverse_search: search_priority = PRIORITY_MAXIMUM + 1; _ISR_Disable( level ); search_thread = (Thread_Control *) header->last; while ( !_Chain_Is_head( header, (Chain_Node *)search_thread ) ) { 10c940: 3b 55 e8 cmp -0x18(%ebp),%edx 10c943: 75 db jne 10c920 <_Thread_queue_Enqueue_priority+0xc0> 10c945: 8b 75 f0 mov -0x10(%ebp),%esi } search_thread = (Thread_Control *) search_thread->Object.Node.previous; } if ( the_thread_queue->sync_state != 10c948: 83 79 30 01 cmpl $0x1,0x30(%ecx) 10c94c: 75 3d jne 10c98b <_Thread_queue_Enqueue_priority+0x12b> THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) goto synchronize; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; 10c94e: c7 41 30 00 00 00 00 movl $0x0,0x30(%ecx) if ( priority == search_priority ) 10c955: 3b 5d ec cmp -0x14(%ebp),%ebx 10c958: 74 1a je 10c974 <_Thread_queue_Enqueue_priority+0x114> goto equal_priority; search_node = (Chain_Node *) search_thread; next_node = search_node->next; 10c95a: 8b 1a mov (%edx),%ebx the_node = (Chain_Node *) the_thread; the_node->next = next_node; 10c95c: 89 18 mov %ebx,(%eax) the_node->previous = search_node; 10c95e: 89 50 04 mov %edx,0x4(%eax) search_node->next = the_node; 10c961: 89 02 mov %eax,(%edx) next_node->previous = the_node; 10c963: 89 43 04 mov %eax,0x4(%ebx) the_thread->Wait.queue = the_thread_queue; 10c966: 89 48 44 mov %ecx,0x44(%eax) _ISR_Enable( level ); 10c969: ff 75 f0 pushl -0x10(%ebp) 10c96c: 9d popf 10c96d: b8 01 00 00 00 mov $0x1,%eax return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; 10c972: eb 1f jmp 10c993 <_Thread_queue_Enqueue_priority+0x133> 10c974: 83 c2 3c add $0x3c,%edx equal_priority: /* add at end of priority group */ search_node = _Chain_Tail( &search_thread->Wait.Block2n ); previous_node = search_node->previous; 10c977: 8b 5a 04 mov 0x4(%edx),%ebx the_node = (Chain_Node *) the_thread; the_node->next = search_node; 10c97a: 89 10 mov %edx,(%eax) the_node->previous = previous_node; 10c97c: 89 58 04 mov %ebx,0x4(%eax) previous_node->next = the_node; 10c97f: 89 03 mov %eax,(%ebx) search_node->previous = the_node; 10c981: 89 42 04 mov %eax,0x4(%edx) the_thread->Wait.queue = the_thread_queue; 10c984: 89 48 44 mov %ecx,0x44(%eax) _ISR_Enable( level ); 10c987: 56 push %esi 10c988: 9d popf 10c989: eb e2 jmp 10c96d <_Thread_queue_Enqueue_priority+0x10d> * 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; 10c98b: 8b 45 10 mov 0x10(%ebp),%eax 10c98e: 89 30 mov %esi,(%eax) return the_thread_queue->sync_state; 10c990: 8b 41 30 mov 0x30(%ecx),%eax } 10c993: 83 c4 10 add $0x10,%esp 10c996: 5b pop %ebx 10c997: 5e pop %esi 10c998: 5f pop %edi 10c999: c9 leave 10c99a: c3 ret =============================================================================== 00110768 <_Thread_queue_Process_timeout>: #include void _Thread_queue_Process_timeout( Thread_Control *the_thread ) { 110768: 55 push %ebp 110769: 89 e5 mov %esp,%ebp 11076b: 83 ec 08 sub $0x8,%esp 11076e: 8b 45 08 mov 0x8(%ebp),%eax Thread_queue_Control *the_thread_queue = the_thread->Wait.queue; 110771: 8b 50 44 mov 0x44(%eax),%edx * 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 && 110774: 8b 4a 30 mov 0x30(%edx),%ecx 110777: 85 c9 test %ecx,%ecx 110779: 74 1c je 110797 <_Thread_queue_Process_timeout+0x2f> 11077b: 3b 05 c4 62 12 00 cmp 0x1262c4,%eax 110781: 75 14 jne 110797 <_Thread_queue_Process_timeout+0x2f><== NEVER TAKEN _Thread_Is_executing( the_thread ) ) { if ( the_thread_queue->sync_state != THREAD_BLOCKING_OPERATION_SATISFIED ) { 110783: 83 f9 03 cmp $0x3,%ecx 110786: 74 23 je 1107ab <_Thread_queue_Process_timeout+0x43> the_thread->Wait.return_code = the_thread->Wait.queue->timeout_status; 110788: 8b 4a 3c mov 0x3c(%edx),%ecx 11078b: 89 48 34 mov %ecx,0x34(%eax) the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT; 11078e: c7 42 30 02 00 00 00 movl $0x2,0x30(%edx) 110795: eb 14 jmp 1107ab <_Thread_queue_Process_timeout+0x43> } } else { the_thread->Wait.return_code = the_thread->Wait.queue->timeout_status; 110797: 8b 52 3c mov 0x3c(%edx),%edx 11079a: 89 50 34 mov %edx,0x34(%eax) _Thread_queue_Extract( the_thread->Wait.queue, the_thread ); 11079d: 52 push %edx 11079e: 52 push %edx 11079f: 50 push %eax 1107a0: ff 70 44 pushl 0x44(%eax) 1107a3: e8 d8 fe ff ff call 110680 <_Thread_queue_Extract> 1107a8: 83 c4 10 add $0x10,%esp } } 1107ab: c9 leave 1107ac: c3 ret =============================================================================== 0010ca3c <_Thread_queue_Requeue>: void _Thread_queue_Requeue( Thread_queue_Control *the_thread_queue, Thread_Control *the_thread ) { 10ca3c: 55 push %ebp 10ca3d: 89 e5 mov %esp,%ebp 10ca3f: 57 push %edi 10ca40: 56 push %esi 10ca41: 53 push %ebx 10ca42: 83 ec 1c sub $0x1c,%esp 10ca45: 8b 75 08 mov 0x8(%ebp),%esi 10ca48: 8b 7d 0c mov 0xc(%ebp),%edi /* * Just in case the thread really wasn't blocked on a thread queue * when we get here. */ if ( !the_thread_queue ) 10ca4b: 85 f6 test %esi,%esi 10ca4d: 74 36 je 10ca85 <_Thread_queue_Requeue+0x49><== 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 ) { 10ca4f: 83 7e 34 01 cmpl $0x1,0x34(%esi) 10ca53: 75 30 jne 10ca85 <_Thread_queue_Requeue+0x49><== NEVER TAKEN Thread_queue_Control *tq = the_thread_queue; ISR_Level level; ISR_Level level_ignored; _ISR_Disable( level ); 10ca55: 9c pushf 10ca56: fa cli 10ca57: 5b pop %ebx if ( _States_Is_waiting_on_thread_queue( the_thread->current_state ) ) { 10ca58: f7 47 10 e0 be 03 00 testl $0x3bee0,0x10(%edi) 10ca5f: 74 22 je 10ca83 <_Thread_queue_Requeue+0x47><== NEVER TAKEN 10ca61: c7 46 30 01 00 00 00 movl $0x1,0x30(%esi) _Thread_queue_Enter_critical_section( tq ); _Thread_queue_Extract_priority_helper( tq, the_thread, true ); 10ca68: 50 push %eax 10ca69: 6a 01 push $0x1 10ca6b: 57 push %edi 10ca6c: 56 push %esi 10ca6d: e8 3e 3c 00 00 call 1106b0 <_Thread_queue_Extract_priority_helper> (void) _Thread_queue_Enqueue_priority( tq, the_thread, &level_ignored ); 10ca72: 83 c4 0c add $0xc,%esp 10ca75: 8d 45 e4 lea -0x1c(%ebp),%eax 10ca78: 50 push %eax 10ca79: 57 push %edi 10ca7a: 56 push %esi 10ca7b: e8 e0 fd ff ff call 10c860 <_Thread_queue_Enqueue_priority> 10ca80: 83 c4 10 add $0x10,%esp } _ISR_Enable( level ); 10ca83: 53 push %ebx 10ca84: 9d popf } } 10ca85: 8d 65 f4 lea -0xc(%ebp),%esp 10ca88: 5b pop %ebx 10ca89: 5e pop %esi 10ca8a: 5f pop %edi 10ca8b: c9 leave 10ca8c: c3 ret =============================================================================== 0010ca90 <_Thread_queue_Timeout>: void _Thread_queue_Timeout( Objects_Id id, void *ignored __attribute__((unused)) ) { 10ca90: 55 push %ebp 10ca91: 89 e5 mov %esp,%ebp 10ca93: 83 ec 20 sub $0x20,%esp Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); 10ca96: 8d 45 f4 lea -0xc(%ebp),%eax 10ca99: 50 push %eax 10ca9a: ff 75 08 pushl 0x8(%ebp) 10ca9d: e8 9e f8 ff ff call 10c340 <_Thread_Get> switch ( location ) { 10caa2: 83 c4 10 add $0x10,%esp 10caa5: 83 7d f4 00 cmpl $0x0,-0xc(%ebp) 10caa9: 75 17 jne 10cac2 <_Thread_queue_Timeout+0x32><== NEVER TAKEN #if defined(RTEMS_MULTIPROCESSING) case OBJECTS_REMOTE: /* impossible */ #endif break; case OBJECTS_LOCAL: _Thread_queue_Process_timeout( the_thread ); 10caab: 83 ec 0c sub $0xc,%esp 10caae: 50 push %eax 10caaf: e8 b4 3c 00 00 call 110768 <_Thread_queue_Process_timeout> */ RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void ) { RTEMS_COMPILER_MEMORY_BARRIER(); _Thread_Dispatch_disable_level -= 1; 10cab4: a1 08 62 12 00 mov 0x126208,%eax 10cab9: 48 dec %eax 10caba: a3 08 62 12 00 mov %eax,0x126208 10cabf: 83 c4 10 add $0x10,%esp _Thread_Unnest_dispatch(); break; } } 10cac2: c9 leave 10cac3: c3 ret =============================================================================== 00117248 <_Timer_server_Body>: * @a arg points to the corresponding timer server control block. */ static rtems_task _Timer_server_Body( rtems_task_argument arg ) { 117248: 55 push %ebp 117249: 89 e5 mov %esp,%ebp 11724b: 57 push %edi 11724c: 56 push %esi 11724d: 53 push %ebx 11724e: 83 ec 4c sub $0x4c,%esp 117251: 8b 5d 08 mov 0x8(%ebp),%ebx 117254: 8d 45 dc lea -0x24(%ebp),%eax 117257: 8d 55 e0 lea -0x20(%ebp),%edx 11725a: 89 55 b4 mov %edx,-0x4c(%ebp) */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 11725d: 89 55 dc mov %edx,-0x24(%ebp) the_chain->permanent_null = NULL; 117260: c7 45 e0 00 00 00 00 movl $0x0,-0x20(%ebp) the_chain->last = _Chain_Head(the_chain); 117267: 89 45 e4 mov %eax,-0x1c(%ebp) */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 11726a: 8d 75 d0 lea -0x30(%ebp),%esi 11726d: 8d 55 d4 lea -0x2c(%ebp),%edx 117270: 89 55 b0 mov %edx,-0x50(%ebp) */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 117273: 89 55 d0 mov %edx,-0x30(%ebp) the_chain->permanent_null = NULL; 117276: c7 45 d4 00 00 00 00 movl $0x0,-0x2c(%ebp) the_chain->last = _Chain_Head(the_chain); 11727d: 89 75 d8 mov %esi,-0x28(%ebp) */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; watchdogs->last_snapshot = snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 117280: 8d 53 30 lea 0x30(%ebx),%edx 117283: 89 55 c0 mov %edx,-0x40(%ebp) /* * 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 ); 117286: 8d 7b 68 lea 0x68(%ebx),%edi static void _Timer_server_Stop_interval_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog ); 117289: 8d 4b 08 lea 0x8(%ebx),%ecx 11728c: 89 4d b8 mov %ecx,-0x48(%ebp) static void _Timer_server_Stop_tod_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->TOD_watchdogs.System_watchdog ); 11728f: 8d 53 40 lea 0x40(%ebx),%edx 117292: 89 55 bc mov %edx,-0x44(%ebp) { /* * 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; 117295: 8d 4d dc lea -0x24(%ebp),%ecx 117298: 89 4b 78 mov %ecx,0x78(%ebx) static void _Timer_server_Process_interval_watchdogs( Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = _Watchdog_Ticks_since_boot; 11729b: a1 28 f7 13 00 mov 0x13f728,%eax /* * We assume adequate unsigned arithmetic here. */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; 1172a0: 8b 53 3c mov 0x3c(%ebx),%edx watchdogs->last_snapshot = snapshot; 1172a3: 89 43 3c mov %eax,0x3c(%ebx) _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 1172a6: 51 push %ecx 1172a7: 8d 4d d0 lea -0x30(%ebp),%ecx 1172aa: 51 push %ecx 1172ab: 29 d0 sub %edx,%eax 1172ad: 50 push %eax 1172ae: ff 75 c0 pushl -0x40(%ebp) 1172b1: e8 06 37 00 00 call 11a9bc <_Watchdog_Adjust_to_chain> static void _Timer_server_Process_tod_watchdogs( Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); 1172b6: a1 6c f6 13 00 mov 0x13f66c,%eax 1172bb: 89 45 c4 mov %eax,-0x3c(%ebp) Watchdog_Interval last_snapshot = watchdogs->last_snapshot; 1172be: 8b 43 74 mov 0x74(%ebx),%eax /* * 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 ) { 1172c1: 83 c4 10 add $0x10,%esp 1172c4: 39 45 c4 cmp %eax,-0x3c(%ebp) 1172c7: 76 13 jbe 1172dc <_Timer_server_Body+0x94> /* * 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 ); 1172c9: 52 push %edx 1172ca: 8d 55 d0 lea -0x30(%ebp),%edx 1172cd: 52 push %edx 1172ce: 8b 4d c4 mov -0x3c(%ebp),%ecx 1172d1: 29 c1 sub %eax,%ecx 1172d3: 51 push %ecx 1172d4: 57 push %edi 1172d5: e8 e2 36 00 00 call 11a9bc <_Watchdog_Adjust_to_chain> 1172da: eb 0f jmp 1172eb <_Timer_server_Body+0xa3> } else if ( snapshot < last_snapshot ) { 1172dc: 73 10 jae 1172ee <_Timer_server_Body+0xa6> /* * 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 ); 1172de: 51 push %ecx 1172df: 2b 45 c4 sub -0x3c(%ebp),%eax 1172e2: 50 push %eax 1172e3: 6a 01 push $0x1 1172e5: 57 push %edi 1172e6: e8 65 36 00 00 call 11a950 <_Watchdog_Adjust> 1172eb: 83 c4 10 add $0x10,%esp } watchdogs->last_snapshot = snapshot; 1172ee: 8b 45 c4 mov -0x3c(%ebp),%eax 1172f1: 89 43 74 mov %eax,0x74(%ebx) } static void _Timer_server_Process_insertions( Timer_server_Control *ts ) { while ( true ) { Timer_Control *timer = (Timer_Control *) _Chain_Get( ts->insert_chain ); 1172f4: 8b 43 78 mov 0x78(%ebx),%eax 1172f7: 83 ec 0c sub $0xc,%esp 1172fa: 50 push %eax 1172fb: e8 54 07 00 00 call 117a54 <_Chain_Get> if ( timer == NULL ) { 117300: 83 c4 10 add $0x10,%esp 117303: 85 c0 test %eax,%eax 117305: 74 29 je 117330 <_Timer_server_Body+0xe8><== ALWAYS TAKEN static void _Timer_server_Insert_timer( Timer_server_Control *ts, Timer_Control *timer ) { if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { 117307: 8b 50 38 mov 0x38(%eax),%edx <== NOT EXECUTED 11730a: 83 fa 01 cmp $0x1,%edx <== NOT EXECUTED 11730d: 75 0b jne 11731a <_Timer_server_Body+0xd2><== NOT EXECUTED _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); 11730f: 52 push %edx <== NOT EXECUTED 117310: 52 push %edx <== NOT EXECUTED 117311: 83 c0 10 add $0x10,%eax <== NOT EXECUTED 117314: 50 push %eax <== NOT EXECUTED 117315: ff 75 c0 pushl -0x40(%ebp) <== NOT EXECUTED 117318: eb 0c jmp 117326 <_Timer_server_Body+0xde><== NOT EXECUTED } else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) { 11731a: 83 fa 03 cmp $0x3,%edx <== NOT EXECUTED 11731d: 75 d5 jne 1172f4 <_Timer_server_Body+0xac><== NOT EXECUTED _Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker ); 11731f: 51 push %ecx <== NOT EXECUTED 117320: 51 push %ecx <== NOT EXECUTED 117321: 83 c0 10 add $0x10,%eax <== NOT EXECUTED 117324: 50 push %eax <== NOT EXECUTED 117325: 57 push %edi <== NOT EXECUTED 117326: e8 19 37 00 00 call 11aa44 <_Watchdog_Insert> <== NOT EXECUTED 11732b: 83 c4 10 add $0x10,%esp <== NOT EXECUTED 11732e: eb c4 jmp 1172f4 <_Timer_server_Body+0xac><== 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 ); 117330: 9c pushf 117331: fa cli 117332: 58 pop %eax if ( _Chain_Is_empty( insert_chain ) ) { 117333: 8b 55 b4 mov -0x4c(%ebp),%edx 117336: 39 55 dc cmp %edx,-0x24(%ebp) 117339: 75 13 jne 11734e <_Timer_server_Body+0x106><== NEVER TAKEN ts->insert_chain = NULL; 11733b: c7 43 78 00 00 00 00 movl $0x0,0x78(%ebx) _ISR_Enable( level ); 117342: 50 push %eax 117343: 9d popf _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 ) ) { 117344: 8b 4d b0 mov -0x50(%ebp),%ecx 117347: 39 4d d0 cmp %ecx,-0x30(%ebp) 11734a: 75 09 jne 117355 <_Timer_server_Body+0x10d> 11734c: eb 3e jmp 11738c <_Timer_server_Body+0x144> ts->insert_chain = NULL; _ISR_Enable( level ); break; } else { _ISR_Enable( level ); 11734e: 50 push %eax <== NOT EXECUTED 11734f: 9d popf <== NOT EXECUTED 117350: e9 46 ff ff ff jmp 11729b <_Timer_server_Body+0x53><== NOT EXECUTED /* * It is essential that interrupts are disable here since an interrupt * service routine may remove a watchdog from the chain. */ _ISR_Disable( level ); 117355: 9c pushf 117356: fa cli 117357: 5a pop %edx */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 117358: 8b 45 d0 mov -0x30(%ebp),%eax */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected( Chain_Control *the_chain ) { if ( !_Chain_Is_empty(the_chain)) 11735b: 3b 45 b0 cmp -0x50(%ebp),%eax 11735e: 74 25 je 117385 <_Timer_server_Body+0x13d> { Chain_Node *return_node; Chain_Node *new_first; return_node = the_chain->first; new_first = return_node->next; 117360: 8b 08 mov (%eax),%ecx the_chain->first = new_first; 117362: 89 4d d0 mov %ecx,-0x30(%ebp) new_first->previous = _Chain_Head(the_chain); 117365: 89 71 04 mov %esi,0x4(%ecx) watchdog = (Watchdog_Control *) _Chain_Get_unprotected( &fire_chain ); if ( watchdog != NULL ) { 117368: 85 c0 test %eax,%eax 11736a: 74 19 je 117385 <_Timer_server_Body+0x13d><== NEVER TAKEN watchdog->state = WATCHDOG_INACTIVE; 11736c: c7 40 08 00 00 00 00 movl $0x0,0x8(%eax) _ISR_Enable( level ); 117373: 52 push %edx 117374: 9d popf /* * 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 ); 117375: 52 push %edx 117376: 52 push %edx 117377: ff 70 24 pushl 0x24(%eax) 11737a: ff 70 20 pushl 0x20(%eax) 11737d: ff 50 1c call *0x1c(%eax) } 117380: 83 c4 10 add $0x10,%esp 117383: eb d0 jmp 117355 <_Timer_server_Body+0x10d> watchdog = (Watchdog_Control *) _Chain_Get_unprotected( &fire_chain ); if ( watchdog != NULL ) { watchdog->state = WATCHDOG_INACTIVE; _ISR_Enable( level ); } else { _ISR_Enable( level ); 117385: 52 push %edx 117386: 9d popf 117387: e9 09 ff ff ff jmp 117295 <_Timer_server_Body+0x4d> * the active flag of the timer server is true. */ (*watchdog->routine)( watchdog->id, watchdog->user_data ); } } else { ts->active = false; 11738c: c6 43 7c 00 movb $0x0,0x7c(%ebx) 117390: a1 dc f5 13 00 mov 0x13f5dc,%eax 117395: 40 inc %eax 117396: a3 dc f5 13 00 mov %eax,0x13f5dc /* * Block until there is something to do. */ _Thread_Disable_dispatch(); _Thread_Set_state( ts->thread, STATES_DELAYING ); 11739b: 50 push %eax 11739c: 50 push %eax 11739d: 6a 08 push $0x8 11739f: ff 33 pushl (%ebx) 1173a1: e8 86 2e 00 00 call 11a22c <_Thread_Set_state> _Timer_server_Reset_interval_system_watchdog( ts ); 1173a6: 89 d8 mov %ebx,%eax 1173a8: e8 0f fe ff ff call 1171bc <_Timer_server_Reset_interval_system_watchdog> _Timer_server_Reset_tod_system_watchdog( ts ); 1173ad: 89 d8 mov %ebx,%eax 1173af: e8 4e fe ff ff call 117202 <_Timer_server_Reset_tod_system_watchdog> _Thread_Enable_dispatch(); 1173b4: e8 2c 25 00 00 call 1198e5 <_Thread_Enable_dispatch> ts->active = true; 1173b9: c6 43 7c 01 movb $0x1,0x7c(%ebx) static void _Timer_server_Stop_interval_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog ); 1173bd: 59 pop %ecx 1173be: ff 75 b8 pushl -0x48(%ebp) 1173c1: e8 96 37 00 00 call 11ab5c <_Watchdog_Remove> static void _Timer_server_Stop_tod_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->TOD_watchdogs.System_watchdog ); 1173c6: 5a pop %edx 1173c7: ff 75 bc pushl -0x44(%ebp) 1173ca: e8 8d 37 00 00 call 11ab5c <_Watchdog_Remove> 1173cf: 83 c4 10 add $0x10,%esp 1173d2: e9 be fe ff ff jmp 117295 <_Timer_server_Body+0x4d> =============================================================================== 001173d7 <_Timer_server_Schedule_operation_method>: static void _Timer_server_Schedule_operation_method( Timer_server_Control *ts, Timer_Control *timer ) { 1173d7: 55 push %ebp 1173d8: 89 e5 mov %esp,%ebp 1173da: 57 push %edi 1173db: 56 push %esi 1173dc: 53 push %ebx 1173dd: 83 ec 2c sub $0x2c,%esp 1173e0: 8b 5d 08 mov 0x8(%ebp),%ebx 1173e3: 8b 45 0c mov 0xc(%ebp),%eax if ( ts->insert_chain == NULL ) { 1173e6: 8b 53 78 mov 0x78(%ebx),%edx 1173e9: 85 d2 test %edx,%edx 1173eb: 0f 85 e6 00 00 00 jne 1174d7 <_Timer_server_Schedule_operation_method+0x100><== NEVER TAKEN 1173f1: 8b 15 dc f5 13 00 mov 0x13f5dc,%edx 1173f7: 42 inc %edx 1173f8: 89 15 dc f5 13 00 mov %edx,0x13f5dc * being inserted. This could result in an integer overflow. */ _Thread_Disable_dispatch(); if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { 1173fe: 8b 50 38 mov 0x38(%eax),%edx 117401: 83 fa 01 cmp $0x1,%edx 117404: 75 5a jne 117460 <_Timer_server_Schedule_operation_method+0x89> /* * We have to advance the last known ticks value of the server and update * the watchdog chain accordingly. */ _ISR_Disable( level ); 117406: 9c pushf 117407: fa cli 117408: 8f 45 e0 popl -0x20(%ebp) snapshot = _Watchdog_Ticks_since_boot; 11740b: 8b 0d 28 f7 13 00 mov 0x13f728,%ecx last_snapshot = ts->Interval_watchdogs.last_snapshot; 117411: 8b 73 3c mov 0x3c(%ebx),%esi */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 117414: 8b 53 30 mov 0x30(%ebx),%edx */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 117417: 8d 7b 34 lea 0x34(%ebx),%edi 11741a: 39 fa cmp %edi,%edx 11741c: 74 19 je 117437 <_Timer_server_Schedule_operation_method+0x60> first_watchdog = _Watchdog_First( &ts->Interval_watchdogs.Chain ); /* * We assume adequate unsigned arithmetic here. */ delta = snapshot - last_snapshot; 11741e: 89 cf mov %ecx,%edi 117420: 29 f7 sub %esi,%edi 117422: 89 7d e4 mov %edi,-0x1c(%ebp) delta_interval = first_watchdog->delta_interval; 117425: 8b 7a 10 mov 0x10(%edx),%edi if (delta_interval > delta) { 117428: 31 f6 xor %esi,%esi 11742a: 3b 7d e4 cmp -0x1c(%ebp),%edi 11742d: 76 05 jbe 117434 <_Timer_server_Schedule_operation_method+0x5d> delta_interval -= delta; 11742f: 89 fe mov %edi,%esi 117431: 2b 75 e4 sub -0x1c(%ebp),%esi } else { delta_interval = 0; } first_watchdog->delta_interval = delta_interval; 117434: 89 72 10 mov %esi,0x10(%edx) } ts->Interval_watchdogs.last_snapshot = snapshot; 117437: 89 4b 3c mov %ecx,0x3c(%ebx) _ISR_Enable( level ); 11743a: ff 75 e0 pushl -0x20(%ebp) 11743d: 9d popf _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); 11743e: 57 push %edi 11743f: 57 push %edi 117440: 83 c0 10 add $0x10,%eax 117443: 50 push %eax 117444: 8d 43 30 lea 0x30(%ebx),%eax 117447: 50 push %eax 117448: e8 f7 35 00 00 call 11aa44 <_Watchdog_Insert> if ( !ts->active ) { 11744d: 8a 43 7c mov 0x7c(%ebx),%al 117450: 83 c4 10 add $0x10,%esp 117453: 84 c0 test %al,%al 117455: 75 74 jne 1174cb <_Timer_server_Schedule_operation_method+0xf4> _Timer_server_Reset_interval_system_watchdog( ts ); 117457: 89 d8 mov %ebx,%eax 117459: e8 5e fd ff ff call 1171bc <_Timer_server_Reset_interval_system_watchdog> 11745e: eb 6b jmp 1174cb <_Timer_server_Schedule_operation_method+0xf4> } } else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) { 117460: 83 fa 03 cmp $0x3,%edx 117463: 75 66 jne 1174cb <_Timer_server_Schedule_operation_method+0xf4> /* * We have to advance the last known seconds value of the server and update * the watchdog chain accordingly. */ _ISR_Disable( level ); 117465: 9c pushf 117466: fa cli 117467: 8f 45 e0 popl -0x20(%ebp) snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); 11746a: 8b 0d 6c f6 13 00 mov 0x13f66c,%ecx last_snapshot = ts->TOD_watchdogs.last_snapshot; 117470: 8b 53 74 mov 0x74(%ebx),%edx */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 117473: 8b 73 68 mov 0x68(%ebx),%esi */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 117476: 8d 7b 6c lea 0x6c(%ebx),%edi 117479: 39 fe cmp %edi,%esi 11747b: 74 27 je 1174a4 <_Timer_server_Schedule_operation_method+0xcd> if ( !_Chain_Is_empty( &ts->TOD_watchdogs.Chain ) ) { first_watchdog = _Watchdog_First( &ts->TOD_watchdogs.Chain ); delta_interval = first_watchdog->delta_interval; 11747d: 8b 7e 10 mov 0x10(%esi),%edi 117480: 89 7d d4 mov %edi,-0x2c(%ebp) if ( snapshot > last_snapshot ) { 117483: 39 d1 cmp %edx,%ecx 117485: 76 15 jbe 11749c <_Timer_server_Schedule_operation_method+0xc5> /* * We advanced in time. */ delta = snapshot - last_snapshot; 117487: 89 cf mov %ecx,%edi 117489: 29 d7 sub %edx,%edi 11748b: 89 7d e4 mov %edi,-0x1c(%ebp) if (delta_interval > delta) { 11748e: 31 d2 xor %edx,%edx 117490: 39 7d d4 cmp %edi,-0x2c(%ebp) 117493: 76 0c jbe 1174a1 <_Timer_server_Schedule_operation_method+0xca><== NEVER TAKEN delta_interval -= delta; 117495: 8b 55 d4 mov -0x2c(%ebp),%edx 117498: 29 fa sub %edi,%edx 11749a: eb 05 jmp 1174a1 <_Timer_server_Schedule_operation_method+0xca> } } else { /* * Someone put us in the past. */ delta = last_snapshot - snapshot; 11749c: 03 55 d4 add -0x2c(%ebp),%edx delta_interval += delta; 11749f: 29 ca sub %ecx,%edx } first_watchdog->delta_interval = delta_interval; 1174a1: 89 56 10 mov %edx,0x10(%esi) } ts->TOD_watchdogs.last_snapshot = snapshot; 1174a4: 89 4b 74 mov %ecx,0x74(%ebx) _ISR_Enable( level ); 1174a7: ff 75 e0 pushl -0x20(%ebp) 1174aa: 9d popf _Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker ); 1174ab: 56 push %esi 1174ac: 56 push %esi 1174ad: 83 c0 10 add $0x10,%eax 1174b0: 50 push %eax 1174b1: 8d 43 68 lea 0x68(%ebx),%eax 1174b4: 50 push %eax 1174b5: e8 8a 35 00 00 call 11aa44 <_Watchdog_Insert> if ( !ts->active ) { 1174ba: 8a 43 7c mov 0x7c(%ebx),%al 1174bd: 83 c4 10 add $0x10,%esp 1174c0: 84 c0 test %al,%al 1174c2: 75 07 jne 1174cb <_Timer_server_Schedule_operation_method+0xf4> _Timer_server_Reset_tod_system_watchdog( ts ); 1174c4: 89 d8 mov %ebx,%eax 1174c6: e8 37 fd ff ff call 117202 <_Timer_server_Reset_tod_system_watchdog> * 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 ); } } 1174cb: 8d 65 f4 lea -0xc(%ebp),%esp 1174ce: 5b pop %ebx 1174cf: 5e pop %esi 1174d0: 5f pop %edi 1174d1: c9 leave if ( !ts->active ) { _Timer_server_Reset_tod_system_watchdog( ts ); } } _Thread_Enable_dispatch(); 1174d2: e9 0e 24 00 00 jmp 1198e5 <_Thread_Enable_dispatch> * 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 ); 1174d7: 8b 53 78 mov 0x78(%ebx),%edx <== NOT EXECUTED 1174da: 89 45 0c mov %eax,0xc(%ebp) <== NOT EXECUTED 1174dd: 89 55 08 mov %edx,0x8(%ebp) <== NOT EXECUTED } } 1174e0: 8d 65 f4 lea -0xc(%ebp),%esp <== NOT EXECUTED 1174e3: 5b pop %ebx <== NOT EXECUTED 1174e4: 5e pop %esi <== NOT EXECUTED 1174e5: 5f pop %edi <== NOT EXECUTED 1174e6: c9 leave <== NOT EXECUTED * 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 ); 1174e7: e9 2c 05 00 00 jmp 117a18 <_Chain_Append> <== NOT EXECUTED =============================================================================== 0010e90c <_Watchdog_Adjust>: void _Watchdog_Adjust( Chain_Control *header, Watchdog_Adjust_directions direction, Watchdog_Interval units ) { 10e90c: 55 push %ebp 10e90d: 89 e5 mov %esp,%ebp 10e90f: 57 push %edi 10e910: 56 push %esi 10e911: 53 push %ebx 10e912: 83 ec 1c sub $0x1c,%esp 10e915: 8b 75 08 mov 0x8(%ebp),%esi 10e918: 8b 7d 0c mov 0xc(%ebp),%edi 10e91b: 8b 5d 10 mov 0x10(%ebp),%ebx ISR_Level level; _ISR_Disable( level ); 10e91e: 9c pushf 10e91f: fa cli 10e920: 58 pop %eax */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 10e921: 8b 16 mov (%esi),%edx */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 10e923: 8d 4e 04 lea 0x4(%esi),%ecx * hence the compiler must not assume *header to remain * unmodified across that call. * * Till Straumann, 7/2003 */ if ( !_Chain_Is_empty( header ) ) { 10e926: 39 ca cmp %ecx,%edx 10e928: 74 44 je 10e96e <_Watchdog_Adjust+0x62> switch ( direction ) { 10e92a: 85 ff test %edi,%edi 10e92c: 74 3c je 10e96a <_Watchdog_Adjust+0x5e> 10e92e: 4f dec %edi 10e92f: 75 3d jne 10e96e <_Watchdog_Adjust+0x62> <== NEVER TAKEN case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; 10e931: 01 5a 10 add %ebx,0x10(%edx) break; 10e934: eb 38 jmp 10e96e <_Watchdog_Adjust+0x62> RTEMS_INLINE_ROUTINE Watchdog_Control *_Watchdog_First( Chain_Control *header ) { return ( (Watchdog_Control *) header->first ); 10e936: 8b 16 mov (%esi),%edx case WATCHDOG_FORWARD: while ( units ) { if ( units < _Watchdog_First( header )->delta_interval ) { 10e938: 8b 7a 10 mov 0x10(%edx),%edi 10e93b: 39 fb cmp %edi,%ebx 10e93d: 73 07 jae 10e946 <_Watchdog_Adjust+0x3a> _Watchdog_First( header )->delta_interval -= units; 10e93f: 29 df sub %ebx,%edi 10e941: 89 7a 10 mov %edi,0x10(%edx) break; 10e944: eb 28 jmp 10e96e <_Watchdog_Adjust+0x62> } else { units -= _Watchdog_First( header )->delta_interval; _Watchdog_First( header )->delta_interval = 1; 10e946: c7 42 10 01 00 00 00 movl $0x1,0x10(%edx) _ISR_Enable( level ); 10e94d: 50 push %eax 10e94e: 9d popf _Watchdog_Tickle( header ); 10e94f: 83 ec 0c sub $0xc,%esp 10e952: 56 push %esi 10e953: 89 4d e4 mov %ecx,-0x1c(%ebp) 10e956: e8 9d 01 00 00 call 10eaf8 <_Watchdog_Tickle> _ISR_Disable( level ); 10e95b: 9c pushf 10e95c: fa cli 10e95d: 58 pop %eax if ( _Chain_Is_empty( header ) ) 10e95e: 83 c4 10 add $0x10,%esp 10e961: 8b 4d e4 mov -0x1c(%ebp),%ecx 10e964: 39 0e cmp %ecx,(%esi) 10e966: 74 06 je 10e96e <_Watchdog_Adjust+0x62> while ( units ) { if ( units < _Watchdog_First( header )->delta_interval ) { _Watchdog_First( header )->delta_interval -= units; break; } else { units -= _Watchdog_First( header )->delta_interval; 10e968: 29 fb sub %edi,%ebx switch ( direction ) { case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; break; case WATCHDOG_FORWARD: while ( units ) { 10e96a: 85 db test %ebx,%ebx 10e96c: 75 c8 jne 10e936 <_Watchdog_Adjust+0x2a> <== ALWAYS TAKEN } break; } } _ISR_Enable( level ); 10e96e: 50 push %eax 10e96f: 9d popf } 10e970: 8d 65 f4 lea -0xc(%ebp),%esp 10e973: 5b pop %ebx 10e974: 5e pop %esi 10e975: 5f pop %edi 10e976: c9 leave 10e977: c3 ret =============================================================================== 0010d218 <_Watchdog_Remove>: */ Watchdog_States _Watchdog_Remove( Watchdog_Control *the_watchdog ) { 10d218: 55 push %ebp 10d219: 89 e5 mov %esp,%ebp 10d21b: 56 push %esi 10d21c: 53 push %ebx 10d21d: 8b 55 08 mov 0x8(%ebp),%edx ISR_Level level; Watchdog_States previous_state; Watchdog_Control *next_watchdog; _ISR_Disable( level ); 10d220: 9c pushf 10d221: fa cli 10d222: 5e pop %esi previous_state = the_watchdog->state; 10d223: 8b 42 08 mov 0x8(%edx),%eax switch ( previous_state ) { 10d226: 83 f8 01 cmp $0x1,%eax 10d229: 74 09 je 10d234 <_Watchdog_Remove+0x1c> 10d22b: 72 44 jb 10d271 <_Watchdog_Remove+0x59> 10d22d: 83 f8 03 cmp $0x3,%eax 10d230: 77 3f ja 10d271 <_Watchdog_Remove+0x59> <== NEVER TAKEN 10d232: eb 09 jmp 10d23d <_Watchdog_Remove+0x25> /* * 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; 10d234: c7 42 08 00 00 00 00 movl $0x0,0x8(%edx) break; 10d23b: eb 34 jmp 10d271 <_Watchdog_Remove+0x59> case WATCHDOG_ACTIVE: case WATCHDOG_REMOVE_IT: the_watchdog->state = WATCHDOG_INACTIVE; 10d23d: c7 42 08 00 00 00 00 movl $0x0,0x8(%edx) RTEMS_INLINE_ROUTINE Watchdog_Control *_Watchdog_Next( Watchdog_Control *the_watchdog ) { return ( (Watchdog_Control *) the_watchdog->Node.next ); 10d244: 8b 0a mov (%edx),%ecx next_watchdog = _Watchdog_Next( the_watchdog ); if ( _Watchdog_Next(next_watchdog) ) 10d246: 83 39 00 cmpl $0x0,(%ecx) 10d249: 74 06 je 10d251 <_Watchdog_Remove+0x39> next_watchdog->delta_interval += the_watchdog->delta_interval; 10d24b: 8b 5a 10 mov 0x10(%edx),%ebx 10d24e: 01 59 10 add %ebx,0x10(%ecx) if ( _Watchdog_Sync_count ) 10d251: 8b 0d 50 63 12 00 mov 0x126350,%ecx 10d257: 85 c9 test %ecx,%ecx 10d259: 74 0c je 10d267 <_Watchdog_Remove+0x4f> _Watchdog_Sync_level = _ISR_Nest_level; 10d25b: 8b 0d a0 62 12 00 mov 0x1262a0,%ecx 10d261: 89 0d c0 62 12 00 mov %ecx,0x1262c0 ) { Chain_Node *next; Chain_Node *previous; next = the_node->next; 10d267: 8b 1a mov (%edx),%ebx previous = the_node->previous; 10d269: 8b 4a 04 mov 0x4(%edx),%ecx next->previous = previous; 10d26c: 89 4b 04 mov %ecx,0x4(%ebx) previous->next = next; 10d26f: 89 19 mov %ebx,(%ecx) _Chain_Extract_unprotected( &the_watchdog->Node ); break; } the_watchdog->stop_time = _Watchdog_Ticks_since_boot; 10d271: 8b 0d 54 63 12 00 mov 0x126354,%ecx 10d277: 89 4a 18 mov %ecx,0x18(%edx) _ISR_Enable( level ); 10d27a: 56 push %esi 10d27b: 9d popf return( previous_state ); } 10d27c: 5b pop %ebx 10d27d: 5e pop %esi 10d27e: c9 leave 10d27f: c3 ret =============================================================================== 0010e460 <_Watchdog_Report_chain>: void _Watchdog_Report_chain( const char *name, Chain_Control *header ) { 10e460: 55 push %ebp 10e461: 89 e5 mov %esp,%ebp 10e463: 57 push %edi 10e464: 56 push %esi 10e465: 53 push %ebx 10e466: 83 ec 20 sub $0x20,%esp 10e469: 8b 7d 08 mov 0x8(%ebp),%edi 10e46c: 8b 75 0c mov 0xc(%ebp),%esi ISR_Level level; Chain_Node *node; _ISR_Disable( level ); 10e46f: 9c pushf 10e470: fa cli 10e471: 8f 45 e4 popl -0x1c(%ebp) printk( "Watchdog Chain: %s %p\n", name, header ); 10e474: 56 push %esi 10e475: 57 push %edi 10e476: 68 48 25 12 00 push $0x122548 10e47b: e8 18 aa ff ff call 108e98 */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 10e480: 8b 1e mov (%esi),%ebx */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 10e482: 83 c6 04 add $0x4,%esi if ( !_Chain_Is_empty( header ) ) { 10e485: 83 c4 10 add $0x10,%esp 10e488: 39 f3 cmp %esi,%ebx 10e48a: 74 1d je 10e4a9 <_Watchdog_Report_chain+0x49> node != _Chain_Tail(header) ; node = node->next ) { Watchdog_Control *watch = (Watchdog_Control *) node; _Watchdog_Report( NULL, watch ); 10e48c: 52 push %edx 10e48d: 52 push %edx 10e48e: 53 push %ebx 10e48f: 6a 00 push $0x0 10e491: e8 32 00 00 00 call 10e4c8 <_Watchdog_Report> _ISR_Disable( level ); printk( "Watchdog Chain: %s %p\n", name, header ); if ( !_Chain_Is_empty( header ) ) { for ( node = header->first ; node != _Chain_Tail(header) ; node = node->next ) 10e496: 8b 1b mov (%ebx),%ebx Chain_Node *node; _ISR_Disable( level ); printk( "Watchdog Chain: %s %p\n", name, header ); if ( !_Chain_Is_empty( header ) ) { for ( node = header->first ; 10e498: 83 c4 10 add $0x10,%esp 10e49b: 39 f3 cmp %esi,%ebx 10e49d: 75 ed jne 10e48c <_Watchdog_Report_chain+0x2c><== NEVER TAKEN { Watchdog_Control *watch = (Watchdog_Control *) node; _Watchdog_Report( NULL, watch ); } printk( "== end of %s \n", name ); 10e49f: 50 push %eax 10e4a0: 50 push %eax 10e4a1: 57 push %edi 10e4a2: 68 5f 25 12 00 push $0x12255f 10e4a7: eb 08 jmp 10e4b1 <_Watchdog_Report_chain+0x51> } else { printk( "Chain is empty\n" ); 10e4a9: 83 ec 0c sub $0xc,%esp 10e4ac: 68 6e 25 12 00 push $0x12256e 10e4b1: e8 e2 a9 ff ff call 108e98 10e4b6: 83 c4 10 add $0x10,%esp } _ISR_Enable( level ); 10e4b9: ff 75 e4 pushl -0x1c(%ebp) 10e4bc: 9d popf } 10e4bd: 8d 65 f4 lea -0xc(%ebp),%esp 10e4c0: 5b pop %ebx 10e4c1: 5e pop %esi 10e4c2: 5f pop %edi 10e4c3: c9 leave 10e4c4: c3 ret =============================================================================== 0010d280 <_Watchdog_Tickle>: */ void _Watchdog_Tickle( Chain_Control *header ) { 10d280: 55 push %ebp 10d281: 89 e5 mov %esp,%ebp 10d283: 57 push %edi 10d284: 56 push %esi 10d285: 53 push %ebx 10d286: 83 ec 1c sub $0x1c,%esp 10d289: 8b 7d 08 mov 0x8(%ebp),%edi * 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 ); 10d28c: 9c pushf 10d28d: fa cli 10d28e: 5e pop %esi */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 10d28f: 8b 1f mov (%edi),%ebx */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 10d291: 8d 47 04 lea 0x4(%edi),%eax 10d294: 89 45 e4 mov %eax,-0x1c(%ebp) if ( _Chain_Is_empty( header ) ) 10d297: 39 c3 cmp %eax,%ebx 10d299: 74 40 je 10d2db <_Watchdog_Tickle+0x5b> * 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) { 10d29b: 8b 43 10 mov 0x10(%ebx),%eax 10d29e: 85 c0 test %eax,%eax 10d2a0: 74 08 je 10d2aa <_Watchdog_Tickle+0x2a> the_watchdog->delta_interval--; 10d2a2: 48 dec %eax 10d2a3: 89 43 10 mov %eax,0x10(%ebx) if ( the_watchdog->delta_interval != 0 ) 10d2a6: 85 c0 test %eax,%eax 10d2a8: 75 31 jne 10d2db <_Watchdog_Tickle+0x5b> goto leave; } do { watchdog_state = _Watchdog_Remove( the_watchdog ); 10d2aa: 83 ec 0c sub $0xc,%esp 10d2ad: 53 push %ebx 10d2ae: e8 65 ff ff ff call 10d218 <_Watchdog_Remove> _ISR_Enable( level ); 10d2b3: 56 push %esi 10d2b4: 9d popf switch( watchdog_state ) { 10d2b5: 83 c4 10 add $0x10,%esp 10d2b8: 83 f8 02 cmp $0x2,%eax 10d2bb: 75 0e jne 10d2cb <_Watchdog_Tickle+0x4b> <== NEVER TAKEN case WATCHDOG_ACTIVE: (*the_watchdog->routine)( 10d2bd: 50 push %eax 10d2be: 50 push %eax 10d2bf: ff 73 24 pushl 0x24(%ebx) 10d2c2: ff 73 20 pushl 0x20(%ebx) 10d2c5: ff 53 1c call *0x1c(%ebx) 10d2c8: 83 c4 10 add $0x10,%esp case WATCHDOG_REMOVE_IT: break; } _ISR_Disable( level ); 10d2cb: 9c pushf 10d2cc: fa cli 10d2cd: 5e pop %esi RTEMS_INLINE_ROUTINE Watchdog_Control *_Watchdog_First( Chain_Control *header ) { return ( (Watchdog_Control *) header->first ); 10d2ce: 8b 1f mov (%edi),%ebx the_watchdog = _Watchdog_First( header ); } while ( !_Chain_Is_empty( header ) && (the_watchdog->delta_interval == 0) ); 10d2d0: 3b 5d e4 cmp -0x1c(%ebp),%ebx 10d2d3: 74 06 je 10d2db <_Watchdog_Tickle+0x5b> 10d2d5: 83 7b 10 00 cmpl $0x0,0x10(%ebx) 10d2d9: eb cd jmp 10d2a8 <_Watchdog_Tickle+0x28> leave: _ISR_Enable(level); 10d2db: 56 push %esi 10d2dc: 9d popf } 10d2dd: 8d 65 f4 lea -0xc(%ebp),%esp 10d2e0: 5b pop %ebx 10d2e1: 5e pop %esi 10d2e2: 5f pop %edi 10d2e3: c9 leave 10d2e4: c3 ret =============================================================================== 0010a490 : int adjtime( struct timeval *delta, struct timeval *olddelta ) { 10a490: 55 push %ebp 10a491: 89 e5 mov %esp,%ebp 10a493: 56 push %esi 10a494: 53 push %ebx 10a495: 83 ec 10 sub $0x10,%esp 10a498: 8b 5d 08 mov 0x8(%ebp),%ebx 10a49b: 8b 75 0c mov 0xc(%ebp),%esi long adjustment; /* * Simple validations */ if ( !delta ) 10a49e: 85 db test %ebx,%ebx 10a4a0: 74 09 je 10a4ab rtems_set_errno_and_return_minus_one( EINVAL ); if ( delta->tv_usec >= TOD_MICROSECONDS_PER_SECOND ) 10a4a2: 81 7b 04 3f 42 0f 00 cmpl $0xf423f,0x4(%ebx) 10a4a9: 76 13 jbe 10a4be rtems_set_errno_and_return_minus_one( EINVAL ); 10a4ab: e8 14 8e 00 00 call 1132c4 <__errno> 10a4b0: c7 00 16 00 00 00 movl $0x16,(%eax) 10a4b6: 83 c8 ff or $0xffffffff,%eax 10a4b9: e9 9a 00 00 00 jmp 10a558 if ( olddelta ) { 10a4be: 85 f6 test %esi,%esi 10a4c0: 74 0d je 10a4cf olddelta->tv_sec = 0; 10a4c2: c7 06 00 00 00 00 movl $0x0,(%esi) olddelta->tv_usec = 0; 10a4c8: c7 46 04 00 00 00 00 movl $0x0,0x4(%esi) } /* convert delta to microseconds */ adjustment = (delta->tv_sec * TOD_MICROSECONDS_PER_SECOND); 10a4cf: 69 03 40 42 0f 00 imul $0xf4240,(%ebx),%eax adjustment += delta->tv_usec; 10a4d5: 03 43 04 add 0x4(%ebx),%eax /* too small to account for */ if ( adjustment < rtems_configuration_get_microseconds_per_tick() ) 10a4d8: 3b 05 04 32 12 00 cmp 0x123204,%eax 10a4de: 72 76 jb 10a556 rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 10a4e0: a1 30 73 12 00 mov 0x127330,%eax 10a4e5: 40 inc %eax 10a4e6: a3 30 73 12 00 mov %eax,0x127330 * This prevents context switches while we are adjusting the TOD */ _Thread_Disable_dispatch(); _TOD_Get( &ts ); 10a4eb: 83 ec 0c sub $0xc,%esp 10a4ee: 8d 45 f0 lea -0x10(%ebp),%eax 10a4f1: 50 push %eax 10a4f2: e8 f5 14 00 00 call 10b9ec <_TOD_Get> ts.tv_sec += delta->tv_sec; 10a4f7: 8b 03 mov (%ebx),%eax 10a4f9: 01 45 f0 add %eax,-0x10(%ebp) ts.tv_nsec += delta->tv_usec * TOD_NANOSECONDS_PER_MICROSECOND; 10a4fc: 69 43 04 e8 03 00 00 imul $0x3e8,0x4(%ebx),%eax 10a503: 8b 4d f0 mov -0x10(%ebp),%ecx 10a506: 03 45 f4 add -0xc(%ebp),%eax /* if adjustment is too much positive */ while ( ts.tv_nsec >= TOD_NANOSECONDS_PER_SECOND ) { 10a509: 83 c4 10 add $0x10,%esp 10a50c: eb 05 jmp 10a513 10a50e: 2d 00 ca 9a 3b sub $0x3b9aca00,%eax 10a513: 89 ca mov %ecx,%edx 10a515: 41 inc %ecx 10a516: 3d ff c9 9a 3b cmp $0x3b9ac9ff,%eax 10a51b: 77 f1 ja 10a50e 10a51d: eb 05 jmp 10a524 10a51f: 05 00 ca 9a 3b add $0x3b9aca00,%eax 10a524: 89 d1 mov %edx,%ecx 10a526: 4a dec %edx ts.tv_nsec -= TOD_NANOSECONDS_PER_SECOND; ts.tv_sec++; } /* if adjustment is too much negative */ while ( ts.tv_nsec <= (-1 * TOD_NANOSECONDS_PER_SECOND) ) { 10a527: 3d 00 36 65 c4 cmp $0xc4653600,%eax 10a52c: 76 f1 jbe 10a51f 10a52e: 89 45 f4 mov %eax,-0xc(%ebp) 10a531: 89 4d f0 mov %ecx,-0x10(%ebp) ts.tv_nsec += TOD_NANOSECONDS_PER_SECOND; ts.tv_sec--; } _TOD_Set( &ts ); 10a534: 83 ec 0c sub $0xc,%esp 10a537: 8d 45 f0 lea -0x10(%ebp),%eax 10a53a: 50 push %eax 10a53b: e8 3c 15 00 00 call 10ba7c <_TOD_Set> _Thread_Enable_dispatch(); 10a540: e8 90 25 00 00 call 10cad5 <_Thread_Enable_dispatch> /* set the user's output */ if ( olddelta ) 10a545: 83 c4 10 add $0x10,%esp 10a548: 85 f6 test %esi,%esi 10a54a: 74 0a je 10a556 <== NEVER TAKEN *olddelta = *delta; 10a54c: 8b 03 mov (%ebx),%eax 10a54e: 8b 53 04 mov 0x4(%ebx),%edx 10a551: 89 06 mov %eax,(%esi) 10a553: 89 56 04 mov %edx,0x4(%esi) 10a556: 31 c0 xor %eax,%eax return 0; } 10a558: 8d 65 f8 lea -0x8(%ebp),%esp 10a55b: 5b pop %ebx 10a55c: 5e pop %esi 10a55d: c9 leave 10a55e: c3 ret =============================================================================== 0010a410 : int clock_gettime( clockid_t clock_id, struct timespec *tp ) { 10a410: 55 push %ebp 10a411: 89 e5 mov %esp,%ebp 10a413: 83 ec 08 sub $0x8,%esp 10a416: 8b 45 08 mov 0x8(%ebp),%eax 10a419: 8b 55 0c mov 0xc(%ebp),%edx if ( !tp ) 10a41c: 85 d2 test %edx,%edx 10a41e: 74 3c je 10a45c rtems_set_errno_and_return_minus_one( EINVAL ); if ( clock_id == CLOCK_REALTIME ) { 10a420: 83 f8 01 cmp $0x1,%eax 10a423: 75 0b jne 10a430 _TOD_Get(tp); 10a425: 83 ec 0c sub $0xc,%esp 10a428: 52 push %edx 10a429: e8 9e 1b 00 00 call 10bfcc <_TOD_Get> 10a42e: eb 13 jmp 10a443 return 0; } #ifdef CLOCK_MONOTONIC if ( clock_id == CLOCK_MONOTONIC ) { 10a430: 83 f8 04 cmp $0x4,%eax 10a433: 74 05 je 10a43a <== NEVER TAKEN return 0; } #endif #ifdef _POSIX_CPUTIME if ( clock_id == CLOCK_PROCESS_CPUTIME ) { 10a435: 83 f8 02 cmp $0x2,%eax 10a438: 75 10 jne 10a44a _TOD_Get_uptime_as_timespec( tp ); 10a43a: 83 ec 0c sub $0xc,%esp 10a43d: 52 push %edx 10a43e: e8 e5 1b 00 00 call 10c028 <_TOD_Get_uptime_as_timespec> 10a443: 31 c0 xor %eax,%eax return 0; 10a445: 83 c4 10 add $0x10,%esp 10a448: eb 20 jmp 10a46a } #endif #ifdef _POSIX_THREAD_CPUTIME if ( clock_id == CLOCK_THREAD_CPUTIME ) 10a44a: 83 f8 03 cmp $0x3,%eax 10a44d: 75 0d jne 10a45c rtems_set_errno_and_return_minus_one( ENOSYS ); 10a44f: e8 90 92 00 00 call 1136e4 <__errno> 10a454: c7 00 58 00 00 00 movl $0x58,(%eax) 10a45a: eb 0b jmp 10a467 #endif rtems_set_errno_and_return_minus_one( EINVAL ); 10a45c: e8 83 92 00 00 call 1136e4 <__errno> 10a461: c7 00 16 00 00 00 movl $0x16,(%eax) 10a467: 83 c8 ff or $0xffffffff,%eax return 0; } 10a46a: c9 leave 10a46b: c3 ret =============================================================================== 0010a46c : int clock_settime( clockid_t clock_id, const struct timespec *tp ) { 10a46c: 55 push %ebp 10a46d: 89 e5 mov %esp,%ebp 10a46f: 83 ec 08 sub $0x8,%esp 10a472: 8b 45 08 mov 0x8(%ebp),%eax 10a475: 8b 55 0c mov 0xc(%ebp),%edx if ( !tp ) 10a478: 85 d2 test %edx,%edx 10a47a: 74 44 je 10a4c0 <== NEVER TAKEN rtems_set_errno_and_return_minus_one( EINVAL ); if ( clock_id == CLOCK_REALTIME ) { 10a47c: 83 f8 01 cmp $0x1,%eax 10a47f: 75 28 jne 10a4a9 if ( tp->tv_sec < TOD_SECONDS_1970_THROUGH_1988 ) 10a481: 81 3a ff e4 da 21 cmpl $0x21dae4ff,(%edx) 10a487: 76 37 jbe 10a4c0 rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 10a489: a1 48 82 12 00 mov 0x128248,%eax 10a48e: 40 inc %eax 10a48f: a3 48 82 12 00 mov %eax,0x128248 rtems_set_errno_and_return_minus_one( EINVAL ); _Thread_Disable_dispatch(); _TOD_Set( tp ); 10a494: 83 ec 0c sub $0xc,%esp 10a497: 52 push %edx 10a498: e8 e3 1b 00 00 call 10c080 <_TOD_Set> _Thread_Enable_dispatch(); 10a49d: e8 37 2c 00 00 call 10d0d9 <_Thread_Enable_dispatch> 10a4a2: 31 c0 xor %eax,%eax rtems_set_errno_and_return_minus_one( ENOSYS ); #endif else rtems_set_errno_and_return_minus_one( EINVAL ); return 0; 10a4a4: 83 c4 10 add $0x10,%esp 10a4a7: eb 25 jmp 10a4ce _Thread_Disable_dispatch(); _TOD_Set( tp ); _Thread_Enable_dispatch(); } #ifdef _POSIX_CPUTIME else if ( clock_id == CLOCK_PROCESS_CPUTIME ) 10a4a9: 83 f8 02 cmp $0x2,%eax 10a4ac: 74 05 je 10a4b3 rtems_set_errno_and_return_minus_one( ENOSYS ); #endif #ifdef _POSIX_THREAD_CPUTIME else if ( clock_id == CLOCK_THREAD_CPUTIME ) 10a4ae: 83 f8 03 cmp $0x3,%eax 10a4b1: 75 0d jne 10a4c0 rtems_set_errno_and_return_minus_one( ENOSYS ); 10a4b3: e8 2c 92 00 00 call 1136e4 <__errno> 10a4b8: c7 00 58 00 00 00 movl $0x58,(%eax) 10a4be: eb 0b jmp 10a4cb #endif else rtems_set_errno_and_return_minus_one( EINVAL ); 10a4c0: e8 1f 92 00 00 call 1136e4 <__errno> 10a4c5: c7 00 16 00 00 00 movl $0x16,(%eax) 10a4cb: 83 c8 ff or $0xffffffff,%eax return 0; } 10a4ce: c9 leave 10a4cf: c3 ret =============================================================================== 00111fc8 : int killinfo( pid_t pid, int sig, const union sigval *value ) { 111fc8: 55 push %ebp 111fc9: 89 e5 mov %esp,%ebp 111fcb: 57 push %edi 111fcc: 56 push %esi 111fcd: 53 push %ebx 111fce: 83 ec 3c sub $0x3c,%esp 111fd1: 8b 5d 0c mov 0xc(%ebp),%ebx 111fd4: 8b 7d 10 mov 0x10(%ebp),%edi POSIX_signals_Siginfo_node *psiginfo; /* * Only supported for the "calling process" (i.e. this node). */ if ( pid != getpid() ) 111fd7: e8 34 ce ff ff call 10ee10 111fdc: 39 45 08 cmp %eax,0x8(%ebp) 111fdf: 74 0d je 111fee rtems_set_errno_and_return_minus_one( ESRCH ); 111fe1: e8 3a 0a 00 00 call 112a20 <__errno> 111fe6: c7 00 03 00 00 00 movl $0x3,(%eax) 111fec: eb 0f jmp 111ffd /* * Validate the signal passed. */ if ( !sig ) 111fee: 85 db test %ebx,%ebx 111ff0: 75 13 jne 112005 rtems_set_errno_and_return_minus_one( EINVAL ); 111ff2: e8 29 0a 00 00 call 112a20 <__errno> 111ff7: c7 00 16 00 00 00 movl $0x16,(%eax) 111ffd: 83 c8 ff or $0xffffffff,%eax 112000: e9 e7 01 00 00 jmp 1121ec static inline bool is_valid_signo( int signo ) { return ((signo) >= 1 && (signo) <= 32 ); 112005: 8d 4b ff lea -0x1(%ebx),%ecx if ( !is_valid_signo(sig) ) 112008: 83 f9 1f cmp $0x1f,%ecx 11200b: 77 e5 ja 111ff2 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 ) 11200d: 6b d3 0c imul $0xc,%ebx,%edx 112010: 31 c0 xor %eax,%eax 112012: 83 ba 70 67 12 00 01 cmpl $0x1,0x126770(%edx) 112019: 0f 84 cd 01 00 00 je 1121ec /* * 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 ) ) 11201f: 83 fb 04 cmp $0x4,%ebx 112022: 74 0a je 11202e 112024: 83 fb 08 cmp $0x8,%ebx 112027: 74 05 je 11202e 112029: 83 fb 0b cmp $0xb,%ebx 11202c: 75 16 jne 112044 return pthread_kill( pthread_self(), sig ); 11202e: e8 71 05 00 00 call 1125a4 112033: 56 push %esi 112034: 56 push %esi 112035: 53 push %ebx 112036: 50 push %eax 112037: e8 bc 04 00 00 call 1124f8 11203c: 83 c4 10 add $0x10,%esp 11203f: e9 a8 01 00 00 jmp 1121ec static inline sigset_t signo_to_mask( uint32_t sig ) { return 1u << (sig - 1); 112044: be 01 00 00 00 mov $0x1,%esi 112049: d3 e6 shl %cl,%esi /* * Build up a siginfo structure */ siginfo = &siginfo_struct; siginfo->si_signo = sig; 11204b: 89 5d dc mov %ebx,-0x24(%ebp) siginfo->si_code = SI_USER; 11204e: c7 45 e0 01 00 00 00 movl $0x1,-0x20(%ebp) if ( !value ) { 112055: 85 ff test %edi,%edi 112057: 75 09 jne 112062 siginfo->si_value.sival_int = 0; 112059: c7 45 e4 00 00 00 00 movl $0x0,-0x1c(%ebp) 112060: eb 05 jmp 112067 } else { siginfo->si_value = *value; 112062: 8b 07 mov (%edi),%eax 112064: 89 45 e4 mov %eax,-0x1c(%ebp) rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 112067: a1 08 62 12 00 mov 0x126208,%eax 11206c: 40 inc %eax 11206d: a3 08 62 12 00 mov %eax,0x126208 /* * 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; 112072: 8b 15 c4 62 12 00 mov 0x1262c4,%edx api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 112078: 8b 82 f8 00 00 00 mov 0xf8(%edx),%eax 11207e: 8b 80 cc 00 00 00 mov 0xcc(%eax),%eax 112084: f7 d0 not %eax 112086: 85 c6 test %eax,%esi 112088: 0f 85 e0 00 00 00 jne 11216e /* XXX violation of visibility -- need to define thread queue support */ the_chain = &_POSIX_signals_Wait_queue.Queues.Fifo; for ( the_node = the_chain->first ; 11208e: a1 f4 68 12 00 mov 0x1268f4,%eax 112093: eb 23 jmp 1120b8 !_Chain_Is_tail( the_chain, the_node ) ; the_node = the_node->next ) { the_thread = (Thread_Control *)the_node; 112095: 89 c2 mov %eax,%edx api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 112097: 8b 88 f8 00 00 00 mov 0xf8(%eax),%ecx #endif /* * Is this thread is actually blocked waiting for the signal? */ if (the_thread->Wait.option & mask) 11209d: 85 70 30 test %esi,0x30(%eax) 1120a0: 0f 85 c8 00 00 00 jne 11216e /* * Is this thread is blocked waiting for another signal but has * not blocked this one? */ if (~api->signals_blocked & mask) 1120a6: 8b 89 cc 00 00 00 mov 0xcc(%ecx),%ecx 1120ac: f7 d1 not %ecx 1120ae: 85 ce test %ecx,%esi 1120b0: 0f 85 b8 00 00 00 jne 11216e the_chain = &_POSIX_signals_Wait_queue.Queues.Fifo; for ( the_node = the_chain->first ; !_Chain_Is_tail( the_chain, the_node ) ; the_node = the_node->next ) { 1120b6: 8b 00 mov (%eax),%eax */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 1120b8: 3d f8 68 12 00 cmp $0x1268f8,%eax 1120bd: 75 d6 jne 112095 * NOTES: * * + rtems internal threads do not receive signals. */ interested = NULL; interested_priority = PRIORITY_MAXIMUM + 1; 1120bf: 0f b6 05 f4 21 12 00 movzbl 0x1221f4,%eax 1120c6: 40 inc %eax 1120c7: 89 45 d4 mov %eax,-0x2c(%ebp) 1120ca: 31 d2 xor %edx,%edx 1120cc: c7 45 cc 02 00 00 00 movl $0x2,-0x34(%ebp) for (the_api = OBJECTS_CLASSIC_API; the_api <= OBJECTS_APIS_LAST; the_api++) { /* * This can occur when no one is interested and ITRON is not configured. */ if ( !_Objects_Information_table[ the_api ] ) 1120d3: 8b 4d cc mov -0x34(%ebp),%ecx 1120d6: 8b 04 8d dc 61 12 00 mov 0x1261dc(,%ecx,4),%eax 1120dd: 85 c0 test %eax,%eax 1120df: 74 7c je 11215d continue; the_info = _Objects_Information_table[ the_api ][ 1 ]; 1120e1: 8b 40 04 mov 0x4(%eax),%eax */ if ( !the_info ) continue; #endif maximum = the_info->maximum; 1120e4: 0f b7 78 10 movzwl 0x10(%eax),%edi 1120e8: 89 7d c0 mov %edi,-0x40(%ebp) object_table = the_info->local_table; 1120eb: 8b 40 1c mov 0x1c(%eax),%eax 1120ee: 89 45 c4 mov %eax,-0x3c(%ebp) 1120f1: c7 45 d0 01 00 00 00 movl $0x1,-0x30(%ebp) for ( index = 1 ; index <= maximum ; index++ ) { 1120f8: eb 5b jmp 112155 the_thread = (Thread_Control *) object_table[ index ]; 1120fa: 8b 4d d0 mov -0x30(%ebp),%ecx 1120fd: 8b 7d c4 mov -0x3c(%ebp),%edi 112100: 8b 04 8f mov (%edi,%ecx,4),%eax if ( !the_thread ) 112103: 85 c0 test %eax,%eax 112105: 74 41 je 112148 /* * If this thread is of lower priority than the interested thread, * go on to the next thread. */ if ( the_thread->current_priority > interested_priority ) 112107: 8b 48 14 mov 0x14(%eax),%ecx 11210a: 3b 4d d4 cmp -0x2c(%ebp),%ecx 11210d: 77 39 ja 112148 DEBUG_STEP("2"); /* * If this thread is not interested, then go on to the next thread. */ api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 11210f: 8b b8 f8 00 00 00 mov 0xf8(%eax),%edi 112115: 8b bf cc 00 00 00 mov 0xcc(%edi),%edi 11211b: f7 d7 not %edi 11211d: 85 fe test %edi,%esi 11211f: 74 27 je 112148 * * 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 ) { 112121: 3b 4d d4 cmp -0x2c(%ebp),%ecx 112124: 72 27 jb 11214d * and blocking interruptibutable by signal. * * If the interested thread is ready, don't think about changing. */ if ( !_States_Is_ready( interested->current_state ) ) { 112126: 8b 7a 10 mov 0x10(%edx),%edi 112129: 89 7d c8 mov %edi,-0x38(%ebp) 11212c: 85 ff test %edi,%edi 11212e: 74 18 je 112148 <== NEVER TAKEN /* preferred ready over blocked */ DEBUG_STEP("5"); if ( _States_Is_ready( the_thread->current_state ) ) { 112130: 8b 78 10 mov 0x10(%eax),%edi 112133: 85 ff test %edi,%edi 112135: 74 16 je 11214d continue; } DEBUG_STEP("6"); /* prefer blocked/interruptible over blocked/not interruptible */ if ( !_States_Is_interruptible_by_signal(interested->current_state) ) { 112137: f7 45 c8 00 00 00 10 testl $0x10000000,-0x38(%ebp) 11213e: 75 08 jne 112148 DEBUG_STEP("7"); if ( _States_Is_interruptible_by_signal(the_thread->current_state) ) { 112140: 81 e7 00 00 00 10 and $0x10000000,%edi 112146: 75 05 jne 11214d 112148: 8b 4d d4 mov -0x2c(%ebp),%ecx 11214b: eb 02 jmp 11214f 11214d: 89 c2 mov %eax,%edx #endif maximum = the_info->maximum; object_table = the_info->local_table; for ( index = 1 ; index <= maximum ; index++ ) { 11214f: ff 45 d0 incl -0x30(%ebp) 112152: 89 4d d4 mov %ecx,-0x2c(%ebp) 112155: 8b 45 c0 mov -0x40(%ebp),%eax 112158: 39 45 d0 cmp %eax,-0x30(%ebp) 11215b: 76 9d jbe 1120fa * + 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++) { 11215d: ff 45 cc incl -0x34(%ebp) 112160: 83 7d cc 05 cmpl $0x5,-0x34(%ebp) 112164: 0f 85 69 ff ff ff jne 1120d3 } } } } if ( interested ) { 11216a: 85 d2 test %edx,%edx 11216c: 74 17 je 112185 * thread needs to do the post context switch extension so it can * evaluate the signals pending. */ process_it: the_thread->do_post_task_switch_extension = true; 11216e: c6 42 74 01 movb $0x1,0x74(%edx) /* * 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 ) ) { 112172: 51 push %ecx 112173: 8d 45 dc lea -0x24(%ebp),%eax 112176: 50 push %eax 112177: 53 push %ebx 112178: 52 push %edx 112179: e8 02 02 00 00 call 112380 <_POSIX_signals_Unblock_thread> 11217e: 83 c4 10 add $0x10,%esp 112181: 84 c0 test %al,%al 112183: 75 60 jne 1121e5 /* * 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 ); 112185: 83 ec 0c sub $0xc,%esp 112188: 56 push %esi 112189: e8 ce 01 00 00 call 11235c <_POSIX_signals_Set_process_signals> if ( _POSIX_signals_Vectors[ sig ].sa_flags == SA_SIGINFO ) { 11218e: 6b db 0c imul $0xc,%ebx,%ebx 112191: 83 c4 10 add $0x10,%esp 112194: 83 bb 68 67 12 00 02 cmpl $0x2,0x126768(%ebx) 11219b: 75 48 jne 1121e5 psiginfo = (POSIX_signals_Siginfo_node *) 11219d: 83 ec 0c sub $0xc,%esp 1121a0: 68 e8 68 12 00 push $0x1268e8 1121a5: e8 da 8c ff ff call 10ae84 <_Chain_Get> _Chain_Get( &_POSIX_signals_Inactive_siginfo ); if ( !psiginfo ) { 1121aa: 83 c4 10 add $0x10,%esp 1121ad: 85 c0 test %eax,%eax 1121af: 75 15 jne 1121c6 _Thread_Enable_dispatch(); 1121b1: e8 67 a1 ff ff call 10c31d <_Thread_Enable_dispatch> rtems_set_errno_and_return_minus_one( EAGAIN ); 1121b6: e8 65 08 00 00 call 112a20 <__errno> 1121bb: c7 00 0b 00 00 00 movl $0xb,(%eax) 1121c1: e9 37 fe ff ff jmp 111ffd } psiginfo->Info = *siginfo; 1121c6: 8d 78 08 lea 0x8(%eax),%edi 1121c9: 8d 75 dc lea -0x24(%ebp),%esi 1121cc: b9 03 00 00 00 mov $0x3,%ecx 1121d1: f3 a5 rep movsl %ds:(%esi),%es:(%edi) _Chain_Append( &_POSIX_signals_Siginfo[ sig ], &psiginfo->Node ); 1121d3: 52 push %edx 1121d4: 52 push %edx 1121d5: 50 push %eax 1121d6: 81 c3 60 69 12 00 add $0x126960,%ebx 1121dc: 53 push %ebx 1121dd: e8 66 8c ff ff call 10ae48 <_Chain_Append> 1121e2: 83 c4 10 add $0x10,%esp } DEBUG_STEP("\n"); _Thread_Enable_dispatch(); 1121e5: e8 33 a1 ff ff call 10c31d <_Thread_Enable_dispatch> 1121ea: 31 c0 xor %eax,%eax return 0; } 1121ec: 8d 65 f4 lea -0xc(%ebp),%esp 1121ef: 5b pop %ebx 1121f0: 5e pop %esi 1121f1: 5f pop %edi 1121f2: c9 leave 1121f3: c3 ret =============================================================================== 0011edd0 : int nanosleep( const struct timespec *rqtp, struct timespec *rmtp ) { 11edd0: 55 push %ebp 11edd1: 89 e5 mov %esp,%ebp 11edd3: 56 push %esi 11edd4: 53 push %ebx 11edd5: 8b 75 08 mov 0x8(%ebp),%esi 11edd8: 8b 5d 0c mov 0xc(%ebp),%ebx Watchdog_Interval ticks; if ( !_Timespec_Is_valid( rqtp ) ) 11eddb: 83 ec 0c sub $0xc,%esp 11edde: 56 push %esi 11eddf: e8 44 01 00 00 call 11ef28 <_Timespec_Is_valid> 11ede4: 83 c4 10 add $0x10,%esp 11ede7: 84 c0 test %al,%al 11ede9: 74 0b je 11edf6 * Return EINVAL if the delay interval is negative. * * NOTE: This behavior is beyond the POSIX specification. * FSU and GNU/Linux pthreads shares this behavior. */ if ( rqtp->tv_sec < 0 || rqtp->tv_nsec < 0 ) 11edeb: 83 3e 00 cmpl $0x0,(%esi) 11edee: 78 06 js 11edf6 <== NEVER TAKEN 11edf0: 83 7e 04 00 cmpl $0x0,0x4(%esi) 11edf4: 79 10 jns 11ee06 <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one( EINVAL ); 11edf6: e8 35 40 ff ff call 112e30 <__errno> 11edfb: c7 00 16 00 00 00 movl $0x16,(%eax) 11ee01: e9 c4 00 00 00 jmp 11eeca ticks = _Timespec_To_ticks( rqtp ); 11ee06: 83 ec 0c sub $0xc,%esp 11ee09: 56 push %esi 11ee0a: e8 5d 1f ff ff call 110d6c <_Timespec_To_ticks> 11ee0f: 89 c6 mov %eax,%esi * A nanosleep for zero time is implemented as a yield. * This behavior is also beyond the POSIX specification but is * consistent with the RTEMS API and yields desirable behavior. */ if ( !ticks ) { 11ee11: 83 c4 10 add $0x10,%esp 11ee14: 85 c0 test %eax,%eax 11ee16: 75 2f jne 11ee47 11ee18: a1 70 72 12 00 mov 0x127270,%eax 11ee1d: 40 inc %eax 11ee1e: a3 70 72 12 00 mov %eax,0x127270 _Thread_Disable_dispatch(); _Thread_Yield_processor(); 11ee23: e8 6c e3 fe ff call 10d194 <_Thread_Yield_processor> _Thread_Enable_dispatch(); 11ee28: e8 78 d8 fe ff call 10c6a5 <_Thread_Enable_dispatch> if ( rmtp ) { 11ee2d: 85 db test %ebx,%ebx 11ee2f: 0f 84 9a 00 00 00 je 11eecf rmtp->tv_sec = 0; 11ee35: c7 03 00 00 00 00 movl $0x0,(%ebx) rmtp->tv_nsec = 0; 11ee3b: c7 43 04 00 00 00 00 movl $0x0,0x4(%ebx) 11ee42: e9 88 00 00 00 jmp 11eecf 11ee47: a1 70 72 12 00 mov 0x127270,%eax 11ee4c: 40 inc %eax 11ee4d: a3 70 72 12 00 mov %eax,0x127270 /* * Block for the desired amount of time */ _Thread_Disable_dispatch(); _Thread_Set_state( 11ee52: 52 push %edx 11ee53: 52 push %edx 11ee54: 68 08 00 00 10 push $0x10000008 11ee59: ff 35 2c 73 12 00 pushl 0x12732c 11ee5f: e8 50 e0 fe ff call 10ceb4 <_Thread_Set_state> STATES_DELAYING | STATES_INTERRUPTIBLE_BY_SIGNAL ); _Watchdog_Initialize( &_Thread_Executing->Timer, _Thread_Delay_ended, _Thread_Executing->Object.id, 11ee64: 8b 15 2c 73 12 00 mov 0x12732c,%edx _Thread_Disable_dispatch(); _Thread_Set_state( _Thread_Executing, STATES_DELAYING | STATES_INTERRUPTIBLE_BY_SIGNAL ); _Watchdog_Initialize( 11ee6a: 8b 42 08 mov 0x8(%edx),%eax Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 11ee6d: c7 42 50 00 00 00 00 movl $0x0,0x50(%edx) the_watchdog->routine = routine; 11ee74: c7 42 64 28 c5 10 00 movl $0x10c528,0x64(%edx) the_watchdog->id = id; 11ee7b: 89 42 68 mov %eax,0x68(%edx) the_watchdog->user_data = user_data; 11ee7e: c7 42 6c 00 00 00 00 movl $0x0,0x6c(%edx) Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 11ee85: 89 72 54 mov %esi,0x54(%edx) _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 11ee88: 59 pop %ecx 11ee89: 58 pop %eax 11ee8a: 83 c2 48 add $0x48,%edx 11ee8d: 52 push %edx 11ee8e: 68 4c 73 12 00 push $0x12734c 11ee93: e8 5c e6 fe ff call 10d4f4 <_Watchdog_Insert> _Thread_Delay_ended, _Thread_Executing->Object.id, NULL ); _Watchdog_Insert_ticks( &_Thread_Executing->Timer, ticks ); _Thread_Enable_dispatch(); 11ee98: e8 08 d8 fe ff call 10c6a5 <_Thread_Enable_dispatch> /* calculate time remaining */ if ( rmtp ) { 11ee9d: 83 c4 10 add $0x10,%esp 11eea0: 85 db test %ebx,%ebx 11eea2: 74 2b je 11eecf ticks -= _Thread_Executing->Timer.stop_time - _Thread_Executing->Timer.start_time; 11eea4: a1 2c 73 12 00 mov 0x12732c,%eax _Thread_Enable_dispatch(); /* calculate time remaining */ if ( rmtp ) { ticks -= 11eea9: 03 70 5c add 0x5c(%eax),%esi 11eeac: 2b 70 60 sub 0x60(%eax),%esi _Thread_Executing->Timer.stop_time - _Thread_Executing->Timer.start_time; _Timespec_From_ticks( ticks, rmtp ); 11eeaf: 50 push %eax 11eeb0: 50 push %eax 11eeb1: 53 push %ebx 11eeb2: 56 push %esi 11eeb3: e8 48 00 00 00 call 11ef00 <_Timespec_From_ticks> */ #if defined(RTEMS_POSIX_API) /* * If there is time remaining, then we were interrupted by a signal. */ if ( ticks ) 11eeb8: 83 c4 10 add $0x10,%esp 11eebb: 85 f6 test %esi,%esi 11eebd: 74 10 je 11eecf rtems_set_errno_and_return_minus_one( EINTR ); 11eebf: e8 6c 3f ff ff call 112e30 <__errno> 11eec4: c7 00 04 00 00 00 movl $0x4,(%eax) 11eeca: 83 c8 ff or $0xffffffff,%eax 11eecd: eb 02 jmp 11eed1 11eecf: 31 c0 xor %eax,%eax #endif } return 0; } 11eed1: 8d 65 f8 lea -0x8(%ebp),%esp 11eed4: 5b pop %ebx 11eed5: 5e pop %esi 11eed6: c9 leave 11eed7: c3 ret =============================================================================== 0010eaec : int pthread_attr_setschedpolicy( pthread_attr_t *attr, int policy ) { 10eaec: 55 push %ebp 10eaed: 89 e5 mov %esp,%ebp 10eaef: 8b 45 08 mov 0x8(%ebp),%eax 10eaf2: 8b 4d 0c mov 0xc(%ebp),%ecx if ( !attr || !attr->is_initialized ) 10eaf5: 85 c0 test %eax,%eax 10eaf7: 74 24 je 10eb1d 10eaf9: 83 38 00 cmpl $0x0,(%eax) 10eafc: 74 1f je 10eb1d return EINVAL; switch ( policy ) { 10eafe: 83 f9 04 cmp $0x4,%ecx 10eb01: 77 0c ja 10eb0f 10eb03: ba 01 00 00 00 mov $0x1,%edx 10eb08: d3 e2 shl %cl,%edx 10eb0a: 80 e2 17 and $0x17,%dl 10eb0d: 75 07 jne 10eb16 <== ALWAYS TAKEN 10eb0f: b8 86 00 00 00 mov $0x86,%eax 10eb14: eb 0c jmp 10eb22 case SCHED_OTHER: case SCHED_FIFO: case SCHED_RR: case SCHED_SPORADIC: attr->schedpolicy = policy; 10eb16: 89 48 14 mov %ecx,0x14(%eax) 10eb19: 31 c0 xor %eax,%eax return 0; 10eb1b: eb 05 jmp 10eb22 10eb1d: b8 16 00 00 00 mov $0x16,%eax default: return ENOTSUP; } } 10eb22: c9 leave 10eb23: c3 ret =============================================================================== 0010a958 : int pthread_barrier_init( pthread_barrier_t *barrier, const pthread_barrierattr_t *attr, unsigned int count ) { 10a958: 55 push %ebp 10a959: 89 e5 mov %esp,%ebp 10a95b: 57 push %edi 10a95c: 56 push %esi 10a95d: 53 push %ebx 10a95e: 83 ec 1c sub $0x1c,%esp 10a961: 8b 5d 08 mov 0x8(%ebp),%ebx 10a964: 8b 75 10 mov 0x10(%ebp),%esi const pthread_barrierattr_t *the_attr; /* * Error check parameters */ if ( !barrier ) 10a967: 85 db test %ebx,%ebx 10a969: 0f 84 93 00 00 00 je 10aa02 return EINVAL; if ( count == 0 ) 10a96f: 85 f6 test %esi,%esi 10a971: 0f 84 8b 00 00 00 je 10aa02 return EINVAL; /* * If the user passed in NULL, use the default attributes */ if ( attr ) { 10a977: 8b 7d 0c mov 0xc(%ebp),%edi 10a97a: 85 ff test %edi,%edi 10a97c: 75 0f jne 10a98d the_attr = attr; } else { (void) pthread_barrierattr_init( &my_attr ); 10a97e: 83 ec 0c sub $0xc,%esp 10a981: 8d 7d d8 lea -0x28(%ebp),%edi 10a984: 57 push %edi 10a985: e8 1a ff ff ff call 10a8a4 10a98a: 83 c4 10 add $0x10,%esp } /* * Now start error checking the attributes that we are going to use */ if ( !the_attr->is_initialized ) 10a98d: 83 3f 00 cmpl $0x0,(%edi) 10a990: 74 70 je 10aa02 return EINVAL; switch ( the_attr->process_shared ) { 10a992: 83 7f 04 00 cmpl $0x0,0x4(%edi) 10a996: 75 6a jne 10aa02 <== NEVER TAKEN } /* * Convert from POSIX attributes to Core Barrier attributes */ the_attributes.discipline = CORE_BARRIER_AUTOMATIC_RELEASE; 10a998: c7 45 e0 00 00 00 00 movl $0x0,-0x20(%ebp) the_attributes.maximum_count = count; 10a99f: 89 75 e4 mov %esi,-0x1c(%ebp) rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 10a9a2: a1 20 72 12 00 mov 0x127220,%eax 10a9a7: 40 inc %eax 10a9a8: a3 20 72 12 00 mov %eax,0x127220 * This function allocates a barrier control block from * the inactive chain of free barrier control blocks. */ RTEMS_INLINE_ROUTINE POSIX_Barrier_Control *_POSIX_Barrier_Allocate( void ) { return (POSIX_Barrier_Control *) 10a9ad: 83 ec 0c sub $0xc,%esp 10a9b0: 68 08 76 12 00 push $0x127608 10a9b5: e8 de 1d 00 00 call 10c798 <_Objects_Allocate> 10a9ba: 89 c6 mov %eax,%esi */ _Thread_Disable_dispatch(); /* prevents deletion */ the_barrier = _POSIX_Barrier_Allocate(); if ( !the_barrier ) { 10a9bc: 83 c4 10 add $0x10,%esp 10a9bf: 85 c0 test %eax,%eax 10a9c1: 75 0c jne 10a9cf _Thread_Enable_dispatch(); 10a9c3: e8 d5 29 00 00 call 10d39d <_Thread_Enable_dispatch> 10a9c8: b8 0b 00 00 00 mov $0xb,%eax return EAGAIN; 10a9cd: eb 38 jmp 10aa07 } _CORE_barrier_Initialize( &the_barrier->Barrier, &the_attributes ); 10a9cf: 50 push %eax 10a9d0: 50 push %eax 10a9d1: 8d 45 e0 lea -0x20(%ebp),%eax 10a9d4: 50 push %eax 10a9d5: 8d 46 10 lea 0x10(%esi),%eax 10a9d8: 50 push %eax 10a9d9: e8 92 14 00 00 call 10be70 <_CORE_barrier_Initialize> #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 10a9de: 8b 46 08 mov 0x8(%esi),%eax 10a9e1: 0f b7 c8 movzwl %ax,%ecx 10a9e4: 8b 15 24 76 12 00 mov 0x127624,%edx 10a9ea: 89 34 8a mov %esi,(%edx,%ecx,4) _Objects_Get_index( the_object->id ), the_object ); /* ASSERT: information->is_string == false */ the_object->name.name_u32 = name; 10a9ed: c7 46 0c 00 00 00 00 movl $0x0,0xc(%esi) ); /* * Exit the critical section and return the user an operational barrier */ *barrier = the_barrier->Object.id; 10a9f4: 89 03 mov %eax,(%ebx) _Thread_Enable_dispatch(); 10a9f6: e8 a2 29 00 00 call 10d39d <_Thread_Enable_dispatch> 10a9fb: 31 c0 xor %eax,%eax return 0; 10a9fd: 83 c4 10 add $0x10,%esp 10aa00: eb 05 jmp 10aa07 10aa02: b8 16 00 00 00 mov $0x16,%eax } 10aa07: 8d 65 f4 lea -0xc(%ebp),%esp 10aa0a: 5b pop %ebx 10aa0b: 5e pop %esi 10aa0c: 5f pop %edi 10aa0d: c9 leave 10aa0e: c3 ret =============================================================================== 0010a338 : void pthread_cleanup_push( void (*routine)( void * ), void *arg ) { 10a338: 55 push %ebp 10a339: 89 e5 mov %esp,%ebp 10a33b: 56 push %esi 10a33c: 53 push %ebx 10a33d: 8b 5d 08 mov 0x8(%ebp),%ebx 10a340: 8b 75 0c mov 0xc(%ebp),%esi /* * 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 ) 10a343: 85 db test %ebx,%ebx 10a345: 74 4b je 10a392 rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 10a347: a1 b8 82 12 00 mov 0x1282b8,%eax 10a34c: 40 inc %eax 10a34d: a3 b8 82 12 00 mov %eax,0x1282b8 return; _Thread_Disable_dispatch(); handler = _Workspace_Allocate( sizeof( POSIX_Cancel_Handler_control ) ); 10a352: 83 ec 0c sub $0xc,%esp 10a355: 6a 10 push $0x10 10a357: e8 f8 3a 00 00 call 10de54 <_Workspace_Allocate> if ( handler ) { 10a35c: 83 c4 10 add $0x10,%esp 10a35f: 85 c0 test %eax,%eax 10a361: 74 24 je 10a387 <== NEVER TAKEN thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; handler_stack = &thread_support->Cancellation_Handlers; 10a363: 8b 15 74 83 12 00 mov 0x128374,%edx 10a369: 8b 92 f8 00 00 00 mov 0xf8(%edx),%edx 10a36f: 81 c2 e0 00 00 00 add $0xe0,%edx handler->routine = routine; 10a375: 89 58 08 mov %ebx,0x8(%eax) handler->arg = arg; 10a378: 89 70 0c mov %esi,0xc(%eax) _Chain_Append( handler_stack, &handler->Node ); 10a37b: 51 push %ecx 10a37c: 51 push %ecx 10a37d: 50 push %eax 10a37e: 52 push %edx 10a37f: e8 88 15 00 00 call 10b90c <_Chain_Append> 10a384: 83 c4 10 add $0x10,%esp } _Thread_Enable_dispatch(); } 10a387: 8d 65 f8 lea -0x8(%ebp),%esp 10a38a: 5b pop %ebx 10a38b: 5e pop %esi 10a38c: c9 leave handler->routine = routine; handler->arg = arg; _Chain_Append( handler_stack, &handler->Node ); } _Thread_Enable_dispatch(); 10a38d: e9 4f 2a 00 00 jmp 10cde1 <_Thread_Enable_dispatch> } 10a392: 8d 65 f8 lea -0x8(%ebp),%esp 10a395: 5b pop %ebx 10a396: 5e pop %esi 10a397: c9 leave 10a398: c3 ret =============================================================================== 0010b0a8 : int pthread_cond_init( pthread_cond_t *cond, const pthread_condattr_t *attr ) { 10b0a8: 55 push %ebp 10b0a9: 89 e5 mov %esp,%ebp 10b0ab: 56 push %esi 10b0ac: 53 push %ebx 10b0ad: 8b 45 0c mov 0xc(%ebp),%eax POSIX_Condition_variables_Control *the_cond; const pthread_condattr_t *the_attr; if ( attr ) the_attr = attr; 10b0b0: bb cc 25 12 00 mov $0x1225cc,%ebx 10b0b5: 85 c0 test %eax,%eax 10b0b7: 74 02 je 10b0bb 10b0b9: 89 c3 mov %eax,%ebx /* * Be careful about attributes when global!!! */ if ( the_attr->process_shared == PTHREAD_PROCESS_SHARED ) 10b0bb: 83 7b 04 01 cmpl $0x1,0x4(%ebx) 10b0bf: 74 78 je 10b139 <== NEVER TAKEN return EINVAL; if ( !the_attr->is_initialized ) 10b0c1: 83 3b 00 cmpl $0x0,(%ebx) 10b0c4: 74 73 je 10b139 rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 10b0c6: a1 08 82 12 00 mov 0x128208,%eax 10b0cb: 40 inc %eax 10b0cc: a3 08 82 12 00 mov %eax,0x128208 */ RTEMS_INLINE_ROUTINE POSIX_Condition_variables_Control *_POSIX_Condition_variables_Allocate( void ) { return (POSIX_Condition_variables_Control *) 10b0d1: 83 ec 0c sub $0xc,%esp 10b0d4: 68 88 86 12 00 push $0x128688 10b0d9: e8 c2 22 00 00 call 10d3a0 <_Objects_Allocate> 10b0de: 89 c6 mov %eax,%esi _Thread_Disable_dispatch(); the_cond = _POSIX_Condition_variables_Allocate(); if ( !the_cond ) { 10b0e0: 83 c4 10 add $0x10,%esp 10b0e3: 85 c0 test %eax,%eax 10b0e5: 75 0c jne 10b0f3 _Thread_Enable_dispatch(); 10b0e7: e8 b9 2e 00 00 call 10dfa5 <_Thread_Enable_dispatch> 10b0ec: b8 0c 00 00 00 mov $0xc,%eax return ENOMEM; 10b0f1: eb 4b jmp 10b13e } the_cond->process_shared = the_attr->process_shared; 10b0f3: 8b 43 04 mov 0x4(%ebx),%eax 10b0f6: 89 46 10 mov %eax,0x10(%esi) the_cond->Mutex = POSIX_CONDITION_VARIABLES_NO_MUTEX; 10b0f9: c7 46 14 00 00 00 00 movl $0x0,0x14(%esi) /* XXX some more initialization might need to go here */ _Thread_queue_Initialize( 10b100: 6a 74 push $0x74 10b102: 68 00 08 00 00 push $0x800 10b107: 6a 00 push $0x0 10b109: 8d 46 18 lea 0x18(%esi),%eax 10b10c: 50 push %eax 10b10d: e8 aa 35 00 00 call 10e6bc <_Thread_queue_Initialize> #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 10b112: 8b 46 08 mov 0x8(%esi),%eax 10b115: 0f b7 c8 movzwl %ax,%ecx 10b118: 8b 15 a4 86 12 00 mov 0x1286a4,%edx 10b11e: 89 34 8a mov %esi,(%edx,%ecx,4) _Objects_Get_index( the_object->id ), the_object ); /* ASSERT: information->is_string == false */ the_object->name.name_u32 = name; 10b121: c7 46 0c 00 00 00 00 movl $0x0,0xc(%esi) &_POSIX_Condition_variables_Information, &the_cond->Object, 0 ); *cond = the_cond->Object.id; 10b128: 8b 55 08 mov 0x8(%ebp),%edx 10b12b: 89 02 mov %eax,(%edx) _Thread_Enable_dispatch(); 10b12d: e8 73 2e 00 00 call 10dfa5 <_Thread_Enable_dispatch> 10b132: 31 c0 xor %eax,%eax return 0; 10b134: 83 c4 10 add $0x10,%esp 10b137: eb 05 jmp 10b13e 10b139: b8 16 00 00 00 mov $0x16,%eax } 10b13e: 8d 65 f8 lea -0x8(%ebp),%esp 10b141: 5b pop %ebx 10b142: 5e pop %esi 10b143: c9 leave 10b144: c3 ret =============================================================================== 0010af5c : */ int pthread_condattr_destroy( pthread_condattr_t *attr ) { 10af5c: 55 push %ebp 10af5d: 89 e5 mov %esp,%ebp 10af5f: 8b 45 08 mov 0x8(%ebp),%eax if ( !attr || attr->is_initialized == false ) 10af62: 85 c0 test %eax,%eax 10af64: 74 0f je 10af75 10af66: 83 38 00 cmpl $0x0,(%eax) 10af69: 74 0a je 10af75 <== NEVER TAKEN return EINVAL; attr->is_initialized = false; 10af6b: c7 00 00 00 00 00 movl $0x0,(%eax) 10af71: 31 c0 xor %eax,%eax return 0; 10af73: eb 05 jmp 10af7a 10af75: b8 16 00 00 00 mov $0x16,%eax } 10af7a: c9 leave 10af7b: c3 ret =============================================================================== 0010a684 : pthread_t *thread, const pthread_attr_t *attr, void *(*start_routine)( void * ), void *arg ) { 10a684: 55 push %ebp 10a685: 89 e5 mov %esp,%ebp 10a687: 57 push %edi 10a688: 56 push %esi 10a689: 53 push %ebx 10a68a: 83 ec 4c sub $0x4c,%esp 10a68d: 8b 45 0c mov 0xc(%ebp),%eax int schedpolicy = SCHED_RR; struct sched_param schedparam; Objects_Name name; int rc; if ( !start_routine ) 10a690: c7 45 b0 0e 00 00 00 movl $0xe,-0x50(%ebp) 10a697: 83 7d 10 00 cmpl $0x0,0x10(%ebp) 10a69b: 0f 84 08 02 00 00 je 10a8a9 return EFAULT; the_attr = (attr) ? attr : &_POSIX_Threads_Default_attributes; 10a6a1: bb 30 11 12 00 mov $0x121130,%ebx 10a6a6: 85 c0 test %eax,%eax 10a6a8: 74 02 je 10a6ac 10a6aa: 89 c3 mov %eax,%ebx if ( !the_attr->is_initialized ) 10a6ac: 83 3b 00 cmpl $0x0,(%ebx) 10a6af: 0f 84 ed 01 00 00 je 10a8a2 * 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) ) 10a6b5: 83 7b 04 00 cmpl $0x0,0x4(%ebx) 10a6b9: 74 0f je 10a6ca 10a6bb: 8b 43 08 mov 0x8(%ebx),%eax 10a6be: 3b 05 14 32 12 00 cmp 0x123214,%eax 10a6c4: 0f 82 d8 01 00 00 jb 10a8a2 * 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 ) { 10a6ca: 8b 43 10 mov 0x10(%ebx),%eax 10a6cd: 83 f8 01 cmp $0x1,%eax 10a6d0: 74 0b je 10a6dd 10a6d2: 83 f8 02 cmp $0x2,%eax 10a6d5: 0f 85 c7 01 00 00 jne 10a8a2 10a6db: eb 1f jmp 10a6fc case PTHREAD_INHERIT_SCHED: api = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; 10a6dd: a1 b4 72 12 00 mov 0x1272b4,%eax 10a6e2: 8b b0 f8 00 00 00 mov 0xf8(%eax),%esi schedpolicy = api->schedpolicy; 10a6e8: 8b 86 80 00 00 00 mov 0x80(%esi),%eax 10a6ee: 89 45 ac mov %eax,-0x54(%ebp) schedparam = api->schedparam; 10a6f1: 8d 7d c4 lea -0x3c(%ebp),%edi 10a6f4: 81 c6 84 00 00 00 add $0x84,%esi 10a6fa: eb 0c jmp 10a708 break; case PTHREAD_EXPLICIT_SCHED: schedpolicy = the_attr->schedpolicy; 10a6fc: 8b 53 14 mov 0x14(%ebx),%edx 10a6ff: 89 55 ac mov %edx,-0x54(%ebp) schedparam = the_attr->schedparam; 10a702: 8d 7d c4 lea -0x3c(%ebp),%edi 10a705: 8d 73 18 lea 0x18(%ebx),%esi 10a708: b9 07 00 00 00 mov $0x7,%ecx 10a70d: f3 a5 rep movsl %ds:(%esi),%es:(%edi) /* * Check the contentionscope since rtems only supports PROCESS wide * contention (i.e. no system wide contention). */ if ( the_attr->contentionscope != PTHREAD_SCOPE_PROCESS ) 10a70f: c7 45 b0 86 00 00 00 movl $0x86,-0x50(%ebp) 10a716: 83 7b 0c 00 cmpl $0x0,0xc(%ebx) 10a71a: 0f 85 89 01 00 00 jne 10a8a9 return ENOTSUP; /* * Interpret the scheduling parameters. */ if ( !_POSIX_Priority_Is_valid( schedparam.sched_priority ) ) 10a720: 83 ec 0c sub $0xc,%esp 10a723: ff 75 c4 pushl -0x3c(%ebp) 10a726: e8 21 5f 00 00 call 11064c <_POSIX_Priority_Is_valid> 10a72b: 83 c4 10 add $0x10,%esp 10a72e: 84 c0 test %al,%al 10a730: 0f 84 6c 01 00 00 je 10a8a2 <== NEVER TAKEN return EINVAL; core_priority = _POSIX_Priority_To_core( schedparam.sched_priority ); 10a736: 8b 7d c4 mov -0x3c(%ebp),%edi RTEMS_INLINE_ROUTINE Priority_Control _POSIX_Priority_To_core( int priority ) { return (Priority_Control) (POSIX_SCHEDULER_MAXIMUM_PRIORITY - priority + 1); 10a739: 0f b6 35 18 32 12 00 movzbl 0x123218,%esi /* * Set the core scheduling policy information. */ rc = _POSIX_Thread_Translate_sched_param( 10a740: 8d 45 e0 lea -0x20(%ebp),%eax 10a743: 50 push %eax 10a744: 8d 45 e4 lea -0x1c(%ebp),%eax 10a747: 50 push %eax 10a748: 8d 45 c4 lea -0x3c(%ebp),%eax 10a74b: 50 push %eax 10a74c: ff 75 ac pushl -0x54(%ebp) 10a74f: e8 18 5f 00 00 call 11066c <_POSIX_Thread_Translate_sched_param> 10a754: 89 45 b0 mov %eax,-0x50(%ebp) schedpolicy, &schedparam, &budget_algorithm, &budget_callout ); if ( rc ) 10a757: 83 c4 10 add $0x10,%esp 10a75a: 85 c0 test %eax,%eax 10a75c: 0f 85 47 01 00 00 jne 10a8a9 #endif /* * Lock the allocator mutex for protection */ _RTEMS_Lock_allocator(); 10a762: 83 ec 0c sub $0xc,%esp 10a765: ff 35 ac 72 12 00 pushl 0x1272ac 10a76b: e8 44 15 00 00 call 10bcb4 <_API_Mutex_Lock> * _POSIX_Threads_Allocate */ RTEMS_INLINE_ROUTINE Thread_Control *_POSIX_Threads_Allocate( void ) { return (Thread_Control *) _Objects_Allocate( &_POSIX_Threads_Information ); 10a770: c7 04 24 60 74 12 00 movl $0x127460,(%esp) 10a777: e8 80 1e 00 00 call 10c5fc <_Objects_Allocate> 10a77c: 89 c2 mov %eax,%edx * Allocate the thread control block. * * NOTE: Global threads are not currently supported. */ the_thread = _POSIX_Threads_Allocate(); if ( !the_thread ) { 10a77e: 83 c4 10 add $0x10,%esp 10a781: 85 c0 test %eax,%eax 10a783: 75 05 jne 10a78a _RTEMS_Unlock_allocator(); 10a785: 83 ec 0c sub $0xc,%esp 10a788: eb 53 jmp 10a7dd /* * Initialize the core thread for this task. */ name.name_p = NULL; /* posix threads don't have a name by default */ status = _Thread_Initialize( 10a78a: 8b 43 08 mov 0x8(%ebx),%eax 10a78d: 51 push %ecx 10a78e: 6a 00 push $0x0 10a790: 6a 00 push $0x0 10a792: ff 75 e0 pushl -0x20(%ebp) 10a795: ff 75 e4 pushl -0x1c(%ebp) 10a798: 6a 01 push $0x1 10a79a: 81 e6 ff 00 00 00 and $0xff,%esi 10a7a0: 29 fe sub %edi,%esi 10a7a2: 56 push %esi 10a7a3: 6a 01 push $0x1 10a7a5: 8b 0d 14 32 12 00 mov 0x123214,%ecx 10a7ab: d1 e1 shl %ecx 10a7ad: 39 c1 cmp %eax,%ecx 10a7af: 73 02 jae 10a7b3 10a7b1: 89 c1 mov %eax,%ecx 10a7b3: 51 push %ecx 10a7b4: ff 73 04 pushl 0x4(%ebx) 10a7b7: 52 push %edx 10a7b8: 68 60 74 12 00 push $0x127460 10a7bd: 89 55 a8 mov %edx,-0x58(%ebp) 10a7c0: e8 ff 2a 00 00 call 10d2c4 <_Thread_Initialize> budget_callout, 0, /* isr level */ name /* posix threads don't have a name */ ); if ( !status ) { 10a7c5: 83 c4 30 add $0x30,%esp 10a7c8: 84 c0 test %al,%al 10a7ca: 8b 55 a8 mov -0x58(%ebp),%edx 10a7cd: 75 25 jne 10a7f4 RTEMS_INLINE_ROUTINE void _POSIX_Threads_Free ( Thread_Control *the_pthread ) { _Objects_Free( &_POSIX_Threads_Information, &the_pthread->Object ); 10a7cf: 53 push %ebx 10a7d0: 53 push %ebx 10a7d1: 52 push %edx 10a7d2: 68 60 74 12 00 push $0x127460 10a7d7: e8 0c 21 00 00 call 10c8e8 <_Objects_Free> _POSIX_Threads_Free( the_thread ); _RTEMS_Unlock_allocator(); 10a7dc: 59 pop %ecx 10a7dd: ff 35 ac 72 12 00 pushl 0x1272ac 10a7e3: e8 14 15 00 00 call 10bcfc <_API_Mutex_Unlock> 10a7e8: c7 45 b0 0b 00 00 00 movl $0xb,-0x50(%ebp) 10a7ef: e9 a9 00 00 00 jmp 10a89d } /* * finish initializing the per API structure */ api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 10a7f4: 8b 8a f8 00 00 00 mov 0xf8(%edx),%ecx 10a7fa: 89 4d b4 mov %ecx,-0x4c(%ebp) api->Attributes = *the_attr; 10a7fd: b9 0f 00 00 00 mov $0xf,%ecx 10a802: 8b 7d b4 mov -0x4c(%ebp),%edi 10a805: 89 de mov %ebx,%esi 10a807: f3 a5 rep movsl %ds:(%esi),%es:(%edi) api->detachstate = the_attr->detachstate; 10a809: 8b 43 38 mov 0x38(%ebx),%eax 10a80c: 8b 4d b4 mov -0x4c(%ebp),%ecx 10a80f: 89 41 3c mov %eax,0x3c(%ecx) api->schedpolicy = schedpolicy; 10a812: 8b 45 ac mov -0x54(%ebp),%eax 10a815: 89 81 80 00 00 00 mov %eax,0x80(%ecx) api->schedparam = schedparam; 10a81b: 89 cf mov %ecx,%edi 10a81d: 81 c7 84 00 00 00 add $0x84,%edi 10a823: 8d 75 c4 lea -0x3c(%ebp),%esi 10a826: b9 07 00 00 00 mov $0x7,%ecx 10a82b: f3 a5 rep movsl %ds:(%esi),%es:(%edi) * This insures we evaluate the process-wide signals pending when we * first run. * * NOTE: Since the thread starts with all unblocked, this is necessary. */ the_thread->do_post_task_switch_extension = true; 10a82d: c6 42 74 01 movb $0x1,0x74(%edx) /* * POSIX threads are allocated and started in one operation. */ status = _Thread_Start( 10a831: 83 ec 0c sub $0xc,%esp 10a834: 6a 00 push $0x0 10a836: ff 75 14 pushl 0x14(%ebp) 10a839: ff 75 10 pushl 0x10(%ebp) 10a83c: 6a 01 push $0x1 10a83e: 52 push %edx 10a83f: 89 55 a8 mov %edx,-0x58(%ebp) 10a842: e8 15 34 00 00 call 10dc5c <_Thread_Start> _RTEMS_Unlock_allocator(); return EINVAL; } #endif if ( schedpolicy == SCHED_SPORADIC ) { 10a847: 83 c4 20 add $0x20,%esp 10a84a: 83 7d ac 04 cmpl $0x4,-0x54(%ebp) 10a84e: 8b 55 a8 mov -0x58(%ebp),%edx 10a851: 75 34 jne 10a887 _Watchdog_Insert_ticks( 10a853: 83 ec 0c sub $0xc,%esp 10a856: 8b 45 b4 mov -0x4c(%ebp),%eax 10a859: 05 8c 00 00 00 add $0x8c,%eax 10a85e: 50 push %eax 10a85f: e8 a4 35 00 00 call 10de08 <_Timespec_To_ticks> Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 10a864: 8b 4d b4 mov -0x4c(%ebp),%ecx 10a867: 89 81 b0 00 00 00 mov %eax,0xb0(%ecx) _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 10a86d: 58 pop %eax 10a86e: 5a pop %edx 10a86f: 89 c8 mov %ecx,%eax 10a871: 05 a4 00 00 00 add $0xa4,%eax 10a876: 50 push %eax 10a877: 68 d4 72 12 00 push $0x1272d4 10a87c: e8 33 38 00 00 call 10e0b4 <_Watchdog_Insert> 10a881: 83 c4 10 add $0x10,%esp 10a884: 8b 55 a8 mov -0x58(%ebp),%edx } /* * Return the id and indicate we successfully created the thread */ *thread = the_thread->Object.id; 10a887: 8b 52 08 mov 0x8(%edx),%edx 10a88a: 8b 45 08 mov 0x8(%ebp),%eax 10a88d: 89 10 mov %edx,(%eax) _RTEMS_Unlock_allocator(); 10a88f: 83 ec 0c sub $0xc,%esp 10a892: ff 35 ac 72 12 00 pushl 0x1272ac 10a898: e8 5f 14 00 00 call 10bcfc <_API_Mutex_Unlock> return 0; 10a89d: 83 c4 10 add $0x10,%esp 10a8a0: eb 07 jmp 10a8a9 10a8a2: c7 45 b0 16 00 00 00 movl $0x16,-0x50(%ebp) } 10a8a9: 8b 45 b0 mov -0x50(%ebp),%eax 10a8ac: 8d 65 f4 lea -0xc(%ebp),%esp 10a8af: 5b pop %ebx 10a8b0: 5e pop %esi 10a8b1: 5f pop %edi 10a8b2: c9 leave 10a8b3: c3 ret =============================================================================== 001124dc : } void pthread_exit( void *value_ptr ) { 1124dc: 55 push %ebp 1124dd: 89 e5 mov %esp,%ebp 1124df: 83 ec 10 sub $0x10,%esp _POSIX_Thread_Exit( _Thread_Executing, value_ptr ); 1124e2: ff 75 08 pushl 0x8(%ebp) 1124e5: ff 35 c4 62 12 00 pushl 0x1262c4 1124eb: e8 88 ff ff ff call 112478 <_POSIX_Thread_Exit> 1124f0: 83 c4 10 add $0x10,%esp <== NOT EXECUTED } 1124f3: c9 leave <== NOT EXECUTED 1124f4: c3 ret <== NOT EXECUTED =============================================================================== 0010a1e0 : #if defined(_UNIX98_THREAD_MUTEX_ATTRIBUTES) int pthread_mutexattr_gettype( const pthread_mutexattr_t *attr, int *type ) { 10a1e0: 55 push %ebp 10a1e1: 89 e5 mov %esp,%ebp 10a1e3: 8b 45 08 mov 0x8(%ebp),%eax 10a1e6: 8b 55 0c mov 0xc(%ebp),%edx if ( !attr ) 10a1e9: 85 c0 test %eax,%eax 10a1eb: 74 12 je 10a1ff return EINVAL; if ( !attr->is_initialized ) 10a1ed: 83 38 00 cmpl $0x0,(%eax) 10a1f0: 74 0d je 10a1ff return EINVAL; if ( !type ) 10a1f2: 85 d2 test %edx,%edx 10a1f4: 74 09 je 10a1ff <== NEVER TAKEN return EINVAL; *type = attr->type; 10a1f6: 8b 40 10 mov 0x10(%eax),%eax 10a1f9: 89 02 mov %eax,(%edx) 10a1fb: 31 c0 xor %eax,%eax return 0; 10a1fd: eb 05 jmp 10a204 10a1ff: b8 16 00 00 00 mov $0x16,%eax } 10a204: c9 leave 10a205: c3 ret =============================================================================== 0010c004 : int pthread_mutexattr_setpshared( pthread_mutexattr_t *attr, int pshared ) { 10c004: 55 push %ebp 10c005: 89 e5 mov %esp,%ebp 10c007: 8b 45 08 mov 0x8(%ebp),%eax 10c00a: 8b 55 0c mov 0xc(%ebp),%edx if ( !attr || !attr->is_initialized ) 10c00d: 85 c0 test %eax,%eax 10c00f: 74 11 je 10c022 10c011: 83 38 00 cmpl $0x0,(%eax) 10c014: 74 0c je 10c022 return EINVAL; switch ( pshared ) { 10c016: 83 fa 01 cmp $0x1,%edx 10c019: 77 07 ja 10c022 <== NEVER TAKEN case PTHREAD_PROCESS_SHARED: case PTHREAD_PROCESS_PRIVATE: attr->process_shared = pshared; 10c01b: 89 50 04 mov %edx,0x4(%eax) 10c01e: 31 c0 xor %eax,%eax return 0; 10c020: eb 05 jmp 10c027 10c022: b8 16 00 00 00 mov $0x16,%eax default: return EINVAL; } } 10c027: c9 leave 10c028: c3 ret =============================================================================== 0010a230 : #if defined(_UNIX98_THREAD_MUTEX_ATTRIBUTES) int pthread_mutexattr_settype( pthread_mutexattr_t *attr, int type ) { 10a230: 55 push %ebp 10a231: 89 e5 mov %esp,%ebp 10a233: 8b 45 08 mov 0x8(%ebp),%eax 10a236: 8b 55 0c mov 0xc(%ebp),%edx if ( !attr || !attr->is_initialized ) 10a239: 85 c0 test %eax,%eax 10a23b: 74 11 je 10a24e 10a23d: 83 38 00 cmpl $0x0,(%eax) 10a240: 74 0c je 10a24e <== NEVER TAKEN return EINVAL; switch ( type ) { 10a242: 83 fa 03 cmp $0x3,%edx 10a245: 77 07 ja 10a24e case PTHREAD_MUTEX_NORMAL: case PTHREAD_MUTEX_RECURSIVE: case PTHREAD_MUTEX_ERRORCHECK: case PTHREAD_MUTEX_DEFAULT: attr->type = type; 10a247: 89 50 10 mov %edx,0x10(%eax) 10a24a: 31 c0 xor %eax,%eax return 0; 10a24c: eb 05 jmp 10a253 10a24e: b8 16 00 00 00 mov $0x16,%eax default: return EINVAL; } } 10a253: c9 leave 10a254: c3 ret =============================================================================== 0010accc : int pthread_once( pthread_once_t *once_control, void (*init_routine)(void) ) { 10accc: 55 push %ebp 10accd: 89 e5 mov %esp,%ebp 10accf: 56 push %esi 10acd0: 53 push %ebx 10acd1: 83 ec 10 sub $0x10,%esp 10acd4: 8b 5d 08 mov 0x8(%ebp),%ebx 10acd7: 8b 75 0c mov 0xc(%ebp),%esi if ( !once_control || !init_routine ) 10acda: 85 f6 test %esi,%esi 10acdc: 74 04 je 10ace2 10acde: 85 db test %ebx,%ebx 10ace0: 75 07 jne 10ace9 10ace2: b8 16 00 00 00 mov $0x16,%eax 10ace7: eb 4b jmp 10ad34 return EINVAL; if ( !once_control->init_executed ) { 10ace9: 31 c0 xor %eax,%eax 10aceb: 83 7b 04 00 cmpl $0x0,0x4(%ebx) 10acef: 75 43 jne 10ad34 rtems_mode saveMode; rtems_task_mode(RTEMS_NO_PREEMPT, RTEMS_PREEMPT_MASK, &saveMode); 10acf1: 52 push %edx 10acf2: 8d 45 f4 lea -0xc(%ebp),%eax 10acf5: 50 push %eax 10acf6: 68 00 01 00 00 push $0x100 10acfb: 68 00 01 00 00 push $0x100 10ad00: e8 93 0a 00 00 call 10b798 if ( !once_control->init_executed ) { 10ad05: 83 c4 10 add $0x10,%esp 10ad08: 83 7b 04 00 cmpl $0x0,0x4(%ebx) 10ad0c: 75 0f jne 10ad1d <== NEVER TAKEN once_control->is_initialized = true; 10ad0e: c7 03 01 00 00 00 movl $0x1,(%ebx) once_control->init_executed = true; 10ad14: c7 43 04 01 00 00 00 movl $0x1,0x4(%ebx) (*init_routine)(); 10ad1b: ff d6 call *%esi } rtems_task_mode(saveMode, RTEMS_PREEMPT_MASK, &saveMode); 10ad1d: 50 push %eax 10ad1e: 8d 45 f4 lea -0xc(%ebp),%eax 10ad21: 50 push %eax 10ad22: 68 00 01 00 00 push $0x100 10ad27: ff 75 f4 pushl -0xc(%ebp) 10ad2a: e8 69 0a 00 00 call 10b798 10ad2f: 31 c0 xor %eax,%eax 10ad31: 83 c4 10 add $0x10,%esp } return 0; } 10ad34: 8d 65 f8 lea -0x8(%ebp),%esp 10ad37: 5b pop %ebx 10ad38: 5e pop %esi 10ad39: c9 leave 10ad3a: c3 ret =============================================================================== 0010b298 : int pthread_rwlock_init( pthread_rwlock_t *rwlock, const pthread_rwlockattr_t *attr ) { 10b298: 55 push %ebp 10b299: 89 e5 mov %esp,%ebp 10b29b: 56 push %esi 10b29c: 53 push %ebx 10b29d: 83 ec 10 sub $0x10,%esp 10b2a0: 8b 5d 08 mov 0x8(%ebp),%ebx const pthread_rwlockattr_t *the_attr; /* * Error check parameters */ if ( !rwlock ) 10b2a3: 85 db test %ebx,%ebx 10b2a5: 0f 84 81 00 00 00 je 10b32c return EINVAL; /* * If the user passed in NULL, use the default attributes */ if ( attr ) { 10b2ab: 8b 75 0c mov 0xc(%ebp),%esi 10b2ae: 85 f6 test %esi,%esi 10b2b0: 75 0f jne 10b2c1 the_attr = attr; } else { (void) pthread_rwlockattr_init( &default_attr ); 10b2b2: 83 ec 0c sub $0xc,%esp 10b2b5: 8d 75 ec lea -0x14(%ebp),%esi 10b2b8: 56 push %esi 10b2b9: e8 3e 09 00 00 call 10bbfc 10b2be: 83 c4 10 add $0x10,%esp } /* * Now start error checking the attributes that we are going to use */ if ( !the_attr->is_initialized ) 10b2c1: 83 3e 00 cmpl $0x0,(%esi) 10b2c4: 74 66 je 10b32c <== NEVER TAKEN return EINVAL; switch ( the_attr->process_shared ) { 10b2c6: 83 7e 04 00 cmpl $0x0,0x4(%esi) 10b2ca: 75 60 jne 10b32c <== NEVER TAKEN rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 10b2cc: a1 a0 93 12 00 mov 0x1293a0,%eax 10b2d1: 40 inc %eax 10b2d2: a3 a0 93 12 00 mov %eax,0x1293a0 * This function allocates a RWLock control block from * the inactive chain of free RWLock control blocks. */ RTEMS_INLINE_ROUTINE POSIX_RWLock_Control *_POSIX_RWLock_Allocate( void ) { return (POSIX_RWLock_Control *) 10b2d7: 83 ec 0c sub $0xc,%esp 10b2da: 68 c8 95 12 00 push $0x1295c8 10b2df: e8 fc 22 00 00 call 10d5e0 <_Objects_Allocate> 10b2e4: 89 c6 mov %eax,%esi */ _Thread_Disable_dispatch(); /* prevents deletion */ the_rwlock = _POSIX_RWLock_Allocate(); if ( !the_rwlock ) { 10b2e6: 83 c4 10 add $0x10,%esp 10b2e9: 85 c0 test %eax,%eax 10b2eb: 75 0c jne 10b2f9 _Thread_Enable_dispatch(); 10b2ed: e8 f3 2e 00 00 call 10e1e5 <_Thread_Enable_dispatch> 10b2f2: b8 0b 00 00 00 mov $0xb,%eax return EAGAIN; 10b2f7: eb 38 jmp 10b331 } _CORE_RWLock_Initialize( &the_rwlock->RWLock, &the_attributes ); 10b2f9: 50 push %eax 10b2fa: 50 push %eax 10b2fb: 8d 45 f4 lea -0xc(%ebp),%eax 10b2fe: 50 push %eax 10b2ff: 8d 46 10 lea 0x10(%esi),%eax 10b302: 50 push %eax 10b303: e8 64 1b 00 00 call 10ce6c <_CORE_RWLock_Initialize> #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 10b308: 8b 46 08 mov 0x8(%esi),%eax 10b30b: 0f b7 c8 movzwl %ax,%ecx 10b30e: 8b 15 e4 95 12 00 mov 0x1295e4,%edx 10b314: 89 34 8a mov %esi,(%edx,%ecx,4) _Objects_Get_index( the_object->id ), the_object ); /* ASSERT: information->is_string == false */ the_object->name.name_u32 = name; 10b317: c7 46 0c 00 00 00 00 movl $0x0,0xc(%esi) &_POSIX_RWLock_Information, &the_rwlock->Object, 0 ); *rwlock = the_rwlock->Object.id; 10b31e: 89 03 mov %eax,(%ebx) _Thread_Enable_dispatch(); 10b320: e8 c0 2e 00 00 call 10e1e5 <_Thread_Enable_dispatch> 10b325: 31 c0 xor %eax,%eax return 0; 10b327: 83 c4 10 add $0x10,%esp 10b32a: eb 05 jmp 10b331 10b32c: b8 16 00 00 00 mov $0x16,%eax } 10b331: 8d 65 f8 lea -0x8(%ebp),%esp 10b334: 5b pop %ebx 10b335: 5e pop %esi 10b336: c9 leave 10b337: c3 ret =============================================================================== 0010b39c : int pthread_rwlock_timedrdlock( pthread_rwlock_t *rwlock, const struct timespec *abstime ) { 10b39c: 55 push %ebp 10b39d: 89 e5 mov %esp,%ebp 10b39f: 56 push %esi 10b3a0: 53 push %ebx 10b3a1: 83 ec 20 sub $0x20,%esp 10b3a4: 8b 75 08 mov 0x8(%ebp),%esi Objects_Locations location; Watchdog_Interval ticks; bool do_wait = true; POSIX_Absolute_timeout_conversion_results_t status; if ( !rwlock ) 10b3a7: 85 f6 test %esi,%esi 10b3a9: 0f 84 89 00 00 00 je 10b438 * * 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 ); 10b3af: 50 push %eax 10b3b0: 50 push %eax 10b3b1: 8d 45 f0 lea -0x10(%ebp),%eax 10b3b4: 50 push %eax 10b3b5: ff 75 0c pushl 0xc(%ebp) 10b3b8: e8 d7 61 00 00 call 111594 <_POSIX_Absolute_timeout_to_ticks> 10b3bd: 89 c3 mov %eax,%ebx 10b3bf: 83 c4 0c add $0xc,%esp 10b3c2: 8d 45 f4 lea -0xc(%ebp),%eax 10b3c5: 50 push %eax 10b3c6: ff 36 pushl (%esi) 10b3c8: 68 c8 95 12 00 push $0x1295c8 10b3cd: e8 22 26 00 00 call 10d9f4 <_Objects_Get> if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE ) do_wait = false; the_rwlock = _POSIX_RWLock_Get( rwlock, &location ); switch ( location ) { 10b3d2: 83 c4 10 add $0x10,%esp 10b3d5: 83 7d f4 00 cmpl $0x0,-0xc(%ebp) 10b3d9: 75 5d jne 10b438 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, 10b3db: 83 fb 03 cmp $0x3,%ebx 10b3de: 0f 94 c2 sete %dl case OBJECTS_LOCAL: _CORE_RWLock_Obtain_for_reading( 10b3e1: 83 ec 0c sub $0xc,%esp 10b3e4: 6a 00 push $0x0 10b3e6: ff 75 f0 pushl -0x10(%ebp) 10b3e9: 0f b6 ca movzbl %dl,%ecx 10b3ec: 51 push %ecx 10b3ed: ff 36 pushl (%esi) 10b3ef: 83 c0 10 add $0x10,%eax 10b3f2: 50 push %eax 10b3f3: 88 55 e4 mov %dl,-0x1c(%ebp) 10b3f6: e8 a5 1a 00 00 call 10cea0 <_CORE_RWLock_Obtain_for_reading> do_wait, ticks, NULL ); _Thread_Enable_dispatch(); 10b3fb: 83 c4 20 add $0x20,%esp 10b3fe: e8 e2 2d 00 00 call 10e1e5 <_Thread_Enable_dispatch> if ( !do_wait ) { 10b403: 8a 55 e4 mov -0x1c(%ebp),%dl 10b406: 84 d2 test %dl,%dl 10b408: 75 19 jne 10b423 if ( _Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE ) { 10b40a: a1 5c 94 12 00 mov 0x12945c,%eax 10b40f: 83 78 34 02 cmpl $0x2,0x34(%eax) 10b413: 75 0e jne 10b423 switch (status) { 10b415: 85 db test %ebx,%ebx 10b417: 74 1f je 10b438 <== NEVER TAKEN 10b419: b8 74 00 00 00 mov $0x74,%eax 10b41e: 83 fb 02 cmp $0x2,%ebx 10b421: 76 1a jbe 10b43d <== ALWAYS TAKEN break; } } } return _POSIX_RWLock_Translate_core_RWLock_return_code( 10b423: 83 ec 0c sub $0xc,%esp 10b426: a1 5c 94 12 00 mov 0x12945c,%eax 10b42b: ff 70 34 pushl 0x34(%eax) 10b42e: e8 b9 00 00 00 call 10b4ec <_POSIX_RWLock_Translate_core_RWLock_return_code> 10b433: 83 c4 10 add $0x10,%esp 10b436: eb 05 jmp 10b43d 10b438: b8 16 00 00 00 mov $0x16,%eax case OBJECTS_ERROR: break; } return EINVAL; } 10b43d: 8d 65 f8 lea -0x8(%ebp),%esp 10b440: 5b pop %ebx 10b441: 5e pop %esi 10b442: c9 leave 10b443: c3 ret =============================================================================== 0010b444 : int pthread_rwlock_timedwrlock( pthread_rwlock_t *rwlock, const struct timespec *abstime ) { 10b444: 55 push %ebp 10b445: 89 e5 mov %esp,%ebp 10b447: 56 push %esi 10b448: 53 push %ebx 10b449: 83 ec 20 sub $0x20,%esp 10b44c: 8b 75 08 mov 0x8(%ebp),%esi Objects_Locations location; Watchdog_Interval ticks; bool do_wait = true; POSIX_Absolute_timeout_conversion_results_t status; if ( !rwlock ) 10b44f: 85 f6 test %esi,%esi 10b451: 0f 84 89 00 00 00 je 10b4e0 * * 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 ); 10b457: 50 push %eax 10b458: 50 push %eax 10b459: 8d 45 f0 lea -0x10(%ebp),%eax 10b45c: 50 push %eax 10b45d: ff 75 0c pushl 0xc(%ebp) 10b460: e8 2f 61 00 00 call 111594 <_POSIX_Absolute_timeout_to_ticks> 10b465: 89 c3 mov %eax,%ebx 10b467: 83 c4 0c add $0xc,%esp 10b46a: 8d 45 f4 lea -0xc(%ebp),%eax 10b46d: 50 push %eax 10b46e: ff 36 pushl (%esi) 10b470: 68 c8 95 12 00 push $0x1295c8 10b475: e8 7a 25 00 00 call 10d9f4 <_Objects_Get> if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE ) do_wait = false; the_rwlock = _POSIX_RWLock_Get( rwlock, &location ); switch ( location ) { 10b47a: 83 c4 10 add $0x10,%esp 10b47d: 83 7d f4 00 cmpl $0x0,-0xc(%ebp) 10b481: 75 5d jne 10b4e0 (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, 10b483: 83 fb 03 cmp $0x3,%ebx 10b486: 0f 94 c2 sete %dl case OBJECTS_LOCAL: _CORE_RWLock_Obtain_for_writing( 10b489: 83 ec 0c sub $0xc,%esp 10b48c: 6a 00 push $0x0 10b48e: ff 75 f0 pushl -0x10(%ebp) 10b491: 0f b6 ca movzbl %dl,%ecx 10b494: 51 push %ecx 10b495: ff 36 pushl (%esi) 10b497: 83 c0 10 add $0x10,%eax 10b49a: 50 push %eax 10b49b: 88 55 e4 mov %dl,-0x1c(%ebp) 10b49e: e8 b5 1a 00 00 call 10cf58 <_CORE_RWLock_Obtain_for_writing> do_wait, ticks, NULL ); _Thread_Enable_dispatch(); 10b4a3: 83 c4 20 add $0x20,%esp 10b4a6: e8 3a 2d 00 00 call 10e1e5 <_Thread_Enable_dispatch> if ( !do_wait && 10b4ab: 8a 55 e4 mov -0x1c(%ebp),%dl 10b4ae: 84 d2 test %dl,%dl 10b4b0: 75 19 jne 10b4cb (_Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE) ) { 10b4b2: a1 5c 94 12 00 mov 0x12945c,%eax 10b4b7: 83 78 34 02 cmpl $0x2,0x34(%eax) 10b4bb: 75 0e jne 10b4cb switch (status) { 10b4bd: 85 db test %ebx,%ebx 10b4bf: 74 1f je 10b4e0 <== NEVER TAKEN 10b4c1: b8 74 00 00 00 mov $0x74,%eax 10b4c6: 83 fb 02 cmp $0x2,%ebx 10b4c9: 76 1a jbe 10b4e5 <== ALWAYS TAKEN case POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE: break; } } return _POSIX_RWLock_Translate_core_RWLock_return_code( 10b4cb: 83 ec 0c sub $0xc,%esp 10b4ce: a1 5c 94 12 00 mov 0x12945c,%eax 10b4d3: ff 70 34 pushl 0x34(%eax) 10b4d6: e8 11 00 00 00 call 10b4ec <_POSIX_RWLock_Translate_core_RWLock_return_code> 10b4db: 83 c4 10 add $0x10,%esp 10b4de: eb 05 jmp 10b4e5 10b4e0: b8 16 00 00 00 mov $0x16,%eax case OBJECTS_ERROR: break; } return EINVAL; } 10b4e5: 8d 65 f8 lea -0x8(%ebp),%esp 10b4e8: 5b pop %ebx 10b4e9: 5e pop %esi 10b4ea: c9 leave 10b4eb: c3 ret =============================================================================== 0010bc1c : int pthread_rwlockattr_setpshared( pthread_rwlockattr_t *attr, int pshared ) { 10bc1c: 55 push %ebp 10bc1d: 89 e5 mov %esp,%ebp 10bc1f: 8b 45 08 mov 0x8(%ebp),%eax 10bc22: 8b 55 0c mov 0xc(%ebp),%edx if ( !attr ) 10bc25: 85 c0 test %eax,%eax 10bc27: 74 11 je 10bc3a return EINVAL; if ( !attr->is_initialized ) 10bc29: 83 38 00 cmpl $0x0,(%eax) 10bc2c: 74 0c je 10bc3a return EINVAL; switch ( pshared ) { 10bc2e: 83 fa 01 cmp $0x1,%edx 10bc31: 77 07 ja 10bc3a <== NEVER TAKEN case PTHREAD_PROCESS_SHARED: case PTHREAD_PROCESS_PRIVATE: attr->process_shared = pshared; 10bc33: 89 50 04 mov %edx,0x4(%eax) 10bc36: 31 c0 xor %eax,%eax return 0; 10bc38: eb 05 jmp 10bc3f 10bc3a: b8 16 00 00 00 mov $0x16,%eax default: return EINVAL; } } 10bc3f: c9 leave 10bc40: c3 ret =============================================================================== 0010cb7c : int pthread_setschedparam( pthread_t thread, int policy, struct sched_param *param ) { 10cb7c: 55 push %ebp 10cb7d: 89 e5 mov %esp,%ebp 10cb7f: 57 push %edi 10cb80: 56 push %esi 10cb81: 53 push %ebx 10cb82: 83 ec 2c sub $0x2c,%esp 10cb85: 8b 75 10 mov 0x10(%ebp),%esi int rc; /* * Check all the parameters */ if ( !param ) 10cb88: c7 45 d4 16 00 00 00 movl $0x16,-0x2c(%ebp) 10cb8f: 85 f6 test %esi,%esi 10cb91: 0f 84 ff 00 00 00 je 10cc96 return EINVAL; rc = _POSIX_Thread_Translate_sched_param( 10cb97: 8d 45 e0 lea -0x20(%ebp),%eax 10cb9a: 50 push %eax 10cb9b: 8d 45 e4 lea -0x1c(%ebp),%eax 10cb9e: 50 push %eax 10cb9f: 56 push %esi 10cba0: ff 75 0c pushl 0xc(%ebp) 10cba3: e8 18 59 00 00 call 1124c0 <_POSIX_Thread_Translate_sched_param> 10cba8: 89 45 d4 mov %eax,-0x2c(%ebp) policy, param, &budget_algorithm, &budget_callout ); if ( rc ) 10cbab: 83 c4 10 add $0x10,%esp 10cbae: 85 c0 test %eax,%eax 10cbb0: 0f 85 e0 00 00 00 jne 10cc96 10cbb6: 53 push %ebx 10cbb7: 8d 45 dc lea -0x24(%ebp),%eax 10cbba: 50 push %eax 10cbbb: ff 75 08 pushl 0x8(%ebp) 10cbbe: 68 c0 b4 12 00 push $0x12b4c0 10cbc3: e8 40 1c 00 00 call 10e808 <_Objects_Get> 10cbc8: 89 c2 mov %eax,%edx /* * Actually change the scheduling policy and parameters */ the_thread = _POSIX_Threads_Get( thread, &location ); switch ( location ) { 10cbca: 83 c4 10 add $0x10,%esp 10cbcd: 83 7d dc 00 cmpl $0x0,-0x24(%ebp) 10cbd1: 74 0c je 10cbdf 10cbd3: c7 45 d4 03 00 00 00 movl $0x3,-0x2c(%ebp) 10cbda: e9 b7 00 00 00 jmp 10cc96 case OBJECTS_LOCAL: api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 10cbdf: 8b 98 f8 00 00 00 mov 0xf8(%eax),%ebx if ( api->schedpolicy == SCHED_SPORADIC ) 10cbe5: 83 bb 80 00 00 00 04 cmpl $0x4,0x80(%ebx) 10cbec: 75 18 jne 10cc06 (void) _Watchdog_Remove( &api->Sporadic_timer ); 10cbee: 83 ec 0c sub $0xc,%esp 10cbf1: 8d 83 a4 00 00 00 lea 0xa4(%ebx),%eax 10cbf7: 50 push %eax 10cbf8: 89 55 d0 mov %edx,-0x30(%ebp) 10cbfb: e8 24 34 00 00 call 110024 <_Watchdog_Remove> 10cc00: 83 c4 10 add $0x10,%esp 10cc03: 8b 55 d0 mov -0x30(%ebp),%edx api->schedpolicy = policy; 10cc06: 8b 45 0c mov 0xc(%ebp),%eax 10cc09: 89 83 80 00 00 00 mov %eax,0x80(%ebx) api->schedparam = *param; 10cc0f: 8d bb 84 00 00 00 lea 0x84(%ebx),%edi 10cc15: b9 07 00 00 00 mov $0x7,%ecx 10cc1a: f3 a5 rep movsl %ds:(%esi),%es:(%edi) the_thread->budget_algorithm = budget_algorithm; 10cc1c: 8b 45 e4 mov -0x1c(%ebp),%eax 10cc1f: 89 42 7c mov %eax,0x7c(%edx) the_thread->budget_callout = budget_callout; 10cc22: 8b 45 e0 mov -0x20(%ebp),%eax 10cc25: 89 82 80 00 00 00 mov %eax,0x80(%edx) switch ( api->schedpolicy ) { 10cc2b: 83 7d 0c 00 cmpl $0x0,0xc(%ebp) 10cc2f: 78 60 js 10cc91 <== NEVER TAKEN 10cc31: 83 7d 0c 02 cmpl $0x2,0xc(%ebp) 10cc35: 7e 08 jle 10cc3f 10cc37: 83 7d 0c 04 cmpl $0x4,0xc(%ebp) 10cc3b: 75 54 jne 10cc91 <== NEVER TAKEN 10cc3d: eb 24 jmp 10cc63 case SCHED_OTHER: case SCHED_FIFO: case SCHED_RR: the_thread->cpu_time_budget = _Thread_Ticks_per_timeslice; 10cc3f: a1 24 b2 12 00 mov 0x12b224,%eax 10cc44: 89 42 78 mov %eax,0x78(%edx) 10cc47: 0f b6 05 18 72 12 00 movzbl 0x127218,%eax 10cc4e: 2b 83 84 00 00 00 sub 0x84(%ebx),%eax the_thread->real_priority = 10cc54: 89 42 18 mov %eax,0x18(%edx) _POSIX_Priority_To_core( api->schedparam.sched_priority ); _Thread_Change_priority( 10cc57: 51 push %ecx 10cc58: 6a 01 push $0x1 10cc5a: 50 push %eax 10cc5b: 52 push %edx 10cc5c: e8 fb 1e 00 00 call 10eb5c <_Thread_Change_priority> 10cc61: eb 2b jmp 10cc8e true ); break; case SCHED_SPORADIC: api->ss_high_priority = api->schedparam.sched_priority; 10cc63: 8b 83 84 00 00 00 mov 0x84(%ebx),%eax 10cc69: 89 83 a0 00 00 00 mov %eax,0xa0(%ebx) _Watchdog_Remove( &api->Sporadic_timer ); 10cc6f: 83 ec 0c sub $0xc,%esp 10cc72: 81 c3 a4 00 00 00 add $0xa4,%ebx 10cc78: 53 push %ebx 10cc79: 89 55 d0 mov %edx,-0x30(%ebp) 10cc7c: e8 a3 33 00 00 call 110024 <_Watchdog_Remove> _POSIX_Threads_Sporadic_budget_TSR( 0, the_thread ); 10cc81: 58 pop %eax 10cc82: 5a pop %edx 10cc83: 8b 55 d0 mov -0x30(%ebp),%edx 10cc86: 52 push %edx 10cc87: 6a 00 push $0x0 10cc89: e8 5d fe ff ff call 10caeb <_POSIX_Threads_Sporadic_budget_TSR> 10cc8e: 83 c4 10 add $0x10,%esp break; } _Thread_Enable_dispatch(); 10cc91: e8 63 23 00 00 call 10eff9 <_Thread_Enable_dispatch> case OBJECTS_ERROR: break; } return ESRCH; } 10cc96: 8b 45 d4 mov -0x2c(%ebp),%eax 10cc99: 8d 65 f4 lea -0xc(%ebp),%esp 10cc9c: 5b pop %ebx 10cc9d: 5e pop %esi 10cc9e: 5f pop %edi 10cc9f: c9 leave 10cca0: c3 ret =============================================================================== 0010aabc : * * 18.2.2 Setting Cancelability State, P1003.1c/Draft 10, p. 183 */ void pthread_testcancel( void ) { 10aabc: 55 push %ebp 10aabd: 89 e5 mov %esp,%ebp 10aabf: 53 push %ebx 10aac0: 83 ec 04 sub $0x4,%esp * 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() ) 10aac3: a1 50 83 12 00 mov 0x128350,%eax 10aac8: 85 c0 test %eax,%eax 10aaca: 75 48 jne 10ab14 <== NEVER TAKEN return; thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; 10aacc: a1 74 83 12 00 mov 0x128374,%eax 10aad1: 8b 80 f8 00 00 00 mov 0xf8(%eax),%eax 10aad7: 8b 15 b8 82 12 00 mov 0x1282b8,%edx 10aadd: 42 inc %edx 10aade: 89 15 b8 82 12 00 mov %edx,0x1282b8 _Thread_Disable_dispatch(); if ( thread_support->cancelability_state == PTHREAD_CANCEL_ENABLE && 10aae4: 31 db xor %ebx,%ebx 10aae6: 83 b8 d4 00 00 00 00 cmpl $0x0,0xd4(%eax) 10aaed: 75 0a jne 10aaf9 <== 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)); 10aaef: 83 b8 dc 00 00 00 00 cmpl $0x0,0xdc(%eax) 10aaf6: 0f 95 c3 setne %bl thread_support->cancelation_requested ) cancel = true; _Thread_Enable_dispatch(); 10aaf9: e8 e3 22 00 00 call 10cde1 <_Thread_Enable_dispatch> if ( cancel ) 10aafe: 84 db test %bl,%bl 10ab00: 74 12 je 10ab14 _POSIX_Thread_Exit( _Thread_Executing, PTHREAD_CANCELED ); 10ab02: 50 push %eax 10ab03: 50 push %eax 10ab04: 6a ff push $0xffffffff 10ab06: ff 35 74 83 12 00 pushl 0x128374 10ab0c: e8 9f 58 00 00 call 1103b0 <_POSIX_Thread_Exit> 10ab11: 83 c4 10 add $0x10,%esp } 10ab14: 8b 5d fc mov -0x4(%ebp),%ebx 10ab17: c9 leave 10ab18: c3 ret =============================================================================== 0010fa10 : */ rtems_status_code rtems_barrier_delete( rtems_id id ) { 10fa10: 55 push %ebp 10fa11: 89 e5 mov %esp,%ebp 10fa13: 53 push %ebx 10fa14: 83 ec 18 sub $0x18,%esp RTEMS_INLINE_ROUTINE Barrier_Control *_Barrier_Get ( Objects_Id id, Objects_Locations *location ) { return (Barrier_Control *) 10fa17: 8d 45 f4 lea -0xc(%ebp),%eax 10fa1a: 50 push %eax 10fa1b: ff 75 08 pushl 0x8(%ebp) 10fa1e: 68 08 6b 12 00 push $0x126b08 10fa23: e8 04 c1 ff ff call 10bb2c <_Objects_Get> 10fa28: 89 c3 mov %eax,%ebx Barrier_Control *the_barrier; Objects_Locations location; the_barrier = _Barrier_Get( id, &location ); switch ( location ) { 10fa2a: 83 c4 10 add $0x10,%esp 10fa2d: b8 04 00 00 00 mov $0x4,%eax 10fa32: 83 7d f4 00 cmpl $0x0,-0xc(%ebp) 10fa36: 75 32 jne 10fa6a <== NEVER TAKEN case OBJECTS_LOCAL: _CORE_barrier_Flush( 10fa38: 52 push %edx 10fa39: 6a 02 push $0x2 10fa3b: 6a 00 push $0x0 10fa3d: 8d 43 14 lea 0x14(%ebx),%eax 10fa40: 50 push %eax 10fa41: e8 7e cf ff ff call 10c9c4 <_Thread_queue_Flush> &the_barrier->Barrier, NULL, CORE_BARRIER_WAS_DELETED ); _Objects_Close( &_Barrier_Information, &the_barrier->Object ); 10fa46: 59 pop %ecx 10fa47: 58 pop %eax 10fa48: 53 push %ebx 10fa49: 68 08 6b 12 00 push $0x126b08 10fa4e: e8 31 bd ff ff call 10b784 <_Objects_Close> */ RTEMS_INLINE_ROUTINE void _Barrier_Free ( Barrier_Control *the_barrier ) { _Objects_Free( &_Barrier_Information, &the_barrier->Object ); 10fa53: 58 pop %eax 10fa54: 5a pop %edx 10fa55: 53 push %ebx 10fa56: 68 08 6b 12 00 push $0x126b08 10fa5b: e8 a4 bf ff ff call 10ba04 <_Objects_Free> _Barrier_Free( the_barrier ); _Thread_Enable_dispatch(); 10fa60: e8 b8 c8 ff ff call 10c31d <_Thread_Enable_dispatch> 10fa65: 31 c0 xor %eax,%eax return RTEMS_SUCCESSFUL; 10fa67: 83 c4 10 add $0x10,%esp case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 10fa6a: 8b 5d fc mov -0x4(%ebp),%ebx 10fa6d: c9 leave 10fa6e: c3 ret =============================================================================== 0010cb60 : #include #include void rtems_iterate_over_all_threads(rtems_per_thread_routine routine) { 10cb60: 55 push %ebp 10cb61: 89 e5 mov %esp,%ebp 10cb63: 57 push %edi 10cb64: 56 push %esi 10cb65: 53 push %ebx 10cb66: 83 ec 0c sub $0xc,%esp uint32_t i; uint32_t api_index; Thread_Control *the_thread; Objects_Information *information; if ( !routine ) 10cb69: 83 7d 08 00 cmpl $0x0,0x8(%ebp) 10cb6d: 74 41 je 10cbb0 <== NEVER TAKEN 10cb6f: bb 01 00 00 00 mov $0x1,%ebx return; for ( api_index = 1 ; api_index <= OBJECTS_APIS_LAST ; api_index++ ) { if ( !_Objects_Information_table[ api_index ] ) 10cb74: 8b 04 9d 20 9f 12 00 mov 0x129f20(,%ebx,4),%eax 10cb7b: 85 c0 test %eax,%eax 10cb7d: 74 2b je 10cbaa continue; information = _Objects_Information_table[ api_index ][ 1 ]; 10cb7f: 8b 78 04 mov 0x4(%eax),%edi if ( !information ) 10cb82: be 01 00 00 00 mov $0x1,%esi 10cb87: 85 ff test %edi,%edi 10cb89: 75 17 jne 10cba2 10cb8b: eb 1d jmp 10cbaa continue; for ( i=1 ; i <= information->maximum ; i++ ) { the_thread = (Thread_Control *)information->local_table[ i ]; 10cb8d: 8b 47 1c mov 0x1c(%edi),%eax 10cb90: 8b 04 b0 mov (%eax,%esi,4),%eax if ( !the_thread ) 10cb93: 85 c0 test %eax,%eax 10cb95: 74 0a je 10cba1 <== NEVER TAKEN continue; (*routine)(the_thread); 10cb97: 83 ec 0c sub $0xc,%esp 10cb9a: 50 push %eax 10cb9b: ff 55 08 call *0x8(%ebp) 10cb9e: 83 c4 10 add $0x10,%esp information = _Objects_Information_table[ api_index ][ 1 ]; if ( !information ) continue; for ( i=1 ; i <= information->maximum ; i++ ) { 10cba1: 46 inc %esi 10cba2: 0f b7 47 10 movzwl 0x10(%edi),%eax 10cba6: 39 c6 cmp %eax,%esi 10cba8: 76 e3 jbe 10cb8d Objects_Information *information; if ( !routine ) return; for ( api_index = 1 ; api_index <= OBJECTS_APIS_LAST ; api_index++ ) { 10cbaa: 43 inc %ebx 10cbab: 83 fb 05 cmp $0x5,%ebx 10cbae: 75 c4 jne 10cb74 (*routine)(the_thread); } } } 10cbb0: 8d 65 f4 lea -0xc(%ebp),%esp 10cbb3: 5b pop %ebx 10cbb4: 5e pop %esi 10cbb5: 5f pop %edi 10cbb6: c9 leave 10cbb7: c3 ret =============================================================================== 00114f08 : uint32_t length, uint32_t buffer_size, rtems_attribute attribute_set, rtems_id *id ) { 114f08: 55 push %ebp 114f09: 89 e5 mov %esp,%ebp 114f0b: 57 push %edi 114f0c: 56 push %esi 114f0d: 53 push %ebx 114f0e: 83 ec 1c sub $0x1c,%esp 114f11: 8b 75 0c mov 0xc(%ebp),%esi 114f14: 8b 55 10 mov 0x10(%ebp),%edx 114f17: 8b 7d 14 mov 0x14(%ebp),%edi register Partition_Control *the_partition; if ( !rtems_is_name_valid( name ) ) 114f1a: b8 03 00 00 00 mov $0x3,%eax 114f1f: 83 7d 08 00 cmpl $0x0,0x8(%ebp) 114f23: 0f 84 cf 00 00 00 je 114ff8 return RTEMS_INVALID_NAME; if ( !starting_address ) 114f29: 85 f6 test %esi,%esi 114f2b: 0f 84 bb 00 00 00 je 114fec return RTEMS_INVALID_ADDRESS; if ( !id ) 114f31: 83 7d 1c 00 cmpl $0x0,0x1c(%ebp) 114f35: 0f 84 b1 00 00 00 je 114fec <== NEVER TAKEN return RTEMS_INVALID_ADDRESS; if ( length == 0 || buffer_size == 0 || length < buffer_size || 114f3b: 85 ff test %edi,%edi 114f3d: 0f 84 b0 00 00 00 je 114ff3 114f43: 85 d2 test %edx,%edx 114f45: 0f 84 a8 00 00 00 je 114ff3 114f4b: 39 fa cmp %edi,%edx 114f4d: 0f 82 a0 00 00 00 jb 114ff3 114f53: f7 c7 03 00 00 00 test $0x3,%edi 114f59: 0f 85 94 00 00 00 jne 114ff3 !_Partition_Is_buffer_size_aligned( buffer_size ) ) return RTEMS_INVALID_SIZE; if ( !_Addresses_Is_aligned( starting_address ) ) 114f5f: f7 c6 03 00 00 00 test $0x3,%esi 114f65: 0f 85 81 00 00 00 jne 114fec 114f6b: a1 dc f5 13 00 mov 0x13f5dc,%eax 114f70: 40 inc %eax 114f71: a3 dc f5 13 00 mov %eax,0x13f5dc * 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 ); 114f76: 83 ec 0c sub $0xc,%esp 114f79: 68 64 f4 13 00 push $0x13f464 114f7e: 89 55 e4 mov %edx,-0x1c(%ebp) 114f81: e8 aa 3c 00 00 call 118c30 <_Objects_Allocate> 114f86: 89 c3 mov %eax,%ebx _Thread_Disable_dispatch(); /* prevents deletion */ the_partition = _Partition_Allocate(); if ( !the_partition ) { 114f88: 83 c4 10 add $0x10,%esp 114f8b: 85 c0 test %eax,%eax 114f8d: 8b 55 e4 mov -0x1c(%ebp),%edx 114f90: 75 0c jne 114f9e _Thread_Enable_dispatch(); 114f92: e8 4e 49 00 00 call 1198e5 <_Thread_Enable_dispatch> 114f97: b8 05 00 00 00 mov $0x5,%eax return RTEMS_TOO_MANY; 114f9c: eb 5a jmp 114ff8 _Thread_Enable_dispatch(); return RTEMS_TOO_MANY; } #endif the_partition->starting_address = starting_address; 114f9e: 89 70 10 mov %esi,0x10(%eax) the_partition->length = length; 114fa1: 89 50 14 mov %edx,0x14(%eax) the_partition->buffer_size = buffer_size; 114fa4: 89 78 18 mov %edi,0x18(%eax) the_partition->attribute_set = attribute_set; 114fa7: 8b 45 18 mov 0x18(%ebp),%eax 114faa: 89 43 1c mov %eax,0x1c(%ebx) the_partition->number_of_used_blocks = 0; 114fad: c7 43 20 00 00 00 00 movl $0x0,0x20(%ebx) _Chain_Initialize( &the_partition->Memory, starting_address, 114fb4: 57 push %edi 114fb5: 89 d0 mov %edx,%eax 114fb7: 31 d2 xor %edx,%edx 114fb9: f7 f7 div %edi 114fbb: 50 push %eax 114fbc: 56 push %esi 114fbd: 8d 43 24 lea 0x24(%ebx),%eax 114fc0: 50 push %eax 114fc1: e8 b2 2a 00 00 call 117a78 <_Chain_Initialize> #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 114fc6: 8b 43 08 mov 0x8(%ebx),%eax 114fc9: 0f b7 c8 movzwl %ax,%ecx 114fcc: 8b 15 80 f4 13 00 mov 0x13f480,%edx 114fd2: 89 1c 8a mov %ebx,(%edx,%ecx,4) information, _Objects_Get_index( the_object->id ), the_object ); the_object->name = name; 114fd5: 8b 55 08 mov 0x8(%ebp),%edx 114fd8: 89 53 0c mov %edx,0xc(%ebx) &_Partition_Information, &the_partition->Object, (Objects_Name) name ); *id = the_partition->Object.id; 114fdb: 8b 55 1c mov 0x1c(%ebp),%edx 114fde: 89 02 mov %eax,(%edx) name, 0 /* Not used */ ); #endif _Thread_Enable_dispatch(); 114fe0: e8 00 49 00 00 call 1198e5 <_Thread_Enable_dispatch> 114fe5: 31 c0 xor %eax,%eax return RTEMS_SUCCESSFUL; 114fe7: 83 c4 10 add $0x10,%esp 114fea: eb 0c jmp 114ff8 114fec: b8 09 00 00 00 mov $0x9,%eax 114ff1: eb 05 jmp 114ff8 114ff3: b8 08 00 00 00 mov $0x8,%eax } 114ff8: 8d 65 f4 lea -0xc(%ebp),%esp 114ffb: 5b pop %ebx 114ffc: 5e pop %esi 114ffd: 5f pop %edi 114ffe: c9 leave 114fff: c3 ret =============================================================================== 0010b465 : rtems_status_code rtems_rate_monotonic_period( rtems_id id, rtems_interval length ) { 10b465: 55 push %ebp 10b466: 89 e5 mov %esp,%ebp 10b468: 57 push %edi 10b469: 56 push %esi 10b46a: 53 push %ebx 10b46b: 83 ec 30 sub $0x30,%esp 10b46e: 8b 75 08 mov 0x8(%ebp),%esi 10b471: 8b 5d 0c mov 0xc(%ebp),%ebx RTEMS_INLINE_ROUTINE Rate_monotonic_Control *_Rate_monotonic_Get ( Objects_Id id, Objects_Locations *location ) { return (Rate_monotonic_Control *) 10b474: 8d 45 e4 lea -0x1c(%ebp),%eax 10b477: 50 push %eax 10b478: 56 push %esi 10b479: 68 14 92 12 00 push $0x129214 10b47e: e8 ed 1d 00 00 call 10d270 <_Objects_Get> 10b483: 89 c7 mov %eax,%edi rtems_rate_monotonic_period_states local_state; ISR_Level level; the_period = _Rate_monotonic_Get( id, &location ); switch ( location ) { 10b485: 83 c4 10 add $0x10,%esp 10b488: 83 7d e4 00 cmpl $0x0,-0x1c(%ebp) 10b48c: 0f 85 40 01 00 00 jne 10b5d2 case OBJECTS_LOCAL: if ( !_Thread_Is_executing( the_period->owner ) ) { 10b492: 8b 40 40 mov 0x40(%eax),%eax 10b495: 3b 05 c8 93 12 00 cmp 0x1293c8,%eax 10b49b: 74 0f je 10b4ac _Thread_Enable_dispatch(); 10b49d: e8 bf 25 00 00 call 10da61 <_Thread_Enable_dispatch> 10b4a2: bb 17 00 00 00 mov $0x17,%ebx return RTEMS_NOT_OWNER_OF_RESOURCE; 10b4a7: e9 2b 01 00 00 jmp 10b5d7 } if ( length == RTEMS_PERIOD_STATUS ) { 10b4ac: 85 db test %ebx,%ebx 10b4ae: 75 19 jne 10b4c9 switch ( the_period->state ) { 10b4b0: 8b 47 38 mov 0x38(%edi),%eax 10b4b3: 83 f8 04 cmp $0x4,%eax 10b4b6: 77 07 ja 10b4bf <== NEVER TAKEN 10b4b8: 8b 1c 85 40 22 12 00 mov 0x122240(,%eax,4),%ebx case RATE_MONOTONIC_ACTIVE: default: /* unreached -- only to remove warnings */ return_value = RTEMS_SUCCESSFUL; break; } _Thread_Enable_dispatch(); 10b4bf: e8 9d 25 00 00 call 10da61 <_Thread_Enable_dispatch> return( return_value ); 10b4c4: e9 0e 01 00 00 jmp 10b5d7 } _ISR_Disable( level ); 10b4c9: 9c pushf 10b4ca: fa cli 10b4cb: 8f 45 d4 popl -0x2c(%ebp) switch ( the_period->state ) { 10b4ce: 8b 47 38 mov 0x38(%edi),%eax 10b4d1: 83 f8 02 cmp $0x2,%eax 10b4d4: 74 5f je 10b535 10b4d6: 83 f8 04 cmp $0x4,%eax 10b4d9: 0f 84 ba 00 00 00 je 10b599 10b4df: 85 c0 test %eax,%eax 10b4e1: 0f 85 eb 00 00 00 jne 10b5d2 <== NEVER TAKEN case RATE_MONOTONIC_INACTIVE: { _ISR_Enable( level ); 10b4e7: ff 75 d4 pushl -0x2c(%ebp) 10b4ea: 9d popf /* * Baseline statistics information for the beginning of a period. */ _Rate_monotonic_Initiate_statistics( the_period ); 10b4eb: 83 ec 0c sub $0xc,%esp 10b4ee: 57 push %edi 10b4ef: e8 9c fd ff ff call 10b290 <_Rate_monotonic_Initiate_statistics> the_period->state = RATE_MONOTONIC_ACTIVE; 10b4f4: c7 47 38 02 00 00 00 movl $0x2,0x38(%edi) Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 10b4fb: c7 47 18 00 00 00 00 movl $0x0,0x18(%edi) the_watchdog->routine = routine; 10b502: c7 47 2c e0 b7 10 00 movl $0x10b7e0,0x2c(%edi) the_watchdog->id = id; 10b509: 89 77 30 mov %esi,0x30(%edi) the_watchdog->user_data = user_data; 10b50c: c7 47 34 00 00 00 00 movl $0x0,0x34(%edi) _Rate_monotonic_Timeout, id, NULL ); the_period->next_length = length; 10b513: 89 5f 3c mov %ebx,0x3c(%edi) Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 10b516: 89 5f 1c mov %ebx,0x1c(%edi) _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 10b519: 5b pop %ebx 10b51a: 5e pop %esi 10b51b: 83 c7 10 add $0x10,%edi 10b51e: 57 push %edi 10b51f: 68 e8 93 12 00 push $0x1293e8 10b524: e8 df 34 00 00 call 10ea08 <_Watchdog_Insert> _Watchdog_Insert_ticks( &the_period->Timer, length ); _Thread_Enable_dispatch(); 10b529: e8 33 25 00 00 call 10da61 <_Thread_Enable_dispatch> 10b52e: 31 db xor %ebx,%ebx 10b530: e9 98 00 00 00 jmp 10b5cd case RATE_MONOTONIC_ACTIVE: /* * Update statistics from the concluding period. */ _Rate_monotonic_Update_statistics( the_period ); 10b535: 83 ec 0c sub $0xc,%esp 10b538: 57 push %edi 10b539: e8 4c fe ff ff call 10b38a <_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; 10b53e: c7 47 38 01 00 00 00 movl $0x1,0x38(%edi) the_period->next_length = length; 10b545: 89 5f 3c mov %ebx,0x3c(%edi) _ISR_Enable( level ); 10b548: ff 75 d4 pushl -0x2c(%ebp) 10b54b: 9d popf _Thread_Executing->Wait.id = the_period->Object.id; 10b54c: a1 c8 93 12 00 mov 0x1293c8,%eax 10b551: 8b 57 08 mov 0x8(%edi),%edx 10b554: 89 50 20 mov %edx,0x20(%eax) _Thread_Set_state( _Thread_Executing, STATES_WAITING_FOR_PERIOD ); 10b557: 5a pop %edx 10b558: 59 pop %ecx 10b559: 68 00 40 00 00 push $0x4000 10b55e: 50 push %eax 10b55f: e8 38 2d 00 00 call 10e29c <_Thread_Set_state> /* * Did the watchdog timer expire while we were actually blocking * on it? */ _ISR_Disable( level ); 10b564: 9c pushf 10b565: fa cli 10b566: 5a pop %edx local_state = the_period->state; 10b567: 8b 47 38 mov 0x38(%edi),%eax the_period->state = RATE_MONOTONIC_ACTIVE; 10b56a: c7 47 38 02 00 00 00 movl $0x2,0x38(%edi) _ISR_Enable( level ); 10b571: 52 push %edx 10b572: 9d popf /* * 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 ) 10b573: 83 c4 10 add $0x10,%esp 10b576: 83 f8 03 cmp $0x3,%eax 10b579: 75 15 jne 10b590 _Thread_Clear_state( _Thread_Executing, STATES_WAITING_FOR_PERIOD ); 10b57b: 56 push %esi 10b57c: 56 push %esi 10b57d: 68 00 40 00 00 push $0x4000 10b582: ff 35 c8 93 12 00 pushl 0x1293c8 10b588: e8 57 21 00 00 call 10d6e4 <_Thread_Clear_state> 10b58d: 83 c4 10 add $0x10,%esp _Thread_Enable_dispatch(); 10b590: e8 cc 24 00 00 call 10da61 <_Thread_Enable_dispatch> 10b595: 31 db xor %ebx,%ebx return RTEMS_SUCCESSFUL; 10b597: eb 3e jmp 10b5d7 case RATE_MONOTONIC_EXPIRED: /* * Update statistics from the concluding period */ _Rate_monotonic_Update_statistics( the_period ); 10b599: 83 ec 0c sub $0xc,%esp 10b59c: 57 push %edi 10b59d: e8 e8 fd ff ff call 10b38a <_Rate_monotonic_Update_statistics> _ISR_Enable( level ); 10b5a2: ff 75 d4 pushl -0x2c(%ebp) 10b5a5: 9d popf the_period->state = RATE_MONOTONIC_ACTIVE; 10b5a6: c7 47 38 02 00 00 00 movl $0x2,0x38(%edi) the_period->next_length = length; 10b5ad: 89 5f 3c mov %ebx,0x3c(%edi) Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 10b5b0: 89 5f 1c mov %ebx,0x1c(%edi) _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 10b5b3: 59 pop %ecx 10b5b4: 5b pop %ebx 10b5b5: 83 c7 10 add $0x10,%edi 10b5b8: 57 push %edi 10b5b9: 68 e8 93 12 00 push $0x1293e8 10b5be: e8 45 34 00 00 call 10ea08 <_Watchdog_Insert> _Watchdog_Insert_ticks( &the_period->Timer, length ); _Thread_Enable_dispatch(); 10b5c3: e8 99 24 00 00 call 10da61 <_Thread_Enable_dispatch> 10b5c8: bb 06 00 00 00 mov $0x6,%ebx return RTEMS_TIMEOUT; 10b5cd: 83 c4 10 add $0x10,%esp 10b5d0: eb 05 jmp 10b5d7 10b5d2: bb 04 00 00 00 mov $0x4,%ebx case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 10b5d7: 89 d8 mov %ebx,%eax 10b5d9: 8d 65 f4 lea -0xc(%ebp),%esp 10b5dc: 5b pop %ebx 10b5dd: 5e pop %esi 10b5de: 5f pop %edi 10b5df: c9 leave 10b5e0: c3 ret =============================================================================== 0010b5e4 : */ void rtems_rate_monotonic_report_statistics_with_plugin( void *context, rtems_printk_plugin_t print ) { 10b5e4: 55 push %ebp 10b5e5: 89 e5 mov %esp,%ebp 10b5e7: 57 push %edi 10b5e8: 56 push %esi 10b5e9: 53 push %ebx 10b5ea: 83 ec 7c sub $0x7c,%esp 10b5ed: 8b 5d 08 mov 0x8(%ebp),%ebx 10b5f0: 8b 7d 0c mov 0xc(%ebp),%edi rtems_id id; rtems_rate_monotonic_period_statistics the_stats; rtems_rate_monotonic_period_status the_status; char name[5]; if ( !print ) 10b5f3: 85 ff test %edi,%edi 10b5f5: 0f 84 2b 01 00 00 je 10b726 <== NEVER TAKEN return; (*print)( context, "Period information by period\n" ); 10b5fb: 52 push %edx 10b5fc: 52 push %edx 10b5fd: 68 54 22 12 00 push $0x122254 10b602: 53 push %ebx 10b603: ff d7 call *%edi #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ (*print)( context, "--- CPU times are in seconds ---\n" ); 10b605: 5e pop %esi 10b606: 58 pop %eax 10b607: 68 72 22 12 00 push $0x122272 10b60c: 53 push %ebx 10b60d: ff d7 call *%edi (*print)( context, "--- Wall times are in seconds ---\n" ); 10b60f: 5a pop %edx 10b610: 59 pop %ecx 10b611: 68 94 22 12 00 push $0x122294 10b616: 53 push %ebx 10b617: ff d7 call *%edi Be sure to test the various cases. (*print)( context,"\ 1234567890123456789012345678901234567890123456789012345678901234567890123456789\ \n"); */ (*print)( context, " ID OWNER COUNT MISSED " 10b619: 5e pop %esi 10b61a: 58 pop %eax 10b61b: 68 b7 22 12 00 push $0x1222b7 10b620: 53 push %ebx 10b621: ff d7 call *%edi #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ " " #endif " WALL TIME\n" ); (*print)( context, " " 10b623: 5a pop %edx 10b624: 59 pop %ecx 10b625: 68 02 23 12 00 push $0x122302 10b62a: 53 push %ebx 10b62b: ff d7 call *%edi /* * 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 ; 10b62d: 8b 35 1c 92 12 00 mov 0x12921c,%esi 10b633: 83 c4 10 add $0x10,%esp 10b636: e9 df 00 00 00 jmp 10b71a id <= _Rate_monotonic_Information.maximum_id ; id++ ) { status = rtems_rate_monotonic_get_statistics( id, &the_stats ); 10b63b: 50 push %eax 10b63c: 50 push %eax 10b63d: 8d 45 88 lea -0x78(%ebp),%eax 10b640: 50 push %eax 10b641: 56 push %esi 10b642: e8 31 5f 00 00 call 111578 if ( status != RTEMS_SUCCESSFUL ) 10b647: 83 c4 10 add $0x10,%esp 10b64a: 85 c0 test %eax,%eax 10b64c: 0f 85 c7 00 00 00 jne 10b719 continue; /* If the above passed, so should this but check it anyway */ status = rtems_rate_monotonic_get_status( id, &the_status ); 10b652: 51 push %ecx 10b653: 51 push %ecx 10b654: 8d 55 c0 lea -0x40(%ebp),%edx 10b657: 52 push %edx 10b658: 56 push %esi 10b659: e8 be 5f 00 00 call 11161c #if defined(RTEMS_DEBUG) if ( status != RTEMS_SUCCESSFUL ) continue; #endif rtems_object_get_name( the_status.owner, sizeof(name), name ); 10b65e: 83 c4 0c add $0xc,%esp 10b661: 8d 45 e3 lea -0x1d(%ebp),%eax 10b664: 50 push %eax 10b665: 6a 05 push $0x5 10b667: ff 75 c0 pushl -0x40(%ebp) 10b66a: e8 fd 01 00 00 call 10b86c /* * Print part of report line that is not dependent on granularity */ (*print)( context, 10b66f: 58 pop %eax 10b670: 5a pop %edx 10b671: ff 75 8c pushl -0x74(%ebp) 10b674: ff 75 88 pushl -0x78(%ebp) 10b677: 8d 55 e3 lea -0x1d(%ebp),%edx 10b67a: 52 push %edx 10b67b: 56 push %esi 10b67c: 68 4e 23 12 00 push $0x12234e 10b681: 53 push %ebx 10b682: ff d7 call *%edi ); /* * If the count is zero, don't print statistics */ if (the_stats.count == 0) { 10b684: 8b 45 88 mov -0x78(%ebp),%eax 10b687: 83 c4 20 add $0x20,%esp 10b68a: 85 c0 test %eax,%eax 10b68c: 75 0f jne 10b69d (*print)( context, "\n" ); 10b68e: 51 push %ecx 10b68f: 51 push %ecx 10b690: 68 c8 25 12 00 push $0x1225c8 10b695: 53 push %ebx 10b696: ff d7 call *%edi continue; 10b698: 83 c4 10 add $0x10,%esp 10b69b: eb 7c jmp 10b719 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 ); 10b69d: 52 push %edx 10b69e: 8d 55 d8 lea -0x28(%ebp),%edx 10b6a1: 52 push %edx 10b6a2: 50 push %eax 10b6a3: 8d 45 a0 lea -0x60(%ebp),%eax 10b6a6: 50 push %eax 10b6a7: e8 30 30 00 00 call 10e6dc <_Timespec_Divide_by_integer> (*print)( context, 10b6ac: 8b 45 dc mov -0x24(%ebp),%eax 10b6af: b9 e8 03 00 00 mov $0x3e8,%ecx 10b6b4: 99 cltd 10b6b5: f7 f9 idiv %ecx 10b6b7: 50 push %eax 10b6b8: ff 75 d8 pushl -0x28(%ebp) 10b6bb: 8b 45 9c mov -0x64(%ebp),%eax 10b6be: 99 cltd 10b6bf: f7 f9 idiv %ecx 10b6c1: 50 push %eax 10b6c2: ff 75 98 pushl -0x68(%ebp) 10b6c5: 8b 45 94 mov -0x6c(%ebp),%eax 10b6c8: 99 cltd 10b6c9: f7 f9 idiv %ecx 10b6cb: 50 push %eax 10b6cc: ff 75 90 pushl -0x70(%ebp) 10b6cf: 68 65 23 12 00 push $0x122365 10b6d4: 53 push %ebx 10b6d5: 89 4d 84 mov %ecx,-0x7c(%ebp) 10b6d8: ff d7 call *%edi 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); 10b6da: 83 c4 2c add $0x2c,%esp 10b6dd: 8d 55 d8 lea -0x28(%ebp),%edx 10b6e0: 52 push %edx 10b6e1: ff 75 88 pushl -0x78(%ebp) 10b6e4: 8d 45 b8 lea -0x48(%ebp),%eax 10b6e7: 50 push %eax 10b6e8: e8 ef 2f 00 00 call 10e6dc <_Timespec_Divide_by_integer> (*print)( context, 10b6ed: 8b 45 dc mov -0x24(%ebp),%eax 10b6f0: 8b 4d 84 mov -0x7c(%ebp),%ecx 10b6f3: 99 cltd 10b6f4: f7 f9 idiv %ecx 10b6f6: 50 push %eax 10b6f7: ff 75 d8 pushl -0x28(%ebp) 10b6fa: 8b 45 b4 mov -0x4c(%ebp),%eax 10b6fd: 99 cltd 10b6fe: f7 f9 idiv %ecx 10b700: 50 push %eax 10b701: ff 75 b0 pushl -0x50(%ebp) 10b704: 8b 45 ac mov -0x54(%ebp),%eax 10b707: 99 cltd 10b708: f7 f9 idiv %ecx 10b70a: 50 push %eax 10b70b: ff 75 a8 pushl -0x58(%ebp) 10b70e: 68 84 23 12 00 push $0x122384 10b713: 53 push %ebx 10b714: ff d7 call *%edi 10b716: 83 c4 30 add $0x30,%esp * 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++ ) { 10b719: 46 inc %esi /* * 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 ; 10b71a: 3b 35 20 92 12 00 cmp 0x129220,%esi 10b720: 0f 86 15 ff ff ff jbe 10b63b the_stats.min_wall_time, the_stats.max_wall_time, ival_wall, fval_wall ); #endif } } } 10b726: 8d 65 f4 lea -0xc(%ebp),%esp 10b729: 5b pop %ebx 10b72a: 5e pop %esi 10b72b: 5f pop %edi 10b72c: c9 leave 10b72d: c3 ret =============================================================================== 0010a3b8 : uint32_t count, rtems_attribute attribute_set, rtems_task_priority priority_ceiling, rtems_id *id ) { 10a3b8: 55 push %ebp 10a3b9: 89 e5 mov %esp,%ebp 10a3bb: 57 push %edi 10a3bc: 56 push %esi 10a3bd: 53 push %ebx 10a3be: 83 ec 3c sub $0x3c,%esp 10a3c1: 8b 7d 0c mov 0xc(%ebp),%edi 10a3c4: 8b 5d 10 mov 0x10(%ebp),%ebx register Semaphore_Control *the_semaphore; CORE_mutex_Attributes the_mutex_attr; CORE_semaphore_Attributes the_semaphore_attr; CORE_mutex_Status mutex_status; if ( !rtems_is_name_valid( name ) ) 10a3c7: b8 03 00 00 00 mov $0x3,%eax 10a3cc: 83 7d 08 00 cmpl $0x0,0x8(%ebp) 10a3d0: 0f 84 74 01 00 00 je 10a54a <== NEVER TAKEN return RTEMS_INVALID_NAME; if ( !id ) 10a3d6: b0 09 mov $0x9,%al 10a3d8: 83 7d 18 00 cmpl $0x0,0x18(%ebp) 10a3dc: 0f 84 68 01 00 00 je 10a54a <== NEVER TAKEN return RTEMS_NOT_DEFINED; } else #endif if ( _Attributes_Is_inherit_priority( attribute_set ) || 10a3e2: 89 d8 mov %ebx,%eax 10a3e4: 25 c0 00 00 00 and $0xc0,%eax 10a3e9: 74 22 je 10a40d _Attributes_Is_priority_ceiling( attribute_set ) ) { if ( ! (_Attributes_Is_binary_semaphore( attribute_set ) && 10a3eb: 89 da mov %ebx,%edx 10a3ed: 83 e2 30 and $0x30,%edx 10a3f0: 83 fa 10 cmp $0x10,%edx 10a3f3: 0f 85 4c 01 00 00 jne 10a545 <== NEVER TAKEN 10a3f9: f6 c3 04 test $0x4,%bl 10a3fc: 0f 84 43 01 00 00 je 10a545 <== NEVER TAKEN _Attributes_Is_priority( attribute_set ) ) ) return RTEMS_NOT_DEFINED; } if ( _Attributes_Is_inherit_priority( attribute_set ) && 10a402: 3d c0 00 00 00 cmp $0xc0,%eax 10a407: 0f 84 38 01 00 00 je 10a545 <== NEVER TAKEN _Attributes_Is_priority_ceiling( attribute_set ) ) return RTEMS_NOT_DEFINED; if ( !_Attributes_Is_counting_semaphore( attribute_set ) && ( count > 1 ) ) 10a40d: 89 da mov %ebx,%edx 10a40f: 83 e2 30 and $0x30,%edx 10a412: 74 0e je 10a422 10a414: b8 0a 00 00 00 mov $0xa,%eax 10a419: 83 ff 01 cmp $0x1,%edi 10a41c: 0f 87 28 01 00 00 ja 10a54a <== NEVER TAKEN rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 10a422: a1 08 62 12 00 mov 0x126208,%eax 10a427: 40 inc %eax 10a428: a3 08 62 12 00 mov %eax,0x126208 * This function allocates a semaphore control block from * the inactive chain of free semaphore control blocks. */ RTEMS_INLINE_ROUTINE Semaphore_Control *_Semaphore_Allocate( void ) { return (Semaphore_Control *) _Objects_Allocate( &_Semaphore_Information ); 10a42d: 83 ec 0c sub $0xc,%esp 10a430: 68 50 61 12 00 push $0x126150 10a435: 89 55 c4 mov %edx,-0x3c(%ebp) 10a438: e8 db 12 00 00 call 10b718 <_Objects_Allocate> 10a43d: 89 c6 mov %eax,%esi _Thread_Disable_dispatch(); /* prevents deletion */ the_semaphore = _Semaphore_Allocate(); if ( !the_semaphore ) { 10a43f: 83 c4 10 add $0x10,%esp 10a442: 85 c0 test %eax,%eax 10a444: 8b 55 c4 mov -0x3c(%ebp),%edx 10a447: 75 0f jne 10a458 _Thread_Enable_dispatch(); 10a449: e8 cf 1e 00 00 call 10c31d <_Thread_Enable_dispatch> 10a44e: b8 05 00 00 00 mov $0x5,%eax return RTEMS_TOO_MANY; 10a453: e9 f2 00 00 00 jmp 10a54a _Thread_Enable_dispatch(); return RTEMS_TOO_MANY; } #endif the_semaphore->attribute_set = attribute_set; 10a458: 89 58 10 mov %ebx,0x10(%eax) /* * Initialize it as a counting semaphore. */ if ( _Attributes_Is_counting_semaphore( attribute_set ) ) { 10a45b: 85 d2 test %edx,%edx 10a45d: 75 37 jne 10a496 /* * This effectively disables limit checking. */ the_semaphore_attr.maximum_count = 0xFFFFFFFF; 10a45f: c7 45 e0 ff ff ff ff movl $0xffffffff,-0x20(%ebp) if ( _Attributes_Is_priority( attribute_set ) ) the_semaphore_attr.discipline = CORE_SEMAPHORE_DISCIPLINES_PRIORITY; 10a466: 31 c0 xor %eax,%eax 10a468: f6 c3 04 test $0x4,%bl 10a46b: 0f 95 c0 setne %al 10a46e: 89 45 e4 mov %eax,-0x1c(%ebp) the_semaphore_attr.discipline = CORE_SEMAPHORE_DISCIPLINES_FIFO; /* * The following are just to make Purify happy. */ the_mutex_attr.lock_nesting_behavior = CORE_MUTEX_NESTING_ACQUIRES; 10a471: c7 45 d0 00 00 00 00 movl $0x0,-0x30(%ebp) the_mutex_attr.priority_ceiling = PRIORITY_MINIMUM; 10a478: c7 45 dc 00 00 00 00 movl $0x0,-0x24(%ebp) _CORE_semaphore_Initialize( 10a47f: 51 push %ecx 10a480: 57 push %edi 10a481: 8d 45 e0 lea -0x20(%ebp),%eax 10a484: 50 push %eax 10a485: 8d 46 14 lea 0x14(%esi),%eax 10a488: 50 push %eax 10a489: e8 8a 0d 00 00 call 10b218 <_CORE_semaphore_Initialize> 10a48e: 83 c4 10 add $0x10,%esp 10a491: e9 8c 00 00 00 jmp 10a522 /* * It is either simple binary semaphore or a more powerful mutex * style binary semaphore. This is the mutex style. */ if ( _Attributes_Is_priority( attribute_set ) ) the_mutex_attr.discipline = CORE_MUTEX_DISCIPLINES_PRIORITY; 10a496: 31 c0 xor %eax,%eax 10a498: f6 c3 04 test $0x4,%bl 10a49b: 0f 95 c0 setne %al 10a49e: 89 45 d8 mov %eax,-0x28(%ebp) else the_mutex_attr.discipline = CORE_MUTEX_DISCIPLINES_FIFO; if ( _Attributes_Is_binary_semaphore( attribute_set ) ) { 10a4a1: 83 fa 10 cmp $0x10,%edx 10a4a4: 75 36 jne 10a4dc the_mutex_attr.priority_ceiling = priority_ceiling; 10a4a6: 8b 45 14 mov 0x14(%ebp),%eax 10a4a9: 89 45 dc mov %eax,-0x24(%ebp) the_mutex_attr.lock_nesting_behavior = CORE_MUTEX_NESTING_ACQUIRES; 10a4ac: c7 45 d0 00 00 00 00 movl $0x0,-0x30(%ebp) the_mutex_attr.only_owner_release = false; 10a4b3: c6 45 d4 00 movb $0x0,-0x2c(%ebp) if ( the_mutex_attr.discipline == CORE_MUTEX_DISCIPLINES_PRIORITY ) { 10a4b7: 83 7d d8 01 cmpl $0x1,-0x28(%ebp) 10a4bb: 75 2a jne 10a4e7 if ( _Attributes_Is_inherit_priority( attribute_set ) ) { 10a4bd: f6 c3 40 test $0x40,%bl 10a4c0: 74 09 je 10a4cb the_mutex_attr.discipline = CORE_MUTEX_DISCIPLINES_PRIORITY_INHERIT; 10a4c2: c7 45 d8 02 00 00 00 movl $0x2,-0x28(%ebp) 10a4c9: eb 0b jmp 10a4d6 the_mutex_attr.only_owner_release = true; } else if ( _Attributes_Is_priority_ceiling( attribute_set ) ) { 10a4cb: 84 db test %bl,%bl 10a4cd: 79 18 jns 10a4e7 the_mutex_attr.discipline = CORE_MUTEX_DISCIPLINES_PRIORITY_CEILING; 10a4cf: c7 45 d8 03 00 00 00 movl $0x3,-0x28(%ebp) the_mutex_attr.only_owner_release = true; 10a4d6: c6 45 d4 01 movb $0x1,-0x2c(%ebp) 10a4da: eb 0b jmp 10a4e7 } } } else /* must be simple binary semaphore */ { the_mutex_attr.lock_nesting_behavior = CORE_MUTEX_NESTING_BLOCKS; 10a4dc: c7 45 d0 02 00 00 00 movl $0x2,-0x30(%ebp) the_mutex_attr.only_owner_release = false; 10a4e3: c6 45 d4 00 movb $0x0,-0x2c(%ebp) } mutex_status = _CORE_mutex_Initialize( 10a4e7: 52 push %edx 10a4e8: 31 c0 xor %eax,%eax 10a4ea: 83 ff 01 cmp $0x1,%edi 10a4ed: 0f 94 c0 sete %al 10a4f0: 50 push %eax 10a4f1: 8d 45 d0 lea -0x30(%ebp),%eax 10a4f4: 50 push %eax 10a4f5: 8d 46 14 lea 0x14(%esi),%eax 10a4f8: 50 push %eax 10a4f9: e8 ae 0a 00 00 call 10afac <_CORE_mutex_Initialize> &the_semaphore->Core_control.mutex, &the_mutex_attr, (count == 1) ? CORE_MUTEX_UNLOCKED : CORE_MUTEX_LOCKED ); if ( mutex_status == CORE_MUTEX_STATUS_CEILING_VIOLATED ) { 10a4fe: 83 c4 10 add $0x10,%esp 10a501: 83 f8 06 cmp $0x6,%eax 10a504: 75 1c jne 10a522 */ RTEMS_INLINE_ROUTINE void _Semaphore_Free ( Semaphore_Control *the_semaphore ) { _Objects_Free( &_Semaphore_Information, &the_semaphore->Object ); 10a506: 50 push %eax 10a507: 50 push %eax 10a508: 56 push %esi 10a509: 68 50 61 12 00 push $0x126150 10a50e: e8 f1 14 00 00 call 10ba04 <_Objects_Free> _Semaphore_Free( the_semaphore ); _Thread_Enable_dispatch(); 10a513: e8 05 1e 00 00 call 10c31d <_Thread_Enable_dispatch> 10a518: b8 13 00 00 00 mov $0x13,%eax return RTEMS_INVALID_PRIORITY; 10a51d: 83 c4 10 add $0x10,%esp 10a520: eb 28 jmp 10a54a #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 10a522: 8b 46 08 mov 0x8(%esi),%eax 10a525: 0f b7 c8 movzwl %ax,%ecx 10a528: 8b 15 6c 61 12 00 mov 0x12616c,%edx 10a52e: 89 34 8a mov %esi,(%edx,%ecx,4) information, _Objects_Get_index( the_object->id ), the_object ); the_object->name = name; 10a531: 8b 55 08 mov 0x8(%ebp),%edx 10a534: 89 56 0c mov %edx,0xc(%esi) &_Semaphore_Information, &the_semaphore->Object, (Objects_Name) name ); *id = the_semaphore->Object.id; 10a537: 8b 55 18 mov 0x18(%ebp),%edx 10a53a: 89 02 mov %eax,(%edx) the_semaphore->Object.id, name, 0 /* Not used */ ); #endif _Thread_Enable_dispatch(); 10a53c: e8 dc 1d 00 00 call 10c31d <_Thread_Enable_dispatch> 10a541: 31 c0 xor %eax,%eax return RTEMS_SUCCESSFUL; 10a543: eb 05 jmp 10a54a 10a545: b8 0b 00 00 00 mov $0xb,%eax } 10a54a: 8d 65 f4 lea -0xc(%ebp),%esp 10a54d: 5b pop %ebx 10a54e: 5e pop %esi 10a54f: 5f pop %edi 10a550: c9 leave 10a551: c3 ret =============================================================================== 001162b0 : rtems_status_code rtems_signal_send( rtems_id id, rtems_signal_set signal_set ) { 1162b0: 55 push %ebp 1162b1: 89 e5 mov %esp,%ebp 1162b3: 53 push %ebx 1162b4: 83 ec 14 sub $0x14,%esp 1162b7: 8b 5d 0c mov 0xc(%ebp),%ebx register Thread_Control *the_thread; Objects_Locations location; RTEMS_API_Control *api; ASR_Information *asr; if ( !signal_set ) 1162ba: b8 0a 00 00 00 mov $0xa,%eax 1162bf: 85 db test %ebx,%ebx 1162c1: 74 71 je 116334 return RTEMS_INVALID_NUMBER; the_thread = _Thread_Get( id, &location ); 1162c3: 50 push %eax 1162c4: 50 push %eax 1162c5: 8d 45 f4 lea -0xc(%ebp),%eax 1162c8: 50 push %eax 1162c9: ff 75 08 pushl 0x8(%ebp) 1162cc: e8 63 36 00 00 call 119934 <_Thread_Get> 1162d1: 89 c1 mov %eax,%ecx switch ( location ) { 1162d3: 83 c4 10 add $0x10,%esp 1162d6: b8 04 00 00 00 mov $0x4,%eax 1162db: 83 7d f4 00 cmpl $0x0,-0xc(%ebp) 1162df: 75 53 jne 116334 case OBJECTS_LOCAL: api = the_thread->API_Extensions[ THREAD_API_RTEMS ]; 1162e1: 8b 91 f4 00 00 00 mov 0xf4(%ecx),%edx asr = &api->Signal; 1162e7: 83 7a 0c 00 cmpl $0x0,0xc(%edx) 1162eb: 74 3d je 11632a if ( ! _ASR_Is_null_handler( asr->handler ) ) { if ( asr->is_enabled ) { 1162ed: 80 7a 08 00 cmpb $0x0,0x8(%edx) 1162f1: 74 26 je 116319 rtems_signal_set *signal_set ) { ISR_Level _level; _ISR_Disable( _level ); 1162f3: 9c pushf 1162f4: fa cli 1162f5: 58 pop %eax *signal_set |= signals; 1162f6: 09 5a 14 or %ebx,0x14(%edx) _ISR_Enable( _level ); 1162f9: 50 push %eax 1162fa: 9d popf _ASR_Post_signals( signal_set, &asr->signals_posted ); the_thread->do_post_task_switch_extension = true; 1162fb: c6 41 74 01 movb $0x1,0x74(%ecx) if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) 1162ff: a1 74 f6 13 00 mov 0x13f674,%eax 116304: 85 c0 test %eax,%eax 116306: 74 19 je 116321 116308: 3b 0d 98 f6 13 00 cmp 0x13f698,%ecx 11630e: 75 11 jne 116321 <== NEVER TAKEN _ISR_Signals_to_thread_executing = true; 116310: c6 05 2c f7 13 00 01 movb $0x1,0x13f72c 116317: eb 08 jmp 116321 rtems_signal_set *signal_set ) { ISR_Level _level; _ISR_Disable( _level ); 116319: 9c pushf 11631a: fa cli 11631b: 58 pop %eax *signal_set |= signals; 11631c: 09 5a 18 or %ebx,0x18(%edx) _ISR_Enable( _level ); 11631f: 50 push %eax 116320: 9d popf } else { _ASR_Post_signals( signal_set, &asr->signals_pending ); } _Thread_Enable_dispatch(); 116321: e8 bf 35 00 00 call 1198e5 <_Thread_Enable_dispatch> 116326: 31 c0 xor %eax,%eax return RTEMS_SUCCESSFUL; 116328: eb 0a jmp 116334 } _Thread_Enable_dispatch(); 11632a: e8 b6 35 00 00 call 1198e5 <_Thread_Enable_dispatch> 11632f: b8 0b 00 00 00 mov $0xb,%eax case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 116334: 8b 5d fc mov -0x4(%ebp),%ebx 116337: c9 leave 116338: c3 ret =============================================================================== 001125c4 : rtems_status_code rtems_task_mode( rtems_mode mode_set, rtems_mode mask, rtems_mode *previous_mode_set ) { 1125c4: 55 push %ebp 1125c5: 89 e5 mov %esp,%ebp 1125c7: 57 push %edi 1125c8: 56 push %esi 1125c9: 53 push %ebx 1125ca: 83 ec 1c sub $0x1c,%esp 1125cd: 8b 4d 10 mov 0x10(%ebp),%ecx ASR_Information *asr; bool is_asr_enabled = false; bool needs_asr_dispatching = false; rtems_mode old_mode; if ( !previous_mode_set ) 1125d0: b8 09 00 00 00 mov $0x9,%eax 1125d5: 85 c9 test %ecx,%ecx 1125d7: 0f 84 f4 00 00 00 je 1126d1 return RTEMS_INVALID_ADDRESS; executing = _Thread_Executing; 1125dd: 8b 1d c4 62 12 00 mov 0x1262c4,%ebx api = executing->API_Extensions[ THREAD_API_RTEMS ]; 1125e3: 8b b3 f4 00 00 00 mov 0xf4(%ebx),%esi asr = &api->Signal; old_mode = (executing->is_preemptible) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT; 1125e9: 80 7b 75 01 cmpb $0x1,0x75(%ebx) 1125ed: 19 ff sbb %edi,%edi 1125ef: 81 e7 00 01 00 00 and $0x100,%edi if ( executing->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_NONE ) 1125f5: 83 7b 7c 00 cmpl $0x0,0x7c(%ebx) 1125f9: 74 06 je 112601 old_mode |= RTEMS_NO_TIMESLICE; else old_mode |= RTEMS_TIMESLICE; 1125fb: 81 cf 00 02 00 00 or $0x200,%edi if ( !previous_mode_set ) return RTEMS_INVALID_ADDRESS; executing = _Thread_Executing; api = executing->API_Extensions[ THREAD_API_RTEMS ]; asr = &api->Signal; 112601: 80 7e 08 01 cmpb $0x1,0x8(%esi) 112605: 19 d2 sbb %edx,%edx 112607: 81 e2 00 04 00 00 and $0x400,%edx old_mode |= RTEMS_NO_TIMESLICE; else old_mode |= RTEMS_TIMESLICE; old_mode |= (asr->is_enabled) ? RTEMS_ASR : RTEMS_NO_ASR; old_mode |= _ISR_Get_level(); 11260d: 89 55 e4 mov %edx,-0x1c(%ebp) 112610: 89 4d e0 mov %ecx,-0x20(%ebp) 112613: e8 63 af ff ff call 10d57b <_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; 112618: 8b 55 e4 mov -0x1c(%ebp),%edx 11261b: 09 d0 or %edx,%eax old_mode |= _ISR_Get_level(); *previous_mode_set = old_mode; 11261d: 09 f8 or %edi,%eax 11261f: 8b 4d e0 mov -0x20(%ebp),%ecx 112622: 89 01 mov %eax,(%ecx) /* * These are generic thread scheduling characteristics. */ if ( mask & RTEMS_PREEMPT_MASK ) 112624: f7 45 0c 00 01 00 00 testl $0x100,0xc(%ebp) 11262b: 74 0f je 11263c executing->is_preemptible = _Modes_Is_preempt(mode_set) ? true : false; 11262d: 8b 45 08 mov 0x8(%ebp),%eax 112630: c1 e8 08 shr $0x8,%eax 112633: 83 f0 01 xor $0x1,%eax 112636: 83 e0 01 and $0x1,%eax 112639: 88 43 75 mov %al,0x75(%ebx) if ( mask & RTEMS_TIMESLICE_MASK ) { 11263c: f7 45 0c 00 02 00 00 testl $0x200,0xc(%ebp) 112643: 74 21 je 112666 if ( _Modes_Is_timeslice(mode_set) ) { 112645: f7 45 08 00 02 00 00 testl $0x200,0x8(%ebp) 11264c: 74 11 je 11265f executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE; 11264e: c7 43 7c 01 00 00 00 movl $0x1,0x7c(%ebx) executing->cpu_time_budget = _Thread_Ticks_per_timeslice; 112655: a1 d4 61 12 00 mov 0x1261d4,%eax 11265a: 89 43 78 mov %eax,0x78(%ebx) 11265d: eb 07 jmp 112666 } else executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE; 11265f: c7 43 7c 00 00 00 00 movl $0x0,0x7c(%ebx) /* * Set the new interrupt level */ if ( mask & RTEMS_INTERRUPT_MASK ) 112666: f6 45 0c 01 testb $0x1,0xc(%ebp) 11266a: 74 0a je 112676 */ RTEMS_INLINE_ROUTINE void _Modes_Set_interrupt_level ( Modes_Control mode_set ) { _ISR_Set_level( _Modes_Get_interrupt_level( mode_set ) ); 11266c: f6 45 08 01 testb $0x1,0x8(%ebp) 112670: 74 03 je 112675 112672: fa cli 112673: eb 01 jmp 112676 112675: fb sti */ is_asr_enabled = false; needs_asr_dispatching = false; if ( mask & RTEMS_ASR_MASK ) { 112676: f7 45 0c 00 04 00 00 testl $0x400,0xc(%ebp) 11267d: 74 33 je 1126b2 * Output: * *previous_mode_set - previous mode set * always return RTEMS_SUCCESSFUL; */ rtems_status_code rtems_task_mode( 11267f: 8b 45 08 mov 0x8(%ebp),%eax 112682: c1 e8 0a shr $0xa,%eax 112685: 83 f0 01 xor $0x1,%eax 112688: 83 e0 01 and $0x1,%eax if ( !previous_mode_set ) return RTEMS_INVALID_ADDRESS; executing = _Thread_Executing; api = executing->API_Extensions[ THREAD_API_RTEMS ]; asr = &api->Signal; 11268b: 3a 46 08 cmp 0x8(%esi),%al 11268e: 74 22 je 1126b2 needs_asr_dispatching = false; if ( mask & RTEMS_ASR_MASK ) { is_asr_enabled = _Modes_Is_asr_disabled( mode_set ) ? false : true; if ( is_asr_enabled != asr->is_enabled ) { asr->is_enabled = is_asr_enabled; 112690: 88 46 08 mov %al,0x8(%esi) ) { rtems_signal_set _signals; ISR_Level _level; _ISR_Disable( _level ); 112693: 9c pushf 112694: fa cli 112695: 58 pop %eax _signals = information->signals_pending; 112696: 8b 56 18 mov 0x18(%esi),%edx information->signals_pending = information->signals_posted; 112699: 8b 4e 14 mov 0x14(%esi),%ecx 11269c: 89 4e 18 mov %ecx,0x18(%esi) information->signals_posted = _signals; 11269f: 89 56 14 mov %edx,0x14(%esi) _ISR_Enable( _level ); 1126a2: 50 push %eax 1126a3: 9d popf if ( !previous_mode_set ) return RTEMS_INVALID_ADDRESS; executing = _Thread_Executing; api = executing->API_Extensions[ THREAD_API_RTEMS ]; asr = &api->Signal; 1126a4: 83 7e 14 00 cmpl $0x0,0x14(%esi) 1126a8: 74 08 je 1126b2 if ( is_asr_enabled != asr->is_enabled ) { asr->is_enabled = is_asr_enabled; _ASR_Swap_signals( asr ); if ( _ASR_Are_signals_pending( asr ) ) { needs_asr_dispatching = true; executing->do_post_task_switch_extension = true; 1126aa: c6 43 74 01 movb $0x1,0x74(%ebx) 1126ae: b3 01 mov $0x1,%bl 1126b0: eb 02 jmp 1126b4 1126b2: 31 db xor %ebx,%ebx } } } if ( _System_state_Is_up( _System_state_Get() ) ) 1126b4: 83 3d a0 63 12 00 03 cmpl $0x3,0x1263a0 1126bb: 75 12 jne 1126cf <== NEVER TAKEN if ( _Thread_Evaluate_mode() || needs_asr_dispatching ) 1126bd: e8 1e 01 00 00 call 1127e0 <_Thread_Evaluate_mode> 1126c2: 84 c0 test %al,%al 1126c4: 75 04 jne 1126ca 1126c6: 84 db test %bl,%bl 1126c8: 74 05 je 1126cf _Thread_Dispatch(); 1126ca: e8 09 9b ff ff call 10c1d8 <_Thread_Dispatch> 1126cf: 31 c0 xor %eax,%eax return RTEMS_SUCCESSFUL; } 1126d1: 83 c4 1c add $0x1c,%esp 1126d4: 5b pop %ebx 1126d5: 5e pop %esi 1126d6: 5f pop %edi 1126d7: c9 leave 1126d8: c3 ret =============================================================================== 0010e200 : rtems_status_code rtems_task_set_priority( rtems_id id, rtems_task_priority new_priority, rtems_task_priority *old_priority ) { 10e200: 55 push %ebp 10e201: 89 e5 mov %esp,%ebp 10e203: 56 push %esi 10e204: 53 push %ebx 10e205: 83 ec 10 sub $0x10,%esp 10e208: 8b 5d 0c mov 0xc(%ebp),%ebx 10e20b: 8b 75 10 mov 0x10(%ebp),%esi register Thread_Control *the_thread; Objects_Locations location; if ( new_priority != RTEMS_CURRENT_PRIORITY && 10e20e: 85 db test %ebx,%ebx 10e210: 74 10 je 10e222 10e212: 0f b6 05 f4 51 12 00 movzbl 0x1251f4,%eax 10e219: ba 13 00 00 00 mov $0x13,%edx 10e21e: 39 c3 cmp %eax,%ebx 10e220: 77 50 ja 10e272 !_RTEMS_tasks_Priority_is_valid( new_priority ) ) return RTEMS_INVALID_PRIORITY; if ( !old_priority ) 10e222: ba 09 00 00 00 mov $0x9,%edx 10e227: 85 f6 test %esi,%esi 10e229: 74 47 je 10e272 return RTEMS_INVALID_ADDRESS; the_thread = _Thread_Get( id, &location ); 10e22b: 51 push %ecx 10e22c: 51 push %ecx 10e22d: 8d 45 f4 lea -0xc(%ebp),%eax 10e230: 50 push %eax 10e231: ff 75 08 pushl 0x8(%ebp) 10e234: e8 f3 1b 00 00 call 10fe2c <_Thread_Get> switch ( location ) { 10e239: 83 c4 10 add $0x10,%esp 10e23c: ba 04 00 00 00 mov $0x4,%edx 10e241: 83 7d f4 00 cmpl $0x0,-0xc(%ebp) 10e245: 75 2b jne 10e272 case OBJECTS_LOCAL: /* XXX need helper to "convert" from core priority */ *old_priority = the_thread->current_priority; 10e247: 8b 50 14 mov 0x14(%eax),%edx 10e24a: 89 16 mov %edx,(%esi) if ( new_priority != RTEMS_CURRENT_PRIORITY ) { 10e24c: 85 db test %ebx,%ebx 10e24e: 74 1b je 10e26b the_thread->real_priority = new_priority; 10e250: 89 58 18 mov %ebx,0x18(%eax) if ( the_thread->resource_count == 0 || 10e253: 83 78 1c 00 cmpl $0x0,0x1c(%eax) 10e257: 74 05 je 10e25e the_thread->current_priority > new_priority ) 10e259: 39 58 14 cmp %ebx,0x14(%eax) 10e25c: 76 0d jbe 10e26b <== ALWAYS TAKEN _Thread_Change_priority( the_thread, new_priority, false ); 10e25e: 52 push %edx 10e25f: 6a 00 push $0x0 10e261: 53 push %ebx 10e262: 50 push %eax 10e263: e8 d8 16 00 00 call 10f940 <_Thread_Change_priority> 10e268: 83 c4 10 add $0x10,%esp } _Thread_Enable_dispatch(); 10e26b: e8 6d 1b 00 00 call 10fddd <_Thread_Enable_dispatch> 10e270: 31 d2 xor %edx,%edx case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 10e272: 89 d0 mov %edx,%eax 10e274: 8d 65 f8 lea -0x8(%ebp),%esp 10e277: 5b pop %ebx 10e278: 5e pop %esi 10e279: c9 leave 10e27a: c3 ret =============================================================================== 00116af8 : */ rtems_status_code rtems_timer_cancel( rtems_id id ) { 116af8: 55 push %ebp 116af9: 89 e5 mov %esp,%ebp 116afb: 83 ec 1c sub $0x1c,%esp RTEMS_INLINE_ROUTINE Timer_Control *_Timer_Get ( Objects_Id id, Objects_Locations *location ) { return (Timer_Control *) 116afe: 8d 45 f4 lea -0xc(%ebp),%eax 116b01: 50 push %eax 116b02: ff 75 08 pushl 0x8(%ebp) 116b05: 68 68 ff 13 00 push $0x13ff68 116b0a: e8 71 25 00 00 call 119080 <_Objects_Get> 116b0f: 89 c2 mov %eax,%edx Timer_Control *the_timer; Objects_Locations location; the_timer = _Timer_Get( id, &location ); switch ( location ) { 116b11: 83 c4 10 add $0x10,%esp 116b14: b8 04 00 00 00 mov $0x4,%eax 116b19: 83 7d f4 00 cmpl $0x0,-0xc(%ebp) 116b1d: 75 1c jne 116b3b case OBJECTS_LOCAL: if ( !_Timer_Is_dormant_class( the_timer->the_class ) ) 116b1f: 83 7a 38 04 cmpl $0x4,0x38(%edx) 116b23: 74 0f je 116b34 <== NEVER TAKEN (void) _Watchdog_Remove( &the_timer->Ticker ); 116b25: 83 ec 0c sub $0xc,%esp 116b28: 83 c2 10 add $0x10,%edx 116b2b: 52 push %edx 116b2c: e8 2b 40 00 00 call 11ab5c <_Watchdog_Remove> 116b31: 83 c4 10 add $0x10,%esp _Thread_Enable_dispatch(); 116b34: e8 ac 2d 00 00 call 1198e5 <_Thread_Enable_dispatch> 116b39: 31 c0 xor %eax,%eax case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 116b3b: c9 leave 116b3c: c3 ret =============================================================================== 00116f60 : rtems_id id, rtems_time_of_day *wall_time, rtems_timer_service_routine_entry routine, void *user_data ) { 116f60: 55 push %ebp 116f61: 89 e5 mov %esp,%ebp 116f63: 57 push %edi 116f64: 56 push %esi 116f65: 53 push %ebx 116f66: 83 ec 1c sub $0x1c,%esp 116f69: 8b 5d 0c mov 0xc(%ebp),%ebx Timer_Control *the_timer; Objects_Locations location; rtems_interval seconds; Timer_server_Control *timer_server = _Timer_server; 116f6c: 8b 35 a8 ff 13 00 mov 0x13ffa8,%esi if ( !timer_server ) 116f72: b8 0e 00 00 00 mov $0xe,%eax 116f77: 85 f6 test %esi,%esi 116f79: 0f 84 b4 00 00 00 je 117033 <== NEVER TAKEN return RTEMS_INCORRECT_STATE; if ( !_TOD_Is_set ) 116f7f: b0 0b mov $0xb,%al 116f81: 80 3d f0 f5 13 00 00 cmpb $0x0,0x13f5f0 116f88: 0f 84 a5 00 00 00 je 117033 <== NEVER TAKEN return RTEMS_NOT_DEFINED; if ( !routine ) 116f8e: b0 09 mov $0x9,%al 116f90: 83 7d 10 00 cmpl $0x0,0x10(%ebp) 116f94: 0f 84 99 00 00 00 je 117033 <== NEVER TAKEN return RTEMS_INVALID_ADDRESS; if ( !_TOD_Validate( wall_time ) ) 116f9a: 83 ec 0c sub $0xc,%esp 116f9d: 53 push %ebx 116f9e: e8 61 d6 ff ff call 114604 <_TOD_Validate> 116fa3: 83 c4 10 add $0x10,%esp 116fa6: 84 c0 test %al,%al 116fa8: 0f 84 80 00 00 00 je 11702e <== NEVER TAKEN return RTEMS_INVALID_CLOCK; seconds = _TOD_To_seconds( wall_time ); 116fae: 83 ec 0c sub $0xc,%esp 116fb1: 53 push %ebx 116fb2: e8 e5 d5 ff ff call 11459c <_TOD_To_seconds> 116fb7: 89 c7 mov %eax,%edi if ( seconds <= _TOD_Seconds_since_epoch() ) 116fb9: 83 c4 10 add $0x10,%esp 116fbc: 3b 05 6c f6 13 00 cmp 0x13f66c,%eax 116fc2: 76 6a jbe 11702e <== NEVER TAKEN 116fc4: 51 push %ecx 116fc5: 8d 45 e4 lea -0x1c(%ebp),%eax 116fc8: 50 push %eax 116fc9: ff 75 08 pushl 0x8(%ebp) 116fcc: 68 68 ff 13 00 push $0x13ff68 116fd1: e8 aa 20 00 00 call 119080 <_Objects_Get> 116fd6: 89 c3 mov %eax,%ebx return RTEMS_INVALID_CLOCK; the_timer = _Timer_Get( id, &location ); switch ( location ) { 116fd8: 83 c4 10 add $0x10,%esp 116fdb: b8 04 00 00 00 mov $0x4,%eax 116fe0: 83 7d e4 00 cmpl $0x0,-0x1c(%ebp) 116fe4: 75 4d jne 117033 <== NEVER TAKEN case OBJECTS_LOCAL: (void) _Watchdog_Remove( &the_timer->Ticker ); 116fe6: 83 ec 0c sub $0xc,%esp 116fe9: 8d 43 10 lea 0x10(%ebx),%eax 116fec: 50 push %eax 116fed: e8 6a 3b 00 00 call 11ab5c <_Watchdog_Remove> the_timer->the_class = TIMER_TIME_OF_DAY_ON_TASK; 116ff2: c7 43 38 03 00 00 00 movl $0x3,0x38(%ebx) Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 116ff9: c7 43 18 00 00 00 00 movl $0x0,0x18(%ebx) the_watchdog->routine = routine; 117000: 8b 45 10 mov 0x10(%ebp),%eax 117003: 89 43 2c mov %eax,0x2c(%ebx) the_watchdog->id = id; 117006: 8b 45 08 mov 0x8(%ebp),%eax 117009: 89 43 30 mov %eax,0x30(%ebx) the_watchdog->user_data = user_data; 11700c: 8b 45 14 mov 0x14(%ebp),%eax 11700f: 89 43 34 mov %eax,0x34(%ebx) _Watchdog_Initialize( &the_timer->Ticker, routine, id, user_data ); the_timer->Ticker.initial = seconds - _TOD_Seconds_since_epoch(); 117012: 2b 3d 6c f6 13 00 sub 0x13f66c,%edi 117018: 89 7b 1c mov %edi,0x1c(%ebx) (*timer_server->schedule_operation)( timer_server, the_timer ); 11701b: 58 pop %eax 11701c: 5a pop %edx 11701d: 53 push %ebx 11701e: 56 push %esi 11701f: ff 56 04 call *0x4(%esi) _Thread_Enable_dispatch(); 117022: e8 be 28 00 00 call 1198e5 <_Thread_Enable_dispatch> 117027: 31 c0 xor %eax,%eax return RTEMS_SUCCESSFUL; 117029: 83 c4 10 add $0x10,%esp 11702c: eb 05 jmp 117033 11702e: b8 14 00 00 00 mov $0x14,%eax case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 117033: 8d 65 f4 lea -0xc(%ebp),%esp 117036: 5b pop %ebx 117037: 5e pop %esi 117038: 5f pop %edi 117039: c9 leave 11703a: c3 ret =============================================================================== 0010ad4c : #include int sched_get_priority_max( int policy ) { 10ad4c: 55 push %ebp 10ad4d: 89 e5 mov %esp,%ebp 10ad4f: 83 ec 08 sub $0x8,%esp 10ad52: 8b 4d 08 mov 0x8(%ebp),%ecx switch ( policy ) { 10ad55: 83 f9 04 cmp $0x4,%ecx 10ad58: 77 0b ja 10ad65 10ad5a: b8 01 00 00 00 mov $0x1,%eax 10ad5f: d3 e0 shl %cl,%eax 10ad61: a8 17 test $0x17,%al 10ad63: 75 10 jne 10ad75 <== ALWAYS TAKEN case SCHED_RR: case SCHED_SPORADIC: break; default: rtems_set_errno_and_return_minus_one( EINVAL ); 10ad65: e8 6a 88 00 00 call 1135d4 <__errno> 10ad6a: c7 00 16 00 00 00 movl $0x16,(%eax) 10ad70: 83 c8 ff or $0xffffffff,%eax 10ad73: eb 08 jmp 10ad7d } return POSIX_SCHEDULER_MAXIMUM_PRIORITY; 10ad75: 0f b6 05 18 32 12 00 movzbl 0x123218,%eax 10ad7c: 48 dec %eax } 10ad7d: c9 leave 10ad7e: c3 ret =============================================================================== 0010ad80 : #include int sched_get_priority_min( int policy ) { 10ad80: 55 push %ebp 10ad81: 89 e5 mov %esp,%ebp 10ad83: 83 ec 08 sub $0x8,%esp 10ad86: 8b 4d 08 mov 0x8(%ebp),%ecx switch ( policy ) { 10ad89: 83 f9 04 cmp $0x4,%ecx 10ad8c: 77 11 ja 10ad9f 10ad8e: ba 01 00 00 00 mov $0x1,%edx 10ad93: d3 e2 shl %cl,%edx 10ad95: b8 01 00 00 00 mov $0x1,%eax 10ad9a: 80 e2 17 and $0x17,%dl 10ad9d: 75 0e jne 10adad <== ALWAYS TAKEN case SCHED_RR: case SCHED_SPORADIC: break; default: rtems_set_errno_and_return_minus_one( EINVAL ); 10ad9f: e8 30 88 00 00 call 1135d4 <__errno> 10ada4: c7 00 16 00 00 00 movl $0x16,(%eax) 10adaa: 83 c8 ff or $0xffffffff,%eax } return POSIX_SCHEDULER_MINIMUM_PRIORITY; } 10adad: c9 leave 10adae: c3 ret =============================================================================== 0010adb0 : int sched_rr_get_interval( pid_t pid, struct timespec *interval ) { 10adb0: 55 push %ebp 10adb1: 89 e5 mov %esp,%ebp 10adb3: 56 push %esi 10adb4: 53 push %ebx 10adb5: 8b 75 08 mov 0x8(%ebp),%esi 10adb8: 8b 5d 0c mov 0xc(%ebp),%ebx /* * Only supported for the "calling process" (i.e. this node). */ if ( pid && pid != getpid() ) 10adbb: 85 f6 test %esi,%esi 10adbd: 74 16 je 10add5 <== NEVER TAKEN 10adbf: e8 a0 cf ff ff call 107d64 10adc4: 39 c6 cmp %eax,%esi 10adc6: 74 0d je 10add5 rtems_set_errno_and_return_minus_one( ESRCH ); 10adc8: e8 07 88 00 00 call 1135d4 <__errno> 10adcd: c7 00 03 00 00 00 movl $0x3,(%eax) 10add3: eb 0f jmp 10ade4 if ( !interval ) 10add5: 85 db test %ebx,%ebx 10add7: 75 10 jne 10ade9 rtems_set_errno_and_return_minus_one( EINVAL ); 10add9: e8 f6 87 00 00 call 1135d4 <__errno> 10adde: c7 00 16 00 00 00 movl $0x16,(%eax) 10ade4: 83 c8 ff or $0xffffffff,%eax 10ade7: eb 13 jmp 10adfc _Timespec_From_ticks( _Thread_Ticks_per_timeslice, interval ); 10ade9: 50 push %eax 10adea: 50 push %eax 10adeb: 53 push %ebx 10adec: ff 35 c4 71 12 00 pushl 0x1271c4 10adf2: e8 b5 2f 00 00 call 10ddac <_Timespec_From_ticks> 10adf7: 31 c0 xor %eax,%eax return 0; 10adf9: 83 c4 10 add $0x10,%esp } 10adfc: 8d 65 f8 lea -0x8(%ebp),%esp 10adff: 5b pop %ebx 10ae00: 5e pop %esi 10ae01: c9 leave 10ae02: c3 ret =============================================================================== 0010d430 : int oflag, ... /* mode_t mode, */ /* unsigned int value */ ) { 10d430: 55 push %ebp 10d431: 89 e5 mov %esp,%ebp 10d433: 57 push %edi 10d434: 56 push %esi 10d435: 53 push %ebx 10d436: 83 ec 2c sub $0x2c,%esp 10d439: 8b 75 08 mov 0x8(%ebp),%esi rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 10d43c: a1 f8 b3 12 00 mov 0x12b3f8,%eax 10d441: 40 inc %eax 10d442: a3 f8 b3 12 00 mov %eax,0x12b3f8 POSIX_Semaphore_Control *the_semaphore; Objects_Locations location; _Thread_Disable_dispatch(); if ( oflag & O_CREAT ) { 10d447: 8b 45 0c mov 0xc(%ebp),%eax 10d44a: 25 00 02 00 00 and $0x200,%eax 10d44f: 89 45 d4 mov %eax,-0x2c(%ebp) 10d452: 75 04 jne 10d458 10d454: 31 ff xor %edi,%edi 10d456: eb 03 jmp 10d45b va_start(arg, oflag); mode = (mode_t) va_arg( arg, unsigned int ); value = va_arg( arg, unsigned int ); 10d458: 8b 7d 14 mov 0x14(%ebp),%edi va_end(arg); } status = _POSIX_Semaphore_Name_to_id( name, &the_semaphore_id ); 10d45b: 52 push %edx 10d45c: 52 push %edx 10d45d: 8d 45 e4 lea -0x1c(%ebp),%eax 10d460: 50 push %eax 10d461: 56 push %esi 10d462: e8 79 5f 00 00 call 1133e0 <_POSIX_Semaphore_Name_to_id> 10d467: 89 c3 mov %eax,%ebx * 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 ) { 10d469: 83 c4 10 add $0x10,%esp 10d46c: 85 c0 test %eax,%eax 10d46e: 74 19 je 10d489 /* * 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) ) ) { 10d470: 83 f8 02 cmp $0x2,%eax 10d473: 75 06 jne 10d47b <== NEVER TAKEN 10d475: 83 7d d4 00 cmpl $0x0,-0x2c(%ebp) 10d479: 75 59 jne 10d4d4 _Thread_Enable_dispatch(); 10d47b: e8 0d 25 00 00 call 10f98d <_Thread_Enable_dispatch> rtems_set_errno_and_return_minus_one_cast( status, sem_t * ); 10d480: e8 df 93 00 00 call 116864 <__errno> 10d485: 89 18 mov %ebx,(%eax) 10d487: eb 1f jmp 10d4a8 /* * Check for existence with creation. */ if ( (oflag & (O_CREAT | O_EXCL)) == (O_CREAT | O_EXCL) ) { 10d489: 8b 45 0c mov 0xc(%ebp),%eax 10d48c: 25 00 0a 00 00 and $0xa00,%eax 10d491: 3d 00 0a 00 00 cmp $0xa00,%eax 10d496: 75 15 jne 10d4ad _Thread_Enable_dispatch(); 10d498: e8 f0 24 00 00 call 10f98d <_Thread_Enable_dispatch> rtems_set_errno_and_return_minus_one_cast( EEXIST, sem_t * ); 10d49d: e8 c2 93 00 00 call 116864 <__errno> 10d4a2: c7 00 11 00 00 00 movl $0x11,(%eax) 10d4a8: 83 c8 ff or $0xffffffff,%eax 10d4ab: eb 4a jmp 10d4f7 10d4ad: 50 push %eax 10d4ae: 8d 45 dc lea -0x24(%ebp),%eax 10d4b1: 50 push %eax 10d4b2: ff 75 e4 pushl -0x1c(%ebp) 10d4b5: 68 e0 b6 12 00 push $0x12b6e0 10d4ba: e8 95 1c 00 00 call 10f154 <_Objects_Get> } the_semaphore = _POSIX_Semaphore_Get( &the_semaphore_id, &location ); 10d4bf: 89 45 e0 mov %eax,-0x20(%ebp) the_semaphore->open_count += 1; 10d4c2: ff 40 18 incl 0x18(%eax) _Thread_Enable_dispatch(); 10d4c5: e8 c3 24 00 00 call 10f98d <_Thread_Enable_dispatch> _Thread_Enable_dispatch(); 10d4ca: e8 be 24 00 00 call 10f98d <_Thread_Enable_dispatch> goto return_id; 10d4cf: 83 c4 10 add $0x10,%esp 10d4d2: eb 1d jmp 10d4f1 /* * 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( 10d4d4: 8d 45 e0 lea -0x20(%ebp),%eax 10d4d7: 50 push %eax 10d4d8: 57 push %edi 10d4d9: 6a 00 push $0x0 10d4db: 56 push %esi 10d4dc: e8 cb 5d 00 00 call 1132ac <_POSIX_Semaphore_Create_support> 10d4e1: 89 c3 mov %eax,%ebx /* * errno was set by Create_support, so don't set it again. */ _Thread_Enable_dispatch(); 10d4e3: e8 a5 24 00 00 call 10f98d <_Thread_Enable_dispatch> if ( status == -1 ) 10d4e8: 83 c4 10 add $0x10,%esp 10d4eb: 83 c8 ff or $0xffffffff,%eax 10d4ee: 43 inc %ebx 10d4ef: 74 06 je 10d4f7 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; 10d4f1: 8b 45 e0 mov -0x20(%ebp),%eax 10d4f4: 83 c0 08 add $0x8,%eax #endif return id; } 10d4f7: 8d 65 f4 lea -0xc(%ebp),%esp 10d4fa: 5b pop %ebx 10d4fb: 5e pop %esi 10d4fc: 5f pop %edi 10d4fd: c9 leave 10d4fe: c3 ret =============================================================================== 0010ac48 : int sigaction( int sig, const struct sigaction *act, struct sigaction *oact ) { 10ac48: 55 push %ebp 10ac49: 89 e5 mov %esp,%ebp 10ac4b: 57 push %edi 10ac4c: 56 push %esi 10ac4d: 53 push %ebx 10ac4e: 83 ec 1c sub $0x1c,%esp 10ac51: 8b 5d 08 mov 0x8(%ebp),%ebx 10ac54: 8b 55 0c mov 0xc(%ebp),%edx 10ac57: 8b 45 10 mov 0x10(%ebp),%eax ISR_Level level; if ( oact ) 10ac5a: 85 c0 test %eax,%eax 10ac5c: 74 12 je 10ac70 *oact = _POSIX_signals_Vectors[ sig ]; 10ac5e: 6b f3 0c imul $0xc,%ebx,%esi 10ac61: 81 c6 a8 87 12 00 add $0x1287a8,%esi 10ac67: b9 03 00 00 00 mov $0x3,%ecx 10ac6c: 89 c7 mov %eax,%edi 10ac6e: f3 a5 rep movsl %ds:(%esi),%es:(%edi) if ( !sig ) 10ac70: 85 db test %ebx,%ebx 10ac72: 74 0d je 10ac81 rtems_set_errno_and_return_minus_one( EINVAL ); if ( !is_valid_signo(sig) ) 10ac74: 8d 43 ff lea -0x1(%ebx),%eax 10ac77: 83 f8 1f cmp $0x1f,%eax 10ac7a: 77 05 ja 10ac81 * * NOTE: Solaris documentation claims to "silently enforce" this which * contradicts the POSIX specification. */ if ( sig == SIGKILL ) 10ac7c: 83 fb 09 cmp $0x9,%ebx 10ac7f: 75 10 jne 10ac91 rtems_set_errno_and_return_minus_one( EINVAL ); 10ac81: e8 5e 8a 00 00 call 1136e4 <__errno> 10ac86: c7 00 16 00 00 00 movl $0x16,(%eax) 10ac8c: 83 c8 ff or $0xffffffff,%eax 10ac8f: eb 53 jmp 10ace4 /* * Evaluate the new action structure and set the global signal vector * appropriately. */ if ( act ) { 10ac91: 31 c0 xor %eax,%eax 10ac93: 85 d2 test %edx,%edx 10ac95: 74 4d je 10ace4 <== 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 ); 10ac97: 9c pushf 10ac98: fa cli 10ac99: 8f 45 e4 popl -0x1c(%ebp) if ( act->sa_handler == SIG_DFL ) { 10ac9c: 83 7a 08 00 cmpl $0x0,0x8(%edx) 10aca0: 75 18 jne 10acba _POSIX_signals_Vectors[ sig ] = _POSIX_signals_Default_vectors[ sig ]; 10aca2: 6b db 0c imul $0xc,%ebx,%ebx 10aca5: 8d bb a8 87 12 00 lea 0x1287a8(%ebx),%edi 10acab: 8d b3 38 22 12 00 lea 0x122238(%ebx),%esi 10acb1: b9 03 00 00 00 mov $0x3,%ecx 10acb6: f3 a5 rep movsl %ds:(%esi),%es:(%edi) 10acb8: eb 24 jmp 10acde } else { _POSIX_signals_Clear_process_signals( sig ); 10acba: 83 ec 0c sub $0xc,%esp 10acbd: 53 push %ebx 10acbe: 89 55 e0 mov %edx,-0x20(%ebp) 10acc1: e8 26 57 00 00 call 1103ec <_POSIX_signals_Clear_process_signals> _POSIX_signals_Vectors[ sig ] = *act; 10acc6: 6b db 0c imul $0xc,%ebx,%ebx 10acc9: 8d bb a8 87 12 00 lea 0x1287a8(%ebx),%edi 10accf: b9 03 00 00 00 mov $0x3,%ecx 10acd4: 8b 55 e0 mov -0x20(%ebp),%edx 10acd7: 89 d6 mov %edx,%esi 10acd9: f3 a5 rep movsl %ds:(%esi),%es:(%edi) 10acdb: 83 c4 10 add $0x10,%esp } _ISR_Enable( level ); 10acde: ff 75 e4 pushl -0x1c(%ebp) 10ace1: 9d popf 10ace2: 31 c0 xor %eax,%eax * + If we are now ignoring a signal that was previously pending, * we clear the pending signal indicator. */ return 0; } 10ace4: 8d 65 f4 lea -0xc(%ebp),%esp 10ace7: 5b pop %ebx 10ace8: 5e pop %esi 10ace9: 5f pop %edi 10acea: c9 leave 10aceb: c3 ret =============================================================================== 0010c9a4 : #include int sigsuspend( const sigset_t *sigmask ) { 10c9a4: 55 push %ebp 10c9a5: 89 e5 mov %esp,%ebp 10c9a7: 56 push %esi 10c9a8: 53 push %ebx 10c9a9: 83 ec 14 sub $0x14,%esp int status; POSIX_API_Control *api; api = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; status = sigprocmask( SIG_BLOCK, sigmask, &saved_signals_blocked ); 10c9ac: 8d 5d f4 lea -0xc(%ebp),%ebx 10c9af: 53 push %ebx 10c9b0: ff 75 08 pushl 0x8(%ebp) 10c9b3: 6a 01 push $0x1 10c9b5: e8 c6 ff ff ff call 10c980 (void) sigfillset( &all_signals ); 10c9ba: 8d 75 f0 lea -0x10(%ebp),%esi 10c9bd: 89 34 24 mov %esi,(%esp) 10c9c0: e8 17 ff ff ff call 10c8dc status = sigtimedwait( &all_signals, NULL, NULL ); 10c9c5: 83 c4 0c add $0xc,%esp 10c9c8: 6a 00 push $0x0 10c9ca: 6a 00 push $0x0 10c9cc: 56 push %esi 10c9cd: e8 69 00 00 00 call 10ca3b 10c9d2: 89 c6 mov %eax,%esi (void) sigprocmask( SIG_SETMASK, &saved_signals_blocked, NULL ); 10c9d4: 83 c4 0c add $0xc,%esp 10c9d7: 6a 00 push $0x0 10c9d9: 53 push %ebx 10c9da: 6a 00 push $0x0 10c9dc: e8 9f ff ff ff call 10c980 /* * sigtimedwait() returns the signal number while sigsuspend() * is supposed to return -1 and EINTR when a signal is caught. */ if ( status != -1 ) 10c9e1: 83 c4 10 add $0x10,%esp 10c9e4: 46 inc %esi 10c9e5: 74 0b je 10c9f2 <== NEVER TAKEN rtems_set_errno_and_return_minus_one( EINTR ); 10c9e7: e8 08 88 00 00 call 1151f4 <__errno> 10c9ec: c7 00 04 00 00 00 movl $0x4,(%eax) return status; } 10c9f2: 83 c8 ff or $0xffffffff,%eax 10c9f5: 8d 65 f8 lea -0x8(%ebp),%esp 10c9f8: 5b pop %ebx 10c9f9: 5e pop %esi 10c9fa: c9 leave 10c9fb: c3 ret =============================================================================== 0010b00b : int sigtimedwait( const sigset_t *set, siginfo_t *info, const struct timespec *timeout ) { 10b00b: 55 push %ebp 10b00c: 89 e5 mov %esp,%ebp 10b00e: 57 push %edi 10b00f: 56 push %esi 10b010: 53 push %ebx 10b011: 83 ec 2c sub $0x2c,%esp 10b014: 8b 7d 08 mov 0x8(%ebp),%edi 10b017: 8b 5d 10 mov 0x10(%ebp),%ebx ISR_Level level; /* * Error check parameters before disabling interrupts. */ if ( !set ) 10b01a: 85 ff test %edi,%edi 10b01c: 74 24 je 10b042 /* NOTE: This is very specifically a RELATIVE not ABSOLUTE time * in the Open Group specification. */ interval = 0; if ( timeout ) { 10b01e: 85 db test %ebx,%ebx 10b020: 74 33 je 10b055 if ( !_Timespec_Is_valid( timeout ) ) 10b022: 83 ec 0c sub $0xc,%esp 10b025: 53 push %ebx 10b026: e8 0d 30 00 00 call 10e038 <_Timespec_Is_valid> 10b02b: 83 c4 10 add $0x10,%esp 10b02e: 84 c0 test %al,%al 10b030: 74 10 je 10b042 rtems_set_errno_and_return_minus_one( EINVAL ); interval = _Timespec_To_ticks( timeout ); 10b032: 83 ec 0c sub $0xc,%esp 10b035: 53 push %ebx 10b036: e8 55 30 00 00 call 10e090 <_Timespec_To_ticks> if ( !interval ) 10b03b: 83 c4 10 add $0x10,%esp 10b03e: 85 c0 test %eax,%eax 10b040: 75 15 jne 10b057 <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one( EINVAL ); 10b042: e8 b1 89 00 00 call 1139f8 <__errno> 10b047: c7 00 16 00 00 00 movl $0x16,(%eax) 10b04d: 83 cf ff or $0xffffffff,%edi 10b050: e9 13 01 00 00 jmp 10b168 10b055: 31 c0 xor %eax,%eax /* * Initialize local variables. */ the_info = ( info ) ? info : &signal_information; 10b057: 8b 5d 0c mov 0xc(%ebp),%ebx 10b05a: 85 db test %ebx,%ebx 10b05c: 75 03 jne 10b061 10b05e: 8d 5d dc lea -0x24(%ebp),%ebx the_thread = _Thread_Executing; 10b061: 8b 15 04 83 12 00 mov 0x128304,%edx api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 10b067: 8b b2 f8 00 00 00 mov 0xf8(%edx),%esi * What if they are already pending? */ /* API signals pending? */ _ISR_Disable( level ); 10b06d: 9c pushf 10b06e: fa cli 10b06f: 8f 45 d4 popl -0x2c(%ebp) if ( *set & api->signals_pending ) { 10b072: 8b 0f mov (%edi),%ecx 10b074: 89 4d d0 mov %ecx,-0x30(%ebp) 10b077: 8b 8e d0 00 00 00 mov 0xd0(%esi),%ecx 10b07d: 85 4d d0 test %ecx,-0x30(%ebp) 10b080: 74 32 je 10b0b4 /* XXX real info later */ the_info->si_signo = _POSIX_signals_Get_highest( api->signals_pending ); 10b082: 83 ec 0c sub $0xc,%esp 10b085: 51 push %ecx 10b086: e8 41 ff ff ff call 10afcc <_POSIX_signals_Get_highest> 10b08b: 89 03 mov %eax,(%ebx) _POSIX_signals_Clear_signals( 10b08d: c7 04 24 00 00 00 00 movl $0x0,(%esp) 10b094: 6a 00 push $0x0 10b096: 53 push %ebx 10b097: 50 push %eax 10b098: 56 push %esi 10b099: e8 56 59 00 00 call 1109f4 <_POSIX_signals_Clear_signals> the_info->si_signo, the_info, false, false ); _ISR_Enable( level ); 10b09e: ff 75 d4 pushl -0x2c(%ebp) 10b0a1: 9d popf the_info->si_code = SI_USER; 10b0a2: c7 43 04 01 00 00 00 movl $0x1,0x4(%ebx) the_info->si_value.sival_int = 0; 10b0a9: c7 43 08 00 00 00 00 movl $0x0,0x8(%ebx) return the_info->si_signo; 10b0b0: 8b 3b mov (%ebx),%edi 10b0b2: eb 3b jmp 10b0ef } /* Process pending signals? */ if ( *set & _POSIX_signals_Pending ) { 10b0b4: 8b 0d 9c 89 12 00 mov 0x12899c,%ecx 10b0ba: 85 4d d0 test %ecx,-0x30(%ebp) 10b0bd: 74 35 je 10b0f4 signo = _POSIX_signals_Get_highest( _POSIX_signals_Pending ); 10b0bf: 83 ec 0c sub $0xc,%esp 10b0c2: 51 push %ecx 10b0c3: e8 04 ff ff ff call 10afcc <_POSIX_signals_Get_highest> 10b0c8: 89 c7 mov %eax,%edi _POSIX_signals_Clear_signals( api, signo, the_info, true, false ); 10b0ca: c7 04 24 00 00 00 00 movl $0x0,(%esp) 10b0d1: 6a 01 push $0x1 10b0d3: 53 push %ebx 10b0d4: 50 push %eax 10b0d5: 56 push %esi 10b0d6: e8 19 59 00 00 call 1109f4 <_POSIX_signals_Clear_signals> _ISR_Enable( level ); 10b0db: ff 75 d4 pushl -0x2c(%ebp) 10b0de: 9d popf the_info->si_signo = signo; 10b0df: 89 3b mov %edi,(%ebx) the_info->si_code = SI_USER; 10b0e1: c7 43 04 01 00 00 00 movl $0x1,0x4(%ebx) the_info->si_value.sival_int = 0; 10b0e8: c7 43 08 00 00 00 00 movl $0x0,0x8(%ebx) return signo; 10b0ef: 83 c4 20 add $0x20,%esp 10b0f2: eb 74 jmp 10b168 } the_info->si_signo = -1; 10b0f4: c7 03 ff ff ff ff movl $0xffffffff,(%ebx) 10b0fa: 8b 0d 48 82 12 00 mov 0x128248,%ecx 10b100: 41 inc %ecx 10b101: 89 0d 48 82 12 00 mov %ecx,0x128248 _Thread_Disable_dispatch(); the_thread->Wait.queue = &_POSIX_signals_Wait_queue; 10b107: c7 42 44 34 89 12 00 movl $0x128934,0x44(%edx) the_thread->Wait.return_code = EINTR; 10b10e: c7 42 34 04 00 00 00 movl $0x4,0x34(%edx) the_thread->Wait.option = *set; 10b115: 8b 0f mov (%edi),%ecx 10b117: 89 4a 30 mov %ecx,0x30(%edx) the_thread->Wait.return_argument = the_info; 10b11a: 89 5a 28 mov %ebx,0x28(%edx) 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; 10b11d: c7 05 64 89 12 00 01 movl $0x1,0x128964 10b124: 00 00 00 _Thread_queue_Enter_critical_section( &_POSIX_signals_Wait_queue ); _ISR_Enable( level ); 10b127: ff 75 d4 pushl -0x2c(%ebp) 10b12a: 9d popf _Thread_queue_Enqueue( &_POSIX_signals_Wait_queue, interval ); 10b12b: 52 push %edx 10b12c: 68 2c dc 10 00 push $0x10dc2c 10b131: 50 push %eax 10b132: 68 34 89 12 00 push $0x128934 10b137: e8 34 28 00 00 call 10d970 <_Thread_queue_Enqueue_with_handler> _Thread_Enable_dispatch(); 10b13c: e8 78 23 00 00 call 10d4b9 <_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 ); 10b141: c7 04 24 00 00 00 00 movl $0x0,(%esp) 10b148: 6a 00 push $0x0 10b14a: 53 push %ebx 10b14b: ff 33 pushl (%ebx) 10b14d: 56 push %esi 10b14e: e8 a1 58 00 00 call 1109f4 <_POSIX_signals_Clear_signals> errno = _Thread_Executing->Wait.return_code; 10b153: 83 c4 20 add $0x20,%esp 10b156: e8 9d 88 00 00 call 1139f8 <__errno> 10b15b: 8b 15 04 83 12 00 mov 0x128304,%edx 10b161: 8b 52 34 mov 0x34(%edx),%edx 10b164: 89 10 mov %edx,(%eax) return the_info->si_signo; 10b166: 8b 3b mov (%ebx),%edi } 10b168: 89 f8 mov %edi,%eax 10b16a: 8d 65 f4 lea -0xc(%ebp),%esp 10b16d: 5b pop %ebx 10b16e: 5e pop %esi 10b16f: 5f pop %edi 10b170: c9 leave 10b171: c3 ret =============================================================================== 0010cbbc : int sigwait( const sigset_t *set, int *sig ) { 10cbbc: 55 push %ebp 10cbbd: 89 e5 mov %esp,%ebp 10cbbf: 53 push %ebx 10cbc0: 83 ec 08 sub $0x8,%esp 10cbc3: 8b 5d 0c mov 0xc(%ebp),%ebx int status; status = sigtimedwait( set, NULL, NULL ); 10cbc6: 6a 00 push $0x0 10cbc8: 6a 00 push $0x0 10cbca: ff 75 08 pushl 0x8(%ebp) 10cbcd: e8 69 fe ff ff call 10ca3b 10cbd2: 89 c2 mov %eax,%edx if ( status != -1 ) { 10cbd4: 83 c4 10 add $0x10,%esp 10cbd7: 83 f8 ff cmp $0xffffffff,%eax 10cbda: 74 0a je 10cbe6 if ( sig ) 10cbdc: 31 c0 xor %eax,%eax 10cbde: 85 db test %ebx,%ebx 10cbe0: 74 0b je 10cbed <== NEVER TAKEN *sig = status; 10cbe2: 89 13 mov %edx,(%ebx) 10cbe4: eb 07 jmp 10cbed return 0; } return errno; 10cbe6: e8 09 86 00 00 call 1151f4 <__errno> 10cbeb: 8b 00 mov (%eax),%eax } 10cbed: 8b 5d fc mov -0x4(%ebp),%ebx 10cbf0: c9 leave 10cbf1: c3 ret =============================================================================== 0010a484 : int timer_create( clockid_t clock_id, struct sigevent *evp, timer_t *timerid ) { 10a484: 55 push %ebp 10a485: 89 e5 mov %esp,%ebp 10a487: 56 push %esi 10a488: 53 push %ebx 10a489: 8b 5d 0c mov 0xc(%ebp),%ebx 10a48c: 8b 75 10 mov 0x10(%ebp),%esi POSIX_Timer_Control *ptimer; if ( clock_id != CLOCK_REALTIME ) 10a48f: 83 7d 08 01 cmpl $0x1,0x8(%ebp) 10a493: 75 1d jne 10a4b2 rtems_set_errno_and_return_minus_one( EINVAL ); if ( !timerid ) 10a495: 85 f6 test %esi,%esi 10a497: 74 19 je 10a4b2 /* * The data of the structure evp are checked in order to verify if they * are coherent. */ if (evp != NULL) { 10a499: 85 db test %ebx,%ebx 10a49b: 74 22 je 10a4bf /* The structure has data */ if ( ( evp->sigev_notify != SIGEV_NONE ) && 10a49d: 8b 03 mov (%ebx),%eax 10a49f: 48 dec %eax 10a4a0: 83 f8 01 cmp $0x1,%eax 10a4a3: 77 0d ja 10a4b2 <== NEVER TAKEN ( evp->sigev_notify != SIGEV_SIGNAL ) ) { /* The value of the field sigev_notify is not valid */ rtems_set_errno_and_return_minus_one( EINVAL ); } if ( !evp->sigev_signo ) 10a4a5: 8b 43 04 mov 0x4(%ebx),%eax 10a4a8: 85 c0 test %eax,%eax 10a4aa: 74 06 je 10a4b2 <== NEVER TAKEN rtems_set_errno_and_return_minus_one( EINVAL ); if ( !is_valid_signo(evp->sigev_signo) ) 10a4ac: 48 dec %eax 10a4ad: 83 f8 1f cmp $0x1f,%eax 10a4b0: 76 0d jbe 10a4bf <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one( EINVAL ); 10a4b2: e8 41 8f 00 00 call 1133f8 <__errno> 10a4b7: c7 00 16 00 00 00 movl $0x16,(%eax) 10a4bd: eb 2f jmp 10a4ee rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 10a4bf: a1 5c 82 12 00 mov 0x12825c,%eax 10a4c4: 40 inc %eax 10a4c5: a3 5c 82 12 00 mov %eax,0x12825c * 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 ); 10a4ca: 83 ec 0c sub $0xc,%esp 10a4cd: 68 84 85 12 00 push $0x128584 10a4d2: e8 35 1b 00 00 call 10c00c <_Objects_Allocate> /* * Allocate a timer */ ptimer = _POSIX_Timer_Allocate(); if ( !ptimer ) { 10a4d7: 83 c4 10 add $0x10,%esp 10a4da: 85 c0 test %eax,%eax 10a4dc: 75 18 jne 10a4f6 _Thread_Enable_dispatch(); 10a4de: e8 2e 27 00 00 call 10cc11 <_Thread_Enable_dispatch> rtems_set_errno_and_return_minus_one( EAGAIN ); 10a4e3: e8 10 8f 00 00 call 1133f8 <__errno> 10a4e8: c7 00 0b 00 00 00 movl $0xb,(%eax) 10a4ee: 83 c8 ff or $0xffffffff,%eax 10a4f1: e9 83 00 00 00 jmp 10a579 } /* The data of the created timer are stored to use them later */ ptimer->state = POSIX_TIMER_STATE_CREATE_NEW; 10a4f6: c6 40 3c 02 movb $0x2,0x3c(%eax) ptimer->thread_id = _Thread_Executing->Object.id; 10a4fa: 8b 15 18 83 12 00 mov 0x128318,%edx 10a500: 8b 52 08 mov 0x8(%edx),%edx 10a503: 89 50 38 mov %edx,0x38(%eax) if ( evp != NULL ) { 10a506: 85 db test %ebx,%ebx 10a508: 74 11 je 10a51b ptimer->inf.sigev_notify = evp->sigev_notify; 10a50a: 8b 13 mov (%ebx),%edx 10a50c: 89 50 40 mov %edx,0x40(%eax) ptimer->inf.sigev_signo = evp->sigev_signo; 10a50f: 8b 53 04 mov 0x4(%ebx),%edx 10a512: 89 50 44 mov %edx,0x44(%eax) ptimer->inf.sigev_value = evp->sigev_value; 10a515: 8b 53 08 mov 0x8(%ebx),%edx 10a518: 89 50 48 mov %edx,0x48(%eax) } ptimer->overrun = 0; 10a51b: c7 40 68 00 00 00 00 movl $0x0,0x68(%eax) ptimer->timer_data.it_value.tv_sec = 0; 10a522: c7 40 5c 00 00 00 00 movl $0x0,0x5c(%eax) ptimer->timer_data.it_value.tv_nsec = 0; 10a529: c7 40 60 00 00 00 00 movl $0x0,0x60(%eax) ptimer->timer_data.it_interval.tv_sec = 0; 10a530: c7 40 54 00 00 00 00 movl $0x0,0x54(%eax) ptimer->timer_data.it_interval.tv_nsec = 0; 10a537: c7 40 58 00 00 00 00 movl $0x0,0x58(%eax) Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 10a53e: c7 40 18 00 00 00 00 movl $0x0,0x18(%eax) the_watchdog->routine = routine; 10a545: c7 40 2c 00 00 00 00 movl $0x0,0x2c(%eax) the_watchdog->id = id; 10a54c: c7 40 30 00 00 00 00 movl $0x0,0x30(%eax) the_watchdog->user_data = user_data; 10a553: c7 40 34 00 00 00 00 movl $0x0,0x34(%eax) #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 10a55a: 8b 50 08 mov 0x8(%eax),%edx 10a55d: 0f b7 da movzwl %dx,%ebx 10a560: 8b 0d a0 85 12 00 mov 0x1285a0,%ecx 10a566: 89 04 99 mov %eax,(%ecx,%ebx,4) _Objects_Get_index( the_object->id ), the_object ); /* ASSERT: information->is_string == false */ the_object->name.name_u32 = name; 10a569: c7 40 0c 00 00 00 00 movl $0x0,0xc(%eax) _Watchdog_Initialize( &ptimer->Timer, NULL, 0, NULL ); _Objects_Open_u32(&_POSIX_Timer_Information, &ptimer->Object, 0); *timerid = ptimer->Object.id; 10a570: 89 16 mov %edx,(%esi) _Thread_Enable_dispatch(); 10a572: e8 9a 26 00 00 call 10cc11 <_Thread_Enable_dispatch> 10a577: 31 c0 xor %eax,%eax return 0; } 10a579: 8d 65 f8 lea -0x8(%ebp),%esp 10a57c: 5b pop %ebx 10a57d: 5e pop %esi 10a57e: c9 leave 10a57f: c3 ret =============================================================================== 0010a580 : timer_t timerid, int flags, const struct itimerspec *value, struct itimerspec *ovalue ) { 10a580: 55 push %ebp 10a581: 89 e5 mov %esp,%ebp 10a583: 57 push %edi 10a584: 56 push %esi 10a585: 53 push %ebx 10a586: 83 ec 2c sub $0x2c,%esp 10a589: 8b 45 0c mov 0xc(%ebp),%eax Objects_Locations location; bool activated; uint32_t initial_period; struct itimerspec normalize; if ( !value ) 10a58c: 83 7d 10 00 cmpl $0x0,0x10(%ebp) 10a590: 0f 84 47 01 00 00 je 10a6dd <== NEVER TAKEN rtems_set_errno_and_return_minus_one( EINVAL ); /* First, it verifies if the structure "value" is correct */ if ( ( value->it_value.tv_nsec >= TOD_NANOSECONDS_PER_SECOND ) || 10a596: 8b 55 10 mov 0x10(%ebp),%edx 10a599: 81 7a 0c ff c9 9a 3b cmpl $0x3b9ac9ff,0xc(%edx) 10a5a0: 0f 87 37 01 00 00 ja 10a6dd ( value->it_value.tv_nsec < 0 ) || ( value->it_interval.tv_nsec >= TOD_NANOSECONDS_PER_SECOND) || 10a5a6: 81 7a 04 ff c9 9a 3b cmpl $0x3b9ac9ff,0x4(%edx) 10a5ad: 0f 87 2a 01 00 00 ja 10a6dd <== NEVER TAKEN ( value->it_interval.tv_nsec < 0 )) { /* The number of nanoseconds is not correct */ rtems_set_errno_and_return_minus_one( EINVAL ); } if ( flags != TIMER_ABSTIME && flags != POSIX_TIMER_RELATIVE ) { 10a5b3: 85 c0 test %eax,%eax 10a5b5: 74 09 je 10a5c0 10a5b7: 83 f8 04 cmp $0x4,%eax 10a5ba: 0f 85 1d 01 00 00 jne 10a6dd rtems_set_errno_and_return_minus_one( EINVAL ); } normalize = *value; 10a5c0: 8d 7d cc lea -0x34(%ebp),%edi 10a5c3: b9 04 00 00 00 mov $0x4,%ecx 10a5c8: 8b 75 10 mov 0x10(%ebp),%esi 10a5cb: f3 a5 rep movsl %ds:(%esi),%es:(%edi) /* Convert absolute to relative time */ if (flags == TIMER_ABSTIME) { 10a5cd: 83 f8 04 cmp $0x4,%eax 10a5d0: 75 2f jne 10a601 struct timespec now; _TOD_Get( &now ); 10a5d2: 83 ec 0c sub $0xc,%esp 10a5d5: 8d 5d dc lea -0x24(%ebp),%ebx 10a5d8: 53 push %ebx 10a5d9: e8 a6 15 00 00 call 10bb84 <_TOD_Get> /* Check for seconds in the past */ if ( _Timespec_Greater_than( &now, &normalize.it_value ) ) 10a5de: 59 pop %ecx 10a5df: 5e pop %esi 10a5e0: 8d 75 d4 lea -0x2c(%ebp),%esi 10a5e3: 56 push %esi 10a5e4: 53 push %ebx 10a5e5: e8 a6 31 00 00 call 10d790 <_Timespec_Greater_than> 10a5ea: 83 c4 10 add $0x10,%esp 10a5ed: 84 c0 test %al,%al 10a5ef: 0f 85 e8 00 00 00 jne 10a6dd rtems_set_errno_and_return_minus_one( EINVAL ); _Timespec_Subtract( &now, &normalize.it_value, &normalize.it_value ); 10a5f5: 52 push %edx 10a5f6: 56 push %esi 10a5f7: 56 push %esi 10a5f8: 53 push %ebx 10a5f9: e8 b6 31 00 00 call 10d7b4 <_Timespec_Subtract> 10a5fe: 83 c4 10 add $0x10,%esp RTEMS_INLINE_ROUTINE POSIX_Timer_Control *_POSIX_Timer_Get ( timer_t id, Objects_Locations *location ) { return (POSIX_Timer_Control *) 10a601: 50 push %eax 10a602: 8d 45 e4 lea -0x1c(%ebp),%eax 10a605: 50 push %eax 10a606: ff 75 08 pushl 0x8(%ebp) 10a609: 68 84 85 12 00 push $0x128584 10a60e: e8 0d 1e 00 00 call 10c420 <_Objects_Get> 10a613: 89 c3 mov %eax,%ebx * something with the structure of times of the timer: to stop, start * or start it again */ ptimer = _POSIX_Timer_Get( timerid, &location ); switch ( location ) { 10a615: 83 c4 10 add $0x10,%esp 10a618: 83 7d e4 00 cmpl $0x0,-0x1c(%ebp) 10a61c: 0f 85 bb 00 00 00 jne 10a6dd 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 ) { 10a622: 83 7d d4 00 cmpl $0x0,-0x2c(%ebp) 10a626: 75 3b jne 10a663 10a628: 83 7d d8 00 cmpl $0x0,-0x28(%ebp) 10a62c: 75 35 jne 10a663 /* Stop the timer */ (void) _Watchdog_Remove( &ptimer->Timer ); 10a62e: 83 ec 0c sub $0xc,%esp 10a631: 8d 40 10 lea 0x10(%eax),%eax 10a634: 50 push %eax 10a635: e8 36 35 00 00 call 10db70 <_Watchdog_Remove> /* The old data of the timer are returned */ if ( ovalue ) 10a63a: 83 c4 10 add $0x10,%esp 10a63d: 83 7d 14 00 cmpl $0x0,0x14(%ebp) 10a641: 74 0d je 10a650 *ovalue = ptimer->timer_data; 10a643: 8d 73 54 lea 0x54(%ebx),%esi 10a646: b9 04 00 00 00 mov $0x4,%ecx 10a64b: 8b 7d 14 mov 0x14(%ebp),%edi 10a64e: f3 a5 rep movsl %ds:(%esi),%es:(%edi) /* The new data are set */ ptimer->timer_data = normalize; 10a650: 8d 7b 54 lea 0x54(%ebx),%edi 10a653: 8d 75 cc lea -0x34(%ebp),%esi 10a656: b9 04 00 00 00 mov $0x4,%ecx 10a65b: f3 a5 rep movsl %ds:(%esi),%es:(%edi) /* Indicates that the timer is created and stopped */ ptimer->state = POSIX_TIMER_STATE_CREATE_STOP; 10a65d: c6 43 3c 04 movb $0x4,0x3c(%ebx) 10a661: eb 35 jmp 10a698 _Thread_Enable_dispatch(); return 0; } /* Convert from seconds and nanoseconds to ticks */ ptimer->ticks = _Timespec_To_ticks( &value->it_interval ); 10a663: 83 ec 0c sub $0xc,%esp 10a666: ff 75 10 pushl 0x10(%ebp) 10a669: e8 7a 31 00 00 call 10d7e8 <_Timespec_To_ticks> 10a66e: 89 43 64 mov %eax,0x64(%ebx) initial_period = _Timespec_To_ticks( &normalize.it_value ); 10a671: 8d 45 d4 lea -0x2c(%ebp),%eax 10a674: 89 04 24 mov %eax,(%esp) 10a677: e8 6c 31 00 00 call 10d7e8 <_Timespec_To_ticks> activated = _POSIX_Timer_Insert_helper( 10a67c: 89 1c 24 mov %ebx,(%esp) 10a67f: 68 f4 a6 10 00 push $0x10a6f4 10a684: ff 73 08 pushl 0x8(%ebx) 10a687: 50 push %eax 10a688: 8d 43 10 lea 0x10(%ebx),%eax 10a68b: 50 push %eax 10a68c: e8 4b 5d 00 00 call 1103dc <_POSIX_Timer_Insert_helper> initial_period, ptimer->Object.id, _POSIX_Timer_TSR, ptimer ); if ( !activated ) { 10a691: 83 c4 20 add $0x20,%esp 10a694: 84 c0 test %al,%al 10a696: 75 09 jne 10a6a1 _Thread_Enable_dispatch(); 10a698: e8 74 25 00 00 call 10cc11 <_Thread_Enable_dispatch> 10a69d: 31 c0 xor %eax,%eax return 0; 10a69f: eb 4a jmp 10a6eb /* * The timer has been started and is running. So we return the * old ones in "ovalue" */ if ( ovalue ) 10a6a1: 83 7d 14 00 cmpl $0x0,0x14(%ebp) 10a6a5: 74 0d je 10a6b4 *ovalue = ptimer->timer_data; 10a6a7: 8d 73 54 lea 0x54(%ebx),%esi 10a6aa: b9 04 00 00 00 mov $0x4,%ecx 10a6af: 8b 7d 14 mov 0x14(%ebp),%edi 10a6b2: f3 a5 rep movsl %ds:(%esi),%es:(%edi) ptimer->timer_data = normalize; 10a6b4: 8d 7b 54 lea 0x54(%ebx),%edi 10a6b7: 8d 75 cc lea -0x34(%ebp),%esi 10a6ba: b9 04 00 00 00 mov $0x4,%ecx 10a6bf: f3 a5 rep movsl %ds:(%esi),%es:(%edi) /* Indicate that the time is running */ ptimer->state = POSIX_TIMER_STATE_CREATE_RUN; 10a6c1: c6 43 3c 03 movb $0x3,0x3c(%ebx) _TOD_Get( &ptimer->time ); 10a6c5: 83 ec 0c sub $0xc,%esp 10a6c8: 83 c3 6c add $0x6c,%ebx 10a6cb: 53 push %ebx 10a6cc: e8 b3 14 00 00 call 10bb84 <_TOD_Get> _Thread_Enable_dispatch(); 10a6d1: e8 3b 25 00 00 call 10cc11 <_Thread_Enable_dispatch> 10a6d6: 31 c0 xor %eax,%eax return 0; 10a6d8: 83 c4 10 add $0x10,%esp 10a6db: eb 0e jmp 10a6eb #endif case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( EINVAL ); 10a6dd: e8 16 8d 00 00 call 1133f8 <__errno> 10a6e2: c7 00 16 00 00 00 movl $0x16,(%eax) 10a6e8: 83 c8 ff or $0xffffffff,%eax } 10a6eb: 8d 65 f4 lea -0xc(%ebp),%esp 10a6ee: 5b pop %ebx 10a6ef: 5e pop %esi 10a6f0: 5f pop %edi 10a6f1: c9 leave 10a6f2: c3 ret =============================================================================== 0010a3a8 : useconds_t ualarm( useconds_t useconds, useconds_t interval ) { 10a3a8: 55 push %ebp 10a3a9: 89 e5 mov %esp,%ebp 10a3ab: 57 push %edi 10a3ac: 56 push %esi 10a3ad: 53 push %ebx 10a3ae: 83 ec 1c sub $0x1c,%esp 10a3b1: 8b 75 08 mov 0x8(%ebp),%esi /* * Initialize the timer used to implement alarm(). */ if ( !the_timer->routine ) { 10a3b4: 83 3d 4c 7b 12 00 00 cmpl $0x0,0x127b4c 10a3bb: 75 2c jne 10a3e9 Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 10a3bd: c7 05 38 7b 12 00 00 movl $0x0,0x127b38 10a3c4: 00 00 00 the_watchdog->routine = routine; 10a3c7: c7 05 4c 7b 12 00 8a movl $0x10a48a,0x127b4c 10a3ce: a4 10 00 the_watchdog->id = id; 10a3d1: c7 05 50 7b 12 00 00 movl $0x0,0x127b50 10a3d8: 00 00 00 the_watchdog->user_data = user_data; 10a3db: c7 05 54 7b 12 00 00 movl $0x0,0x127b54 10a3e2: 00 00 00 10a3e5: 31 db xor %ebx,%ebx 10a3e7: eb 4f jmp 10a438 _Watchdog_Initialize( the_timer, _POSIX_signals_Ualarm_TSR, 0, NULL ); } else { Watchdog_States state; state = _Watchdog_Remove( the_timer ); 10a3e9: 83 ec 0c sub $0xc,%esp 10a3ec: 68 30 7b 12 00 push $0x127b30 10a3f1: e8 be 33 00 00 call 10d7b4 <_Watchdog_Remove> if ( (state == WATCHDOG_ACTIVE) || (state == WATCHDOG_REMOVE_IT) ) { 10a3f6: 83 e8 02 sub $0x2,%eax 10a3f9: 83 c4 10 add $0x10,%esp 10a3fc: 31 db xor %ebx,%ebx 10a3fe: 83 f8 01 cmp $0x1,%eax 10a401: 77 35 ja 10a438 <== 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); 10a403: a1 44 7b 12 00 mov 0x127b44,%eax 10a408: 03 05 3c 7b 12 00 add 0x127b3c,%eax /* remaining is now in ticks */ _Timespec_From_ticks( ticks, &tp ); 10a40e: 51 push %ecx 10a40f: 51 push %ecx 10a410: 8d 55 e0 lea -0x20(%ebp),%edx 10a413: 52 push %edx 10a414: 2b 05 48 7b 12 00 sub 0x127b48,%eax 10a41a: 50 push %eax 10a41b: e8 44 2f 00 00 call 10d364 <_Timespec_From_ticks> remaining = tp.tv_sec * TOD_MICROSECONDS_PER_SECOND; 10a420: 69 4d e0 40 42 0f 00 imul $0xf4240,-0x20(%ebp),%ecx remaining += tp.tv_nsec / 1000; 10a427: 8b 45 e4 mov -0x1c(%ebp),%eax 10a42a: bf e8 03 00 00 mov $0x3e8,%edi 10a42f: 99 cltd 10a430: f7 ff idiv %edi 10a432: 8d 1c 08 lea (%eax,%ecx,1),%ebx 10a435: 83 c4 10 add $0x10,%esp /* * 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 ) { 10a438: 85 f6 test %esi,%esi 10a43a: 74 44 je 10a480 Watchdog_Interval ticks; tp.tv_sec = useconds / TOD_MICROSECONDS_PER_SECOND; 10a43c: b9 40 42 0f 00 mov $0xf4240,%ecx 10a441: 89 f0 mov %esi,%eax 10a443: 31 d2 xor %edx,%edx 10a445: f7 f1 div %ecx 10a447: 89 45 e0 mov %eax,-0x20(%ebp) tp.tv_nsec = (useconds % TOD_MICROSECONDS_PER_SECOND) * 1000; 10a44a: 69 d2 e8 03 00 00 imul $0x3e8,%edx,%edx 10a450: 89 55 e4 mov %edx,-0x1c(%ebp) ticks = _Timespec_To_ticks( &tp ); 10a453: 83 ec 0c sub $0xc,%esp 10a456: 8d 75 e0 lea -0x20(%ebp),%esi 10a459: 56 push %esi 10a45a: e8 61 2f 00 00 call 10d3c0 <_Timespec_To_ticks> if ( ticks == 0 ) ticks = 1; _Watchdog_Insert_ticks( the_timer, _Timespec_To_ticks( &tp ) ); 10a45f: 89 34 24 mov %esi,(%esp) 10a462: e8 59 2f 00 00 call 10d3c0 <_Timespec_To_ticks> Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 10a467: a3 3c 7b 12 00 mov %eax,0x127b3c _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 10a46c: 58 pop %eax 10a46d: 5a pop %edx 10a46e: 68 30 7b 12 00 push $0x127b30 10a473: 68 34 73 12 00 push $0x127334 10a478: e8 1f 32 00 00 call 10d69c <_Watchdog_Insert> 10a47d: 83 c4 10 add $0x10,%esp } return remaining; } 10a480: 89 d8 mov %ebx,%eax 10a482: 8d 65 f4 lea -0xc(%ebp),%esp 10a485: 5b pop %ebx 10a486: 5e pop %esi 10a487: 5f pop %edi 10a488: c9 leave 10a489: c3 ret