=============================================================================== 0010c774 <_CORE_RWLock_Release>: */ CORE_RWLock_Status _CORE_RWLock_Release( CORE_RWLock_Control *the_rwlock ) { 10c774: 55 push %ebp 10c775: 89 e5 mov %esp,%ebp 10c777: 53 push %ebx 10c778: 51 push %ecx 10c779: 8b 5d 08 mov 0x8(%ebp),%ebx ISR_Level level; Thread_Control *executing = _Thread_Executing; 10c77c: 8b 15 e4 18 13 00 mov 0x1318e4,%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 ); 10c782: 9c pushf 10c783: fa cli 10c784: 58 pop %eax if ( the_rwlock->current_state == CORE_RWLOCK_UNLOCKED){ 10c785: 8b 4b 44 mov 0x44(%ebx),%ecx 10c788: 85 c9 test %ecx,%ecx 10c78a: 75 0b jne 10c797 <_CORE_RWLock_Release+0x23> _ISR_Enable( level ); 10c78c: 50 push %eax 10c78d: 9d popf executing->Wait.return_code = CORE_RWLOCK_UNAVAILABLE; 10c78e: c7 42 34 02 00 00 00 movl $0x2,0x34(%edx) return CORE_RWLOCK_SUCCESSFUL; 10c795: eb 6c jmp 10c803 <_CORE_RWLock_Release+0x8f> } if ( the_rwlock->current_state == CORE_RWLOCK_LOCKED_FOR_READING ) { 10c797: 49 dec %ecx 10c798: 75 09 jne 10c7a3 <_CORE_RWLock_Release+0x2f> the_rwlock->number_of_readers -= 1; if ( the_rwlock->number_of_readers != 0 ) { 10c79a: ff 4b 48 decl 0x48(%ebx) 10c79d: 74 04 je 10c7a3 <_CORE_RWLock_Release+0x2f> /* must be unlocked again */ _ISR_Enable( level ); 10c79f: 50 push %eax 10c7a0: 9d popf return CORE_RWLOCK_SUCCESSFUL; 10c7a1: eb 60 jmp 10c803 <_CORE_RWLock_Release+0x8f> } } /* CORE_RWLOCK_LOCKED_FOR_WRITING or READING with readers */ executing->Wait.return_code = CORE_RWLOCK_SUCCESSFUL; 10c7a3: 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; 10c7aa: c7 43 44 00 00 00 00 movl $0x0,0x44(%ebx) _ISR_Enable( level ); 10c7b1: 50 push %eax 10c7b2: 9d popf next = _Thread_queue_Dequeue( &the_rwlock->Wait_queue ); 10c7b3: 83 ec 0c sub $0xc,%esp 10c7b6: 53 push %ebx 10c7b7: e8 80 18 00 00 call 10e03c <_Thread_queue_Dequeue> if ( next ) { 10c7bc: 83 c4 10 add $0x10,%esp 10c7bf: 85 c0 test %eax,%eax 10c7c1: 74 40 je 10c803 <_CORE_RWLock_Release+0x8f> if ( next->Wait.option == CORE_RWLOCK_THREAD_WAITING_FOR_WRITE ) { 10c7c3: 83 78 30 01 cmpl $0x1,0x30(%eax) 10c7c7: 75 09 jne 10c7d2 <_CORE_RWLock_Release+0x5e> the_rwlock->current_state = CORE_RWLOCK_LOCKED_FOR_WRITING; 10c7c9: c7 43 44 02 00 00 00 movl $0x2,0x44(%ebx) return CORE_RWLOCK_SUCCESSFUL; 10c7d0: eb 31 jmp 10c803 <_CORE_RWLock_Release+0x8f> } /* * Must be CORE_RWLOCK_THREAD_WAITING_FOR_READING */ the_rwlock->number_of_readers += 1; 10c7d2: ff 43 48 incl 0x48(%ebx) the_rwlock->current_state = CORE_RWLOCK_LOCKED_FOR_READING; 10c7d5: 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 ); 10c7dc: 83 ec 0c sub $0xc,%esp 10c7df: 53 push %ebx 10c7e0: e8 1b 1c 00 00 call 10e400 <_Thread_queue_First> if ( !next || 10c7e5: 83 c4 10 add $0x10,%esp 10c7e8: 85 c0 test %eax,%eax 10c7ea: 74 17 je 10c803 <_CORE_RWLock_Release+0x8f> 10c7ec: 83 78 30 01 cmpl $0x1,0x30(%eax) 10c7f0: 74 11 je 10c803 <_CORE_RWLock_Release+0x8f><== NEVER TAKEN next->Wait.option == CORE_RWLOCK_THREAD_WAITING_FOR_WRITE ) return CORE_RWLOCK_SUCCESSFUL; the_rwlock->number_of_readers += 1; 10c7f2: ff 43 48 incl 0x48(%ebx) _Thread_queue_Extract( &the_rwlock->Wait_queue, next ); 10c7f5: 52 push %edx 10c7f6: 52 push %edx 10c7f7: 50 push %eax 10c7f8: 53 push %ebx 10c7f9: e8 fa 1a 00 00 call 10e2f8 <_Thread_queue_Extract> } 10c7fe: 83 c4 10 add $0x10,%esp 10c801: eb d9 jmp 10c7dc <_CORE_RWLock_Release+0x68> } /* indentation is to match _ISR_Disable at top */ return CORE_RWLOCK_SUCCESSFUL; } 10c803: 31 c0 xor %eax,%eax 10c805: 8b 5d fc mov -0x4(%ebp),%ebx 10c808: c9 leave 10c809: c3 ret =============================================================================== 0010c80c <_CORE_RWLock_Timeout>: void _CORE_RWLock_Timeout( Objects_Id id, void *ignored ) { 10c80c: 55 push %ebp 10c80d: 89 e5 mov %esp,%ebp 10c80f: 83 ec 20 sub $0x20,%esp Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); 10c812: 8d 45 f4 lea -0xc(%ebp),%eax 10c815: 50 push %eax 10c816: ff 75 08 pushl 0x8(%ebp) 10c819: e8 d6 14 00 00 call 10dcf4 <_Thread_Get> switch ( location ) { 10c81e: 83 c4 10 add $0x10,%esp 10c821: 83 7d f4 00 cmpl $0x0,-0xc(%ebp) 10c825: 75 1c jne 10c843 <_CORE_RWLock_Timeout+0x37><== NEVER TAKEN #if defined(RTEMS_MULTIPROCESSING) case OBJECTS_REMOTE: /* impossible */ #endif break; case OBJECTS_LOCAL: _Thread_queue_Process_timeout( the_thread ); 10c827: 83 ec 0c sub $0xc,%esp 10c82a: 50 push %eax 10c82b: e8 84 1c 00 00 call 10e4b4 <_Thread_queue_Process_timeout> * * This routine decrements the thread dispatch level. */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_decrement_disable_level(void) { _Thread_Dispatch_disable_level--; 10c830: a1 dc 13 13 00 mov 0x1313dc,%eax 10c835: 48 dec %eax 10c836: a3 dc 13 13 00 mov %eax,0x1313dc return _Thread_Dispatch_disable_level; 10c83b: a1 dc 13 13 00 mov 0x1313dc,%eax 10c840: 83 c4 10 add $0x10,%esp _Thread_Unnest_dispatch(); break; } } 10c843: c9 leave 10c844: c3 ret =============================================================================== 0010a9a4 <_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 ) { 10a9a4: 55 push %ebp 10a9a5: 89 e5 mov %esp,%ebp 10a9a7: 53 push %ebx 10a9a8: 83 ec 10 sub $0x10,%esp 10a9ab: 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)) ) { 10a9ae: 53 push %ebx 10a9af: e8 c0 17 00 00 call 10c174 <_Thread_queue_Dequeue> 10a9b4: 83 c4 10 add $0x10,%esp { Thread_Control *the_thread; ISR_Level level; CORE_semaphore_Status status; status = CORE_SEMAPHORE_STATUS_SUCCESSFUL; 10a9b7: 31 d2 xor %edx,%edx if ( (the_thread = _Thread_queue_Dequeue(&the_semaphore->Wait_queue)) ) { 10a9b9: 85 c0 test %eax,%eax 10a9bb: 75 15 jne 10a9d2 <_CORE_semaphore_Surrender+0x2e> if ( !_Objects_Is_local_id( the_thread->Object.id ) ) (*api_semaphore_mp_support) ( the_thread, id ); #endif } else { _ISR_Disable( level ); 10a9bd: 9c pushf 10a9be: fa cli 10a9bf: 59 pop %ecx if ( the_semaphore->count < the_semaphore->Attributes.maximum_count ) 10a9c0: 8b 43 48 mov 0x48(%ebx),%eax the_semaphore->count += 1; else status = CORE_SEMAPHORE_MAXIMUM_COUNT_EXCEEDED; 10a9c3: b2 04 mov $0x4,%dl (*api_semaphore_mp_support) ( the_thread, id ); #endif } else { _ISR_Disable( level ); if ( the_semaphore->count < the_semaphore->Attributes.maximum_count ) 10a9c5: 3b 43 40 cmp 0x40(%ebx),%eax 10a9c8: 73 06 jae 10a9d0 <_CORE_semaphore_Surrender+0x2c><== NEVER TAKEN the_semaphore->count += 1; 10a9ca: 40 inc %eax 10a9cb: 89 43 48 mov %eax,0x48(%ebx) { Thread_Control *the_thread; ISR_Level level; CORE_semaphore_Status status; status = CORE_SEMAPHORE_STATUS_SUCCESSFUL; 10a9ce: 30 d2 xor %dl,%dl _ISR_Disable( level ); if ( the_semaphore->count < the_semaphore->Attributes.maximum_count ) the_semaphore->count += 1; else status = CORE_SEMAPHORE_MAXIMUM_COUNT_EXCEEDED; _ISR_Enable( level ); 10a9d0: 51 push %ecx 10a9d1: 9d popf } return status; } 10a9d2: 89 d0 mov %edx,%eax 10a9d4: 8b 5d fc mov -0x4(%ebp),%ebx 10a9d7: c9 leave 10a9d8: c3 ret =============================================================================== 00109a10 <_Event_Surrender>: */ void _Event_Surrender( Thread_Control *the_thread ) { 109a10: 55 push %ebp 109a11: 89 e5 mov %esp,%ebp 109a13: 57 push %edi 109a14: 56 push %esi 109a15: 53 push %ebx 109a16: 83 ec 1c sub $0x1c,%esp 109a19: 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 ]; 109a1c: 8b b3 e4 00 00 00 mov 0xe4(%ebx),%esi option_set = (rtems_option) the_thread->Wait.option; 109a22: 8b 43 30 mov 0x30(%ebx),%eax 109a25: 89 45 e0 mov %eax,-0x20(%ebp) _ISR_Disable( level ); 109a28: 9c pushf 109a29: fa cli 109a2a: 58 pop %eax pending_events = api->pending_events; 109a2b: 8b 16 mov (%esi),%edx 109a2d: 89 55 e4 mov %edx,-0x1c(%ebp) event_condition = (rtems_event_set) the_thread->Wait.count; 109a30: 8b 4b 24 mov 0x24(%ebx),%ecx seized_events = _Event_sets_Get( pending_events, event_condition ); /* * No events were seized in this operation */ if ( _Event_sets_Is_empty( seized_events ) ) { 109a33: 21 ca and %ecx,%edx 109a35: 75 05 jne 109a3c <_Event_Surrender+0x2c> 109a37: e9 ab 00 00 00 jmp 109ae7 <_Event_Surrender+0xd7> /* * 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() && 109a3c: 83 3d e8 e8 12 00 00 cmpl $0x0,0x12e8e8 109a43: 74 47 je 109a8c <_Event_Surrender+0x7c> 109a45: 3b 1d ec e8 12 00 cmp 0x12e8ec,%ebx 109a4b: 75 3f jne 109a8c <_Event_Surrender+0x7c> _Thread_Is_executing( the_thread ) && ((_Event_Sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || 109a4d: 8b 3d c8 ec 12 00 mov 0x12ecc8,%edi /* * If we are in an ISR and sending to the current thread, then * we have a critical section issue to deal with. */ if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) && 109a53: 83 ff 02 cmp $0x2,%edi 109a56: 74 09 je 109a61 <_Event_Surrender+0x51> <== NEVER TAKEN ((_Event_Sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || (_Event_Sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED)) ) { 109a58: 8b 3d c8 ec 12 00 mov 0x12ecc8,%edi * If we are in an ISR and sending to the current thread, then * we have a critical section issue to deal with. */ if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) && ((_Event_Sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || 109a5e: 4f dec %edi 109a5f: 75 2b jne 109a8c <_Event_Surrender+0x7c> (_Event_Sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED)) ) { if ( seized_events == event_condition || _Options_Is_any(option_set) ) { 109a61: 39 ca cmp %ecx,%edx 109a63: 74 06 je 109a6b <_Event_Surrender+0x5b> 109a65: f6 45 e0 02 testb $0x2,-0x20(%ebp) 109a69: 74 7c je 109ae7 <_Event_Surrender+0xd7> <== NEVER TAKEN RTEMS_INLINE_ROUTINE rtems_event_set _Event_sets_Clear( rtems_event_set the_event_set, rtems_event_set the_mask ) { return ( the_event_set & ~(the_mask) ); 109a6b: 89 d1 mov %edx,%ecx 109a6d: f7 d1 not %ecx 109a6f: 23 4d e4 and -0x1c(%ebp),%ecx 109a72: 89 0e mov %ecx,(%esi) api->pending_events = _Event_sets_Clear( pending_events,seized_events ); the_thread->Wait.count = 0; 109a74: c7 43 24 00 00 00 00 movl $0x0,0x24(%ebx) *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 109a7b: 8b 4b 28 mov 0x28(%ebx),%ecx 109a7e: 89 11 mov %edx,(%ecx) _Event_Sync_state = THREAD_BLOCKING_OPERATION_SATISFIED; 109a80: c7 05 c8 ec 12 00 03 movl $0x3,0x12ecc8 109a87: 00 00 00 109a8a: eb 5b jmp 109ae7 <_Event_Surrender+0xd7> } /* * Otherwise, this is a normal send to another thread */ if ( _States_Is_waiting_for_event( the_thread->current_state ) ) { 109a8c: f6 43 11 01 testb $0x1,0x11(%ebx) 109a90: 74 55 je 109ae7 <_Event_Surrender+0xd7> if ( seized_events == event_condition || _Options_Is_any( option_set ) ) { 109a92: 39 ca cmp %ecx,%edx 109a94: 74 06 je 109a9c <_Event_Surrender+0x8c> 109a96: f6 45 e0 02 testb $0x2,-0x20(%ebp) 109a9a: 74 4b je 109ae7 <_Event_Surrender+0xd7> <== NEVER TAKEN 109a9c: 89 d1 mov %edx,%ecx 109a9e: f7 d1 not %ecx 109aa0: 23 4d e4 and -0x1c(%ebp),%ecx 109aa3: 89 0e mov %ecx,(%esi) api->pending_events = _Event_sets_Clear( pending_events, seized_events ); the_thread->Wait.count = 0; 109aa5: c7 43 24 00 00 00 00 movl $0x0,0x24(%ebx) *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 109aac: 8b 4b 28 mov 0x28(%ebx),%ecx 109aaf: 89 11 mov %edx,(%ecx) _ISR_Flash( level ); 109ab1: 50 push %eax 109ab2: 9d popf 109ab3: fa cli if ( !_Watchdog_Is_active( &the_thread->Timer ) ) { 109ab4: 83 7b 50 02 cmpl $0x2,0x50(%ebx) 109ab8: 74 06 je 109ac0 <_Event_Surrender+0xb0> _ISR_Enable( level ); 109aba: 50 push %eax 109abb: 9d popf RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 109abc: 51 push %ecx 109abd: 51 push %ecx 109abe: eb 17 jmp 109ad7 <_Event_Surrender+0xc7> RTEMS_INLINE_ROUTINE void _Watchdog_Deactivate( Watchdog_Control *the_watchdog ) { the_watchdog->state = WATCHDOG_REMOVE_IT; 109ac0: c7 43 50 03 00 00 00 movl $0x3,0x50(%ebx) _Thread_Unblock( the_thread ); } else { _Watchdog_Deactivate( &the_thread->Timer ); _ISR_Enable( level ); 109ac7: 50 push %eax 109ac8: 9d popf (void) _Watchdog_Remove( &the_thread->Timer ); 109ac9: 83 ec 0c sub $0xc,%esp 109acc: 8d 43 48 lea 0x48(%ebx),%eax 109acf: 50 push %eax 109ad0: e8 43 2f 00 00 call 10ca18 <_Watchdog_Remove> 109ad5: 58 pop %eax 109ad6: 5a pop %edx 109ad7: 68 f8 ff 03 10 push $0x1003fff8 109adc: 53 push %ebx 109add: e8 fa 1f 00 00 call 10badc <_Thread_Clear_state> 109ae2: 83 c4 10 add $0x10,%esp 109ae5: eb 02 jmp 109ae9 <_Event_Surrender+0xd9> _Thread_Unblock( the_thread ); } return; } } _ISR_Enable( level ); 109ae7: 50 push %eax 109ae8: 9d popf } 109ae9: 8d 65 f4 lea -0xc(%ebp),%esp 109aec: 5b pop %ebx 109aed: 5e pop %esi 109aee: 5f pop %edi 109aef: 5d pop %ebp 109af0: c3 ret =============================================================================== 00109af4 <_Event_Timeout>: void _Event_Timeout( Objects_Id id, void *ignored ) { 109af4: 55 push %ebp 109af5: 89 e5 mov %esp,%ebp 109af7: 83 ec 20 sub $0x20,%esp Thread_Control *the_thread; Objects_Locations location; ISR_Level level; the_thread = _Thread_Get( id, &location ); 109afa: 8d 45 f4 lea -0xc(%ebp),%eax 109afd: 50 push %eax 109afe: ff 75 08 pushl 0x8(%ebp) 109b01: e8 26 23 00 00 call 10be2c <_Thread_Get> switch ( location ) { 109b06: 83 c4 10 add $0x10,%esp 109b09: 83 7d f4 00 cmpl $0x0,-0xc(%ebp) 109b0d: 75 4e jne 109b5d <_Event_Timeout+0x69> <== 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 ); 109b0f: 9c pushf 109b10: fa cli 109b11: 5a pop %edx _ISR_Enable( level ); return; } #endif the_thread->Wait.count = 0; 109b12: c7 40 24 00 00 00 00 movl $0x0,0x24(%eax) if ( _Thread_Is_executing( the_thread ) ) { 109b19: 3b 05 ec e8 12 00 cmp 0x12e8ec,%eax 109b1f: 75 13 jne 109b34 <_Event_Timeout+0x40> if ( _Event_Sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) 109b21: 8b 0d c8 ec 12 00 mov 0x12ecc8,%ecx 109b27: 49 dec %ecx 109b28: 75 0a jne 109b34 <_Event_Timeout+0x40> _Event_Sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT; 109b2a: c7 05 c8 ec 12 00 02 movl $0x2,0x12ecc8 109b31: 00 00 00 } the_thread->Wait.return_code = RTEMS_TIMEOUT; 109b34: c7 40 34 06 00 00 00 movl $0x6,0x34(%eax) _ISR_Enable( level ); 109b3b: 52 push %edx 109b3c: 9d popf 109b3d: 52 push %edx 109b3e: 52 push %edx 109b3f: 68 f8 ff 03 10 push $0x1003fff8 109b44: 50 push %eax 109b45: e8 92 1f 00 00 call 10badc <_Thread_Clear_state> * * This routine decrements the thread dispatch level. */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_decrement_disable_level(void) { _Thread_Dispatch_disable_level--; 109b4a: a1 e4 e3 12 00 mov 0x12e3e4,%eax 109b4f: 48 dec %eax 109b50: a3 e4 e3 12 00 mov %eax,0x12e3e4 return _Thread_Dispatch_disable_level; 109b55: a1 e4 e3 12 00 mov 0x12e3e4,%eax 109b5a: 83 c4 10 add $0x10,%esp case OBJECTS_REMOTE: /* impossible */ #endif case OBJECTS_ERROR: break; } } 109b5d: c9 leave 109b5e: c3 ret =============================================================================== 0010f33f <_Heap_Extend>: Heap_Control *heap, void *extend_area_begin_ptr, uintptr_t extend_area_size, uintptr_t *extended_size_ptr ) { 10f33f: 55 push %ebp 10f340: 89 e5 mov %esp,%ebp 10f342: 57 push %edi 10f343: 56 push %esi 10f344: 53 push %ebx 10f345: 83 ec 4c sub $0x4c,%esp 10f348: 8b 5d 08 mov 0x8(%ebp),%ebx 10f34b: 8b 45 10 mov 0x10(%ebp),%eax Heap_Statistics *const stats = &heap->stats; Heap_Block *const first_block = heap->first_block; 10f34e: 8b 4b 20 mov 0x20(%ebx),%ecx 10f351: 89 4d b8 mov %ecx,-0x48(%ebp) Heap_Block *start_block = first_block; Heap_Block *merge_below_block = NULL; Heap_Block *merge_above_block = NULL; Heap_Block *link_below_block = NULL; Heap_Block *link_above_block = NULL; Heap_Block *extend_first_block = NULL; 10f354: c7 45 e0 00 00 00 00 movl $0x0,-0x20(%ebp) Heap_Block *extend_last_block = NULL; 10f35b: c7 45 e4 00 00 00 00 movl $0x0,-0x1c(%ebp) uintptr_t const page_size = heap->page_size; 10f362: 8b 73 10 mov 0x10(%ebx),%esi 10f365: 89 75 bc mov %esi,-0x44(%ebp) uintptr_t const min_block_size = heap->min_block_size; 10f368: 8b 53 14 mov 0x14(%ebx),%edx uintptr_t const extend_area_begin = (uintptr_t) extend_area_begin_ptr; uintptr_t const extend_area_end = extend_area_begin + extend_area_size; uintptr_t const free_size = stats->free_size; 10f36b: 8b 4b 30 mov 0x30(%ebx),%ecx 10f36e: 89 4d b4 mov %ecx,-0x4c(%ebp) uintptr_t extend_first_block_size = 0; uintptr_t extended_size = 0; bool extend_area_ok = false; if ( extend_area_end < extend_area_begin ) { 10f371: 8b 75 0c mov 0xc(%ebp),%esi 10f374: 01 c6 add %eax,%esi 10f376: 89 75 d4 mov %esi,-0x2c(%ebp) 10f379: 73 07 jae 10f382 <_Heap_Extend+0x43> return false; 10f37b: 31 c0 xor %eax,%eax 10f37d: e9 cb 01 00 00 jmp 10f54d <_Heap_Extend+0x20e> } extend_area_ok = _Heap_Get_first_and_last_block( 10f382: 51 push %ecx 10f383: 51 push %ecx 10f384: 8d 4d e4 lea -0x1c(%ebp),%ecx 10f387: 51 push %ecx 10f388: 8d 4d e0 lea -0x20(%ebp),%ecx 10f38b: 51 push %ecx 10f38c: 52 push %edx 10f38d: ff 75 bc pushl -0x44(%ebp) 10f390: 50 push %eax 10f391: ff 75 0c pushl 0xc(%ebp) 10f394: e8 89 b8 ff ff call 10ac22 <_Heap_Get_first_and_last_block> page_size, min_block_size, &extend_first_block, &extend_last_block ); if (!extend_area_ok ) { 10f399: 83 c4 20 add $0x20,%esp 10f39c: 84 c0 test %al,%al 10f39e: 74 db je 10f37b <_Heap_Extend+0x3c> 10f3a0: 8b 4d b8 mov -0x48(%ebp),%ecx 10f3a3: c7 45 c8 00 00 00 00 movl $0x0,-0x38(%ebp) 10f3aa: c7 45 c4 00 00 00 00 movl $0x0,-0x3c(%ebp) 10f3b1: 31 ff xor %edi,%edi 10f3b3: c7 45 cc 00 00 00 00 movl $0x0,-0x34(%ebp) return false; } do { uintptr_t const sub_area_begin = (start_block != first_block) ? (uintptr_t) start_block : heap->area_begin; 10f3ba: 8b 73 18 mov 0x18(%ebx),%esi 10f3bd: 89 75 c0 mov %esi,-0x40(%ebp) 10f3c0: eb 03 jmp 10f3c5 <_Heap_Extend+0x86> 10f3c2: 89 4d c0 mov %ecx,-0x40(%ebp) uintptr_t const sub_area_end = start_block->prev_size; 10f3c5: 8b 01 mov (%ecx),%eax 10f3c7: 89 45 d0 mov %eax,-0x30(%ebp) RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 10f3ca: 89 c6 mov %eax,%esi 10f3cc: 83 ee 08 sub $0x8,%esi 10f3cf: 31 d2 xor %edx,%edx 10f3d1: f7 75 bc divl -0x44(%ebp) uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) - HEAP_BLOCK_HEADER_SIZE); 10f3d4: 29 d6 sub %edx,%esi Heap_Block *const end_block = _Heap_Block_of_alloc_area( sub_area_end, page_size ); if ( 10f3d6: 8b 55 c0 mov -0x40(%ebp),%edx 10f3d9: 39 55 d4 cmp %edx,-0x2c(%ebp) 10f3dc: 76 08 jbe 10f3e6 <_Heap_Extend+0xa7> 10f3de: 8b 45 d0 mov -0x30(%ebp),%eax 10f3e1: 39 45 0c cmp %eax,0xc(%ebp) 10f3e4: 72 95 jb 10f37b <_Heap_Extend+0x3c> sub_area_end > extend_area_begin && extend_area_end > sub_area_begin ) { return false; } if ( extend_area_end == sub_area_begin ) { 10f3e6: 8b 55 c0 mov -0x40(%ebp),%edx 10f3e9: 39 55 d4 cmp %edx,-0x2c(%ebp) 10f3ec: 74 0a je 10f3f8 <_Heap_Extend+0xb9> merge_below_block = start_block; } else if ( extend_area_end < sub_area_end ) { 10f3ee: 8b 45 d0 mov -0x30(%ebp),%eax 10f3f1: 39 45 d4 cmp %eax,-0x2c(%ebp) 10f3f4: 72 07 jb 10f3fd <_Heap_Extend+0xbe> 10f3f6: eb 08 jmp 10f400 <_Heap_Extend+0xc1> sub_area_end > extend_area_begin && extend_area_end > sub_area_begin ) { return false; } if ( extend_area_end == sub_area_begin ) { 10f3f8: 89 4d cc mov %ecx,-0x34(%ebp) 10f3fb: eb 03 jmp 10f400 <_Heap_Extend+0xc1> merge_below_block = start_block; } else if ( extend_area_end < sub_area_end ) { 10f3fd: 89 4d c4 mov %ecx,-0x3c(%ebp) link_below_block = start_block; } if ( sub_area_end == extend_area_begin ) { 10f400: 8b 55 0c mov 0xc(%ebp),%edx 10f403: 39 55 d0 cmp %edx,-0x30(%ebp) 10f406: 75 09 jne 10f411 <_Heap_Extend+0xd2> start_block->prev_size = extend_area_end; 10f408: 8b 45 d4 mov -0x2c(%ebp),%eax 10f40b: 89 01 mov %eax,(%ecx) 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 ) 10f40d: 89 f7 mov %esi,%edi 10f40f: eb 05 jmp 10f416 <_Heap_Extend+0xd7> merge_above_block = end_block; } else if ( sub_area_end < extend_area_begin ) { 10f411: 73 03 jae 10f416 <_Heap_Extend+0xd7> 10f413: 89 75 c8 mov %esi,-0x38(%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; 10f416: 8b 4e 04 mov 0x4(%esi),%ecx 10f419: 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); 10f41c: 01 f1 add %esi,%ecx link_above_block = end_block; } start_block = _Heap_Block_at( end_block, _Heap_Block_size( end_block ) ); } while ( start_block != first_block ); 10f41e: 3b 4d b8 cmp -0x48(%ebp),%ecx 10f421: 75 9f jne 10f3c2 <_Heap_Extend+0x83> if ( extend_area_begin < heap->area_begin ) { 10f423: 8b 4d 0c mov 0xc(%ebp),%ecx 10f426: 3b 4b 18 cmp 0x18(%ebx),%ecx 10f429: 73 05 jae 10f430 <_Heap_Extend+0xf1> heap->area_begin = extend_area_begin; 10f42b: 89 4b 18 mov %ecx,0x18(%ebx) 10f42e: eb 0b jmp 10f43b <_Heap_Extend+0xfc> } else if ( heap->area_end < extend_area_end ) { 10f430: 8b 75 d4 mov -0x2c(%ebp),%esi 10f433: 39 73 1c cmp %esi,0x1c(%ebx) 10f436: 73 03 jae 10f43b <_Heap_Extend+0xfc> heap->area_end = extend_area_end; 10f438: 89 73 1c mov %esi,0x1c(%ebx) } extend_first_block_size = (uintptr_t) extend_last_block - (uintptr_t) extend_first_block; 10f43b: 8b 45 e4 mov -0x1c(%ebp),%eax 10f43e: 8b 55 e0 mov -0x20(%ebp),%edx heap->area_begin = extend_area_begin; } else if ( heap->area_end < extend_area_end ) { heap->area_end = extend_area_end; } extend_first_block_size = 10f441: 89 c1 mov %eax,%ecx 10f443: 29 d1 sub %edx,%ecx (uintptr_t) extend_last_block - (uintptr_t) extend_first_block; extend_first_block->prev_size = extend_area_end; 10f445: 8b 75 d4 mov -0x2c(%ebp),%esi 10f448: 89 32 mov %esi,(%edx) extend_first_block->size_and_flag = extend_first_block_size | HEAP_PREV_BLOCK_USED; 10f44a: 89 ce mov %ecx,%esi 10f44c: 83 ce 01 or $0x1,%esi 10f44f: 89 72 04 mov %esi,0x4(%edx) _Heap_Protection_block_initialize( heap, extend_first_block ); extend_last_block->prev_size = extend_first_block_size; 10f452: 89 08 mov %ecx,(%eax) extend_last_block->size_and_flag = 0; 10f454: c7 40 04 00 00 00 00 movl $0x0,0x4(%eax) _Heap_Protection_block_initialize( heap, extend_last_block ); if ( (uintptr_t) extend_first_block < (uintptr_t) heap->first_block ) { 10f45b: 39 53 20 cmp %edx,0x20(%ebx) 10f45e: 76 05 jbe 10f465 <_Heap_Extend+0x126> heap->first_block = extend_first_block; 10f460: 89 53 20 mov %edx,0x20(%ebx) 10f463: eb 08 jmp 10f46d <_Heap_Extend+0x12e> } else if ( (uintptr_t) extend_last_block > (uintptr_t) heap->last_block ) { 10f465: 39 43 24 cmp %eax,0x24(%ebx) 10f468: 73 03 jae 10f46d <_Heap_Extend+0x12e> heap->last_block = extend_last_block; 10f46a: 89 43 24 mov %eax,0x24(%ebx) } if ( merge_below_block != NULL ) { 10f46d: 83 7d cc 00 cmpl $0x0,-0x34(%ebp) 10f471: 74 35 je 10f4a8 <_Heap_Extend+0x169> Heap_Control *heap, uintptr_t extend_area_begin, Heap_Block *first_block ) { uintptr_t const page_size = heap->page_size; 10f473: 8b 73 10 mov 0x10(%ebx),%esi uintptr_t const new_first_block_alloc_begin = _Heap_Align_up( extend_area_begin + HEAP_BLOCK_HEADER_SIZE, page_size ); 10f476: 8b 4d 0c mov 0xc(%ebp),%ecx 10f479: 83 c1 08 add $0x8,%ecx RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_up( uintptr_t value, uintptr_t alignment ) { uintptr_t remainder = value % alignment; 10f47c: 89 c8 mov %ecx,%eax 10f47e: 31 d2 xor %edx,%edx 10f480: f7 f6 div %esi if ( remainder != 0 ) { 10f482: 85 d2 test %edx,%edx 10f484: 74 04 je 10f48a <_Heap_Extend+0x14b> return value - remainder + alignment; 10f486: 01 f1 add %esi,%ecx 10f488: 29 d1 sub %edx,%ecx uintptr_t const new_first_block_begin = 10f48a: 8d 51 f8 lea -0x8(%ecx),%edx uintptr_t const first_block_begin = (uintptr_t) first_block; uintptr_t const new_first_block_size = first_block_begin - new_first_block_begin; Heap_Block *const new_first_block = (Heap_Block *) new_first_block_begin; new_first_block->prev_size = first_block->prev_size; 10f48d: 8b 75 cc mov -0x34(%ebp),%esi 10f490: 8b 06 mov (%esi),%eax 10f492: 89 41 f8 mov %eax,-0x8(%ecx) uintptr_t const new_first_block_alloc_begin = _Heap_Align_up( extend_area_begin + HEAP_BLOCK_HEADER_SIZE, page_size ); uintptr_t const new_first_block_begin = new_first_block_alloc_begin - HEAP_BLOCK_HEADER_SIZE; uintptr_t const first_block_begin = (uintptr_t) first_block; uintptr_t const new_first_block_size = 10f495: 89 f0 mov %esi,%eax 10f497: 29 d0 sub %edx,%eax first_block_begin - new_first_block_begin; Heap_Block *const new_first_block = (Heap_Block *) new_first_block_begin; new_first_block->prev_size = first_block->prev_size; new_first_block->size_and_flag = new_first_block_size | HEAP_PREV_BLOCK_USED; 10f499: 83 c8 01 or $0x1,%eax 10f49c: 89 42 04 mov %eax,0x4(%edx) _Heap_Free_block( heap, new_first_block ); 10f49f: 89 d8 mov %ebx,%eax 10f4a1: e8 7e fe ff ff call 10f324 <_Heap_Free_block> 10f4a6: eb 11 jmp 10f4b9 <_Heap_Extend+0x17a> heap->last_block = extend_last_block; } if ( merge_below_block != NULL ) { _Heap_Merge_below( heap, extend_area_begin, merge_below_block ); } else if ( link_below_block != NULL ) { 10f4a8: 83 7d c4 00 cmpl $0x0,-0x3c(%ebp) 10f4ac: 74 0b je 10f4b9 <_Heap_Extend+0x17a> { uintptr_t const last_block_begin = (uintptr_t) last_block; uintptr_t const link_begin = (uintptr_t) link; last_block->size_and_flag = (link_begin - last_block_begin) | HEAP_PREV_BLOCK_USED; 10f4ae: 8b 55 c4 mov -0x3c(%ebp),%edx 10f4b1: 29 c2 sub %eax,%edx 10f4b3: 83 ca 01 or $0x1,%edx 10f4b6: 89 50 04 mov %edx,0x4(%eax) link_below_block, extend_last_block ); } if ( merge_above_block != NULL ) { 10f4b9: 85 ff test %edi,%edi 10f4bb: 74 33 je 10f4f0 <_Heap_Extend+0x1b1> ) { uintptr_t const page_size = heap->page_size; uintptr_t const last_block_begin = (uintptr_t) last_block; uintptr_t const last_block_new_size = _Heap_Align_down( extend_area_end - last_block_begin - HEAP_BLOCK_HEADER_SIZE, 10f4bd: 8b 4d d4 mov -0x2c(%ebp),%ecx 10f4c0: 83 e9 08 sub $0x8,%ecx uintptr_t extend_area_end ) { uintptr_t const page_size = heap->page_size; uintptr_t const last_block_begin = (uintptr_t) last_block; uintptr_t const last_block_new_size = _Heap_Align_down( 10f4c3: 29 f9 sub %edi,%ecx RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 10f4c5: 89 c8 mov %ecx,%eax 10f4c7: 31 d2 xor %edx,%edx 10f4c9: f7 73 10 divl 0x10(%ebx) 10f4cc: 29 d1 sub %edx,%ecx ); Heap_Block *const new_last_block = _Heap_Block_at( last_block, last_block_new_size ); new_last_block->size_and_flag = (last_block->size_and_flag - last_block_new_size) 10f4ce: 8b 47 04 mov 0x4(%edi),%eax 10f4d1: 29 c8 sub %ecx,%eax | HEAP_PREV_BLOCK_USED; 10f4d3: 83 c8 01 or $0x1,%eax 10f4d6: 89 44 39 04 mov %eax,0x4(%ecx,%edi,1) RTEMS_INLINE_ROUTINE void _Heap_Block_set_size( Heap_Block *block, uintptr_t size ) { uintptr_t flag = block->size_and_flag & HEAP_PREV_BLOCK_USED; 10f4da: 8b 47 04 mov 0x4(%edi),%eax 10f4dd: 83 e0 01 and $0x1,%eax block->size_and_flag = size | flag; 10f4e0: 09 c8 or %ecx,%eax 10f4e2: 89 47 04 mov %eax,0x4(%edi) _Heap_Block_set_size( last_block, last_block_new_size ); _Heap_Free_block( heap, last_block ); 10f4e5: 89 fa mov %edi,%edx 10f4e7: 89 d8 mov %ebx,%eax 10f4e9: e8 36 fe ff ff call 10f324 <_Heap_Free_block> 10f4ee: eb 20 jmp 10f510 <_Heap_Extend+0x1d1> ); } if ( merge_above_block != NULL ) { _Heap_Merge_above( heap, merge_above_block, extend_area_end ); } else if ( link_above_block != NULL ) { 10f4f0: 83 7d c8 00 cmpl $0x0,-0x38(%ebp) 10f4f4: 74 1a je 10f510 <_Heap_Extend+0x1d1> _Heap_Link_above( 10f4f6: 8b 4d e4 mov -0x1c(%ebp),%ecx RTEMS_INLINE_ROUTINE void _Heap_Block_set_size( Heap_Block *block, uintptr_t size ) { uintptr_t flag = block->size_and_flag & HEAP_PREV_BLOCK_USED; 10f4f9: 8b 75 c8 mov -0x38(%ebp),%esi 10f4fc: 8b 46 04 mov 0x4(%esi),%eax 10f4ff: 83 e0 01 and $0x1,%eax ) { uintptr_t const link_begin = (uintptr_t) link; uintptr_t const first_block_begin = (uintptr_t) first_block; _Heap_Block_set_size( link, first_block_begin - link_begin ); 10f502: 8b 55 e0 mov -0x20(%ebp),%edx 10f505: 29 f2 sub %esi,%edx block->size_and_flag = size | flag; 10f507: 09 d0 or %edx,%eax 10f509: 89 46 04 mov %eax,0x4(%esi) last_block->size_and_flag |= HEAP_PREV_BLOCK_USED; 10f50c: 83 49 04 01 orl $0x1,0x4(%ecx) extend_first_block, extend_last_block ); } if ( merge_below_block == NULL && merge_above_block == NULL ) { 10f510: 85 ff test %edi,%edi 10f512: 75 10 jne 10f524 <_Heap_Extend+0x1e5> 10f514: 83 7d cc 00 cmpl $0x0,-0x34(%ebp) 10f518: 75 0a jne 10f524 <_Heap_Extend+0x1e5> _Heap_Free_block( heap, extend_first_block ); 10f51a: 8b 55 e0 mov -0x20(%ebp),%edx 10f51d: 89 d8 mov %ebx,%eax 10f51f: e8 00 fe ff ff call 10f324 <_Heap_Free_block> */ RTEMS_INLINE_ROUTINE void _Heap_Set_last_block_size( Heap_Control *heap ) { _Heap_Block_set_size( heap->last_block, (uintptr_t) heap->first_block - (uintptr_t) heap->last_block 10f524: 8b 53 24 mov 0x24(%ebx),%edx RTEMS_INLINE_ROUTINE void _Heap_Block_set_size( Heap_Block *block, uintptr_t size ) { uintptr_t flag = block->size_and_flag & HEAP_PREV_BLOCK_USED; 10f527: 8b 42 04 mov 0x4(%edx),%eax 10f52a: 83 e0 01 and $0x1,%eax * This feature will be used to terminate the scattered heap area list. See * also _Heap_Extend(). */ RTEMS_INLINE_ROUTINE void _Heap_Set_last_block_size( Heap_Control *heap ) { _Heap_Block_set_size( 10f52d: 8b 4b 20 mov 0x20(%ebx),%ecx 10f530: 29 d1 sub %edx,%ecx uintptr_t size ) { uintptr_t flag = block->size_and_flag & HEAP_PREV_BLOCK_USED; block->size_and_flag = size | flag; 10f532: 09 c8 or %ecx,%eax 10f534: 89 42 04 mov %eax,0x4(%edx) } _Heap_Set_last_block_size( heap ); extended_size = stats->free_size - free_size; 10f537: 8b 43 30 mov 0x30(%ebx),%eax 10f53a: 2b 45 b4 sub -0x4c(%ebp),%eax /* Statistics */ stats->size += extended_size; 10f53d: 01 43 2c add %eax,0x2c(%ebx) if ( extended_size_ptr != NULL ) 10f540: 83 7d 14 00 cmpl $0x0,0x14(%ebp) 10f544: 74 05 je 10f54b <_Heap_Extend+0x20c> <== NEVER TAKEN *extended_size_ptr = extended_size; 10f546: 8b 4d 14 mov 0x14(%ebp),%ecx 10f549: 89 01 mov %eax,(%ecx) return true; 10f54b: b0 01 mov $0x1,%al } 10f54d: 8d 65 f4 lea -0xc(%ebp),%esp 10f550: 5b pop %ebx 10f551: 5e pop %esi 10f552: 5f pop %edi 10f553: 5d pop %ebp 10f554: c3 ret =============================================================================== 0010f2d4 <_Heap_Free>: return do_free; } #endif bool _Heap_Free( Heap_Control *heap, void *alloc_begin_ptr ) { 10f2d4: 55 push %ebp 10f2d5: 89 e5 mov %esp,%ebp 10f2d7: 57 push %edi 10f2d8: 56 push %esi 10f2d9: 53 push %ebx 10f2da: 83 ec 14 sub $0x14,%esp 10f2dd: 8b 4d 08 mov 0x8(%ebp),%ecx 10f2e0: 8b 45 0c mov 0xc(%ebp),%eax /* * If NULL return true so a free on NULL is considered a valid release. This * is a special case that could be handled by the in heap check how-ever that * would result in false being returned which is wrong. */ if ( alloc_begin_ptr == NULL ) { 10f2e3: 85 c0 test %eax,%eax 10f2e5: 0f 84 46 01 00 00 je 10f431 <_Heap_Free+0x15d> 10f2eb: 8d 58 f8 lea -0x8(%eax),%ebx 10f2ee: 31 d2 xor %edx,%edx 10f2f0: f7 71 10 divl 0x10(%ecx) uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) - HEAP_BLOCK_HEADER_SIZE); 10f2f3: 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 10f2f5: 8b 41 20 mov 0x20(%ecx),%eax 10f2f8: 89 45 e8 mov %eax,-0x18(%ebp) && (uintptr_t) block <= (uintptr_t) heap->last_block; 10f2fb: 31 d2 xor %edx,%edx 10f2fd: 39 c3 cmp %eax,%ebx 10f2ff: 72 08 jb 10f309 <_Heap_Free+0x35> 10f301: 31 d2 xor %edx,%edx 10f303: 39 59 24 cmp %ebx,0x24(%ecx) 10f306: 0f 93 c2 setae %dl alloc_begin = (uintptr_t) alloc_begin_ptr; block = _Heap_Block_of_alloc_area( alloc_begin, heap->page_size ); if ( !_Heap_Is_block_in_heap( heap, block ) ) { return false; 10f309: 31 c0 xor %eax,%eax } alloc_begin = (uintptr_t) alloc_begin_ptr; block = _Heap_Block_of_alloc_area( alloc_begin, heap->page_size ); if ( !_Heap_Is_block_in_heap( heap, block ) ) { 10f30b: 85 d2 test %edx,%edx 10f30d: 0f 84 20 01 00 00 je 10f433 <_Heap_Free+0x15f> --stats->used_blocks; ++stats->frees; stats->free_size += block_size; return( true ); } 10f313: 8b 43 04 mov 0x4(%ebx),%eax 10f316: 89 45 ec mov %eax,-0x14(%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; 10f319: 89 c7 mov %eax,%edi 10f31b: 83 e7 fe and $0xfffffffe,%edi RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 10f31e: 8d 14 1f lea (%edi,%ebx,1),%edx 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; 10f321: 31 f6 xor %esi,%esi 10f323: 3b 55 e8 cmp -0x18(%ebp),%edx 10f326: 72 0a jb 10f332 <_Heap_Free+0x5e> <== NEVER TAKEN 10f328: 31 c0 xor %eax,%eax 10f32a: 39 51 24 cmp %edx,0x24(%ecx) 10f32d: 0f 93 c0 setae %al 10f330: 89 c6 mov %eax,%esi alloc_begin = (uintptr_t) alloc_begin_ptr; block = _Heap_Block_of_alloc_area( alloc_begin, heap->page_size ); if ( !_Heap_Is_block_in_heap( heap, block ) ) { return false; 10f332: 31 c0 xor %eax,%eax _Heap_Protection_block_check( heap, block ); block_size = _Heap_Block_size( block ); next_block = _Heap_Block_at( block, block_size ); if ( !_Heap_Is_block_in_heap( heap, next_block ) ) { 10f334: 85 f6 test %esi,%esi 10f336: 0f 84 f7 00 00 00 je 10f433 <_Heap_Free+0x15f> <== NEVER TAKEN --stats->used_blocks; ++stats->frees; stats->free_size += block_size; return( true ); } 10f33c: 8b 72 04 mov 0x4(%edx),%esi return false; } _Heap_Protection_block_check( heap, next_block ); if ( !_Heap_Is_prev_used( next_block ) ) { 10f33f: f7 c6 01 00 00 00 test $0x1,%esi 10f345: 0f 84 e8 00 00 00 je 10f433 <_Heap_Free+0x15f> <== 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; 10f34b: 83 e6 fe and $0xfffffffe,%esi 10f34e: 89 75 f0 mov %esi,-0x10(%ebp) if ( !_Heap_Protection_determine_block_free( heap, block ) ) { return true; } next_block_size = _Heap_Block_size( next_block ); next_is_free = next_block != heap->last_block 10f351: 8b 41 24 mov 0x24(%ecx),%eax 10f354: 89 45 e0 mov %eax,-0x20(%ebp) && !_Heap_Is_prev_used( _Heap_Block_at( next_block, next_block_size )); 10f357: 39 c2 cmp %eax,%edx 10f359: 74 0c je 10f367 <_Heap_Free+0x93> 10f35b: 8b 74 32 04 mov 0x4(%edx,%esi,1),%esi 10f35f: 83 f6 01 xor $0x1,%esi 10f362: 83 e6 01 and $0x1,%esi 10f365: eb 02 jmp 10f369 <_Heap_Free+0x95> 10f367: 31 f6 xor %esi,%esi if ( !_Heap_Protection_determine_block_free( heap, block ) ) { return true; } next_block_size = _Heap_Block_size( next_block ); next_is_free = next_block != heap->last_block 10f369: 89 f0 mov %esi,%eax 10f36b: 88 45 e7 mov %al,-0x19(%ebp) && !_Heap_Is_prev_used( _Heap_Block_at( next_block, next_block_size )); if ( !_Heap_Is_prev_used( block ) ) { 10f36e: f6 45 ec 01 testb $0x1,-0x14(%ebp) 10f372: 75 5e jne 10f3d2 <_Heap_Free+0xfe> uintptr_t const prev_size = block->prev_size; 10f374: 8b 33 mov (%ebx),%esi RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 10f376: 29 f3 sub %esi,%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; 10f378: c7 45 ec 00 00 00 00 movl $0x0,-0x14(%ebp) 10f37f: 3b 5d e8 cmp -0x18(%ebp),%ebx 10f382: 72 0b jb 10f38f <_Heap_Free+0xbb> <== NEVER TAKEN 10f384: 31 c0 xor %eax,%eax 10f386: 39 5d e0 cmp %ebx,-0x20(%ebp) 10f389: 0f 93 c0 setae %al 10f38c: 89 45 ec mov %eax,-0x14(%ebp) alloc_begin = (uintptr_t) alloc_begin_ptr; block = _Heap_Block_of_alloc_area( alloc_begin, heap->page_size ); if ( !_Heap_Is_block_in_heap( heap, block ) ) { return false; 10f38f: 31 c0 xor %eax,%eax if ( !_Heap_Is_prev_used( block ) ) { uintptr_t const prev_size = block->prev_size; Heap_Block * const prev_block = _Heap_Block_at( block, -prev_size ); if ( !_Heap_Is_block_in_heap( heap, prev_block ) ) { 10f391: 83 7d ec 00 cmpl $0x0,-0x14(%ebp) 10f395: 0f 84 98 00 00 00 je 10f433 <_Heap_Free+0x15f> <== 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) ) { 10f39b: f6 43 04 01 testb $0x1,0x4(%ebx) 10f39f: 0f 84 8e 00 00 00 je 10f433 <_Heap_Free+0x15f> <== NEVER TAKEN _HAssert( false ); return( false ); } if ( next_is_free ) { /* coalesce both */ 10f3a5: 80 7d e7 00 cmpb $0x0,-0x19(%ebp) 10f3a9: 8d 34 37 lea (%edi,%esi,1),%esi 10f3ac: 74 14 je 10f3c2 <_Heap_Free+0xee> uintptr_t const size = block_size + prev_size + next_block_size; 10f3ae: 03 75 f0 add -0x10(%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; 10f3b1: 8b 42 08 mov 0x8(%edx),%eax Heap_Block *prev = block->prev; 10f3b4: 8b 52 0c mov 0xc(%edx),%edx prev->next = next; 10f3b7: 89 42 08 mov %eax,0x8(%edx) next->prev = prev; 10f3ba: 89 50 0c mov %edx,0xc(%eax) _Heap_Free_list_remove( next_block ); stats->free_blocks -= 1; 10f3bd: ff 49 38 decl 0x38(%ecx) 10f3c0: eb 2d jmp 10f3ef <_Heap_Free+0x11b> next_block = _Heap_Block_at( prev_block, size ); _HAssert(!_Heap_Is_prev_used( next_block)); next_block->prev_size = size; } else { /* coalesce prev */ uintptr_t const size = block_size + prev_size; prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 10f3c2: 89 f0 mov %esi,%eax 10f3c4: 83 c8 01 or $0x1,%eax 10f3c7: 89 43 04 mov %eax,0x4(%ebx) next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 10f3ca: 83 62 04 fe andl $0xfffffffe,0x4(%edx) next_block->prev_size = size; 10f3ce: 89 32 mov %esi,(%edx) 10f3d0: eb 56 jmp 10f428 <_Heap_Free+0x154> } } else if ( next_is_free ) { /* coalesce next */ 10f3d2: 80 7d e7 00 cmpb $0x0,-0x19(%ebp) 10f3d6: 74 24 je 10f3fc <_Heap_Free+0x128> uintptr_t const size = block_size + next_block_size; 10f3d8: 8b 75 f0 mov -0x10(%ebp),%esi 10f3db: 01 fe add %edi,%esi RTEMS_INLINE_ROUTINE void _Heap_Free_list_replace( Heap_Block *old_block, Heap_Block *new_block ) { Heap_Block *next = old_block->next; 10f3dd: 8b 42 08 mov 0x8(%edx),%eax Heap_Block *prev = old_block->prev; 10f3e0: 8b 52 0c mov 0xc(%edx),%edx new_block->next = next; 10f3e3: 89 43 08 mov %eax,0x8(%ebx) new_block->prev = prev; 10f3e6: 89 53 0c mov %edx,0xc(%ebx) next->prev = new_block; 10f3e9: 89 58 0c mov %ebx,0xc(%eax) prev->next = new_block; 10f3ec: 89 5a 08 mov %ebx,0x8(%edx) _Heap_Free_list_replace( next_block, block ); block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 10f3ef: 89 f0 mov %esi,%eax 10f3f1: 83 c8 01 or $0x1,%eax 10f3f4: 89 43 04 mov %eax,0x4(%ebx) next_block = _Heap_Block_at( block, size ); next_block->prev_size = size; 10f3f7: 89 34 1e mov %esi,(%esi,%ebx,1) 10f3fa: eb 2c jmp 10f428 <_Heap_Free+0x154> RTEMS_INLINE_ROUTINE void _Heap_Free_list_insert_after( Heap_Block *block_before, Heap_Block *new_block ) { Heap_Block *next = block_before->next; 10f3fc: 8b 41 08 mov 0x8(%ecx),%eax new_block->next = next; 10f3ff: 89 43 08 mov %eax,0x8(%ebx) new_block->prev = block_before; 10f402: 89 4b 0c mov %ecx,0xc(%ebx) block_before->next = new_block; 10f405: 89 59 08 mov %ebx,0x8(%ecx) next->prev = new_block; 10f408: 89 58 0c mov %ebx,0xc(%eax) } 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; 10f40b: 89 f8 mov %edi,%eax 10f40d: 83 c8 01 or $0x1,%eax 10f410: 89 43 04 mov %eax,0x4(%ebx) next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 10f413: 83 62 04 fe andl $0xfffffffe,0x4(%edx) next_block->prev_size = block_size; 10f417: 89 3a mov %edi,(%edx) /* Statistics */ ++stats->free_blocks; 10f419: 8b 41 38 mov 0x38(%ecx),%eax 10f41c: 40 inc %eax 10f41d: 89 41 38 mov %eax,0x38(%ecx) if ( stats->max_free_blocks < stats->free_blocks ) { 10f420: 39 41 3c cmp %eax,0x3c(%ecx) 10f423: 73 03 jae 10f428 <_Heap_Free+0x154> stats->max_free_blocks = stats->free_blocks; 10f425: 89 41 3c mov %eax,0x3c(%ecx) } } /* Statistics */ --stats->used_blocks; 10f428: ff 49 40 decl 0x40(%ecx) ++stats->frees; 10f42b: ff 41 50 incl 0x50(%ecx) stats->free_size += block_size; 10f42e: 01 79 30 add %edi,0x30(%ecx) * If NULL return true so a free on NULL is considered a valid release. This * is a special case that could be handled by the in heap check how-ever that * would result in false being returned which is wrong. */ if ( alloc_begin_ptr == NULL ) { return true; 10f431: b0 01 mov $0x1,%al --stats->used_blocks; ++stats->frees; stats->free_size += block_size; return( true ); } 10f433: 83 c4 14 add $0x14,%esp 10f436: 5b pop %ebx 10f437: 5e pop %esi 10f438: 5f pop %edi 10f439: 5d pop %ebp 10f43a: c3 ret =============================================================================== 0010c528 <_Heap_Greedy_allocate>: Heap_Block *_Heap_Greedy_allocate( Heap_Control *heap, const uintptr_t *block_sizes, size_t block_count ) { 10c528: 55 push %ebp 10c529: 89 e5 mov %esp,%ebp 10c52b: 57 push %edi 10c52c: 56 push %esi 10c52d: 53 push %ebx 10c52e: 83 ec 1c sub $0x1c,%esp 10c531: 8b 5d 08 mov 0x8(%ebp),%ebx Heap_Block *allocated_blocks = NULL; Heap_Block *blocks = NULL; Heap_Block *current; size_t i; for (i = 0; i < block_count; ++i) { 10c534: 31 f6 xor %esi,%esi const uintptr_t *block_sizes, size_t block_count ) { Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); Heap_Block *allocated_blocks = NULL; 10c536: 31 c9 xor %ecx,%ecx Heap_Block *blocks = NULL; Heap_Block *current; size_t i; for (i = 0; i < block_count; ++i) { 10c538: eb 2d jmp 10c567 <_Heap_Greedy_allocate+0x3f> * @brief See _Heap_Allocate_aligned_with_boundary() with alignment and * boundary equals zero. */ RTEMS_INLINE_ROUTINE void *_Heap_Allocate( Heap_Control *heap, uintptr_t size ) { return _Heap_Allocate_aligned_with_boundary( heap, size, 0, 0 ); 10c53a: 6a 00 push $0x0 10c53c: 6a 00 push $0x0 10c53e: 8b 45 0c mov 0xc(%ebp),%eax 10c541: ff 34 b0 pushl (%eax,%esi,4) 10c544: 53 push %ebx 10c545: 89 4d e4 mov %ecx,-0x1c(%ebp) 10c548: e8 bb 67 00 00 call 112d08 <_Heap_Allocate_aligned_with_boundary> void *next = _Heap_Allocate( heap, block_sizes [i] ); if ( next != NULL ) { 10c54d: 83 c4 10 add $0x10,%esp 10c550: 85 c0 test %eax,%eax 10c552: 8b 4d e4 mov -0x1c(%ebp),%ecx 10c555: 74 0f je 10c566 <_Heap_Greedy_allocate+0x3e><== NEVER TAKEN RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 10c557: 8d 78 f8 lea -0x8(%eax),%edi 10c55a: 31 d2 xor %edx,%edx 10c55c: f7 73 10 divl 0x10(%ebx) uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) - HEAP_BLOCK_HEADER_SIZE); 10c55f: 29 d7 sub %edx,%edi Heap_Block *next_block = _Heap_Block_of_alloc_area( (uintptr_t) next, heap->page_size ); next_block->next = allocated_blocks; 10c561: 89 4f 08 mov %ecx,0x8(%edi) 10c564: 89 f9 mov %edi,%ecx Heap_Block *allocated_blocks = NULL; Heap_Block *blocks = NULL; Heap_Block *current; size_t i; for (i = 0; i < block_count; ++i) { 10c566: 46 inc %esi 10c567: 3b 75 10 cmp 0x10(%ebp),%esi 10c56a: 75 ce jne 10c53a <_Heap_Greedy_allocate+0x12> 10c56c: 31 f6 xor %esi,%esi 10c56e: eb 23 jmp 10c593 <_Heap_Greedy_allocate+0x6b> } RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block ) { return block->size_and_flag & ~HEAP_PREV_BLOCK_USED; 10c570: 8b 47 04 mov 0x4(%edi),%eax 10c573: 83 e0 fe and $0xfffffffe,%eax allocated_blocks = next_block; } } while ( (current = _Heap_Free_list_first( heap )) != free_list_tail ) { _Heap_Block_allocate( 10c576: 83 e8 08 sub $0x8,%eax 10c579: 50 push %eax RTEMS_INLINE_ROUTINE uintptr_t _Heap_Alloc_area_of_block( const Heap_Block *block ) { return (uintptr_t) block + HEAP_BLOCK_HEADER_SIZE; 10c57a: 8d 47 08 lea 0x8(%edi),%eax 10c57d: 50 push %eax 10c57e: 57 push %edi 10c57f: 53 push %ebx 10c580: 89 4d e4 mov %ecx,-0x1c(%ebp) 10c583: e8 8e 02 00 00 call 10c816 <_Heap_Block_allocate> current, _Heap_Alloc_area_of_block( current ), _Heap_Block_size( current ) - HEAP_BLOCK_HEADER_SIZE ); current->next = blocks; 10c588: 89 77 08 mov %esi,0x8(%edi) 10c58b: 89 fe mov %edi,%esi 10c58d: 83 c4 10 add $0x10,%esp 10c590: 8b 4d e4 mov -0x1c(%ebp),%ecx return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next; 10c593: 8b 7b 08 mov 0x8(%ebx),%edi next_block->next = allocated_blocks; allocated_blocks = next_block; } } while ( (current = _Heap_Free_list_first( heap )) != free_list_tail ) { 10c596: 39 df cmp %ebx,%edi 10c598: 75 d6 jne 10c570 <_Heap_Greedy_allocate+0x48> 10c59a: eb 14 jmp 10c5b0 <_Heap_Greedy_allocate+0x88> blocks = current; } while ( allocated_blocks != NULL ) { current = allocated_blocks; allocated_blocks = allocated_blocks->next; 10c59c: 8b 79 08 mov 0x8(%ecx),%edi _Heap_Free( heap, (void *) _Heap_Alloc_area_of_block( current ) ); 10c59f: 50 push %eax 10c5a0: 50 push %eax RTEMS_INLINE_ROUTINE uintptr_t _Heap_Alloc_area_of_block( const Heap_Block *block ) { return (uintptr_t) block + HEAP_BLOCK_HEADER_SIZE; 10c5a1: 83 c1 08 add $0x8,%ecx 10c5a4: 51 push %ecx 10c5a5: 53 push %ebx 10c5a6: e8 b5 68 00 00 call 112e60 <_Heap_Free> 10c5ab: 83 c4 10 add $0x10,%esp blocks = current; } while ( allocated_blocks != NULL ) { current = allocated_blocks; allocated_blocks = allocated_blocks->next; 10c5ae: 89 f9 mov %edi,%ecx current->next = blocks; blocks = current; } while ( allocated_blocks != NULL ) { 10c5b0: 85 c9 test %ecx,%ecx 10c5b2: 75 e8 jne 10c59c <_Heap_Greedy_allocate+0x74> allocated_blocks = allocated_blocks->next; _Heap_Free( heap, (void *) _Heap_Alloc_area_of_block( current ) ); } return blocks; } 10c5b4: 89 f0 mov %esi,%eax 10c5b6: 8d 65 f4 lea -0xc(%ebp),%esp 10c5b9: 5b pop %ebx 10c5ba: 5e pop %esi 10c5bb: 5f pop %edi 10c5bc: 5d pop %ebp 10c5bd: c3 ret =============================================================================== 00112620 <_Heap_Iterate>: void _Heap_Iterate( Heap_Control *heap, Heap_Block_visitor visitor, void *visitor_arg ) { 112620: 55 push %ebp 112621: 89 e5 mov %esp,%ebp 112623: 56 push %esi 112624: 53 push %ebx 112625: 8b 45 08 mov 0x8(%ebp),%eax Heap_Block *current = heap->first_block; 112628: 8b 50 20 mov 0x20(%eax),%edx Heap_Block *end = heap->last_block; 11262b: 8b 58 24 mov 0x24(%eax),%ebx bool stop = false; 11262e: 31 c0 xor %eax,%eax while ( !stop && current != end ) { 112630: eb 1f jmp 112651 <_Heap_Iterate+0x31> 112632: 8b 42 04 mov 0x4(%edx),%eax 112635: 83 e0 fe and $0xfffffffe,%eax RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 112638: 8d 34 02 lea (%edx,%eax,1),%esi uintptr_t size = _Heap_Block_size( current ); Heap_Block *next = _Heap_Block_at( current, size ); bool used = _Heap_Is_prev_used( next ); stop = (*visitor)( current, size, used, visitor_arg ); 11263b: ff 75 10 pushl 0x10(%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; 11263e: 8b 4e 04 mov 0x4(%esi),%ecx 112641: 83 e1 01 and $0x1,%ecx 112644: 51 push %ecx 112645: 50 push %eax 112646: 52 push %edx 112647: 8b 55 0c mov 0xc(%ebp),%edx 11264a: ff d2 call *%edx 11264c: 89 f2 mov %esi,%edx 11264e: 83 c4 10 add $0x10,%esp { Heap_Block *current = heap->first_block; Heap_Block *end = heap->last_block; bool stop = false; while ( !stop && current != end ) { 112651: 39 da cmp %ebx,%edx 112653: 74 04 je 112659 <_Heap_Iterate+0x39> 112655: fe c8 dec %al 112657: 75 d9 jne 112632 <_Heap_Iterate+0x12> <== ALWAYS TAKEN stop = (*visitor)( current, size, used, visitor_arg ); current = next; } } 112659: 8d 65 f8 lea -0x8(%ebp),%esp 11265c: 5b pop %ebx 11265d: 5e pop %esi 11265e: 5d pop %ebp 11265f: c3 ret =============================================================================== 0010f534 <_Heap_Size_of_alloc_area>: bool _Heap_Size_of_alloc_area( Heap_Control *heap, void *alloc_begin_ptr, uintptr_t *alloc_size ) { 10f534: 55 push %ebp 10f535: 89 e5 mov %esp,%ebp 10f537: 57 push %edi 10f538: 56 push %esi 10f539: 53 push %ebx 10f53a: 8b 5d 08 mov 0x8(%ebp),%ebx 10f53d: 8b 75 0c mov 0xc(%ebp),%esi RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 10f540: 8d 4e f8 lea -0x8(%esi),%ecx 10f543: 89 f0 mov %esi,%eax 10f545: 31 d2 xor %edx,%edx 10f547: f7 73 10 divl 0x10(%ebx) uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) - HEAP_BLOCK_HEADER_SIZE); 10f54a: 29 d1 sub %edx,%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 10f54c: 8b 53 20 mov 0x20(%ebx),%edx && (uintptr_t) block <= (uintptr_t) heap->last_block; 10f54f: 31 ff xor %edi,%edi 10f551: 39 d1 cmp %edx,%ecx 10f553: 72 0a jb 10f55f <_Heap_Size_of_alloc_area+0x2b> 10f555: 31 c0 xor %eax,%eax 10f557: 39 4b 24 cmp %ecx,0x24(%ebx) 10f55a: 0f 93 c0 setae %al 10f55d: 89 c7 mov %eax,%edi 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 ) ) { return false; 10f55f: 31 c0 xor %eax,%eax 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 ) ) { 10f561: 85 ff test %edi,%edi 10f563: 74 30 je 10f595 <_Heap_Size_of_alloc_area+0x61> - 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; 10f565: 8b 41 04 mov 0x4(%ecx),%eax 10f568: 83 e0 fe and $0xfffffffe,%eax RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 10f56b: 01 c1 add %eax,%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; 10f56d: 31 ff xor %edi,%edi 10f56f: 39 d1 cmp %edx,%ecx 10f571: 72 0a jb 10f57d <_Heap_Size_of_alloc_area+0x49><== NEVER TAKEN 10f573: 31 c0 xor %eax,%eax 10f575: 39 4b 24 cmp %ecx,0x24(%ebx) 10f578: 0f 93 c0 setae %al 10f57b: 89 c7 mov %eax,%edi return false; 10f57d: 31 c0 xor %eax,%eax } block_size = _Heap_Block_size( block ); next_block = _Heap_Block_at( block, block_size ); if ( 10f57f: 85 ff test %edi,%edi 10f581: 74 12 je 10f595 <_Heap_Size_of_alloc_area+0x61><== NEVER TAKEN !_Heap_Is_block_in_heap( heap, next_block ) || !_Heap_Is_prev_used( next_block ) 10f583: f6 41 04 01 testb $0x1,0x4(%ecx) 10f587: 74 0c je 10f595 <_Heap_Size_of_alloc_area+0x61><== NEVER TAKEN ) { return false; } *alloc_size = (uintptr_t) next_block + HEAP_ALLOC_BONUS - alloc_begin; 10f589: 29 f1 sub %esi,%ecx 10f58b: 8d 51 04 lea 0x4(%ecx),%edx 10f58e: 8b 45 10 mov 0x10(%ebp),%eax 10f591: 89 10 mov %edx,(%eax) return true; 10f593: b0 01 mov $0x1,%al } 10f595: 5b pop %ebx 10f596: 5e pop %esi 10f597: 5f pop %edi 10f598: 5d pop %ebp 10f599: c3 ret =============================================================================== 0010b5d2 <_Heap_Walk>: bool _Heap_Walk( Heap_Control *heap, int source, bool dump ) { 10b5d2: 55 push %ebp 10b5d3: 89 e5 mov %esp,%ebp 10b5d5: 57 push %edi 10b5d6: 56 push %esi 10b5d7: 53 push %ebx 10b5d8: 83 ec 3c sub $0x3c,%esp 10b5db: 8b 7d 0c mov 0xc(%ebp),%edi uintptr_t const page_size = heap->page_size; 10b5de: 8b 4d 08 mov 0x8(%ebp),%ecx 10b5e1: 8b 49 10 mov 0x10(%ecx),%ecx 10b5e4: 89 4d e0 mov %ecx,-0x20(%ebp) uintptr_t const min_block_size = heap->min_block_size; 10b5e7: 8b 4d 08 mov 0x8(%ebp),%ecx 10b5ea: 8b 49 14 mov 0x14(%ecx),%ecx 10b5ed: 89 4d d8 mov %ecx,-0x28(%ebp) Heap_Block *const first_block = heap->first_block; 10b5f0: 8b 4d 08 mov 0x8(%ebp),%ecx 10b5f3: 8b 71 20 mov 0x20(%ecx),%esi Heap_Block *const last_block = heap->last_block; 10b5f6: 8b 49 24 mov 0x24(%ecx),%ecx 10b5f9: 89 4d d4 mov %ecx,-0x2c(%ebp) Heap_Block *block = first_block; Heap_Walk_printer printer = dump ? _Heap_Walk_print : _Heap_Walk_print_nothing; 10b5fc: bb 94 b5 10 00 mov $0x10b594,%ebx 10b601: 80 7d 10 00 cmpb $0x0,0x10(%ebp) 10b605: 74 05 je 10b60c <_Heap_Walk+0x3a> 10b607: bb 99 b5 10 00 mov $0x10b599,%ebx if ( !_System_state_Is_up( _System_state_Get() ) ) { 10b60c: 83 3d a8 05 13 00 03 cmpl $0x3,0x1305a8 10b613: 74 07 je 10b61c <_Heap_Walk+0x4a> return true; 10b615: b0 01 mov $0x1,%al 10b617: e9 ec 02 00 00 jmp 10b908 <_Heap_Walk+0x336> 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)( 10b61c: 50 push %eax 10b61d: 8b 4d 08 mov 0x8(%ebp),%ecx 10b620: ff 71 0c pushl 0xc(%ecx) 10b623: ff 71 08 pushl 0x8(%ecx) 10b626: ff 75 d4 pushl -0x2c(%ebp) 10b629: 56 push %esi 10b62a: ff 71 1c pushl 0x1c(%ecx) 10b62d: ff 71 18 pushl 0x18(%ecx) 10b630: ff 75 d8 pushl -0x28(%ebp) 10b633: ff 75 e0 pushl -0x20(%ebp) 10b636: 68 e4 07 12 00 push $0x1207e4 10b63b: 6a 00 push $0x0 10b63d: 57 push %edi 10b63e: ff d3 call *%ebx heap->area_begin, heap->area_end, first_block, last_block, first_free_block, last_free_block ); if ( page_size == 0 ) { 10b640: 83 c4 30 add $0x30,%esp 10b643: 83 7d e0 00 cmpl $0x0,-0x20(%ebp) 10b647: 75 0b jne 10b654 <_Heap_Walk+0x82> (*printer)( source, true, "page size is zero\n" ); 10b649: 50 push %eax 10b64a: 68 75 08 12 00 push $0x120875 10b64f: e9 d5 00 00 00 jmp 10b729 <_Heap_Walk+0x157> return false; } if ( !_Addresses_Is_aligned( (void *) page_size ) ) { 10b654: f6 45 e0 03 testb $0x3,-0x20(%ebp) 10b658: 74 0d je 10b667 <_Heap_Walk+0x95> (*printer)( 10b65a: ff 75 e0 pushl -0x20(%ebp) 10b65d: 68 88 08 12 00 push $0x120888 10b662: e9 c2 00 00 00 jmp 10b729 <_Heap_Walk+0x157> RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 10b667: 8b 45 d8 mov -0x28(%ebp),%eax 10b66a: 31 d2 xor %edx,%edx 10b66c: f7 75 e0 divl -0x20(%ebp) ); return false; } if ( !_Heap_Is_aligned( min_block_size, page_size ) ) { 10b66f: 85 d2 test %edx,%edx 10b671: 74 0d je 10b680 <_Heap_Walk+0xae> (*printer)( 10b673: ff 75 d8 pushl -0x28(%ebp) 10b676: 68 a6 08 12 00 push $0x1208a6 10b67b: e9 a9 00 00 00 jmp 10b729 <_Heap_Walk+0x157> RTEMS_INLINE_ROUTINE uintptr_t _Heap_Alloc_area_of_block( const Heap_Block *block ) { return (uintptr_t) block + HEAP_BLOCK_HEADER_SIZE; 10b680: 8d 46 08 lea 0x8(%esi),%eax RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 10b683: 31 d2 xor %edx,%edx 10b685: f7 75 e0 divl -0x20(%ebp) ); return false; } if ( 10b688: 85 d2 test %edx,%edx 10b68a: 74 0b je 10b697 <_Heap_Walk+0xc5> !_Heap_Is_aligned( _Heap_Alloc_area_of_block( first_block ), page_size ) ) { (*printer)( 10b68c: 56 push %esi 10b68d: 68 ca 08 12 00 push $0x1208ca 10b692: e9 92 00 00 00 jmp 10b729 <_Heap_Walk+0x157> ); return false; } if ( !_Heap_Is_prev_used( first_block ) ) { 10b697: f6 46 04 01 testb $0x1,0x4(%esi) 10b69b: 75 0b jne 10b6a8 <_Heap_Walk+0xd6> (*printer)( 10b69d: 50 push %eax 10b69e: 68 fb 08 12 00 push $0x1208fb 10b6a3: e9 81 00 00 00 jmp 10b729 <_Heap_Walk+0x157> - 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; 10b6a8: 8b 4d d4 mov -0x2c(%ebp),%ecx 10b6ab: 8b 41 04 mov 0x4(%ecx),%eax 10b6ae: 83 e0 fe and $0xfffffffe,%eax RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 10b6b1: 01 c8 add %ecx,%eax 10b6b3: 89 45 d0 mov %eax,-0x30(%ebp) ); return false; } if ( _Heap_Is_free( last_block ) ) { 10b6b6: f6 40 04 01 testb $0x1,0x4(%eax) 10b6ba: 75 08 jne 10b6c4 <_Heap_Walk+0xf2> (*printer)( 10b6bc: 50 push %eax 10b6bd: 68 29 09 12 00 push $0x120929 10b6c2: eb 65 jmp 10b729 <_Heap_Walk+0x157> ); return false; } if ( 10b6c4: 39 75 d0 cmp %esi,-0x30(%ebp) 10b6c7: 74 08 je 10b6d1 <_Heap_Walk+0xff> _Heap_Block_at( last_block, _Heap_Block_size( last_block ) ) != first_block ) { (*printer)( 10b6c9: 56 push %esi 10b6ca: 68 3e 09 12 00 push $0x12093e 10b6cf: eb 58 jmp 10b729 <_Heap_Walk+0x157> int source, Heap_Walk_printer printer, Heap_Control *heap ) { uintptr_t const page_size = heap->page_size; 10b6d1: 8b 4d 08 mov 0x8(%ebp),%ecx 10b6d4: 8b 49 10 mov 0x10(%ecx),%ecx 10b6d7: 89 4d e4 mov %ecx,-0x1c(%ebp) return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next; 10b6da: 8b 45 08 mov 0x8(%ebp),%eax 10b6dd: 8b 48 08 mov 0x8(%eax),%ecx const Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); 10b6e0: 89 c6 mov %eax,%esi 10b6e2: eb 6d jmp 10b751 <_Heap_Walk+0x17f> 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; 10b6e4: 31 c0 xor %eax,%eax 10b6e6: 8b 55 08 mov 0x8(%ebp),%edx 10b6e9: 39 4a 20 cmp %ecx,0x20(%edx) 10b6ec: 77 08 ja 10b6f6 <_Heap_Walk+0x124> 10b6ee: 31 c0 xor %eax,%eax 10b6f0: 39 4a 24 cmp %ecx,0x24(%edx) 10b6f3: 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 ) ) { 10b6f6: 85 c0 test %eax,%eax 10b6f8: 75 08 jne 10b702 <_Heap_Walk+0x130> (*printer)( 10b6fa: 51 push %ecx 10b6fb: 68 6d 09 12 00 push $0x12096d 10b700: eb 27 jmp 10b729 <_Heap_Walk+0x157> RTEMS_INLINE_ROUTINE uintptr_t _Heap_Alloc_area_of_block( const Heap_Block *block ) { return (uintptr_t) block + HEAP_BLOCK_HEADER_SIZE; 10b702: 8d 41 08 lea 0x8(%ecx),%eax RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 10b705: 31 d2 xor %edx,%edx 10b707: f7 75 e4 divl -0x1c(%ebp) ); return false; } if ( 10b70a: 85 d2 test %edx,%edx 10b70c: 74 08 je 10b716 <_Heap_Walk+0x144> !_Heap_Is_aligned( _Heap_Alloc_area_of_block( free_block ), page_size ) ) { (*printer)( 10b70e: 51 push %ecx 10b70f: 68 8d 09 12 00 push $0x12098d 10b714: eb 13 jmp 10b729 <_Heap_Walk+0x157> - 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; 10b716: 8b 41 04 mov 0x4(%ecx),%eax 10b719: 83 e0 fe and $0xfffffffe,%eax ); return false; } if ( _Heap_Is_used( free_block ) ) { 10b71c: f6 44 01 04 01 testb $0x1,0x4(%ecx,%eax,1) 10b721: 74 13 je 10b736 <_Heap_Walk+0x164> (*printer)( 10b723: 51 push %ecx 10b724: 68 bd 09 12 00 push $0x1209bd 10b729: 6a 01 push $0x1 10b72b: 57 push %edi 10b72c: ff d3 call *%ebx 10b72e: 83 c4 10 add $0x10,%esp 10b731: e9 c3 01 00 00 jmp 10b8f9 <_Heap_Walk+0x327> ); return false; } if ( free_block->prev != prev_block ) { 10b736: 8b 41 0c mov 0xc(%ecx),%eax 10b739: 39 f0 cmp %esi,%eax 10b73b: 74 0f je 10b74c <_Heap_Walk+0x17a> (*printer)( 10b73d: 83 ec 0c sub $0xc,%esp 10b740: 50 push %eax 10b741: 51 push %ecx 10b742: 68 d9 09 12 00 push $0x1209d9 10b747: e9 42 01 00 00 jmp 10b88e <_Heap_Walk+0x2bc> return false; } prev_block = free_block; free_block = free_block->next; 10b74c: 89 ce mov %ecx,%esi 10b74e: 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 ) { 10b751: 3b 4d 08 cmp 0x8(%ebp),%ecx 10b754: 75 8e jne 10b6e4 <_Heap_Walk+0x112> 10b756: 8b 75 d0 mov -0x30(%ebp),%esi block = next_block; } while ( block != first_block ); return true; } 10b759: 8b 46 04 mov 0x4(%esi),%eax 10b75c: 89 c1 mov %eax,%ecx 10b75e: 83 e1 fe and $0xfffffffe,%ecx 10b761: 89 4d e4 mov %ecx,-0x1c(%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; 10b764: 83 e0 01 and $0x1,%eax 10b767: 89 45 c8 mov %eax,-0x38(%ebp) RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 10b76a: 01 f1 add %esi,%ecx 10b76c: 89 4d dc mov %ecx,-0x24(%ebp) uintptr_t const block_begin = (uintptr_t) block; uintptr_t const block_size = _Heap_Block_size( block ); bool const prev_used = _Heap_Is_prev_used( block ); Heap_Block *const next_block = _Heap_Block_at( block, block_size ); uintptr_t const next_block_begin = (uintptr_t) next_block; bool const is_not_last_block = block != last_block; 10b76f: 3b 75 d4 cmp -0x2c(%ebp),%esi 10b772: 0f 95 c1 setne %cl 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; 10b775: c7 45 cc 00 00 00 00 movl $0x0,-0x34(%ebp) 10b77c: 8b 55 dc mov -0x24(%ebp),%edx 10b77f: 8b 45 08 mov 0x8(%ebp),%eax 10b782: 39 50 20 cmp %edx,0x20(%eax) 10b785: 77 0c ja 10b793 <_Heap_Walk+0x1c1> <== NEVER TAKEN 10b787: 39 50 24 cmp %edx,0x24(%eax) 10b78a: 0f 93 c0 setae %al 10b78d: 0f b6 c0 movzbl %al,%eax 10b790: 89 45 cc mov %eax,-0x34(%ebp) if ( !_Heap_Is_block_in_heap( heap, next_block ) ) { 10b793: 83 7d cc 00 cmpl $0x0,-0x34(%ebp) 10b797: 75 11 jne 10b7aa <_Heap_Walk+0x1d8> (*printer)( 10b799: 83 ec 0c sub $0xc,%esp 10b79c: ff 75 dc pushl -0x24(%ebp) 10b79f: 56 push %esi 10b7a0: 68 0b 0a 12 00 push $0x120a0b 10b7a5: e9 e4 00 00 00 jmp 10b88e <_Heap_Walk+0x2bc> RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 10b7aa: 8b 45 e4 mov -0x1c(%ebp),%eax 10b7ad: 31 d2 xor %edx,%edx 10b7af: f7 75 e0 divl -0x20(%ebp) ); return false; } if ( !_Heap_Is_aligned( block_size, page_size ) && is_not_last_block ) { 10b7b2: 85 d2 test %edx,%edx 10b7b4: 74 15 je 10b7cb <_Heap_Walk+0x1f9> 10b7b6: 84 c9 test %cl,%cl 10b7b8: 74 11 je 10b7cb <_Heap_Walk+0x1f9> (*printer)( 10b7ba: 83 ec 0c sub $0xc,%esp 10b7bd: ff 75 e4 pushl -0x1c(%ebp) 10b7c0: 56 push %esi 10b7c1: 68 38 0a 12 00 push $0x120a38 10b7c6: e9 c3 00 00 00 jmp 10b88e <_Heap_Walk+0x2bc> ); return false; } if ( block_size < min_block_size && is_not_last_block ) { 10b7cb: 8b 45 d8 mov -0x28(%ebp),%eax 10b7ce: 39 45 e4 cmp %eax,-0x1c(%ebp) 10b7d1: 73 15 jae 10b7e8 <_Heap_Walk+0x216> 10b7d3: 84 c9 test %cl,%cl 10b7d5: 74 11 je 10b7e8 <_Heap_Walk+0x216> <== NEVER TAKEN (*printer)( 10b7d7: 51 push %ecx 10b7d8: 51 push %ecx 10b7d9: 50 push %eax 10b7da: ff 75 e4 pushl -0x1c(%ebp) 10b7dd: 56 push %esi 10b7de: 68 66 0a 12 00 push $0x120a66 10b7e3: e9 a6 00 00 00 jmp 10b88e <_Heap_Walk+0x2bc> ); return false; } if ( next_block_begin <= block_begin && is_not_last_block ) { 10b7e8: 3b 75 dc cmp -0x24(%ebp),%esi 10b7eb: 72 15 jb 10b802 <_Heap_Walk+0x230> 10b7ed: 84 c9 test %cl,%cl 10b7ef: 74 11 je 10b802 <_Heap_Walk+0x230> (*printer)( 10b7f1: 83 ec 0c sub $0xc,%esp 10b7f4: ff 75 dc pushl -0x24(%ebp) 10b7f7: 56 push %esi 10b7f8: 68 91 0a 12 00 push $0x120a91 10b7fd: e9 8c 00 00 00 jmp 10b88e <_Heap_Walk+0x2bc> ); return false; } if ( !_Heap_Is_prev_used( next_block ) ) { 10b802: 8b 4d dc mov -0x24(%ebp),%ecx 10b805: f6 41 04 01 testb $0x1,0x4(%ecx) 10b809: 0f 85 b0 00 00 00 jne 10b8bf <_Heap_Walk+0x2ed> return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next; 10b80f: 8b 45 08 mov 0x8(%ebp),%eax 10b812: 8b 48 08 mov 0x8(%eax),%ecx block->prev, block->prev == first_free_block ? " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), block->next, block->next == last_free_block ? 10b815: 8b 56 08 mov 0x8(%esi),%edx 10b818: 89 55 c4 mov %edx,-0x3c(%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)( 10b81b: 3b 50 0c cmp 0xc(%eax),%edx 10b81e: 74 14 je 10b834 <_Heap_Walk+0x262> " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), block->next, block->next == last_free_block ? " (= last free)" : (block->next == free_list_tail ? " (= tail)" : "") 10b820: b8 89 06 12 00 mov $0x120689,%eax 10b825: 8b 55 08 mov 0x8(%ebp),%edx 10b828: 39 55 c4 cmp %edx,-0x3c(%ebp) 10b82b: 75 0c jne 10b839 <_Heap_Walk+0x267> 10b82d: b8 c0 07 12 00 mov $0x1207c0,%eax 10b832: eb 05 jmp 10b839 <_Heap_Walk+0x267> 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)( 10b834: b8 b1 07 12 00 mov $0x1207b1,%eax false, "block 0x%08x: size %u, prev 0x%08x%s, next 0x%08x%s\n", block, block_size, block->prev, block->prev == first_free_block ? 10b839: 8b 56 0c mov 0xc(%esi),%edx 10b83c: 89 55 cc mov %edx,-0x34(%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)( 10b83f: 39 ca cmp %ecx,%edx 10b841: 74 14 je 10b857 <_Heap_Walk+0x285> block, block_size, block->prev, block->prev == first_free_block ? " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), 10b843: ba 89 06 12 00 mov $0x120689,%edx 10b848: 8b 4d 08 mov 0x8(%ebp),%ecx 10b84b: 39 4d cc cmp %ecx,-0x34(%ebp) 10b84e: 75 0c jne 10b85c <_Heap_Walk+0x28a> 10b850: ba da 07 12 00 mov $0x1207da,%edx 10b855: eb 05 jmp 10b85c <_Heap_Walk+0x28a> 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)( 10b857: ba ca 07 12 00 mov $0x1207ca,%edx 10b85c: 83 ec 0c sub $0xc,%esp 10b85f: 50 push %eax 10b860: ff 75 c4 pushl -0x3c(%ebp) 10b863: 52 push %edx 10b864: ff 75 cc pushl -0x34(%ebp) 10b867: ff 75 e4 pushl -0x1c(%ebp) 10b86a: 56 push %esi 10b86b: 68 c5 0a 12 00 push $0x120ac5 10b870: 6a 00 push $0x0 10b872: 57 push %edi 10b873: ff d3 call *%ebx block->next == last_free_block ? " (= last free)" : (block->next == free_list_tail ? " (= tail)" : "") ); if ( block_size != next_block->prev_size ) { 10b875: 8b 4d dc mov -0x24(%ebp),%ecx 10b878: 8b 01 mov (%ecx),%eax 10b87a: 83 c4 30 add $0x30,%esp 10b87d: 39 45 e4 cmp %eax,-0x1c(%ebp) 10b880: 74 16 je 10b898 <_Heap_Walk+0x2c6> (*printer)( 10b882: 52 push %edx 10b883: 51 push %ecx 10b884: 50 push %eax 10b885: ff 75 e4 pushl -0x1c(%ebp) 10b888: 56 push %esi 10b889: 68 fa 0a 12 00 push $0x120afa 10b88e: 6a 01 push $0x1 10b890: 57 push %edi 10b891: ff d3 call *%ebx 10b893: 83 c4 20 add $0x20,%esp 10b896: eb 61 jmp 10b8f9 <_Heap_Walk+0x327> ); return false; } if ( !prev_used ) { 10b898: 83 7d c8 00 cmpl $0x0,-0x38(%ebp) 10b89c: 75 0b jne 10b8a9 <_Heap_Walk+0x2d7> (*printer)( 10b89e: 56 push %esi 10b89f: 68 33 0b 12 00 push $0x120b33 10b8a4: e9 80 fe ff ff jmp 10b729 <_Heap_Walk+0x157> 10b8a9: 8b 4d 08 mov 0x8(%ebp),%ecx 10b8ac: 8b 41 08 mov 0x8(%ecx),%eax 10b8af: eb 07 jmp 10b8b8 <_Heap_Walk+0x2e6> { 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 ) { 10b8b1: 39 f0 cmp %esi,%eax 10b8b3: 74 33 je 10b8e8 <_Heap_Walk+0x316> return true; } free_block = free_block->next; 10b8b5: 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 ) { 10b8b8: 3b 45 08 cmp 0x8(%ebp),%eax 10b8bb: 75 f4 jne 10b8b1 <_Heap_Walk+0x2df> 10b8bd: eb 3e jmp 10b8fd <_Heap_Walk+0x32b> if ( !_Heap_Is_prev_used( next_block ) ) { if ( !_Heap_Walk_check_free_block( source, printer, heap, block ) ) { return false; } } else if (prev_used) { 10b8bf: 83 7d c8 00 cmpl $0x0,-0x38(%ebp) 10b8c3: 74 0e je 10b8d3 <_Heap_Walk+0x301> (*printer)( 10b8c5: 83 ec 0c sub $0xc,%esp 10b8c8: ff 75 e4 pushl -0x1c(%ebp) 10b8cb: 56 push %esi 10b8cc: 68 62 0b 12 00 push $0x120b62 10b8d1: eb 0d jmp 10b8e0 <_Heap_Walk+0x30e> "block 0x%08x: size %u\n", block, block_size ); } else { (*printer)( 10b8d3: 50 push %eax 10b8d4: 50 push %eax 10b8d5: ff 36 pushl (%esi) 10b8d7: ff 75 e4 pushl -0x1c(%ebp) 10b8da: 56 push %esi 10b8db: 68 79 0b 12 00 push $0x120b79 10b8e0: 6a 00 push $0x0 10b8e2: 57 push %edi 10b8e3: ff d3 call *%ebx 10b8e5: 83 c4 20 add $0x20,%esp 10b8e8: 8b 75 dc mov -0x24(%ebp),%esi block->prev_size ); } block = next_block; } while ( block != first_block ); 10b8eb: 3b 75 d0 cmp -0x30(%ebp),%esi 10b8ee: 0f 85 65 fe ff ff jne 10b759 <_Heap_Walk+0x187> 10b8f4: e9 1c fd ff ff jmp 10b615 <_Heap_Walk+0x43> if ( !_System_state_Is_up( _System_state_Get() ) ) { return true; } if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; 10b8f9: 31 c0 xor %eax,%eax 10b8fb: eb 0b jmp 10b908 <_Heap_Walk+0x336> return false; } if ( !_Heap_Walk_is_in_free_list( heap, block ) ) { (*printer)( 10b8fd: 56 push %esi 10b8fe: 68 9e 0b 12 00 push $0x120b9e 10b903: e9 21 fe ff ff jmp 10b729 <_Heap_Walk+0x157> block = next_block; } while ( block != first_block ); return true; } 10b908: 8d 65 f4 lea -0xc(%ebp),%esp 10b90b: 5b pop %ebx 10b90c: 5e pop %esi 10b90d: 5f pop %edi 10b90e: 5d pop %ebp 10b90f: c3 ret =============================================================================== 0010adcc <_Internal_error_Occurred>: void _Internal_error_Occurred( Internal_errors_Source the_source, bool is_internal, Internal_errors_t the_error ) { 10adcc: 55 push %ebp 10adcd: 89 e5 mov %esp,%ebp 10adcf: 53 push %ebx 10add0: 83 ec 08 sub $0x8,%esp 10add3: 8b 55 08 mov 0x8(%ebp),%edx 10add6: 8b 45 0c mov 0xc(%ebp),%eax 10add9: 8b 5d 10 mov 0x10(%ebp),%ebx _Internal_errors_What_happened.the_source = the_source; 10addc: 89 15 64 e4 12 00 mov %edx,0x12e464 _Internal_errors_What_happened.is_internal = is_internal; 10ade2: a2 68 e4 12 00 mov %al,0x12e468 _Internal_errors_What_happened.the_error = the_error; 10ade7: 89 1d 6c e4 12 00 mov %ebx,0x12e46c _User_extensions_Fatal( the_source, is_internal, the_error ); 10aded: 53 push %ebx 10adee: 0f b6 c0 movzbl %al,%eax 10adf1: 50 push %eax 10adf2: 52 push %edx 10adf3: e8 01 1a 00 00 call 10c7f9 <_User_extensions_Fatal> RTEMS_INLINE_ROUTINE void _System_state_Set ( System_state_Codes state ) { _System_state_Current = state; 10adf8: c7 05 20 e5 12 00 05 movl $0x5,0x12e520 <== NOT EXECUTED 10adff: 00 00 00 _System_state_Set( SYSTEM_STATE_FAILED ); _CPU_Fatal_halt( the_error ); 10ae02: fa cli <== NOT EXECUTED 10ae03: 89 d8 mov %ebx,%eax <== NOT EXECUTED 10ae05: f4 hlt <== NOT EXECUTED 10ae06: 83 c4 10 add $0x10,%esp <== NOT EXECUTED 10ae09: eb fe jmp 10ae09 <_Internal_error_Occurred+0x3d><== NOT EXECUTED =============================================================================== 0010ae5c <_Objects_Allocate>: */ Objects_Control *_Objects_Allocate( Objects_Information *information ) { 10ae5c: 55 push %ebp 10ae5d: 89 e5 mov %esp,%ebp 10ae5f: 56 push %esi 10ae60: 53 push %ebx 10ae61: 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 ) 10ae64: 83 7b 18 00 cmpl $0x0,0x18(%ebx) 10ae68: 75 04 jne 10ae6e <_Objects_Allocate+0x12><== ALWAYS TAKEN return NULL; 10ae6a: 31 c9 xor %ecx,%ecx 10ae6c: eb 51 jmp 10aebf <_Objects_Allocate+0x63> /* * 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 ); 10ae6e: 8d 73 20 lea 0x20(%ebx),%esi 10ae71: 83 ec 0c sub $0xc,%esp 10ae74: 56 push %esi 10ae75: e8 06 f8 ff ff call 10a680 <_Chain_Get> 10ae7a: 89 c1 mov %eax,%ecx if ( information->auto_extend ) { 10ae7c: 83 c4 10 add $0x10,%esp 10ae7f: 80 7b 12 00 cmpb $0x0,0x12(%ebx) 10ae83: 74 3a je 10aebf <_Objects_Allocate+0x63> /* * If the list is empty then we are out of objects and need to * extend information base. */ if ( !the_object ) { 10ae85: 85 c0 test %eax,%eax 10ae87: 75 1a jne 10aea3 <_Objects_Allocate+0x47> _Objects_Extend_information( information ); 10ae89: 83 ec 0c sub $0xc,%esp 10ae8c: 53 push %ebx 10ae8d: e8 56 00 00 00 call 10aee8 <_Objects_Extend_information> the_object = (Objects_Control *) _Chain_Get( &information->Inactive ); 10ae92: 89 34 24 mov %esi,(%esp) 10ae95: e8 e6 f7 ff ff call 10a680 <_Chain_Get> 10ae9a: 89 c1 mov %eax,%ecx } if ( the_object ) { 10ae9c: 83 c4 10 add $0x10,%esp 10ae9f: 85 c0 test %eax,%eax 10aea1: 74 c7 je 10ae6a <_Objects_Allocate+0xe> uint32_t block; block = (uint32_t) _Objects_Get_index( the_object->id ) - 10aea3: 0f b7 41 08 movzwl 0x8(%ecx),%eax 10aea7: 0f b7 53 08 movzwl 0x8(%ebx),%edx 10aeab: 29 d0 sub %edx,%eax _Objects_Get_index( information->minimum_id ); block /= information->allocation_size; 10aead: 0f b7 73 14 movzwl 0x14(%ebx),%esi 10aeb1: 31 d2 xor %edx,%edx 10aeb3: f7 f6 div %esi information->inactive_per_block[ block ]--; 10aeb5: 8b 53 30 mov 0x30(%ebx),%edx 10aeb8: ff 0c 82 decl (%edx,%eax,4) information->inactive--; 10aebb: 66 ff 4b 2c decw 0x2c(%ebx) ); } #endif return the_object; } 10aebf: 89 c8 mov %ecx,%eax 10aec1: 8d 65 f8 lea -0x8(%ebp),%esp 10aec4: 5b pop %ebx 10aec5: 5e pop %esi 10aec6: 5d pop %ebp 10aec7: c3 ret =============================================================================== 0010aee8 <_Objects_Extend_information>: */ void _Objects_Extend_information( Objects_Information *information ) { 10aee8: 55 push %ebp 10aee9: 89 e5 mov %esp,%ebp 10aeeb: 57 push %edi 10aeec: 56 push %esi 10aeed: 53 push %ebx 10aeee: 83 ec 3c sub $0x3c,%esp 10aef1: 8b 5d 08 mov 0x8(%ebp),%ebx /* * Search for a free block of indexes. If we do NOT need to allocate or * extend the block table, then we will change do_extend. */ do_extend = true; minimum_index = _Objects_Get_index( information->minimum_id ); 10aef4: 0f b7 43 08 movzwl 0x8(%ebx),%eax 10aef8: 89 45 c8 mov %eax,-0x38(%ebp) index_base = minimum_index; block = 0; /* if ( information->maximum < minimum_index ) */ if ( information->object_blocks == NULL ) 10aefb: 8b 73 34 mov 0x34(%ebx),%esi 10aefe: 85 f6 test %esi,%esi 10af00: 74 40 je 10af42 <_Objects_Extend_information+0x5a> block_count = 0; else { block_count = information->maximum / information->allocation_size; 10af02: 0f b7 4b 14 movzwl 0x14(%ebx),%ecx 10af06: 8b 43 10 mov 0x10(%ebx),%eax 10af09: 31 d2 xor %edx,%edx 10af0b: 66 f7 f1 div %cx 10af0e: 0f b7 c0 movzwl %ax,%eax 10af11: 89 45 d0 mov %eax,-0x30(%ebp) /* * Search for a free block of indexes. If we do NOT need to allocate or * extend the block table, then we will change do_extend. */ do_extend = true; minimum_index = _Objects_Get_index( information->minimum_id ); 10af14: 8b 55 c8 mov -0x38(%ebp),%edx 10af17: 89 55 cc mov %edx,-0x34(%ebp) index_base = minimum_index; block = 0; 10af1a: c7 45 d4 00 00 00 00 movl $0x0,-0x2c(%ebp) if ( information->object_blocks == NULL ) block_count = 0; else { block_count = information->maximum / information->allocation_size; for ( ; block < block_count; block++ ) { 10af21: eb 10 jmp 10af33 <_Objects_Extend_information+0x4b> if ( information->object_blocks[ block ] == NULL ) { 10af23: 8b 55 d4 mov -0x2c(%ebp),%edx 10af26: 83 3c 96 00 cmpl $0x0,(%esi,%edx,4) 10af2a: 74 31 je 10af5d <_Objects_Extend_information+0x75> * information - object information table * * Output parameters: NONE */ void _Objects_Extend_information( 10af2c: 01 4d cc add %ecx,-0x34(%ebp) if ( information->object_blocks == NULL ) block_count = 0; else { block_count = information->maximum / information->allocation_size; for ( ; block < block_count; block++ ) { 10af2f: 42 inc %edx 10af30: 89 55 d4 mov %edx,-0x2c(%ebp) 10af33: 8b 55 d0 mov -0x30(%ebp),%edx 10af36: 39 55 d4 cmp %edx,-0x2c(%ebp) 10af39: 72 e8 jb 10af23 <_Objects_Extend_information+0x3b> /* * Search for a free block of indexes. If we do NOT need to allocate or * extend the block table, then we will change do_extend. */ do_extend = true; 10af3b: be 01 00 00 00 mov $0x1,%esi 10af40: eb 1d jmp 10af5f <_Objects_Extend_information+0x77> minimum_index = _Objects_Get_index( information->minimum_id ); 10af42: 8b 4d c8 mov -0x38(%ebp),%ecx 10af45: 89 4d cc mov %ecx,-0x34(%ebp) /* * Search for a free block of indexes. If we do NOT need to allocate or * extend the block table, then we will change do_extend. */ do_extend = true; 10af48: be 01 00 00 00 mov $0x1,%esi minimum_index = _Objects_Get_index( information->minimum_id ); index_base = minimum_index; block = 0; 10af4d: c7 45 d4 00 00 00 00 movl $0x0,-0x2c(%ebp) /* if ( information->maximum < minimum_index ) */ if ( information->object_blocks == NULL ) block_count = 0; 10af54: c7 45 d0 00 00 00 00 movl $0x0,-0x30(%ebp) 10af5b: eb 02 jmp 10af5f <_Objects_Extend_information+0x77> else { block_count = information->maximum / information->allocation_size; for ( ; block < block_count; block++ ) { if ( information->object_blocks[ block ] == NULL ) { do_extend = false; 10af5d: 31 f6 xor %esi,%esi } else index_base += information->allocation_size; } } maximum = (uint32_t) information->maximum + information->allocation_size; 10af5f: 0f b7 43 14 movzwl 0x14(%ebx),%eax 10af63: 0f b7 53 10 movzwl 0x10(%ebx),%edx 10af67: 01 c2 add %eax,%edx 10af69: 89 55 bc mov %edx,-0x44(%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 ) { 10af6c: 81 fa ff ff 00 00 cmp $0xffff,%edx 10af72: 0f 87 bb 01 00 00 ja 10b133 <_Objects_Extend_information+0x24b><== 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; 10af78: 0f af 43 18 imul 0x18(%ebx),%eax if ( information->auto_extend ) { 10af7c: 80 7b 12 00 cmpb $0x0,0x12(%ebx) 10af80: 74 18 je 10af9a <_Objects_Extend_information+0xb2> new_object_block = _Workspace_Allocate( block_size ); 10af82: 83 ec 0c sub $0xc,%esp 10af85: 50 push %eax 10af86: e8 b9 1b 00 00 call 10cb44 <_Workspace_Allocate> 10af8b: 89 45 c0 mov %eax,-0x40(%ebp) if ( !new_object_block ) 10af8e: 83 c4 10 add $0x10,%esp 10af91: 85 c0 test %eax,%eax 10af93: 75 14 jne 10afa9 <_Objects_Extend_information+0xc1> 10af95: e9 99 01 00 00 jmp 10b133 <_Objects_Extend_information+0x24b> return; } else { new_object_block = _Workspace_Allocate_or_fatal_error( block_size ); 10af9a: 83 ec 0c sub $0xc,%esp 10af9d: 50 push %eax 10af9e: e8 d2 1b 00 00 call 10cb75 <_Workspace_Allocate_or_fatal_error> 10afa3: 89 45 c0 mov %eax,-0x40(%ebp) 10afa6: 83 c4 10 add $0x10,%esp } /* * Do we need to grow the tables? */ if ( do_extend ) { 10afa9: 89 f0 mov %esi,%eax 10afab: 84 c0 test %al,%al 10afad: 0f 84 fd 00 00 00 je 10b0b0 <_Objects_Extend_information+0x1c8> */ /* * Up the block count and maximum */ block_count++; 10afb3: 8b 75 d0 mov -0x30(%ebp),%esi 10afb6: 46 inc %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 ); 10afb7: 83 ec 0c sub $0xc,%esp /* * 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 *)); 10afba: 8b 55 bc mov -0x44(%ebp),%edx 10afbd: 03 55 c8 add -0x38(%ebp),%edx /* * Allocate the tables and break it up. */ block_size = block_count * (sizeof(void *) + sizeof(uint32_t) + sizeof(Objects_Name *)) + 10afc0: 8d 04 76 lea (%esi,%esi,2),%eax 10afc3: 01 d0 add %edx,%eax block_count++; /* * Allocate the tables and break it up. */ block_size = block_count * 10afc5: c1 e0 02 shl $0x2,%eax (sizeof(void *) + sizeof(uint32_t) + sizeof(Objects_Name *)) + ((maximum + minimum_index) * sizeof(Objects_Control *)); object_blocks = (void**) _Workspace_Allocate( block_size ); 10afc8: 50 push %eax 10afc9: e8 76 1b 00 00 call 10cb44 <_Workspace_Allocate> 10afce: 89 c2 mov %eax,%edx if ( !object_blocks ) { 10afd0: 83 c4 10 add $0x10,%esp 10afd3: 85 c0 test %eax,%eax 10afd5: 75 13 jne 10afea <_Objects_Extend_information+0x102> _Workspace_Free( new_object_block ); 10afd7: 83 ec 0c sub $0xc,%esp 10afda: ff 75 c0 pushl -0x40(%ebp) 10afdd: e8 7b 1b 00 00 call 10cb5d <_Workspace_Free> 10afe2: 83 c4 10 add $0x10,%esp 10afe5: e9 49 01 00 00 jmp 10b133 <_Objects_Extend_information+0x24b> 10afea: 8d 0c b0 lea (%eax,%esi,4),%ecx 10afed: 89 4d b8 mov %ecx,-0x48(%ebp) 10aff0: 8d 34 f0 lea (%eax,%esi,8),%esi 10aff3: 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 ) { 10aff6: 0f b7 4b 10 movzwl 0x10(%ebx),%ecx 10affa: 31 c0 xor %eax,%eax 10affc: 3b 4d c8 cmp -0x38(%ebp),%ecx 10afff: 76 38 jbe 10b039 <_Objects_Extend_information+0x151> /* * 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, 10b001: 8b 45 d0 mov -0x30(%ebp),%eax 10b004: c1 e0 02 shl $0x2,%eax 10b007: 8b 73 34 mov 0x34(%ebx),%esi 10b00a: 89 d7 mov %edx,%edi 10b00c: 89 c1 mov %eax,%ecx 10b00e: f3 a4 rep movsb %ds:(%esi),%es:(%edi) information->object_blocks, block_count * sizeof(void*) ); memcpy( inactive_per_block, 10b010: 8b 73 30 mov 0x30(%ebx),%esi 10b013: 8b 7d b8 mov -0x48(%ebp),%edi 10b016: 89 c1 mov %eax,%ecx 10b018: f3 a4 rep movsb %ds:(%esi),%es:(%edi) information->inactive_per_block, block_count * sizeof(uint32_t) ); memcpy( local_table, information->local_table, (information->maximum + minimum_index) * sizeof(Objects_Control *) ); 10b01a: 0f b7 4b 10 movzwl 0x10(%ebx),%ecx 10b01e: 03 4d c8 add -0x38(%ebp),%ecx information->object_blocks, block_count * sizeof(void*) ); memcpy( inactive_per_block, information->inactive_per_block, block_count * sizeof(uint32_t) ); memcpy( local_table, 10b021: c1 e1 02 shl $0x2,%ecx 10b024: 8b 73 1c mov 0x1c(%ebx),%esi 10b027: 8b 7d c4 mov -0x3c(%ebp),%edi 10b02a: f3 a4 rep movsb %ds:(%esi),%es:(%edi) 10b02c: eb 10 jmp 10b03e <_Objects_Extend_information+0x156> /* * Deal with the special case of the 0 to minimum_index */ for ( index = 0; index < minimum_index; index++ ) { local_table[ index ] = NULL; 10b02e: 8b 75 c4 mov -0x3c(%ebp),%esi 10b031: c7 04 86 00 00 00 00 movl $0x0,(%esi,%eax,4) } else { /* * Deal with the special case of the 0 to minimum_index */ for ( index = 0; index < minimum_index; index++ ) { 10b038: 40 inc %eax 10b039: 3b 45 c8 cmp -0x38(%ebp),%eax 10b03c: 75 f0 jne 10b02e <_Objects_Extend_information+0x146> } /* * Initialise the new entries in the table. */ object_blocks[block_count] = NULL; 10b03e: 8b 45 d0 mov -0x30(%ebp),%eax 10b041: c7 04 82 00 00 00 00 movl $0x0,(%edx,%eax,4) inactive_per_block[block_count] = 0; 10b048: 8b 4d b8 mov -0x48(%ebp),%ecx 10b04b: c7 04 81 00 00 00 00 movl $0x0,(%ecx,%eax,4) for ( index=index_base ; index < ( information->allocation_size + index_base ); 10b052: 0f b7 4b 14 movzwl 0x14(%ebx),%ecx 10b056: 03 4d cc add -0x34(%ebp),%ecx * Initialise the new entries in the table. */ object_blocks[block_count] = NULL; inactive_per_block[block_count] = 0; for ( index=index_base ; 10b059: 8b 45 cc mov -0x34(%ebp),%eax 10b05c: eb 0b jmp 10b069 <_Objects_Extend_information+0x181> index < ( information->allocation_size + index_base ); index++ ) { local_table[ index ] = NULL; 10b05e: 8b 75 c4 mov -0x3c(%ebp),%esi 10b061: c7 04 86 00 00 00 00 movl $0x0,(%esi,%eax,4) object_blocks[block_count] = NULL; inactive_per_block[block_count] = 0; for ( index=index_base ; index < ( information->allocation_size + index_base ); index++ ) { 10b068: 40 inc %eax * Initialise the new entries in the table. */ object_blocks[block_count] = NULL; inactive_per_block[block_count] = 0; for ( index=index_base ; 10b069: 39 c8 cmp %ecx,%eax 10b06b: 72 f1 jb 10b05e <_Objects_Extend_information+0x176> index < ( information->allocation_size + index_base ); index++ ) { local_table[ index ] = NULL; } _ISR_Disable( level ); 10b06d: 9c pushf 10b06e: fa cli 10b06f: 5e pop %esi old_tables = information->object_blocks; 10b070: 8b 4b 34 mov 0x34(%ebx),%ecx information->object_blocks = object_blocks; 10b073: 89 53 34 mov %edx,0x34(%ebx) information->inactive_per_block = inactive_per_block; 10b076: 8b 45 b8 mov -0x48(%ebp),%eax 10b079: 89 43 30 mov %eax,0x30(%ebx) information->local_table = local_table; 10b07c: 8b 55 c4 mov -0x3c(%ebp),%edx 10b07f: 89 53 1c mov %edx,0x1c(%ebx) information->maximum = (Objects_Maximum) maximum; 10b082: 8b 45 bc mov -0x44(%ebp),%eax 10b085: 66 89 43 10 mov %ax,0x10(%ebx) uint32_t the_class, uint32_t node, uint32_t index ) { return (( (Objects_Id) the_api ) << OBJECTS_API_START_BIT) | 10b089: 8b 03 mov (%ebx),%eax 10b08b: c1 e0 18 shl $0x18,%eax 10b08e: 0d 00 00 01 00 or $0x10000,%eax (( (Objects_Id) the_class ) << OBJECTS_CLASS_START_BIT) | 10b093: 0b 45 bc or -0x44(%ebp),%eax information->maximum_id = _Objects_Build_id( 10b096: 0f b7 53 04 movzwl 0x4(%ebx),%edx 10b09a: c1 e2 1b shl $0x1b,%edx uint32_t the_class, uint32_t node, uint32_t index ) { return (( (Objects_Id) the_api ) << OBJECTS_API_START_BIT) | 10b09d: 09 d0 or %edx,%eax 10b09f: 89 43 0c mov %eax,0xc(%ebx) information->the_class, _Objects_Local_node, information->maximum ); _ISR_Enable( level ); 10b0a2: 56 push %esi 10b0a3: 9d popf _Workspace_Free( old_tables ); 10b0a4: 83 ec 0c sub $0xc,%esp 10b0a7: 51 push %ecx 10b0a8: e8 b0 1a 00 00 call 10cb5d <_Workspace_Free> 10b0ad: 83 c4 10 add $0x10,%esp } /* * Assign the new object block to the object block table. */ information->object_blocks[ block ] = new_object_block; 10b0b0: 8b 55 d4 mov -0x2c(%ebp),%edx 10b0b3: c1 e2 02 shl $0x2,%edx 10b0b6: 89 55 d0 mov %edx,-0x30(%ebp) 10b0b9: 8b 43 34 mov 0x34(%ebx),%eax 10b0bc: 8b 4d c0 mov -0x40(%ebp),%ecx 10b0bf: 8b 55 d4 mov -0x2c(%ebp),%edx 10b0c2: 89 0c 90 mov %ecx,(%eax,%edx,4) /* * Initialize objects .. add to a local chain first. */ _Chain_Initialize( 10b0c5: ff 73 18 pushl 0x18(%ebx) 10b0c8: 0f b7 43 14 movzwl 0x14(%ebx),%eax 10b0cc: 50 push %eax 10b0cd: 8b 43 34 mov 0x34(%ebx),%eax 10b0d0: ff 34 90 pushl (%eax,%edx,4) 10b0d3: 8d 7d dc lea -0x24(%ebp),%edi 10b0d6: 57 push %edi 10b0d7: e8 c8 f5 ff ff call 10a6a4 <_Chain_Initialize> /* * Move from the local chain, initialise, then append to the inactive chain */ index = index_base; while ((the_object = (Objects_Control *) _Chain_Get( &Inactive )) != NULL ) { 10b0dc: 83 c4 10 add $0x10,%esp ); /* * Move from the local chain, initialise, then append to the inactive chain */ index = index_base; 10b0df: 8b 75 cc mov -0x34(%ebp),%esi information->the_class, _Objects_Local_node, index ); _Chain_Append( &information->Inactive, &the_object->Node ); 10b0e2: 8d 7b 20 lea 0x20(%ebx),%edi /* * Move from the local chain, initialise, then append to the inactive chain */ index = index_base; while ((the_object = (Objects_Control *) _Chain_Get( &Inactive )) != NULL ) { 10b0e5: eb 26 jmp 10b10d <_Objects_Extend_information+0x225> 10b0e7: 8b 13 mov (%ebx),%edx 10b0e9: c1 e2 18 shl $0x18,%edx 10b0ec: 81 ca 00 00 01 00 or $0x10000,%edx the_object->id = _Objects_Build_id( 10b0f2: 0f b7 4b 04 movzwl 0x4(%ebx),%ecx (( (Objects_Id) the_class ) << OBJECTS_CLASS_START_BIT) | 10b0f6: c1 e1 1b shl $0x1b,%ecx 10b0f9: 09 ca or %ecx,%edx uint32_t the_class, uint32_t node, uint32_t index ) { return (( (Objects_Id) the_api ) << OBJECTS_API_START_BIT) | 10b0fb: 09 f2 or %esi,%edx 10b0fd: 89 50 08 mov %edx,0x8(%eax) information->the_class, _Objects_Local_node, index ); _Chain_Append( &information->Inactive, &the_object->Node ); 10b100: 52 push %edx 10b101: 52 push %edx 10b102: 50 push %eax 10b103: 57 push %edi 10b104: e8 53 f5 ff ff call 10a65c <_Chain_Append> index++; 10b109: 46 inc %esi 10b10a: 83 c4 10 add $0x10,%esp /* * Move from the local chain, initialise, then append to the inactive chain */ index = index_base; while ((the_object = (Objects_Control *) _Chain_Get( &Inactive )) != NULL ) { 10b10d: 83 ec 0c sub $0xc,%esp 10b110: 8d 45 dc lea -0x24(%ebp),%eax 10b113: 50 push %eax 10b114: e8 67 f5 ff ff call 10a680 <_Chain_Get> 10b119: 83 c4 10 add $0x10,%esp 10b11c: 85 c0 test %eax,%eax 10b11e: 75 c7 jne 10b0e7 <_Objects_Extend_information+0x1ff> _Chain_Append( &information->Inactive, &the_object->Node ); index++; } information->inactive_per_block[ block ] = information->allocation_size; 10b120: 8b 43 14 mov 0x14(%ebx),%eax 10b123: 8b 53 30 mov 0x30(%ebx),%edx 10b126: 0f b7 c8 movzwl %ax,%ecx 10b129: 8b 75 d0 mov -0x30(%ebp),%esi 10b12c: 89 0c 32 mov %ecx,(%edx,%esi,1) information->inactive = (Objects_Maximum)(information->inactive + information->allocation_size); 10b12f: 66 01 43 2c add %ax,0x2c(%ebx) } 10b133: 8d 65 f4 lea -0xc(%ebp),%esp 10b136: 5b pop %ebx 10b137: 5e pop %esi 10b138: 5f pop %edi 10b139: 5d pop %ebp 10b13a: c3 ret =============================================================================== 0010b1cc <_Objects_Get_information>: Objects_Information *_Objects_Get_information( Objects_APIs the_api, uint16_t the_class ) { 10b1cc: 55 push %ebp 10b1cd: 89 e5 mov %esp,%ebp 10b1cf: 56 push %esi 10b1d0: 53 push %ebx 10b1d1: 8b 5d 08 mov 0x8(%ebp),%ebx 10b1d4: 0f b7 75 0c movzwl 0xc(%ebp),%esi Objects_Information *info; int the_class_api_maximum; if ( !the_class ) 10b1d8: 66 85 f6 test %si,%si 10b1db: 75 04 jne 10b1e1 <_Objects_Get_information+0x15> return NULL; 10b1dd: 31 c0 xor %eax,%eax 10b1df: eb 2d jmp 10b20e <_Objects_Get_information+0x42> /* * 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 ); 10b1e1: 83 ec 0c sub $0xc,%esp 10b1e4: 53 push %ebx 10b1e5: e8 b2 43 00 00 call 10f59c <_Objects_API_maximum_class> if ( the_class_api_maximum == 0 ) 10b1ea: 83 c4 10 add $0x10,%esp 10b1ed: 85 c0 test %eax,%eax 10b1ef: 74 ec je 10b1dd <_Objects_Get_information+0x11> return NULL; if ( the_class > (uint32_t) the_class_api_maximum ) 10b1f1: 39 c6 cmp %eax,%esi 10b1f3: 77 e8 ja 10b1dd <_Objects_Get_information+0x11> return NULL; if ( !_Objects_Information_table[ the_api ] ) 10b1f5: 8b 04 9d bc e3 12 00 mov 0x12e3bc(,%ebx,4),%eax 10b1fc: 85 c0 test %eax,%eax 10b1fe: 74 dd je 10b1dd <_Objects_Get_information+0x11><== NEVER TAKEN return NULL; info = _Objects_Information_table[ the_api ][ the_class ]; 10b200: 8b 04 b0 mov (%eax,%esi,4),%eax if ( !info ) 10b203: 85 c0 test %eax,%eax 10b205: 74 d6 je 10b1dd <_Objects_Get_information+0x11><== 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 ) 10b207: 66 83 78 10 00 cmpw $0x0,0x10(%eax) 10b20c: 74 cf je 10b1dd <_Objects_Get_information+0x11> return NULL; #endif return info; } 10b20e: 8d 65 f8 lea -0x8(%ebp),%esp 10b211: 5b pop %ebx 10b212: 5e pop %esi 10b213: 5d pop %ebp 10b214: c3 ret =============================================================================== 001187b4 <_Objects_Get_no_protection>: Objects_Control *_Objects_Get_no_protection( Objects_Information *information, Objects_Id id, Objects_Locations *location ) { 1187b4: 55 push %ebp 1187b5: 89 e5 mov %esp,%ebp 1187b7: 53 push %ebx 1187b8: 8b 55 08 mov 0x8(%ebp),%edx 1187bb: 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; 1187be: b8 01 00 00 00 mov $0x1,%eax 1187c3: 2b 42 08 sub 0x8(%edx),%eax 1187c6: 03 45 0c add 0xc(%ebp),%eax if ( information->maximum >= index ) { 1187c9: 0f b7 5a 10 movzwl 0x10(%edx),%ebx 1187cd: 39 c3 cmp %eax,%ebx 1187cf: 72 12 jb 1187e3 <_Objects_Get_no_protection+0x2f> if ( (the_object = information->local_table[ index ]) != NULL ) { 1187d1: 8b 52 1c mov 0x1c(%edx),%edx 1187d4: 8b 04 82 mov (%edx,%eax,4),%eax 1187d7: 85 c0 test %eax,%eax 1187d9: 74 08 je 1187e3 <_Objects_Get_no_protection+0x2f><== NEVER TAKEN *location = OBJECTS_LOCAL; 1187db: c7 01 00 00 00 00 movl $0x0,(%ecx) return the_object; 1187e1: eb 08 jmp 1187eb <_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; 1187e3: c7 01 01 00 00 00 movl $0x1,(%ecx) return NULL; 1187e9: 31 c0 xor %eax,%eax } 1187eb: 5b pop %ebx 1187ec: 5d pop %ebp 1187ed: c3 ret =============================================================================== 0010e310 <_Objects_Id_to_name>: */ Objects_Name_or_id_lookup_errors _Objects_Id_to_name ( Objects_Id id, Objects_Name *name ) { 10e310: 55 push %ebp 10e311: 89 e5 mov %esp,%ebp 10e313: 83 ec 18 sub $0x18,%esp /* * Caller is trusted for name != NULL. */ tmpId = (id == OBJECTS_ID_OF_SELF) ? _Thread_Executing->Object.id : id; 10e316: 8b 45 08 mov 0x8(%ebp),%eax 10e319: 85 c0 test %eax,%eax 10e31b: 75 08 jne 10e325 <_Objects_Id_to_name+0x15> 10e31d: a1 ec a1 13 00 mov 0x13a1ec,%eax 10e322: 8b 40 08 mov 0x8(%eax),%eax 10e325: 89 c2 mov %eax,%edx 10e327: c1 ea 18 shr $0x18,%edx 10e32a: 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 ) 10e32d: 8d 4a ff lea -0x1(%edx),%ecx 10e330: 83 f9 02 cmp $0x2,%ecx 10e333: 76 3d jbe 10e372 <_Objects_Id_to_name+0x62> the_api = _Objects_Get_API( tmpId ); if ( !_Objects_Is_api_valid( the_api ) ) return OBJECTS_INVALID_ID; 10e335: b8 03 00 00 00 mov $0x3,%eax 10e33a: eb 43 jmp 10e37f <_Objects_Id_to_name+0x6f> */ RTEMS_INLINE_ROUTINE uint32_t _Objects_Get_class( Objects_Id id ) { return (uint32_t) 10e33c: 89 c1 mov %eax,%ecx 10e33e: c1 e9 1b shr $0x1b,%ecx if ( !_Objects_Information_table[ the_api ] ) return OBJECTS_INVALID_ID; the_class = _Objects_Get_class( tmpId ); information = _Objects_Information_table[ the_api ][ the_class ]; 10e341: 8b 14 8a mov (%edx,%ecx,4),%edx if ( !information ) 10e344: 85 d2 test %edx,%edx 10e346: 74 ed je 10e335 <_Objects_Id_to_name+0x25><== NEVER TAKEN return OBJECTS_INVALID_ID; #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES) if ( information->is_string ) 10e348: 80 7a 38 00 cmpb $0x0,0x38(%edx) 10e34c: 75 e7 jne 10e335 <_Objects_Id_to_name+0x25><== NEVER TAKEN return OBJECTS_INVALID_ID; #endif the_object = _Objects_Get( information, tmpId, &ignored_location ); 10e34e: 51 push %ecx 10e34f: 8d 4d f4 lea -0xc(%ebp),%ecx 10e352: 51 push %ecx 10e353: 50 push %eax 10e354: 52 push %edx 10e355: e8 56 ff ff ff call 10e2b0 <_Objects_Get> if ( !the_object ) 10e35a: 83 c4 10 add $0x10,%esp 10e35d: 85 c0 test %eax,%eax 10e35f: 74 d4 je 10e335 <_Objects_Id_to_name+0x25> return OBJECTS_INVALID_ID; *name = the_object->name; 10e361: 8b 50 0c mov 0xc(%eax),%edx 10e364: 8b 45 0c mov 0xc(%ebp),%eax 10e367: 89 10 mov %edx,(%eax) _Thread_Enable_dispatch(); 10e369: e8 5a 0b 00 00 call 10eec8 <_Thread_Enable_dispatch> return OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL; 10e36e: 31 c0 xor %eax,%eax 10e370: eb 0d jmp 10e37f <_Objects_Id_to_name+0x6f> the_api = _Objects_Get_API( tmpId ); if ( !_Objects_Is_api_valid( the_api ) ) return OBJECTS_INVALID_ID; if ( !_Objects_Information_table[ the_api ] ) 10e372: 8b 14 95 7c 9c 13 00 mov 0x139c7c(,%edx,4),%edx 10e379: 85 d2 test %edx,%edx 10e37b: 75 bf jne 10e33c <_Objects_Id_to_name+0x2c> 10e37d: eb b6 jmp 10e335 <_Objects_Id_to_name+0x25> return OBJECTS_INVALID_ID; *name = the_object->name; _Thread_Enable_dispatch(); return OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL; } 10e37f: c9 leave 10e380: c3 ret =============================================================================== 00110704 <_POSIX_Keys_Run_destructors>: */ void _POSIX_Keys_Run_destructors( Thread_Control *thread ) { 110704: 55 push %ebp 110705: 89 e5 mov %esp,%ebp 110707: 57 push %edi 110708: 56 push %esi 110709: 53 push %ebx 11070a: 83 ec 1c sub $0x1c,%esp Objects_Maximum thread_index = _Objects_Get_index( thread->Object.id ); 11070d: 8b 45 08 mov 0x8(%ebp),%eax 110710: 8b 40 08 mov 0x8(%eax),%eax 110713: 89 c6 mov %eax,%esi 110715: c1 ee 18 shr $0x18,%esi 110718: 83 e6 07 and $0x7,%esi for ( index = 1 ; index <= max ; ++index ) { POSIX_Keys_Control *key = (POSIX_Keys_Control *) _POSIX_Keys_Information.local_table [ index ]; if ( key != NULL && key->destructor != NULL ) { void *value = key->Values [ thread_api ][ thread_index ]; 11071b: 25 ff ff 00 00 and $0xffff,%eax 110720: c1 e0 02 shl $0x2,%eax 110723: 89 45 e0 mov %eax,-0x20(%ebp) * * Reference: 17.1.1.2 P1003.1c/Draft 10, p. 163, line 99. */ while ( !done ) { Objects_Maximum index = 0; Objects_Maximum max = _POSIX_Keys_Information.maximum; 110726: a1 d0 e7 12 00 mov 0x12e7d0,%eax 11072b: 66 89 45 e6 mov %ax,-0x1a(%ebp) done = true; for ( index = 1 ; index <= max ; ++index ) { 11072f: bb 01 00 00 00 mov $0x1,%ebx */ while ( !done ) { Objects_Maximum index = 0; Objects_Maximum max = _POSIX_Keys_Information.maximum; done = true; 110734: b2 01 mov $0x1,%dl for ( index = 1 ; index <= max ; ++index ) { 110736: eb 35 jmp 11076d <_POSIX_Keys_Run_destructors+0x69> POSIX_Keys_Control *key = (POSIX_Keys_Control *) _POSIX_Keys_Information.local_table [ index ]; 110738: 0f b7 cb movzwl %bx,%ecx Objects_Maximum max = _POSIX_Keys_Information.maximum; done = true; for ( index = 1 ; index <= max ; ++index ) { POSIX_Keys_Control *key = (POSIX_Keys_Control *) 11073b: a1 dc e7 12 00 mov 0x12e7dc,%eax 110740: 8b 04 88 mov (%eax,%ecx,4),%eax _POSIX_Keys_Information.local_table [ index ]; if ( key != NULL && key->destructor != NULL ) { 110743: 85 c0 test %eax,%eax 110745: 74 25 je 11076c <_POSIX_Keys_Run_destructors+0x68> 110747: 83 78 10 00 cmpl $0x0,0x10(%eax) 11074b: 74 1f je 11076c <_POSIX_Keys_Run_destructors+0x68> void *value = key->Values [ thread_api ][ thread_index ]; 11074d: 8b 7d e0 mov -0x20(%ebp),%edi 110750: 03 7c b0 14 add 0x14(%eax,%esi,4),%edi 110754: 8b 0f mov (%edi),%ecx if ( value != NULL ) { 110756: 85 c9 test %ecx,%ecx 110758: 74 12 je 11076c <_POSIX_Keys_Run_destructors+0x68><== ALWAYS TAKEN key->Values [ thread_api ][ thread_index ] = NULL; 11075a: c7 07 00 00 00 00 movl $0x0,(%edi) <== NOT EXECUTED (*key->destructor)( value ); 110760: 83 ec 0c sub $0xc,%esp <== NOT EXECUTED 110763: 51 push %ecx <== NOT EXECUTED 110764: ff 50 10 call *0x10(%eax) <== NOT EXECUTED 110767: 83 c4 10 add $0x10,%esp <== NOT EXECUTED done = false; 11076a: 31 d2 xor %edx,%edx <== NOT EXECUTED Objects_Maximum index = 0; Objects_Maximum max = _POSIX_Keys_Information.maximum; done = true; for ( index = 1 ; index <= max ; ++index ) { 11076c: 43 inc %ebx 11076d: 66 3b 5d e6 cmp -0x1a(%ebp),%bx 110771: 76 c5 jbe 110738 <_POSIX_Keys_Run_destructors+0x34> * number of iterations. An infinite loop may happen if destructors set * thread specific data. This can be considered dubious. * * Reference: 17.1.1.2 P1003.1c/Draft 10, p. 163, line 99. */ while ( !done ) { 110773: 84 d2 test %dl,%dl 110775: 74 af je 110726 <_POSIX_Keys_Run_destructors+0x22><== NEVER TAKEN done = false; } } } } } 110777: 8d 65 f4 lea -0xc(%ebp),%esp 11077a: 5b pop %ebx 11077b: 5e pop %esi 11077c: 5f pop %edi 11077d: 5d pop %ebp 11077e: c3 ret =============================================================================== 0010dd3c <_POSIX_Message_queue_Receive_support>: size_t msg_len, unsigned int *msg_prio, bool wait, Watchdog_Interval timeout ) { 10dd3c: 55 push %ebp 10dd3d: 89 e5 mov %esp,%ebp 10dd3f: 57 push %edi 10dd40: 56 push %esi 10dd41: 53 push %ebx 10dd42: 83 ec 30 sub $0x30,%esp 10dd45: 8b 75 08 mov 0x8(%ebp),%esi 10dd48: 8b 5d 14 mov 0x14(%ebp),%ebx 10dd4b: 8a 4d 18 mov 0x18(%ebp),%cl POSIX_Message_queue_Control_fd *the_mq_fd; Objects_Locations location; size_t length_out; bool do_wait; the_mq_fd = _POSIX_Message_queue_Get_fd( mqdes, &location ); 10dd4e: 8d 45 e0 lea -0x20(%ebp),%eax 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( 10dd51: 50 push %eax 10dd52: 56 push %esi 10dd53: 68 b4 5d 13 00 push $0x135db4 10dd58: 88 4d d4 mov %cl,-0x2c(%ebp) 10dd5b: e8 34 2b 00 00 call 110894 <_Objects_Get> switch ( location ) { 10dd60: 83 c4 10 add $0x10,%esp 10dd63: 83 7d e0 00 cmpl $0x0,-0x20(%ebp) 10dd67: 8a 4d d4 mov -0x2c(%ebp),%cl 10dd6a: 0f 85 b6 00 00 00 jne 10de26 <_POSIX_Message_queue_Receive_support+0xea> case OBJECTS_LOCAL: if ( (the_mq_fd->oflag & O_ACCMODE) == O_WRONLY ) { 10dd70: 8b 78 14 mov 0x14(%eax),%edi 10dd73: 89 fa mov %edi,%edx 10dd75: 83 e2 03 and $0x3,%edx 10dd78: 4a dec %edx 10dd79: 75 0a jne 10dd85 <_POSIX_Message_queue_Receive_support+0x49> _Thread_Enable_dispatch(); 10dd7b: e8 c4 36 00 00 call 111444 <_Thread_Enable_dispatch> 10dd80: e9 a1 00 00 00 jmp 10de26 <_POSIX_Message_queue_Receive_support+0xea> rtems_set_errno_and_return_minus_one( EBADF ); } the_mq = the_mq_fd->Queue; 10dd85: 8b 50 10 mov 0x10(%eax),%edx if ( msg_len < the_mq->Message_queue.maximum_message_size ) { 10dd88: 8b 42 68 mov 0x68(%edx),%eax 10dd8b: 39 45 10 cmp %eax,0x10(%ebp) 10dd8e: 73 15 jae 10dda5 <_POSIX_Message_queue_Receive_support+0x69> _Thread_Enable_dispatch(); 10dd90: e8 af 36 00 00 call 111444 <_Thread_Enable_dispatch> rtems_set_errno_and_return_minus_one( EMSGSIZE ); 10dd95: e8 a6 88 00 00 call 116640 <__errno> 10dd9a: c7 00 7a 00 00 00 movl $0x7a,(%eax) 10dda0: e9 8c 00 00 00 jmp 10de31 <_POSIX_Message_queue_Receive_support+0xf5> /* * Now if something goes wrong, we return a "length" of -1 * to indicate an error. */ length_out = -1; 10dda5: c7 45 e4 ff ff ff ff movl $0xffffffff,-0x1c(%ebp) /* * A timed receive with a bad time will do a poll regardless. */ if ( wait ) 10ddac: 31 c0 xor %eax,%eax 10ddae: 84 c9 test %cl,%cl 10ddb0: 74 0b je 10ddbd <_POSIX_Message_queue_Receive_support+0x81> do_wait = (the_mq_fd->oflag & O_NONBLOCK) ? false : true; 10ddb2: 89 f8 mov %edi,%eax 10ddb4: c1 e8 0e shr $0xe,%eax 10ddb7: 83 f0 01 xor $0x1,%eax 10ddba: 83 e0 01 and $0x1,%eax do_wait = wait; /* * Now perform the actual message receive */ _CORE_message_queue_Seize( 10ddbd: 51 push %ecx 10ddbe: 51 push %ecx 10ddbf: ff 75 1c pushl 0x1c(%ebp) 10ddc2: 0f b6 c0 movzbl %al,%eax 10ddc5: 50 push %eax 10ddc6: 8d 45 e4 lea -0x1c(%ebp),%eax 10ddc9: 50 push %eax 10ddca: ff 75 0c pushl 0xc(%ebp) 10ddcd: 56 push %esi 10ddce: 83 c2 1c add $0x1c,%edx 10ddd1: 52 push %edx 10ddd2: e8 dd 1c 00 00 call 10fab4 <_CORE_message_queue_Seize> &length_out, do_wait, timeout ); _Thread_Enable_dispatch(); 10ddd7: 83 c4 20 add $0x20,%esp 10ddda: e8 65 36 00 00 call 111444 <_Thread_Enable_dispatch> if (msg_prio) { 10dddf: 85 db test %ebx,%ebx 10dde1: 74 15 je 10ddf8 <_POSIX_Message_queue_Receive_support+0xbc><== NEVER TAKEN *msg_prio = _POSIX_Message_queue_Priority_from_core( _Thread_Executing->Wait.count 10dde3: 8b 15 2c 5e 13 00 mov 0x135e2c,%edx RTEMS_INLINE_ROUTINE unsigned int _POSIX_Message_queue_Priority_from_core( CORE_message_queue_Submit_types priority ) { /* absolute value without a library dependency */ return (unsigned int) ((priority >= 0) ? priority : -priority); 10dde9: 8b 42 24 mov 0x24(%edx),%eax 10ddec: c1 f8 1f sar $0x1f,%eax 10ddef: 8b 52 24 mov 0x24(%edx),%edx 10ddf2: 31 c2 xor %eax,%edx 10ddf4: 89 13 mov %edx,(%ebx) 10ddf6: 29 03 sub %eax,(%ebx) ); } if ( !_Thread_Executing->Wait.return_code ) 10ddf8: a1 2c 5e 13 00 mov 0x135e2c,%eax 10ddfd: 83 78 34 00 cmpl $0x0,0x34(%eax) 10de01: 75 05 jne 10de08 <_POSIX_Message_queue_Receive_support+0xcc> return length_out; 10de03: 8b 45 e4 mov -0x1c(%ebp),%eax 10de06: eb 2c jmp 10de34 <_POSIX_Message_queue_Receive_support+0xf8> rtems_set_errno_and_return_minus_one( 10de08: e8 33 88 00 00 call 116640 <__errno> 10de0d: 89 c3 mov %eax,%ebx 10de0f: 83 ec 0c sub $0xc,%esp 10de12: a1 2c 5e 13 00 mov 0x135e2c,%eax 10de17: ff 70 34 pushl 0x34(%eax) 10de1a: e8 f1 01 00 00 call 10e010 <_POSIX_Message_queue_Translate_core_message_queue_return_code> 10de1f: 89 03 mov %eax,(%ebx) 10de21: 83 c4 10 add $0x10,%esp 10de24: eb 0b jmp 10de31 <_POSIX_Message_queue_Receive_support+0xf5> #endif case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( EBADF ); 10de26: e8 15 88 00 00 call 116640 <__errno> 10de2b: c7 00 09 00 00 00 movl $0x9,(%eax) 10de31: 83 c8 ff or $0xffffffff,%eax } 10de34: 8d 65 f4 lea -0xc(%ebp),%esp 10de37: 5b pop %ebx 10de38: 5e pop %esi 10de39: 5f pop %edi 10de3a: 5d pop %ebp 10de3b: c3 ret =============================================================================== 001100d8 <_POSIX_Semaphore_Create_support>: size_t name_len, int pshared, unsigned int value, POSIX_Semaphore_Control **the_sem ) { 1100d8: 55 push %ebp 1100d9: 89 e5 mov %esp,%ebp 1100db: 56 push %esi 1100dc: 53 push %ebx 1100dd: 8b 75 08 mov 0x8(%ebp),%esi POSIX_Semaphore_Control *the_semaphore; CORE_semaphore_Attributes *the_sem_attr; char *name; /* Sharing semaphores among processes is not currently supported */ if (pshared != 0) 1100e0: 83 7d 10 00 cmpl $0x0,0x10(%ebp) 1100e4: 74 0d je 1100f3 <_POSIX_Semaphore_Create_support+0x1b> rtems_set_errno_and_return_minus_one( ENOSYS ); 1100e6: e8 ad 27 00 00 call 112898 <__errno> 1100eb: c7 00 58 00 00 00 movl $0x58,(%eax) 1100f1: eb 36 jmp 110129 <_POSIX_Semaphore_Create_support+0x51> * * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { _Thread_Dispatch_disable_level++; 1100f3: a1 b4 31 13 00 mov 0x1331b4,%eax 1100f8: 40 inc %eax 1100f9: a3 b4 31 13 00 mov %eax,0x1331b4 return _Thread_Dispatch_disable_level; 1100fe: a1 b4 31 13 00 mov 0x1331b4,%eax * _POSIX_Semaphore_Allocate */ RTEMS_INLINE_ROUTINE POSIX_Semaphore_Control *_POSIX_Semaphore_Allocate( void ) { return (POSIX_Semaphore_Control *) 110103: 83 ec 0c sub $0xc,%esp 110106: 68 78 34 13 00 push $0x133478 11010b: e8 a8 c5 ff ff call 10c6b8 <_Objects_Allocate> 110110: 89 c3 mov %eax,%ebx _Thread_Disable_dispatch(); the_semaphore = _POSIX_Semaphore_Allocate(); if ( !the_semaphore ) { 110112: 83 c4 10 add $0x10,%esp 110115: 85 c0 test %eax,%eax 110117: 75 18 jne 110131 <_POSIX_Semaphore_Create_support+0x59> _Thread_Enable_dispatch(); 110119: e8 9e d5 ff ff call 10d6bc <_Thread_Enable_dispatch> rtems_set_errno_and_return_minus_one( ENOSPC ); 11011e: e8 75 27 00 00 call 112898 <__errno> 110123: c7 00 1c 00 00 00 movl $0x1c,(%eax) 110129: 83 c8 ff or $0xffffffff,%eax 11012c: e9 a4 00 00 00 jmp 1101d5 <_POSIX_Semaphore_Create_support+0xfd> /* * Make a copy of the user's string for name just in case it was * dynamically constructed. */ if ( name_arg != NULL ) { 110131: 85 f6 test %esi,%esi 110133: 74 36 je 11016b <_POSIX_Semaphore_Create_support+0x93> name = _Workspace_String_duplicate( name_arg, name_len ); 110135: 51 push %ecx 110136: 51 push %ecx 110137: ff 75 0c pushl 0xc(%ebp) 11013a: 56 push %esi 11013b: e8 d4 12 00 00 call 111414 <_Workspace_String_duplicate> 110140: 89 c6 mov %eax,%esi if ( !name ) { 110142: 83 c4 10 add $0x10,%esp 110145: 85 c0 test %eax,%eax 110147: 75 24 jne 11016d <_POSIX_Semaphore_Create_support+0x95><== ALWAYS TAKEN RTEMS_INLINE_ROUTINE void _POSIX_Semaphore_Free ( POSIX_Semaphore_Control *the_semaphore ) { _Objects_Free( &_POSIX_Semaphore_Information, &the_semaphore->Object ); 110149: 52 push %edx <== NOT EXECUTED 11014a: 52 push %edx <== NOT EXECUTED 11014b: 53 push %ebx <== NOT EXECUTED 11014c: 68 78 34 13 00 push $0x133478 <== NOT EXECUTED 110151: e8 42 c8 ff ff call 10c998 <_Objects_Free> <== NOT EXECUTED _POSIX_Semaphore_Free( the_semaphore ); _Thread_Enable_dispatch(); 110156: e8 61 d5 ff ff call 10d6bc <_Thread_Enable_dispatch><== NOT EXECUTED rtems_set_errno_and_return_minus_one( ENOMEM ); 11015b: e8 38 27 00 00 call 112898 <__errno> <== NOT EXECUTED 110160: c7 00 0c 00 00 00 movl $0xc,(%eax) <== NOT EXECUTED 110166: 83 c4 10 add $0x10,%esp <== NOT EXECUTED 110169: eb be jmp 110129 <_POSIX_Semaphore_Create_support+0x51><== NOT EXECUTED } } else { name = NULL; 11016b: 31 f6 xor %esi,%esi } the_semaphore->process_shared = pshared; 11016d: c7 43 10 00 00 00 00 movl $0x0,0x10(%ebx) if ( name ) { 110174: 85 f6 test %esi,%esi 110176: 74 11 je 110189 <_POSIX_Semaphore_Create_support+0xb1> the_semaphore->named = true; 110178: c6 43 14 01 movb $0x1,0x14(%ebx) the_semaphore->open_count = 1; 11017c: c7 43 18 01 00 00 00 movl $0x1,0x18(%ebx) the_semaphore->linked = true; 110183: c6 43 15 01 movb $0x1,0x15(%ebx) 110187: eb 0f jmp 110198 <_POSIX_Semaphore_Create_support+0xc0> } else { the_semaphore->named = false; 110189: c6 43 14 00 movb $0x0,0x14(%ebx) the_semaphore->open_count = 0; 11018d: c7 43 18 00 00 00 00 movl $0x0,0x18(%ebx) the_semaphore->linked = false; 110194: c6 43 15 00 movb $0x0,0x15(%ebx) * blocking tasks on this semaphore should be. It could somehow * be derived from the current scheduling policy. One * thing is certain, no matter what we decide, it won't be * the same as all other POSIX implementations. :) */ the_sem_attr->discipline = CORE_SEMAPHORE_DISCIPLINES_FIFO; 110198: c7 43 60 00 00 00 00 movl $0x0,0x60(%ebx) /* * This effectively disables limit checking. */ the_sem_attr->maximum_count = 0xFFFFFFFF; 11019f: c7 43 5c ff ff ff ff movl $0xffffffff,0x5c(%ebx) _CORE_semaphore_Initialize( &the_semaphore->Semaphore, the_sem_attr, value ); 1101a6: 50 push %eax 1101a7: ff 75 14 pushl 0x14(%ebp) the_semaphore->named = false; the_semaphore->open_count = 0; the_semaphore->linked = false; } the_sem_attr = &the_semaphore->Semaphore.Attributes; 1101aa: 8d 43 5c lea 0x5c(%ebx),%eax /* * This effectively disables limit checking. */ the_sem_attr->maximum_count = 0xFFFFFFFF; _CORE_semaphore_Initialize( &the_semaphore->Semaphore, the_sem_attr, value ); 1101ad: 50 push %eax 1101ae: 8d 43 1c lea 0x1c(%ebx),%eax 1101b1: 50 push %eax 1101b2: e8 e9 bf ff ff call 10c1a0 <_CORE_semaphore_Initialize> Objects_Information *information, Objects_Control *the_object, const char *name ) { _Objects_Set_local_object( 1101b7: 0f b7 53 08 movzwl 0x8(%ebx),%edx #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 1101bb: a1 94 34 13 00 mov 0x133494,%eax 1101c0: 89 1c 90 mov %ebx,(%eax,%edx,4) the_object ); #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES) /* ASSERT: information->is_string */ the_object->name.name_p = name; 1101c3: 89 73 0c mov %esi,0xc(%ebx) &_POSIX_Semaphore_Information, &the_semaphore->Object, name ); *the_sem = the_semaphore; 1101c6: 8b 45 18 mov 0x18(%ebp),%eax 1101c9: 89 18 mov %ebx,(%eax) _Thread_Enable_dispatch(); 1101cb: e8 ec d4 ff ff call 10d6bc <_Thread_Enable_dispatch> return 0; 1101d0: 83 c4 10 add $0x10,%esp 1101d3: 31 c0 xor %eax,%eax } 1101d5: 8d 65 f8 lea -0x8(%ebp),%esp 1101d8: 5b pop %ebx 1101d9: 5e pop %esi 1101da: 5d pop %ebp 1101db: c3 ret =============================================================================== 0010e1a8 <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch>: #include void _POSIX_Thread_Evaluate_cancellation_and_enable_dispatch( Thread_Control *the_thread ) { 10e1a8: 55 push %ebp 10e1a9: 89 e5 mov %esp,%ebp 10e1ab: 83 ec 08 sub $0x8,%esp 10e1ae: 8b 55 08 mov 0x8(%ebp),%edx POSIX_API_Control *thread_support; thread_support = the_thread->API_Extensions[ THREAD_API_POSIX ]; 10e1b1: 8b 82 e8 00 00 00 mov 0xe8(%edx),%eax if ( thread_support->cancelability_state == PTHREAD_CANCEL_ENABLE && 10e1b7: 83 b8 d8 00 00 00 00 cmpl $0x0,0xd8(%eax) 10e1be: 75 31 jne 10e1f1 <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch+0x49><== NEVER TAKEN 10e1c0: 83 b8 dc 00 00 00 01 cmpl $0x1,0xdc(%eax) 10e1c7: 75 28 jne 10e1f1 <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch+0x49> thread_support->cancelability_type == PTHREAD_CANCEL_ASYNCHRONOUS && 10e1c9: 83 b8 e0 00 00 00 00 cmpl $0x0,0xe0(%eax) 10e1d0: 74 1f je 10e1f1 <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch+0x49> * * This routine decrements the thread dispatch level. */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_decrement_disable_level(void) { _Thread_Dispatch_disable_level--; 10e1d2: a1 dc e3 12 00 mov 0x12e3dc,%eax 10e1d7: 48 dec %eax 10e1d8: a3 dc e3 12 00 mov %eax,0x12e3dc return _Thread_Dispatch_disable_level; 10e1dd: a1 dc e3 12 00 mov 0x12e3dc,%eax thread_support->cancelation_requested ) { _Thread_Unnest_dispatch(); _POSIX_Thread_Exit( the_thread, PTHREAD_CANCELED ); 10e1e2: 50 push %eax 10e1e3: 50 push %eax 10e1e4: 6a ff push $0xffffffff 10e1e6: 52 push %edx 10e1e7: e8 e4 05 00 00 call 10e7d0 <_POSIX_Thread_Exit> 10e1ec: 83 c4 10 add $0x10,%esp 10e1ef: eb 06 jmp 10e1f7 <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch+0x4f> } else _Thread_Enable_dispatch(); } 10e1f1: 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(); 10e1f2: e9 61 dd ff ff jmp 10bf58 <_Thread_Enable_dispatch> } 10e1f7: c9 leave 10e1f8: c3 ret =============================================================================== 0010f20c <_POSIX_Thread_Translate_sched_param>: int policy, struct sched_param *param, Thread_CPU_budget_algorithms *budget_algorithm, Thread_CPU_budget_algorithm_callout *budget_callout ) { 10f20c: 55 push %ebp 10f20d: 89 e5 mov %esp,%ebp 10f20f: 57 push %edi 10f210: 56 push %esi 10f211: 53 push %ebx 10f212: 83 ec 18 sub $0x18,%esp 10f215: 8b 75 08 mov 0x8(%ebp),%esi 10f218: 8b 7d 0c mov 0xc(%ebp),%edi 10f21b: 8b 5d 10 mov 0x10(%ebp),%ebx if ( !_POSIX_Priority_Is_valid( param->sched_priority ) ) 10f21e: ff 37 pushl (%edi) 10f220: e8 c7 ff ff ff call 10f1ec <_POSIX_Priority_Is_valid> 10f225: 83 c4 10 add $0x10,%esp 10f228: 84 c0 test %al,%al 10f22a: 75 0a jne 10f236 <_POSIX_Thread_Translate_sched_param+0x2a><== ALWAYS TAKEN return EINVAL; 10f22c: b8 16 00 00 00 mov $0x16,%eax 10f231: e9 91 00 00 00 jmp 10f2c7 <_POSIX_Thread_Translate_sched_param+0xbb> *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE; 10f236: c7 03 00 00 00 00 movl $0x0,(%ebx) *budget_callout = NULL; 10f23c: 8b 45 14 mov 0x14(%ebp),%eax 10f23f: c7 00 00 00 00 00 movl $0x0,(%eax) if ( policy == SCHED_OTHER ) { 10f245: 85 f6 test %esi,%esi 10f247: 75 08 jne 10f251 <_POSIX_Thread_Translate_sched_param+0x45> *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE; 10f249: c7 03 01 00 00 00 movl $0x1,(%ebx) 10f24f: eb 74 jmp 10f2c5 <_POSIX_Thread_Translate_sched_param+0xb9> return 0; } if ( policy == SCHED_FIFO ) { 10f251: 83 fe 01 cmp $0x1,%esi 10f254: 74 6f je 10f2c5 <_POSIX_Thread_Translate_sched_param+0xb9> *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE; return 0; } if ( policy == SCHED_RR ) { 10f256: 83 fe 02 cmp $0x2,%esi 10f259: 75 08 jne 10f263 <_POSIX_Thread_Translate_sched_param+0x57> *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_EXHAUST_TIMESLICE; 10f25b: c7 03 02 00 00 00 movl $0x2,(%ebx) 10f261: eb 62 jmp 10f2c5 <_POSIX_Thread_Translate_sched_param+0xb9> return 0; } if ( policy == SCHED_SPORADIC ) { 10f263: 83 fe 04 cmp $0x4,%esi 10f266: 75 c4 jne 10f22c <_POSIX_Thread_Translate_sched_param+0x20> if ( (param->sched_ss_repl_period.tv_sec == 0) && 10f268: 83 7f 08 00 cmpl $0x0,0x8(%edi) 10f26c: 75 06 jne 10f274 <_POSIX_Thread_Translate_sched_param+0x68> 10f26e: 83 7f 0c 00 cmpl $0x0,0xc(%edi) 10f272: 74 b8 je 10f22c <_POSIX_Thread_Translate_sched_param+0x20> (param->sched_ss_repl_period.tv_nsec == 0) ) return EINVAL; if ( (param->sched_ss_init_budget.tv_sec == 0) && 10f274: 83 7f 10 00 cmpl $0x0,0x10(%edi) 10f278: 75 06 jne 10f280 <_POSIX_Thread_Translate_sched_param+0x74> 10f27a: 83 7f 14 00 cmpl $0x0,0x14(%edi) 10f27e: 74 ac je 10f22c <_POSIX_Thread_Translate_sched_param+0x20> (param->sched_ss_init_budget.tv_nsec == 0) ) return EINVAL; if ( _Timespec_To_ticks( ¶m->sched_ss_repl_period ) < 10f280: 83 ec 0c sub $0xc,%esp 10f283: 8d 47 08 lea 0x8(%edi),%eax 10f286: 50 push %eax 10f287: e8 74 e1 ff ff call 10d400 <_Timespec_To_ticks> 10f28c: 89 c6 mov %eax,%esi _Timespec_To_ticks( ¶m->sched_ss_init_budget ) ) 10f28e: 8d 47 10 lea 0x10(%edi),%eax 10f291: 89 04 24 mov %eax,(%esp) 10f294: e8 67 e1 ff ff call 10d400 <_Timespec_To_ticks> if ( (param->sched_ss_init_budget.tv_sec == 0) && (param->sched_ss_init_budget.tv_nsec == 0) ) return EINVAL; if ( _Timespec_To_ticks( ¶m->sched_ss_repl_period ) < 10f299: 83 c4 10 add $0x10,%esp 10f29c: 39 c6 cmp %eax,%esi 10f29e: 72 8c jb 10f22c <_POSIX_Thread_Translate_sched_param+0x20> _Timespec_To_ticks( ¶m->sched_ss_init_budget ) ) return EINVAL; if ( !_POSIX_Priority_Is_valid( param->sched_ss_low_priority ) ) 10f2a0: 83 ec 0c sub $0xc,%esp 10f2a3: ff 77 04 pushl 0x4(%edi) 10f2a6: e8 41 ff ff ff call 10f1ec <_POSIX_Priority_Is_valid> 10f2ab: 83 c4 10 add $0x10,%esp 10f2ae: 84 c0 test %al,%al 10f2b0: 0f 84 76 ff ff ff je 10f22c <_POSIX_Thread_Translate_sched_param+0x20> return EINVAL; *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_CALLOUT; 10f2b6: c7 03 03 00 00 00 movl $0x3,(%ebx) *budget_callout = _POSIX_Threads_Sporadic_budget_callout; 10f2bc: 8b 45 14 mov 0x14(%ebp),%eax 10f2bf: c7 00 fb a2 10 00 movl $0x10a2fb,(%eax) return 0; } if ( policy == SCHED_FIFO ) { *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE; return 0; 10f2c5: 31 c0 xor %eax,%eax *budget_callout = _POSIX_Threads_Sporadic_budget_callout; return 0; } return EINVAL; } 10f2c7: 8d 65 f4 lea -0xc(%ebp),%esp 10f2ca: 5b pop %ebx 10f2cb: 5e pop %esi 10f2cc: 5f pop %edi 10f2cd: 5d pop %ebp 10f2ce: c3 ret =============================================================================== 0010e3c1 <_POSIX_Threads_Delete_extension>: */ static void _POSIX_Threads_Delete_extension( Thread_Control *executing __attribute__((unused)), Thread_Control *deleted ) { 10e3c1: 55 push %ebp 10e3c2: 89 e5 mov %esp,%ebp 10e3c4: 57 push %edi 10e3c5: 56 push %esi 10e3c6: 53 push %ebx 10e3c7: 83 ec 28 sub $0x28,%esp 10e3ca: 8b 5d 0c mov 0xc(%ebp),%ebx Thread_Control *the_thread; POSIX_API_Control *api; void **value_ptr; api = deleted->API_Extensions[ THREAD_API_POSIX ]; 10e3cd: 8b b3 e8 00 00 00 mov 0xe8(%ebx),%esi /* * Run the POSIX cancellation handlers */ _POSIX_Threads_cancel_run( deleted ); 10e3d3: 53 push %ebx 10e3d4: e8 cb 22 00 00 call 1106a4 <_POSIX_Threads_cancel_run> /* * Run all the key destructors */ _POSIX_Keys_Run_destructors( deleted ); 10e3d9: 89 1c 24 mov %ebx,(%esp) 10e3dc: e8 23 23 00 00 call 110704 <_POSIX_Keys_Run_destructors> /* * Wakeup all the tasks which joined with this one */ value_ptr = (void **) deleted->Wait.return_argument; 10e3e1: 8b 53 28 mov 0x28(%ebx),%edx while ( (the_thread = _Thread_queue_Dequeue( &api->Join_List )) ) 10e3e4: 83 c4 10 add $0x10,%esp 10e3e7: 8d 7e 44 lea 0x44(%esi),%edi 10e3ea: eb 05 jmp 10e3f1 <_POSIX_Threads_Delete_extension+0x30> *(void **)the_thread->Wait.return_argument = value_ptr; 10e3ec: 8b 40 28 mov 0x28(%eax),%eax <== NOT EXECUTED 10e3ef: 89 10 mov %edx,(%eax) <== NOT EXECUTED /* * Wakeup all the tasks which joined with this one */ value_ptr = (void **) deleted->Wait.return_argument; while ( (the_thread = _Thread_queue_Dequeue( &api->Join_List )) ) 10e3f1: 83 ec 0c sub $0xc,%esp 10e3f4: 57 push %edi 10e3f5: 89 55 e4 mov %edx,-0x1c(%ebp) 10e3f8: e8 77 dd ff ff call 10c174 <_Thread_queue_Dequeue> 10e3fd: 83 c4 10 add $0x10,%esp 10e400: 85 c0 test %eax,%eax 10e402: 8b 55 e4 mov -0x1c(%ebp),%edx 10e405: 75 e5 jne 10e3ec <_POSIX_Threads_Delete_extension+0x2b><== NEVER TAKEN *(void **)the_thread->Wait.return_argument = value_ptr; if ( api->schedpolicy == SCHED_SPORADIC ) 10e407: 83 be 84 00 00 00 04 cmpl $0x4,0x84(%esi) 10e40e: 75 12 jne 10e422 <_POSIX_Threads_Delete_extension+0x61> (void) _Watchdog_Remove( &api->Sporadic_timer ); 10e410: 83 ec 0c sub $0xc,%esp 10e413: 8d 86 a8 00 00 00 lea 0xa8(%esi),%eax 10e419: 50 push %eax 10e41a: e8 f9 e5 ff ff call 10ca18 <_Watchdog_Remove> 10e41f: 83 c4 10 add $0x10,%esp deleted->API_Extensions[ THREAD_API_POSIX ] = NULL; 10e422: c7 83 e8 00 00 00 00 movl $0x0,0xe8(%ebx) 10e429: 00 00 00 _Workspace_Free( api ); 10e42c: 89 75 08 mov %esi,0x8(%ebp) } 10e42f: 8d 65 f4 lea -0xc(%ebp),%esp 10e432: 5b pop %ebx 10e433: 5e pop %esi 10e434: 5f pop %edi 10e435: 5d pop %ebp if ( api->schedpolicy == SCHED_SPORADIC ) (void) _Watchdog_Remove( &api->Sporadic_timer ); deleted->API_Extensions[ THREAD_API_POSIX ] = NULL; _Workspace_Free( api ); 10e436: e9 22 e7 ff ff jmp 10cb5d <_Workspace_Free> =============================================================================== 0010a028 <_POSIX_Threads_Initialize_user_threads_body>: * * Output parameters: NONE */ void _POSIX_Threads_Initialize_user_threads_body(void) { 10a028: 55 push %ebp 10a029: 89 e5 mov %esp,%ebp 10a02b: 57 push %edi 10a02c: 56 push %esi 10a02d: 53 push %ebx 10a02e: 83 ec 6c sub $0x6c,%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; 10a031: 8b 3d c4 b1 12 00 mov 0x12b1c4,%edi maximum = Configuration_POSIX_API.number_of_initialization_threads; 10a037: 8b 15 c0 b1 12 00 mov 0x12b1c0,%edx if ( !user_threads || maximum == 0 ) 10a03d: 85 d2 test %edx,%edx 10a03f: 74 54 je 10a095 <_POSIX_Threads_Initialize_user_threads_body+0x6d><== NEVER TAKEN 10a041: 85 ff test %edi,%edi 10a043: 74 50 je 10a095 <_POSIX_Threads_Initialize_user_threads_body+0x6d><== NEVER TAKEN 10a045: 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 ); 10a047: 8d 75 a8 lea -0x58(%ebp),%esi 10a04a: 83 ec 0c sub $0xc,%esp 10a04d: 56 push %esi 10a04e: 89 55 94 mov %edx,-0x6c(%ebp) 10a051: e8 7a 52 00 00 call 10f2d0 (void) pthread_attr_setinheritsched( &attr, PTHREAD_EXPLICIT_SCHED ); 10a056: 59 pop %ecx 10a057: 58 pop %eax 10a058: 6a 02 push $0x2 10a05a: 56 push %esi 10a05b: e8 98 52 00 00 call 10f2f8 (void) pthread_attr_setstacksize(&attr, user_threads[ index ].stack_size); 10a060: 58 pop %eax 10a061: 5a pop %edx 10a062: ff 74 df 04 pushl 0x4(%edi,%ebx,8) 10a066: 56 push %esi 10a067: e8 b8 52 00 00 call 10f324 status = pthread_create( 10a06c: 6a 00 push $0x0 10a06e: ff 34 df pushl (%edi,%ebx,8) 10a071: 56 push %esi 10a072: 8d 45 a4 lea -0x5c(%ebp),%eax 10a075: 50 push %eax 10a076: e8 75 fc ff ff call 109cf0 &thread_id, &attr, user_threads[ index ].thread_entry, NULL ); if ( status ) 10a07b: 83 c4 20 add $0x20,%esp 10a07e: 85 c0 test %eax,%eax 10a080: 8b 55 94 mov -0x6c(%ebp),%edx 10a083: 74 0b je 10a090 <_POSIX_Threads_Initialize_user_threads_body+0x68> _Internal_error_Occurred( INTERNAL_ERROR_POSIX_API, true, status ); 10a085: 52 push %edx 10a086: 50 push %eax 10a087: 6a 01 push $0x1 10a089: 6a 02 push $0x2 10a08b: e8 98 1a 00 00 call 10bb28 <_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++ ) { 10a090: 43 inc %ebx 10a091: 39 d3 cmp %edx,%ebx 10a093: 75 b5 jne 10a04a <_POSIX_Threads_Initialize_user_threads_body+0x22><== NEVER TAKEN NULL ); if ( status ) _Internal_error_Occurred( INTERNAL_ERROR_POSIX_API, true, status ); } } 10a095: 8d 65 f4 lea -0xc(%ebp),%esp 10a098: 5b pop %ebx 10a099: 5e pop %esi 10a09a: 5f pop %edi 10a09b: 5d pop %ebp 10a09c: c3 ret =============================================================================== 0010e56d <_POSIX_Threads_Sporadic_budget_TSR>: */ void _POSIX_Threads_Sporadic_budget_TSR( Objects_Id id __attribute__((unused)), void *argument ) { 10e56d: 55 push %ebp 10e56e: 89 e5 mov %esp,%ebp 10e570: 56 push %esi 10e571: 53 push %ebx 10e572: 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 ]; 10e575: 8b b3 e8 00 00 00 mov 0xe8(%ebx),%esi /* ticks is guaranteed to be at least one */ ticks = _Timespec_To_ticks( &api->schedparam.sched_ss_init_budget ); 10e57b: 83 ec 0c sub $0xc,%esp 10e57e: 8d 86 98 00 00 00 lea 0x98(%esi),%eax 10e584: 50 push %eax 10e585: e8 a2 12 00 00 call 10f82c <_Timespec_To_ticks> the_thread->cpu_time_budget = ticks; 10e58a: 89 43 74 mov %eax,0x74(%ebx) RTEMS_INLINE_ROUTINE Priority_Control _POSIX_Priority_To_core( int priority ) { return (Priority_Control) (POSIX_SCHEDULER_MAXIMUM_PRIORITY - priority + 1); 10e58d: 0f b6 05 88 a1 12 00 movzbl 0x12a188,%eax 10e594: 2b 86 88 00 00 00 sub 0x88(%esi),%eax new_priority = _POSIX_Priority_To_core( api->schedparam.sched_priority ); the_thread->real_priority = new_priority; 10e59a: 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 ) { 10e59d: 83 c4 10 add $0x10,%esp 10e5a0: 83 7b 1c 00 cmpl $0x0,0x1c(%ebx) 10e5a4: 75 12 jne 10e5b8 <_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 ) { 10e5a6: 39 43 14 cmp %eax,0x14(%ebx) 10e5a9: 76 0d jbe 10e5b8 <_POSIX_Threads_Sporadic_budget_TSR+0x4b> _Thread_Change_priority( the_thread, new_priority, true ); 10e5ab: 52 push %edx 10e5ac: 6a 01 push $0x1 10e5ae: 50 push %eax 10e5af: 53 push %ebx 10e5b0: e8 67 d4 ff ff call 10ba1c <_Thread_Change_priority> 10e5b5: 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 ); 10e5b8: 83 ec 0c sub $0xc,%esp 10e5bb: 8d 86 90 00 00 00 lea 0x90(%esi),%eax 10e5c1: 50 push %eax 10e5c2: e8 65 12 00 00 call 10f82c <_Timespec_To_ticks> Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 10e5c7: 89 86 b4 00 00 00 mov %eax,0xb4(%esi) _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 10e5cd: 83 c4 10 add $0x10,%esp _Watchdog_Insert_ticks( &api->Sporadic_timer, ticks ); 10e5d0: 81 c6 a8 00 00 00 add $0xa8,%esi 10e5d6: 89 75 0c mov %esi,0xc(%ebp) 10e5d9: c7 45 08 88 e4 12 00 movl $0x12e488,0x8(%ebp) } 10e5e0: 8d 65 f8 lea -0x8(%ebp),%esp 10e5e3: 5b pop %ebx 10e5e4: 5e pop %esi 10e5e5: 5d pop %ebp 10e5e6: e9 19 e3 ff ff jmp 10c904 <_Watchdog_Insert> =============================================================================== 0010e5eb <_POSIX_Threads_Sporadic_budget_callout>: * _POSIX_Threads_Sporadic_budget_callout */ void _POSIX_Threads_Sporadic_budget_callout( Thread_Control *the_thread ) { 10e5eb: 55 push %ebp 10e5ec: 89 e5 mov %esp,%ebp 10e5ee: 83 ec 08 sub $0x8,%esp 10e5f1: 8b 45 08 mov 0x8(%ebp),%eax POSIX_API_Control *api; uint32_t new_priority; api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 10e5f4: 8b 88 e8 00 00 00 mov 0xe8(%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 */ 10e5fa: c7 40 74 ff ff ff ff movl $0xffffffff,0x74(%eax) 10e601: 0f b6 15 88 a1 12 00 movzbl 0x12a188,%edx 10e608: 2b 91 8c 00 00 00 sub 0x8c(%ecx),%edx new_priority = _POSIX_Priority_To_core(api->schedparam.sched_ss_low_priority); the_thread->real_priority = new_priority; 10e60e: 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 ) { 10e611: 83 78 1c 00 cmpl $0x0,0x1c(%eax) 10e615: 75 12 jne 10e629 <_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 ) { 10e617: 39 50 14 cmp %edx,0x14(%eax) 10e61a: 73 0d jae 10e629 <_POSIX_Threads_Sporadic_budget_callout+0x3e><== NEVER TAKEN _Thread_Change_priority( the_thread, new_priority, true ); 10e61c: 51 push %ecx 10e61d: 6a 01 push $0x1 10e61f: 52 push %edx 10e620: 50 push %eax 10e621: e8 f6 d3 ff ff call 10ba1c <_Thread_Change_priority> 10e626: 83 c4 10 add $0x10,%esp #if 0 printk( "lower priority\n" ); #endif } } } 10e629: c9 leave 10e62a: c3 ret =============================================================================== 00109bb8 <_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) { 109bb8: 55 push %ebp 109bb9: 89 e5 mov %esp,%ebp 109bbb: 57 push %edi 109bbc: 56 push %esi 109bbd: 53 push %ebx 109bbe: 83 ec 1c sub $0x1c,%esp 109bc1: 8b 5d 0c mov 0xc(%ebp),%ebx bool activated; ptimer = (POSIX_Timer_Control *)data; /* Increment the number of expirations. */ ptimer->overrun = ptimer->overrun + 1; 109bc4: ff 43 68 incl 0x68(%ebx) /* The timer must be reprogrammed */ if ( ( ptimer->timer_data.it_interval.tv_sec != 0 ) || 109bc7: 83 7b 54 00 cmpl $0x0,0x54(%ebx) 109bcb: 75 06 jne 109bd3 <_POSIX_Timer_TSR+0x1b> 109bcd: 83 7b 58 00 cmpl $0x0,0x58(%ebx) 109bd1: 74 5f je 109c32 <_POSIX_Timer_TSR+0x7a> <== NEVER TAKEN ( ptimer->timer_data.it_interval.tv_nsec != 0 ) ) { activated = _POSIX_Timer_Insert_helper( 109bd3: 83 ec 0c sub $0xc,%esp 109bd6: 53 push %ebx 109bd7: 68 b8 9b 10 00 push $0x109bb8 109bdc: ff 73 08 pushl 0x8(%ebx) 109bdf: ff 73 64 pushl 0x64(%ebx) 109be2: 8d 43 10 lea 0x10(%ebx),%eax 109be5: 50 push %eax 109be6: e8 65 51 00 00 call 10ed50 <_POSIX_Timer_Insert_helper> ptimer->ticks, ptimer->Object.id, _POSIX_Timer_TSR, ptimer ); if ( !activated ) 109beb: 83 c4 20 add $0x20,%esp 109bee: 84 c0 test %al,%al 109bf0: 74 5b je 109c4d <_POSIX_Timer_TSR+0x95> <== NEVER TAKEN struct timespec *tod_as_timespec ) { Timestamp_Control tod_as_timestamp; _TOD_Get_as_timestamp( &tod_as_timestamp ); 109bf2: 83 ec 0c sub $0xc,%esp 109bf5: 8d 45 e0 lea -0x20(%ebp),%eax 109bf8: 50 push %eax 109bf9: e8 5e 13 00 00 call 10af5c <_TOD_Get_as_timestamp> _Timestamp_To_timespec( &tod_as_timestamp, tod_as_timespec ); 109bfe: 8b 75 e0 mov -0x20(%ebp),%esi 109c01: 8b 7d e4 mov -0x1c(%ebp),%edi static inline void _Timestamp64_implementation_To_timespec( const Timestamp64_Control *_timestamp, struct timespec *_timespec ) { _timespec->tv_sec = (time_t) (*_timestamp / 1000000000L); 109c04: 6a 00 push $0x0 109c06: 68 00 ca 9a 3b push $0x3b9aca00 109c0b: 57 push %edi 109c0c: 56 push %esi 109c0d: e8 d2 3f 01 00 call 11dbe4 <__divdi3> 109c12: 83 c4 10 add $0x10,%esp 109c15: 89 43 6c mov %eax,0x6c(%ebx) _timespec->tv_nsec = (long) (*_timestamp % 1000000000L); 109c18: 6a 00 push $0x0 109c1a: 68 00 ca 9a 3b push $0x3b9aca00 109c1f: 57 push %edi 109c20: 56 push %esi 109c21: e8 12 41 01 00 call 11dd38 <__moddi3> 109c26: 89 43 70 mov %eax,0x70(%ebx) /* Store the time when the timer was started again */ _TOD_Get( &ptimer->time ); /* The state really did not change but just to be safe */ ptimer->state = POSIX_TIMER_STATE_CREATE_RUN; 109c29: c6 43 3c 03 movb $0x3,0x3c(%ebx) 109c2d: 83 c4 20 add $0x20,%esp 109c30: eb 04 jmp 109c36 <_POSIX_Timer_TSR+0x7e> } else { /* Indicates that the timer is stopped */ ptimer->state = POSIX_TIMER_STATE_CREATE_STOP; 109c32: c6 43 3c 04 movb $0x4,0x3c(%ebx) <== NOT EXECUTED /* * 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 ) ) { 109c36: 50 push %eax 109c37: 50 push %eax 109c38: ff 73 44 pushl 0x44(%ebx) 109c3b: ff 73 38 pushl 0x38(%ebx) 109c3e: e8 0d 4d 00 00 call 10e950 } /* After the signal handler returns, the count of expirations of the * timer must be set to 0. */ ptimer->overrun = 0; 109c43: c7 43 68 00 00 00 00 movl $0x0,0x68(%ebx) 109c4a: 83 c4 10 add $0x10,%esp } 109c4d: 8d 65 f4 lea -0xc(%ebp),%esp 109c50: 5b pop %ebx 109c51: 5e pop %esi 109c52: 5f pop %edi 109c53: 5d pop %ebp 109c54: c3 ret =============================================================================== 00110780 <_POSIX_signals_Check_signal>: bool _POSIX_signals_Check_signal( POSIX_API_Control *api, int signo, bool is_global ) { 110780: 55 push %ebp 110781: 89 e5 mov %esp,%ebp 110783: 57 push %edi 110784: 56 push %esi 110785: 53 push %ebx 110786: 83 ec 68 sub $0x68,%esp siginfo_t siginfo_struct; sigset_t saved_signals_blocked; Thread_Wait_information stored_thread_wait_information; if ( ! _POSIX_signals_Clear_signals( api, signo, &siginfo_struct, 110789: 6a 01 push $0x1 11078b: 0f b6 45 10 movzbl 0x10(%ebp),%eax 11078f: 50 push %eax 110790: 8d 45 b4 lea -0x4c(%ebp),%eax 110793: 50 push %eax 110794: ff 75 0c pushl 0xc(%ebp) 110797: ff 75 08 pushl 0x8(%ebp) 11079a: e8 91 00 00 00 call 110830 <_POSIX_signals_Clear_signals> 11079f: 83 c4 20 add $0x20,%esp is_global, true ) ) return false; 1107a2: 31 c9 xor %ecx,%ecx { siginfo_t siginfo_struct; sigset_t saved_signals_blocked; Thread_Wait_information stored_thread_wait_information; if ( ! _POSIX_signals_Clear_signals( api, signo, &siginfo_struct, 1107a4: 84 c0 test %al,%al 1107a6: 74 7d je 110825 <_POSIX_signals_Check_signal+0xa5> #endif /* * Just to prevent sending a signal which is currently being ignored. */ if ( _POSIX_signals_Vectors[ signo ].sa_handler == SIG_IGN ) 1107a8: 6b 55 0c 0c imul $0xc,0xc(%ebp),%edx 1107ac: 8b 9a 30 e9 12 00 mov 0x12e930(%edx),%ebx 1107b2: 83 fb 01 cmp $0x1,%ebx 1107b5: 74 6e je 110825 <_POSIX_signals_Check_signal+0xa5><== NEVER TAKEN return false; /* * Block the signals requested in sa_mask */ saved_signals_blocked = api->signals_blocked; 1107b7: 8b 4d 08 mov 0x8(%ebp),%ecx 1107ba: 8b 89 d0 00 00 00 mov 0xd0(%ecx),%ecx 1107c0: 89 4d a4 mov %ecx,-0x5c(%ebp) api->signals_blocked |= _POSIX_signals_Vectors[ signo ].sa_mask; 1107c3: 8b 82 2c e9 12 00 mov 0x12e92c(%edx),%eax 1107c9: 09 c8 or %ecx,%eax 1107cb: 8b 4d 08 mov 0x8(%ebp),%ecx 1107ce: 89 81 d0 00 00 00 mov %eax,0xd0(%ecx) /* * We have to save the blocking information of the current wait queue * because the signal handler may subsequently go on and put the thread * on a wait queue, for its own purposes. */ memcpy( &stored_thread_wait_information, &_Thread_Executing->Wait, 1107d4: 8d 7d c0 lea -0x40(%ebp),%edi 1107d7: 8b 35 ec e8 12 00 mov 0x12e8ec,%esi 1107dd: 83 c6 20 add $0x20,%esi 1107e0: b9 0a 00 00 00 mov $0xa,%ecx 1107e5: f3 a5 rep movsl %ds:(%esi),%es:(%edi) sizeof( Thread_Wait_information )); /* * Here, the signal handler function executes */ switch ( _POSIX_signals_Vectors[ signo ].sa_flags ) { 1107e7: 83 ba 28 e9 12 00 02 cmpl $0x2,0x12e928(%edx) 1107ee: 75 09 jne 1107f9 <_POSIX_signals_Check_signal+0x79> case SA_SIGINFO: (*_POSIX_signals_Vectors[ signo ].sa_sigaction)( 1107f0: 50 push %eax 1107f1: 6a 00 push $0x0 1107f3: 8d 45 b4 lea -0x4c(%ebp),%eax 1107f6: 50 push %eax 1107f7: eb 03 jmp 1107fc <_POSIX_signals_Check_signal+0x7c> &siginfo_struct, NULL /* context is undefined per 1003.1b-1993, p. 66 */ ); break; default: (*_POSIX_signals_Vectors[ signo ].sa_handler)( signo ); 1107f9: 83 ec 0c sub $0xc,%esp 1107fc: ff 75 0c pushl 0xc(%ebp) 1107ff: ff d3 call *%ebx break; 110801: 83 c4 10 add $0x10,%esp } /* * Restore the blocking information */ memcpy( &_Thread_Executing->Wait, &stored_thread_wait_information, 110804: 8b 3d ec e8 12 00 mov 0x12e8ec,%edi 11080a: 83 c7 20 add $0x20,%edi 11080d: 8d 75 c0 lea -0x40(%ebp),%esi 110810: b9 0a 00 00 00 mov $0xa,%ecx 110815: f3 a5 rep movsl %ds:(%esi),%es:(%edi) sizeof( Thread_Wait_information )); /* * Restore the previous set of blocked signals */ api->signals_blocked = saved_signals_blocked; 110817: 8b 45 a4 mov -0x5c(%ebp),%eax 11081a: 8b 55 08 mov 0x8(%ebp),%edx 11081d: 89 82 d0 00 00 00 mov %eax,0xd0(%edx) return true; 110823: b1 01 mov $0x1,%cl } 110825: 88 c8 mov %cl,%al 110827: 8d 65 f4 lea -0xc(%ebp),%esp 11082a: 5b pop %ebx 11082b: 5e pop %esi 11082c: 5f pop %edi 11082d: 5d pop %ebp 11082e: c3 ret =============================================================================== 00110e54 <_POSIX_signals_Clear_process_signals>: */ void _POSIX_signals_Clear_process_signals( int signo ) { 110e54: 55 push %ebp 110e55: 89 e5 mov %esp,%ebp 110e57: 53 push %ebx 110e58: 8b 55 08 mov 0x8(%ebp),%edx 110e5b: 8d 4a ff lea -0x1(%edx),%ecx 110e5e: b8 01 00 00 00 mov $0x1,%eax 110e63: d3 e0 shl %cl,%eax clear_signal = true; mask = signo_to_mask( signo ); ISR_Level level; _ISR_Disable( level ); 110e65: 9c pushf 110e66: fa cli 110e67: 59 pop %ecx if ( _POSIX_signals_Vectors[ signo ].sa_flags == SA_SIGINFO ) { 110e68: 6b d2 0c imul $0xc,%edx,%edx 110e6b: 83 ba 28 e9 12 00 02 cmpl $0x2,0x12e928(%edx) 110e72: 75 12 jne 110e86 <_POSIX_signals_Clear_process_signals+0x32> RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 110e74: 8d 9a 24 eb 12 00 lea 0x12eb24(%edx),%ebx if ( !_Chain_Is_empty( &_POSIX_signals_Siginfo[ signo ] ) ) 110e7a: 39 9a 20 eb 12 00 cmp %ebx,0x12eb20(%edx) 110e80: 74 04 je 110e86 <_POSIX_signals_Clear_process_signals+0x32><== ALWAYS TAKEN clear_signal = false; } if ( clear_signal ) { _POSIX_signals_Pending &= ~mask; } _ISR_Enable( level ); 110e82: 51 push %ecx 110e83: 9d popf 110e84: eb 0a jmp 110e90 <_POSIX_signals_Clear_process_signals+0x3c> if ( _POSIX_signals_Vectors[ signo ].sa_flags == SA_SIGINFO ) { if ( !_Chain_Is_empty( &_POSIX_signals_Siginfo[ signo ] ) ) clear_signal = false; } if ( clear_signal ) { _POSIX_signals_Pending &= ~mask; 110e86: f7 d0 not %eax 110e88: 21 05 1c eb 12 00 and %eax,0x12eb1c 110e8e: eb f2 jmp 110e82 <_POSIX_signals_Clear_process_signals+0x2e> } _ISR_Enable( level ); } 110e90: 5b pop %ebx 110e91: 5d pop %ebp 110e92: c3 ret =============================================================================== 0010a6c4 <_POSIX_signals_Get_lowest>: #include static int _POSIX_signals_Get_lowest( sigset_t set ) { 10a6c4: 55 push %ebp 10a6c5: 89 e5 mov %esp,%ebp 10a6c7: 56 push %esi 10a6c8: 53 push %ebx int signo; for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) { 10a6c9: ba 1b 00 00 00 mov $0x1b,%edx 10a6ce: bb 01 00 00 00 mov $0x1,%ebx #include #include #include #include static int _POSIX_signals_Get_lowest( 10a6d3: 8d 4a ff lea -0x1(%edx),%ecx 10a6d6: 89 de mov %ebx,%esi 10a6d8: d3 e6 shl %cl,%esi ) { int signo; for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) { if ( set & signo_to_mask( signo ) ) { 10a6da: 85 c6 test %eax,%esi 10a6dc: 75 1e jne 10a6fc <_POSIX_signals_Get_lowest+0x38><== NEVER TAKEN sigset_t set ) { int signo; for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) { 10a6de: 42 inc %edx 10a6df: 83 fa 20 cmp $0x20,%edx 10a6e2: 75 ef jne 10a6d3 <_POSIX_signals_Get_lowest+0xf> 10a6e4: b2 01 mov $0x1,%dl 10a6e6: bb 01 00 00 00 mov $0x1,%ebx #include #include #include #include static int _POSIX_signals_Get_lowest( 10a6eb: 8d 4a ff lea -0x1(%edx),%ecx 10a6ee: 89 de mov %ebx,%esi 10a6f0: d3 e6 shl %cl,%esi #if (SIGHUP != 1) #error "Assumption that SIGHUP==1 violated!!" #endif for ( signo = SIGHUP ; signo <= __SIGLASTNOTRT ; signo++ ) { if ( set & signo_to_mask( signo ) ) { 10a6f2: 85 c6 test %eax,%esi 10a6f4: 75 06 jne 10a6fc <_POSIX_signals_Get_lowest+0x38> */ #if (SIGHUP != 1) #error "Assumption that SIGHUP==1 violated!!" #endif for ( signo = SIGHUP ; signo <= __SIGLASTNOTRT ; signo++ ) { 10a6f6: 42 inc %edx 10a6f7: 83 fa 1b cmp $0x1b,%edx 10a6fa: 75 ef jne 10a6eb <_POSIX_signals_Get_lowest+0x27><== 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; } 10a6fc: 89 d0 mov %edx,%eax 10a6fe: 5b pop %ebx 10a6ff: 5e pop %esi 10a700: 5d pop %ebp 10a701: c3 ret =============================================================================== 0011dbf0 <_POSIX_signals_Unblock_thread>: bool _POSIX_signals_Unblock_thread( Thread_Control *the_thread, int signo, siginfo_t *info ) { 11dbf0: 55 push %ebp 11dbf1: 89 e5 mov %esp,%ebp 11dbf3: 57 push %edi 11dbf4: 56 push %esi 11dbf5: 53 push %ebx 11dbf6: 83 ec 0c sub $0xc,%esp 11dbf9: 8b 5d 08 mov 0x8(%ebp),%ebx 11dbfc: 8b 75 0c mov 0xc(%ebp),%esi POSIX_API_Control *api; sigset_t mask; siginfo_t *the_info = NULL; api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 11dbff: 8b bb e8 00 00 00 mov 0xe8(%ebx),%edi 11dc05: 8d 4e ff lea -0x1(%esi),%ecx 11dc08: b8 01 00 00 00 mov $0x1,%eax 11dc0d: d3 e0 shl %cl,%eax /* * Is the thread is specifically waiting for a signal? */ if ( _States_Is_interruptible_signal( the_thread->current_state ) ) { 11dc0f: 8b 53 10 mov 0x10(%ebx),%edx 11dc12: 89 d1 mov %edx,%ecx 11dc14: 81 e1 00 80 00 10 and $0x10008000,%ecx 11dc1a: 81 f9 00 80 00 10 cmp $0x10008000,%ecx 11dc20: 75 54 jne 11dc76 <_POSIX_signals_Unblock_thread+0x86> if ( (the_thread->Wait.option & mask) || (~api->signals_blocked & mask) ) { 11dc22: 85 43 30 test %eax,0x30(%ebx) 11dc25: 75 11 jne 11dc38 <_POSIX_signals_Unblock_thread+0x48> 11dc27: 8b 97 d0 00 00 00 mov 0xd0(%edi),%edx 11dc2d: f7 d2 not %edx 11dc2f: 85 d0 test %edx,%eax 11dc31: 75 05 jne 11dc38 <_POSIX_signals_Unblock_thread+0x48> 11dc33: e9 ab 00 00 00 jmp 11dce3 <_POSIX_signals_Unblock_thread+0xf3> the_thread->Wait.return_code = EINTR; 11dc38: c7 43 34 04 00 00 00 movl $0x4,0x34(%ebx) the_info = (siginfo_t *) the_thread->Wait.return_argument; 11dc3f: 8b 43 28 mov 0x28(%ebx),%eax if ( !info ) { 11dc42: 83 7d 10 00 cmpl $0x0,0x10(%ebp) 11dc46: 75 12 jne 11dc5a <_POSIX_signals_Unblock_thread+0x6a> the_info->si_signo = signo; 11dc48: 89 30 mov %esi,(%eax) the_info->si_code = SI_USER; 11dc4a: c7 40 04 01 00 00 00 movl $0x1,0x4(%eax) the_info->si_value.sival_int = 0; 11dc51: c7 40 08 00 00 00 00 movl $0x0,0x8(%eax) 11dc58: eb 0c jmp 11dc66 <_POSIX_signals_Unblock_thread+0x76> } else { *the_info = *info; 11dc5a: b9 03 00 00 00 mov $0x3,%ecx 11dc5f: 89 c7 mov %eax,%edi 11dc61: 8b 75 10 mov 0x10(%ebp),%esi 11dc64: f3 a5 rep movsl %ds:(%esi),%es:(%edi) } _Thread_queue_Extract_with_proxy( the_thread ); 11dc66: 83 ec 0c sub $0xc,%esp 11dc69: 53 push %ebx 11dc6a: e8 c1 e7 fe ff call 10c430 <_Thread_queue_Extract_with_proxy> return true; 11dc6f: 83 c4 10 add $0x10,%esp 11dc72: b0 01 mov $0x1,%al 11dc74: eb 6f jmp 11dce5 <_POSIX_signals_Unblock_thread+0xf5> } /* * Thread is not waiting due to a sigwait. */ if ( ~api->signals_blocked & mask ) { 11dc76: 8b 8f d0 00 00 00 mov 0xd0(%edi),%ecx 11dc7c: f7 d1 not %ecx 11dc7e: 85 c8 test %ecx,%eax 11dc80: 74 61 je 11dce3 <_POSIX_signals_Unblock_thread+0xf3> * it is not blocked, THEN * we need to dispatch at the end of this ISR. * + Any other combination, do nothing. */ if ( _States_Is_interruptible_by_signal( the_thread->current_state ) ) { 11dc82: f7 c2 00 00 00 10 test $0x10000000,%edx 11dc88: 74 3d je 11dcc7 <_POSIX_signals_Unblock_thread+0xd7> the_thread->Wait.return_code = EINTR; 11dc8a: c7 43 34 04 00 00 00 movl $0x4,0x34(%ebx) /* * In pthread_cond_wait, a thread will be blocking on a thread * queue, but is also interruptible by a POSIX signal. */ if ( _States_Is_waiting_on_thread_queue(the_thread->current_state) ) 11dc91: f7 c2 e0 be 03 00 test $0x3bee0,%edx 11dc97: 74 0b je 11dca4 <_POSIX_signals_Unblock_thread+0xb4> _Thread_queue_Extract_with_proxy( the_thread ); 11dc99: 83 ec 0c sub $0xc,%esp 11dc9c: 53 push %ebx 11dc9d: e8 8e e7 fe ff call 10c430 <_Thread_queue_Extract_with_proxy> 11dca2: eb 1e jmp 11dcc2 <_POSIX_signals_Unblock_thread+0xd2> else if ( _States_Is_delaying(the_thread->current_state) ) { 11dca4: 80 e2 08 and $0x8,%dl 11dca7: 74 3a je 11dce3 <_POSIX_signals_Unblock_thread+0xf3><== NEVER TAKEN (void) _Watchdog_Remove( &the_thread->Timer ); 11dca9: 83 ec 0c sub $0xc,%esp 11dcac: 8d 43 48 lea 0x48(%ebx),%eax 11dcaf: 50 push %eax 11dcb0: e8 63 ed fe ff call 10ca18 <_Watchdog_Remove> RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 11dcb5: 58 pop %eax 11dcb6: 5a pop %edx 11dcb7: 68 f8 ff 03 10 push $0x1003fff8 11dcbc: 53 push %ebx 11dcbd: e8 1a de fe ff call 10badc <_Thread_Clear_state> 11dcc2: 83 c4 10 add $0x10,%esp 11dcc5: eb 1c jmp 11dce3 <_POSIX_signals_Unblock_thread+0xf3> _Thread_Unblock( the_thread ); } } else if ( the_thread->current_state == STATES_READY ) { 11dcc7: 85 d2 test %edx,%edx 11dcc9: 75 18 jne 11dce3 <_POSIX_signals_Unblock_thread+0xf3><== NEVER TAKEN if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) 11dccb: 83 3d e8 e8 12 00 00 cmpl $0x0,0x12e8e8 11dcd2: 74 0f je 11dce3 <_POSIX_signals_Unblock_thread+0xf3> 11dcd4: 3b 1d ec e8 12 00 cmp 0x12e8ec,%ebx 11dcda: 75 07 jne 11dce3 <_POSIX_signals_Unblock_thread+0xf3><== NEVER TAKEN _Thread_Dispatch_necessary = true; 11dcdc: c6 05 f8 e8 12 00 01 movb $0x1,0x12e8f8 } } return false; 11dce3: 31 c0 xor %eax,%eax } 11dce5: 8d 65 f4 lea -0xc(%ebp),%esp 11dce8: 5b pop %ebx 11dce9: 5e pop %esi 11dcea: 5f pop %edi 11dceb: 5d pop %ebp 11dcec: c3 ret =============================================================================== 0010c004 <_RBTree_Extract_unprotected>: */ void _RBTree_Extract_unprotected( RBTree_Control *the_rbtree, RBTree_Node *the_node ) { 10c004: 55 push %ebp 10c005: 89 e5 mov %esp,%ebp 10c007: 57 push %edi 10c008: 56 push %esi 10c009: 53 push %ebx 10c00a: 83 ec 1c sub $0x1c,%esp 10c00d: 8b 7d 08 mov 0x8(%ebp),%edi 10c010: 8b 5d 0c mov 0xc(%ebp),%ebx RBTree_Node *leaf, *target; RBTree_Color victim_color; RBTree_Direction dir; if (!the_node) return; 10c013: 85 db test %ebx,%ebx 10c015: 0f 84 0d 01 00 00 je 10c128 <_RBTree_Extract_unprotected+0x124> /* check if min needs to be updated */ if (the_node == the_rbtree->first[RBT_LEFT]) { 10c01b: 3b 5f 08 cmp 0x8(%edi),%ebx 10c01e: 75 10 jne 10c030 <_RBTree_Extract_unprotected+0x2c> */ RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Successor_unprotected( const RBTree_Node *node ) { return _RBTree_Next_unprotected( node, RBT_RIGHT ); 10c020: 50 push %eax 10c021: 50 push %eax 10c022: 6a 01 push $0x1 10c024: 53 push %ebx 10c025: e8 5a 03 00 00 call 10c384 <_RBTree_Next_unprotected> RBTree_Node *next; next = _RBTree_Successor_unprotected(the_node); the_rbtree->first[RBT_LEFT] = next; 10c02a: 89 47 08 mov %eax,0x8(%edi) 10c02d: 83 c4 10 add $0x10,%esp } /* Check if max needs to be updated. min=max for 1 element trees so * do not use else if here. */ if (the_node == the_rbtree->first[RBT_RIGHT]) { 10c030: 3b 5f 0c cmp 0xc(%edi),%ebx 10c033: 75 10 jne 10c045 <_RBTree_Extract_unprotected+0x41> */ RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Predecessor_unprotected( const RBTree_Node *node ) { return _RBTree_Next_unprotected( node, RBT_LEFT ); 10c035: 56 push %esi 10c036: 56 push %esi 10c037: 6a 00 push $0x0 10c039: 53 push %ebx 10c03a: e8 45 03 00 00 call 10c384 <_RBTree_Next_unprotected> RBTree_Node *previous; previous = _RBTree_Predecessor_unprotected(the_node); the_rbtree->first[RBT_RIGHT] = previous; 10c03f: 89 47 0c mov %eax,0xc(%edi) 10c042: 83 c4 10 add $0x10,%esp * either max in node->child[RBT_LEFT] or min in node->child[RBT_RIGHT], * and replace the_node with the target node. This maintains the binary * search tree property, but may violate the red-black properties. */ if (the_node->child[RBT_LEFT] && the_node->child[RBT_RIGHT]) { 10c045: 8b 73 04 mov 0x4(%ebx),%esi 10c048: 85 f6 test %esi,%esi 10c04a: 74 77 je 10c0c3 <_RBTree_Extract_unprotected+0xbf> 10c04c: 83 7b 08 00 cmpl $0x0,0x8(%ebx) 10c050: 75 04 jne 10c056 <_RBTree_Extract_unprotected+0x52> 10c052: eb 78 jmp 10c0cc <_RBTree_Extract_unprotected+0xc8> target = the_node->child[RBT_LEFT]; /* find max in node->child[RBT_LEFT] */ while (target->child[RBT_RIGHT]) target = target->child[RBT_RIGHT]; 10c054: 89 c6 mov %eax,%esi 10c056: 8b 46 08 mov 0x8(%esi),%eax 10c059: 85 c0 test %eax,%eax 10c05b: 75 f7 jne 10c054 <_RBTree_Extract_unprotected+0x50> * target's position (target is the right child of target->parent) * when target vacates it. if there is no child, then target->parent * should become NULL. This may cause the coloring to be violated. * For now we store the color of the node being deleted in victim_color. */ leaf = target->child[RBT_LEFT]; 10c05d: 8b 56 04 mov 0x4(%esi),%edx if(leaf) { 10c060: 85 d2 test %edx,%edx 10c062: 74 06 je 10c06a <_RBTree_Extract_unprotected+0x66> leaf->parent = target->parent; 10c064: 8b 06 mov (%esi),%eax 10c066: 89 02 mov %eax,(%edx) 10c068: eb 0d jmp 10c077 <_RBTree_Extract_unprotected+0x73> } else { /* fix the tree here if the child is a null leaf. */ _RBTree_Extract_validate_unprotected(target); 10c06a: 89 f0 mov %esi,%eax 10c06c: 89 55 e0 mov %edx,-0x20(%ebp) 10c06f: e8 53 fe ff ff call 10bec7 <_RBTree_Extract_validate_unprotected> 10c074: 8b 55 e0 mov -0x20(%ebp),%edx } victim_color = target->color; 10c077: 8b 46 0c mov 0xc(%esi),%eax 10c07a: 89 45 e4 mov %eax,-0x1c(%ebp) dir = target != target->parent->child[0]; 10c07d: 8b 06 mov (%esi),%eax 10c07f: 31 c9 xor %ecx,%ecx 10c081: 3b 70 04 cmp 0x4(%eax),%esi 10c084: 0f 95 c1 setne %cl target->parent->child[dir] = leaf; 10c087: 89 54 88 04 mov %edx,0x4(%eax,%ecx,4) /* now replace the_node with target */ dir = the_node != the_node->parent->child[0]; 10c08b: 8b 03 mov (%ebx),%eax 10c08d: 31 c9 xor %ecx,%ecx 10c08f: 3b 58 04 cmp 0x4(%eax),%ebx 10c092: 0f 95 c1 setne %cl the_node->parent->child[dir] = target; 10c095: 89 74 88 04 mov %esi,0x4(%eax,%ecx,4) /* set target's new children to the original node's children */ target->child[RBT_RIGHT] = the_node->child[RBT_RIGHT]; 10c099: 8b 43 08 mov 0x8(%ebx),%eax 10c09c: 89 46 08 mov %eax,0x8(%esi) if (the_node->child[RBT_RIGHT]) 10c09f: 8b 43 08 mov 0x8(%ebx),%eax 10c0a2: 85 c0 test %eax,%eax 10c0a4: 74 02 je 10c0a8 <_RBTree_Extract_unprotected+0xa4><== NEVER TAKEN the_node->child[RBT_RIGHT]->parent = target; 10c0a6: 89 30 mov %esi,(%eax) target->child[RBT_LEFT] = the_node->child[RBT_LEFT]; 10c0a8: 8b 43 04 mov 0x4(%ebx),%eax 10c0ab: 89 46 04 mov %eax,0x4(%esi) if (the_node->child[RBT_LEFT]) 10c0ae: 8b 43 04 mov 0x4(%ebx),%eax 10c0b1: 85 c0 test %eax,%eax 10c0b3: 74 02 je 10c0b7 <_RBTree_Extract_unprotected+0xb3> the_node->child[RBT_LEFT]->parent = target; 10c0b5: 89 30 mov %esi,(%eax) /* finally, update the parent node and recolor. target has completely * replaced the_node, and target's child has moved up the tree if needed. * the_node is no longer part of the tree, although it has valid pointers * still. */ target->parent = the_node->parent; 10c0b7: 8b 03 mov (%ebx),%eax 10c0b9: 89 06 mov %eax,(%esi) target->color = the_node->color; 10c0bb: 8b 43 0c mov 0xc(%ebx),%eax 10c0be: 89 46 0c mov %eax,0xc(%esi) 10c0c1: eb 32 jmp 10c0f5 <_RBTree_Extract_unprotected+0xf1> * the_node's location in the tree. This may cause the coloring to be * violated. We will fix it later. * For now we store the color of the node being deleted in victim_color. */ leaf = the_node->child[RBT_LEFT] ? the_node->child[RBT_LEFT] : the_node->child[RBT_RIGHT]; 10c0c3: 8b 53 08 mov 0x8(%ebx),%edx if( leaf ) { 10c0c6: 85 d2 test %edx,%edx 10c0c8: 75 04 jne 10c0ce <_RBTree_Extract_unprotected+0xca> 10c0ca: eb 08 jmp 10c0d4 <_RBTree_Extract_unprotected+0xd0> * either max in node->child[RBT_LEFT] or min in node->child[RBT_RIGHT], * and replace the_node with the target node. This maintains the binary * search tree property, but may violate the red-black properties. */ if (the_node->child[RBT_LEFT] && the_node->child[RBT_RIGHT]) { 10c0cc: 89 f2 mov %esi,%edx * For now we store the color of the node being deleted in victim_color. */ leaf = the_node->child[RBT_LEFT] ? the_node->child[RBT_LEFT] : the_node->child[RBT_RIGHT]; if( leaf ) { leaf->parent = the_node->parent; 10c0ce: 8b 03 mov (%ebx),%eax 10c0d0: 89 02 mov %eax,(%edx) 10c0d2: eb 0d jmp 10c0e1 <_RBTree_Extract_unprotected+0xdd> } else { /* fix the tree here if the child is a null leaf. */ _RBTree_Extract_validate_unprotected(the_node); 10c0d4: 89 d8 mov %ebx,%eax 10c0d6: 89 55 e0 mov %edx,-0x20(%ebp) 10c0d9: e8 e9 fd ff ff call 10bec7 <_RBTree_Extract_validate_unprotected> 10c0de: 8b 55 e0 mov -0x20(%ebp),%edx } victim_color = the_node->color; 10c0e1: 8b 43 0c mov 0xc(%ebx),%eax 10c0e4: 89 45 e4 mov %eax,-0x1c(%ebp) /* remove the_node from the tree */ dir = the_node != the_node->parent->child[0]; 10c0e7: 8b 03 mov (%ebx),%eax 10c0e9: 31 c9 xor %ecx,%ecx 10c0eb: 3b 58 04 cmp 0x4(%eax),%ebx 10c0ee: 0f 95 c1 setne %cl the_node->parent->child[dir] = leaf; 10c0f1: 89 54 88 04 mov %edx,0x4(%eax,%ecx,4) /* fix coloring. leaf has moved up the tree. The color of the deleted * node is in victim_color. There are two cases: * 1. Deleted a red node, its child must be black. Nothing must be done. * 2. Deleted a black node, its child must be red. Paint child black. */ if (victim_color == RBT_BLACK) { /* eliminate case 1 */ 10c0f5: 83 7d e4 00 cmpl $0x0,-0x1c(%ebp) 10c0f9: 75 0b jne 10c106 <_RBTree_Extract_unprotected+0x102> if (leaf) { 10c0fb: 85 d2 test %edx,%edx 10c0fd: 74 07 je 10c106 <_RBTree_Extract_unprotected+0x102> leaf->color = RBT_BLACK; /* case 2 */ 10c0ff: c7 42 0c 00 00 00 00 movl $0x0,0xc(%edx) */ RTEMS_INLINE_ROUTINE void _RBTree_Set_off_rbtree( RBTree_Node *node ) { node->parent = node->child[RBT_LEFT] = node->child[RBT_RIGHT] = NULL; 10c106: c7 43 08 00 00 00 00 movl $0x0,0x8(%ebx) 10c10d: c7 43 04 00 00 00 00 movl $0x0,0x4(%ebx) 10c114: c7 03 00 00 00 00 movl $0x0,(%ebx) /* Wipe the_node */ _RBTree_Set_off_rbtree(the_node); /* set root to black, if it exists */ if (the_rbtree->root) the_rbtree->root->color = RBT_BLACK; 10c11a: 8b 47 04 mov 0x4(%edi),%eax 10c11d: 85 c0 test %eax,%eax 10c11f: 74 07 je 10c128 <_RBTree_Extract_unprotected+0x124> 10c121: c7 40 0c 00 00 00 00 movl $0x0,0xc(%eax) } 10c128: 8d 65 f4 lea -0xc(%ebp),%esp 10c12b: 5b pop %ebx 10c12c: 5e pop %esi 10c12d: 5f pop %edi 10c12e: 5d pop %ebp 10c12f: c3 ret =============================================================================== 0010cb1c <_RBTree_Initialize>: void *starting_address, size_t number_nodes, size_t node_size, bool is_unique ) { 10cb1c: 55 push %ebp 10cb1d: 89 e5 mov %esp,%ebp 10cb1f: 57 push %edi 10cb20: 56 push %esi 10cb21: 53 push %ebx 10cb22: 83 ec 0c sub $0xc,%esp 10cb25: 8b 5d 08 mov 0x8(%ebp),%ebx 10cb28: 8b 75 14 mov 0x14(%ebp),%esi 10cb2b: 8b 45 1c mov 0x1c(%ebp),%eax size_t count; RBTree_Node *next; /* TODO: Error message? */ if (!the_rbtree) return; 10cb2e: 85 db test %ebx,%ebx 10cb30: 74 3d je 10cb6f <_RBTree_Initialize+0x53><== NEVER TAKEN RBTree_Control *the_rbtree, RBTree_Compare_function compare_function, bool is_unique ) { the_rbtree->permanent_null = NULL; 10cb32: c7 03 00 00 00 00 movl $0x0,(%ebx) the_rbtree->root = NULL; 10cb38: c7 43 04 00 00 00 00 movl $0x0,0x4(%ebx) the_rbtree->first[0] = NULL; 10cb3f: c7 43 08 00 00 00 00 movl $0x0,0x8(%ebx) the_rbtree->first[1] = NULL; 10cb46: c7 43 0c 00 00 00 00 movl $0x0,0xc(%ebx) the_rbtree->compare_function = compare_function; 10cb4d: 8b 55 0c mov 0xc(%ebp),%edx 10cb50: 89 53 10 mov %edx,0x10(%ebx) the_rbtree->is_unique = is_unique; 10cb53: 88 43 14 mov %al,0x14(%ebx) /* could do sanity checks here */ _RBTree_Initialize_empty(the_rbtree, compare_function, is_unique); count = number_nodes; next = starting_address; 10cb56: 8b 7d 10 mov 0x10(%ebp),%edi while ( count-- ) { 10cb59: eb 10 jmp 10cb6b <_RBTree_Initialize+0x4f> _RBTree_Insert_unprotected(the_rbtree, next); 10cb5b: 50 push %eax 10cb5c: 50 push %eax 10cb5d: 57 push %edi 10cb5e: 53 push %ebx 10cb5f: e8 a8 fd ff ff call 10c90c <_RBTree_Insert_unprotected> * node_size - size of node in bytes * * Output parameters: NONE */ void _RBTree_Initialize( 10cb64: 03 7d 18 add 0x18(%ebp),%edi 10cb67: 4e dec %esi 10cb68: 83 c4 10 add $0x10,%esp /* could do sanity checks here */ _RBTree_Initialize_empty(the_rbtree, compare_function, is_unique); count = number_nodes; next = starting_address; while ( count-- ) { 10cb6b: 85 f6 test %esi,%esi 10cb6d: 75 ec jne 10cb5b <_RBTree_Initialize+0x3f> _RBTree_Insert_unprotected(the_rbtree, next); next = (RBTree_Node *) _Addresses_Add_offset( (void *) next, node_size ); } } 10cb6f: 8d 65 f4 lea -0xc(%ebp),%esp 10cb72: 5b pop %ebx 10cb73: 5e pop %esi 10cb74: 5f pop %edi 10cb75: 5d pop %ebp 10cb76: c3 ret =============================================================================== 0010c194 <_RBTree_Insert_unprotected>: */ RBTree_Node *_RBTree_Insert_unprotected( RBTree_Control *the_rbtree, RBTree_Node *the_node ) { 10c194: 55 push %ebp 10c195: 89 e5 mov %esp,%ebp 10c197: 57 push %edi 10c198: 56 push %esi 10c199: 53 push %ebx 10c19a: 83 ec 1c sub $0x1c,%esp 10c19d: 8b 75 08 mov 0x8(%ebp),%esi 10c1a0: 8b 5d 0c mov 0xc(%ebp),%ebx if(!the_node) return (RBTree_Node*)-1; 10c1a3: 85 db test %ebx,%ebx 10c1a5: 0f 84 55 01 00 00 je 10c300 <_RBTree_Insert_unprotected+0x16c> RBTree_Node *iter_node = the_rbtree->root; 10c1ab: 8b 7e 04 mov 0x4(%esi),%edi int compare_result; if (!iter_node) { /* special case: first node inserted */ 10c1ae: 89 f9 mov %edi,%ecx 10c1b0: 85 ff test %edi,%edi 10c1b2: 75 27 jne 10c1db <_RBTree_Insert_unprotected+0x47> the_node->color = RBT_BLACK; 10c1b4: c7 43 0c 00 00 00 00 movl $0x0,0xc(%ebx) the_rbtree->root = the_node; 10c1bb: 89 5e 04 mov %ebx,0x4(%esi) the_rbtree->first[0] = the_rbtree->first[1] = the_node; 10c1be: 89 5e 0c mov %ebx,0xc(%esi) 10c1c1: 89 5e 08 mov %ebx,0x8(%esi) the_node->parent = (RBTree_Node *) the_rbtree; 10c1c4: 89 33 mov %esi,(%ebx) the_node->child[RBT_LEFT] = the_node->child[RBT_RIGHT] = NULL; 10c1c6: c7 43 08 00 00 00 00 movl $0x0,0x8(%ebx) 10c1cd: c7 43 04 00 00 00 00 movl $0x0,0x4(%ebx) 10c1d4: e9 37 01 00 00 jmp 10c310 <_RBTree_Insert_unprotected+0x17c> (dir && _RBTree_Is_greater(compare_result)) ) { the_rbtree->first[dir] = the_node; } break; } else { iter_node = iter_node->child[dir]; 10c1d9: 89 f9 mov %edi,%ecx the_node->parent = (RBTree_Node *) the_rbtree; the_node->child[RBT_LEFT] = the_node->child[RBT_RIGHT] = NULL; } else { /* typical binary search tree insert, descend tree to leaf and insert */ while (iter_node) { compare_result = the_rbtree->compare_function(the_node, iter_node); 10c1db: 52 push %edx 10c1dc: 52 push %edx 10c1dd: 57 push %edi 10c1de: 53 push %ebx 10c1df: 89 4d e4 mov %ecx,-0x1c(%ebp) 10c1e2: ff 56 10 call *0x10(%esi) if ( the_rbtree->is_unique && _RBTree_Is_equal( compare_result ) ) 10c1e5: 83 c4 10 add $0x10,%esp 10c1e8: 80 7e 14 00 cmpb $0x0,0x14(%esi) 10c1ec: 8b 4d e4 mov -0x1c(%ebp),%ecx 10c1ef: 74 08 je 10c1f9 <_RBTree_Insert_unprotected+0x65> 10c1f1: 85 c0 test %eax,%eax 10c1f3: 0f 84 17 01 00 00 je 10c310 <_RBTree_Insert_unprotected+0x17c> return iter_node; RBTree_Direction dir = !_RBTree_Is_lesser( compare_result ); 10c1f9: 89 c2 mov %eax,%edx 10c1fb: f7 d2 not %edx 10c1fd: c1 ea 1f shr $0x1f,%edx if (!iter_node->child[dir]) { 10c200: 8b 7c 97 04 mov 0x4(%edi,%edx,4),%edi 10c204: 85 ff test %edi,%edi 10c206: 75 d1 jne 10c1d9 <_RBTree_Insert_unprotected+0x45> the_node->child[RBT_LEFT] = the_node->child[RBT_RIGHT] = NULL; 10c208: c7 43 08 00 00 00 00 movl $0x0,0x8(%ebx) 10c20f: c7 43 04 00 00 00 00 movl $0x0,0x4(%ebx) the_node->color = RBT_RED; 10c216: c7 43 0c 01 00 00 00 movl $0x1,0xc(%ebx) iter_node->child[dir] = the_node; 10c21d: 89 5c 91 04 mov %ebx,0x4(%ecx,%edx,4) the_node->parent = iter_node; 10c221: 89 0b mov %ecx,(%ebx) /* update min/max */ compare_result = the_rbtree->compare_function( 10c223: 50 push %eax 10c224: 50 push %eax 10c225: ff 74 96 08 pushl 0x8(%esi,%edx,4) 10c229: 53 push %ebx 10c22a: 89 55 e4 mov %edx,-0x1c(%ebp) 10c22d: ff 56 10 call *0x10(%esi) the_node, _RBTree_First(the_rbtree, dir) ); if ( (!dir && _RBTree_Is_lesser(compare_result)) || 10c230: 83 c4 10 add $0x10,%esp 10c233: 8b 55 e4 mov -0x1c(%ebp),%edx 10c236: 85 d2 test %edx,%edx 10c238: 75 0a jne 10c244 <_RBTree_Insert_unprotected+0xb0> 10c23a: 85 c0 test %eax,%eax 10c23c: 0f 89 9f 00 00 00 jns 10c2e1 <_RBTree_Insert_unprotected+0x14d> 10c242: eb 08 jmp 10c24c <_RBTree_Insert_unprotected+0xb8> (dir && _RBTree_Is_greater(compare_result)) ) { 10c244: 85 c0 test %eax,%eax 10c246: 0f 8e 95 00 00 00 jle 10c2e1 <_RBTree_Insert_unprotected+0x14d> the_rbtree->first[dir] = the_node; 10c24c: 89 5c 96 08 mov %ebx,0x8(%esi,%edx,4) 10c250: e9 8c 00 00 00 jmp 10c2e1 <_RBTree_Insert_unprotected+0x14d> const RBTree_Node *the_node ) { if(!the_node) return NULL; if(!(the_node->parent)) return NULL; if(!(the_node->parent->parent)) return NULL; 10c255: 85 f6 test %esi,%esi 10c257: 74 1b je 10c274 <_RBTree_Insert_unprotected+0xe0><== NEVER TAKEN if(!(the_node->parent->parent->parent)) return NULL; 10c259: 83 3e 00 cmpl $0x0,(%esi) 10c25c: 74 16 je 10c274 <_RBTree_Insert_unprotected+0xe0><== NEVER TAKEN { if(!the_node) return NULL; if(!(the_node->parent)) return NULL; if(!(the_node->parent->parent)) return NULL; if(the_node == the_node->parent->child[RBT_LEFT]) 10c25e: 8b 56 04 mov 0x4(%esi),%edx 10c261: 39 d0 cmp %edx,%eax 10c263: 75 03 jne 10c268 <_RBTree_Insert_unprotected+0xd4> return the_node->parent->child[RBT_RIGHT]; 10c265: 8b 56 08 mov 0x8(%esi),%edx */ RTEMS_INLINE_ROUTINE bool _RBTree_Is_red( const RBTree_Node *the_node ) { return (the_node && the_node->color == RBT_RED); 10c268: 85 d2 test %edx,%edx 10c26a: 74 0a je 10c276 <_RBTree_Insert_unprotected+0xe2> 10c26c: 83 7a 0c 01 cmpl $0x1,0xc(%edx) 10c270: 75 04 jne 10c276 <_RBTree_Insert_unprotected+0xe2> 10c272: eb 06 jmp 10c27a <_RBTree_Insert_unprotected+0xe6> ) { if(!the_node) return NULL; if(!(the_node->parent)) return NULL; if(!(the_node->parent->parent)) return NULL; if(!(the_node->parent->parent->parent)) return NULL; 10c274: 31 d2 xor %edx,%edx <== NOT EXECUTED */ RTEMS_INLINE_ROUTINE bool _RBTree_Is_red( const RBTree_Node *the_node ) { return (the_node && the_node->color == RBT_RED); 10c276: 31 c9 xor %ecx,%ecx 10c278: eb 05 jmp 10c27f <_RBTree_Insert_unprotected+0xeb> 10c27a: b9 01 00 00 00 mov $0x1,%ecx while (_RBTree_Is_red(_RBTree_Parent(the_node))) { u = _RBTree_Parent_sibling(the_node); g = the_node->parent->parent; /* if uncle is red, repaint uncle/parent black and grandparent red */ if(_RBTree_Is_red(u)) { 10c27f: 85 c9 test %ecx,%ecx 10c281: 74 17 je 10c29a <_RBTree_Insert_unprotected+0x106> the_node->parent->color = RBT_BLACK; 10c283: c7 40 0c 00 00 00 00 movl $0x0,0xc(%eax) u->color = RBT_BLACK; 10c28a: c7 42 0c 00 00 00 00 movl $0x0,0xc(%edx) g->color = RBT_RED; 10c291: c7 46 0c 01 00 00 00 movl $0x1,0xc(%esi) 10c298: eb 45 jmp 10c2df <_RBTree_Insert_unprotected+0x14b> the_node = g; } else { /* if uncle is black */ RBTree_Direction dir = the_node != the_node->parent->child[0]; RBTree_Direction pdir = the_node->parent != g->child[0]; 10c29a: 31 c9 xor %ecx,%ecx 10c29c: 3b 46 04 cmp 0x4(%esi),%eax 10c29f: 0f 95 c1 setne %cl the_node->parent->color = RBT_BLACK; u->color = RBT_BLACK; g->color = RBT_RED; the_node = g; } else { /* if uncle is black */ RBTree_Direction dir = the_node != the_node->parent->child[0]; 10c2a2: 31 d2 xor %edx,%edx 10c2a4: 3b 58 04 cmp 0x4(%eax),%ebx 10c2a7: 0f 95 c2 setne %dl RBTree_Direction pdir = the_node->parent != g->child[0]; /* ensure node is on the same branch direction as parent */ if (dir != pdir) { 10c2aa: 39 ca cmp %ecx,%edx 10c2ac: 74 11 je 10c2bf <_RBTree_Insert_unprotected+0x12b> _RBTree_Rotate(the_node->parent, pdir); 10c2ae: 89 ca mov %ecx,%edx 10c2b0: 89 4d e4 mov %ecx,-0x1c(%ebp) 10c2b3: e8 98 fe ff ff call 10c150 <_RBTree_Rotate> the_node = the_node->child[pdir]; 10c2b8: 8b 4d e4 mov -0x1c(%ebp),%ecx 10c2bb: 8b 5c 8b 04 mov 0x4(%ebx,%ecx,4),%ebx } the_node->parent->color = RBT_BLACK; 10c2bf: 8b 03 mov (%ebx),%eax 10c2c1: c7 40 0c 00 00 00 00 movl $0x0,0xc(%eax) g->color = RBT_RED; 10c2c8: c7 46 0c 01 00 00 00 movl $0x1,0xc(%esi) /* now rotate grandparent in the other branch direction (toward uncle) */ _RBTree_Rotate(g, (1-pdir)); 10c2cf: ba 01 00 00 00 mov $0x1,%edx 10c2d4: 29 ca sub %ecx,%edx 10c2d6: 89 f0 mov %esi,%eax 10c2d8: e8 73 fe ff ff call 10c150 <_RBTree_Rotate> 10c2dd: 89 de mov %ebx,%esi 10c2df: 89 f3 mov %esi,%ebx _ISR_Disable( level ); return_node = _RBTree_Insert_unprotected( tree, node ); _ISR_Enable( level ); return return_node; } 10c2e1: 8b 03 mov (%ebx),%eax */ RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Parent( const RBTree_Node *the_node ) { if (!the_node->parent->parent) return NULL; 10c2e3: 8b 30 mov (%eax),%esi 10c2e5: 85 f6 test %esi,%esi 10c2e7: 75 1c jne 10c305 <_RBTree_Insert_unprotected+0x171> */ RTEMS_INLINE_ROUTINE bool _RBTree_Is_red( const RBTree_Node *the_node ) { return (the_node && the_node->color == RBT_RED); 10c2e9: 31 d2 xor %edx,%edx RBTree_Node *u,*g; /* note: the insert root case is handled already */ /* if the parent is black, nothing needs to be done * otherwise may need to loop a few times */ while (_RBTree_Is_red(_RBTree_Parent(the_node))) { 10c2eb: 85 d2 test %edx,%edx 10c2ed: 0f 85 62 ff ff ff jne 10c255 <_RBTree_Insert_unprotected+0xc1> /* now rotate grandparent in the other branch direction (toward uncle) */ _RBTree_Rotate(g, (1-pdir)); } } if(!the_node->parent->parent) the_node->color = RBT_BLACK; 10c2f3: 85 f6 test %esi,%esi 10c2f5: 75 19 jne 10c310 <_RBTree_Insert_unprotected+0x17c> 10c2f7: c7 43 0c 00 00 00 00 movl $0x0,0xc(%ebx) 10c2fe: eb 10 jmp 10c310 <_RBTree_Insert_unprotected+0x17c> RBTree_Node *_RBTree_Insert_unprotected( RBTree_Control *the_rbtree, RBTree_Node *the_node ) { if(!the_node) return (RBTree_Node*)-1; 10c300: 83 cf ff or $0xffffffff,%edi 10c303: eb 0b jmp 10c310 <_RBTree_Insert_unprotected+0x17c> 10c305: 31 d2 xor %edx,%edx 10c307: 83 78 0c 01 cmpl $0x1,0xc(%eax) 10c30b: 0f 94 c2 sete %dl 10c30e: eb db jmp 10c2eb <_RBTree_Insert_unprotected+0x157> /* verify red-black properties */ _RBTree_Validate_insert_unprotected(the_node); } return (RBTree_Node*)0; } 10c310: 89 f8 mov %edi,%eax 10c312: 8d 65 f4 lea -0xc(%ebp),%esp 10c315: 5b pop %ebx 10c316: 5e pop %esi 10c317: 5f pop %edi 10c318: 5d pop %ebp 10c319: c3 ret =============================================================================== 0010c338 <_RBTree_Iterate_unprotected>: const RBTree_Control *rbtree, RBTree_Direction dir, RBTree_Visitor visitor, void *visitor_arg ) { 10c338: 55 push %ebp 10c339: 89 e5 mov %esp,%ebp 10c33b: 57 push %edi 10c33c: 56 push %esi 10c33d: 53 push %ebx 10c33e: 83 ec 0c sub $0xc,%esp 10c341: 8b 5d 0c mov 0xc(%ebp),%ebx */ RTEMS_INLINE_ROUTINE RBTree_Direction _RBTree_Opposite_direction( RBTree_Direction the_dir ) { return (RBTree_Direction) !((int) the_dir); 10c344: 31 d2 xor %edx,%edx 10c346: 85 db test %ebx,%ebx 10c348: 0f 94 c2 sete %dl RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_First( const RBTree_Control *the_rbtree, RBTree_Direction dir ) { return the_rbtree->first[dir]; 10c34b: 8b 45 08 mov 0x8(%ebp),%eax 10c34e: 8b 74 90 08 mov 0x8(%eax,%edx,4),%esi RBTree_Direction opp_dir = _RBTree_Opposite_direction( dir ); const RBTree_Node *current = _RBTree_First( rbtree, opp_dir ); bool stop = false; 10c352: 31 ff xor %edi,%edi while ( !stop && current != NULL ) { 10c354: eb 1b jmp 10c371 <_RBTree_Iterate_unprotected+0x39> stop = (*visitor)( current, dir, visitor_arg ); 10c356: 50 push %eax 10c357: ff 75 14 pushl 0x14(%ebp) 10c35a: 53 push %ebx 10c35b: 56 push %esi 10c35c: 8b 55 10 mov 0x10(%ebp),%edx 10c35f: ff d2 call *%edx 10c361: 89 c7 mov %eax,%edi current = _RBTree_Next_unprotected( current, dir ); 10c363: 5a pop %edx 10c364: 59 pop %ecx 10c365: 53 push %ebx 10c366: 56 push %esi 10c367: e8 18 00 00 00 call 10c384 <_RBTree_Next_unprotected> 10c36c: 89 c6 mov %eax,%esi 10c36e: 83 c4 10 add $0x10,%esp { RBTree_Direction opp_dir = _RBTree_Opposite_direction( dir ); const RBTree_Node *current = _RBTree_First( rbtree, opp_dir ); bool stop = false; while ( !stop && current != NULL ) { 10c371: 85 f6 test %esi,%esi 10c373: 74 06 je 10c37b <_RBTree_Iterate_unprotected+0x43> 10c375: 89 f8 mov %edi,%eax 10c377: fe c8 dec %al 10c379: 75 db jne 10c356 <_RBTree_Iterate_unprotected+0x1e><== ALWAYS TAKEN stop = (*visitor)( current, dir, visitor_arg ); current = _RBTree_Next_unprotected( current, dir ); } } 10c37b: 8d 65 f4 lea -0xc(%ebp),%esp 10c37e: 5b pop %ebx 10c37f: 5e pop %esi 10c380: 5f pop %edi 10c381: 5d pop %ebp 10c382: c3 ret =============================================================================== 0010be83 <_RBTree_Rotate>: RBTree_Node *the_node, RBTree_Direction dir ) { RBTree_Node *c; if (the_node == NULL) return; 10be83: 85 c0 test %eax,%eax 10be85: 74 3f je 10bec6 <_RBTree_Rotate+0x43> <== NEVER TAKEN */ RTEMS_INLINE_ROUTINE void _RBTree_Rotate( RBTree_Node *the_node, RBTree_Direction dir ) { 10be87: 55 push %ebp 10be88: 89 e5 mov %esp,%ebp 10be8a: 56 push %esi 10be8b: 53 push %ebx */ RTEMS_INLINE_ROUTINE RBTree_Direction _RBTree_Opposite_direction( RBTree_Direction the_dir ) { return (RBTree_Direction) !((int) the_dir); 10be8c: 31 db xor %ebx,%ebx 10be8e: 85 d2 test %edx,%edx 10be90: 0f 94 c3 sete %bl RBTree_Direction dir ) { RBTree_Node *c; if (the_node == NULL) return; if (the_node->child[_RBTree_Opposite_direction(dir)] == NULL) return; 10be93: 8b 4c 98 04 mov 0x4(%eax,%ebx,4),%ecx 10be97: 85 c9 test %ecx,%ecx 10be99: 74 28 je 10bec3 <_RBTree_Rotate+0x40> <== NEVER TAKEN c = the_node->child[_RBTree_Opposite_direction(dir)]; the_node->child[_RBTree_Opposite_direction(dir)] = c->child[dir]; 10be9b: 8b 74 91 04 mov 0x4(%ecx,%edx,4),%esi 10be9f: 89 74 98 04 mov %esi,0x4(%eax,%ebx,4) if (c->child[dir]) 10bea3: 8b 5c 91 04 mov 0x4(%ecx,%edx,4),%ebx 10bea7: 85 db test %ebx,%ebx 10bea9: 74 02 je 10bead <_RBTree_Rotate+0x2a> c->child[dir]->parent = the_node; 10beab: 89 03 mov %eax,(%ebx) c->child[dir] = the_node; 10bead: 89 44 91 04 mov %eax,0x4(%ecx,%edx,4) the_node->parent->child[the_node != the_node->parent->child[0]] = c; 10beb1: 8b 10 mov (%eax),%edx 10beb3: 31 db xor %ebx,%ebx 10beb5: 3b 42 04 cmp 0x4(%edx),%eax 10beb8: 0f 95 c3 setne %bl 10bebb: 89 4c 9a 04 mov %ecx,0x4(%edx,%ebx,4) c->parent = the_node->parent; 10bebf: 89 11 mov %edx,(%ecx) the_node->parent = c; 10bec1: 89 08 mov %ecx,(%eax) } 10bec3: 5b pop %ebx 10bec4: 5e pop %esi 10bec5: 5d pop %ebp 10bec6: c3 ret =============================================================================== 0010be5f <_RBTree_Sibling>: * exists, and NULL if not. */ RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Sibling( const RBTree_Node *the_node ) { 10be5f: 55 push %ebp 10be60: 89 e5 mov %esp,%ebp if(!the_node) return NULL; 10be62: 85 c0 test %eax,%eax 10be64: 74 17 je 10be7d <_RBTree_Sibling+0x1e> <== NEVER TAKEN if(!(the_node->parent)) return NULL; 10be66: 8b 08 mov (%eax),%ecx 10be68: 85 c9 test %ecx,%ecx 10be6a: 74 11 je 10be7d <_RBTree_Sibling+0x1e> <== NEVER TAKEN if(!(the_node->parent->parent)) return NULL; 10be6c: 83 39 00 cmpl $0x0,(%ecx) 10be6f: 74 0c je 10be7d <_RBTree_Sibling+0x1e> if(the_node == the_node->parent->child[RBT_LEFT]) 10be71: 8b 51 04 mov 0x4(%ecx),%edx 10be74: 39 d0 cmp %edx,%eax 10be76: 75 07 jne 10be7f <_RBTree_Sibling+0x20> return the_node->parent->child[RBT_RIGHT]; 10be78: 8b 51 08 mov 0x8(%ecx),%edx 10be7b: eb 02 jmp 10be7f <_RBTree_Sibling+0x20> */ RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Sibling( const RBTree_Node *the_node ) { if(!the_node) return NULL; 10be7d: 31 d2 xor %edx,%edx if(the_node == the_node->parent->child[RBT_LEFT]) return the_node->parent->child[RBT_RIGHT]; else return the_node->parent->child[RBT_LEFT]; } 10be7f: 89 d0 mov %edx,%eax 10be81: 5d pop %ebp 10be82: c3 ret =============================================================================== 0012dbb8 <_Rate_monotonic_Get_status>: bool _Rate_monotonic_Get_status( Rate_monotonic_Control *the_period, Rate_monotonic_Period_time_t *wall_since_last_period, Thread_CPU_usage_t *cpu_since_last_period ) { 12dbb8: 55 push %ebp 12dbb9: 89 e5 mov %esp,%ebp 12dbbb: 57 push %edi 12dbbc: 56 push %esi 12dbbd: 53 push %ebx 12dbbe: 83 ec 28 sub $0x28,%esp #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ Timestamp_Control uptime; #endif Thread_Control *owning_thread = the_period->owner; 12dbc1: 8b 45 08 mov 0x8(%ebp),%eax 12dbc4: 8b 78 40 mov 0x40(%eax),%edi /* * Determine elapsed wall time since period initiated. */ #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ _TOD_Get_uptime( &uptime ); 12dbc7: 8d 45 e0 lea -0x20(%ebp),%eax 12dbca: 50 push %eax 12dbcb: e8 e4 30 fe ff call 110cb4 <_TOD_Get_uptime> _Timestamp_Subtract( 12dbd0: 8b 45 e0 mov -0x20(%ebp),%eax 12dbd3: 8b 55 e4 mov -0x1c(%ebp),%edx const Timestamp64_Control *_start, const Timestamp64_Control *_end, Timestamp64_Control *_result ) { *_result = *_end - *_start; 12dbd6: 89 c1 mov %eax,%ecx 12dbd8: 89 d3 mov %edx,%ebx 12dbda: 8b 75 08 mov 0x8(%ebp),%esi 12dbdd: 2b 4e 4c sub 0x4c(%esi),%ecx 12dbe0: 1b 5e 50 sbb 0x50(%esi),%ebx 12dbe3: 8b 75 0c mov 0xc(%ebp),%esi 12dbe6: 89 0e mov %ecx,(%esi) 12dbe8: 89 5e 04 mov %ebx,0x4(%esi) #endif /* * Determine cpu usage since period initiated. */ used = owning_thread->cpu_time_used; 12dbeb: 8b 8f 80 00 00 00 mov 0x80(%edi),%ecx 12dbf1: 8b 9f 84 00 00 00 mov 0x84(%edi),%ebx #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ if (owning_thread == _Thread_Executing) { 12dbf7: 83 c4 10 add $0x10,%esp if (used < the_period->cpu_usage_period_initiated) return false; *cpu_since_last_period = used - the_period->cpu_usage_period_initiated; #endif return true; 12dbfa: be 01 00 00 00 mov $0x1,%esi * Determine cpu usage since period initiated. */ used = owning_thread->cpu_time_used; #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ if (owning_thread == _Thread_Executing) { 12dbff: 3b 3d 04 e7 16 00 cmp 0x16e704,%edi 12dc05: 75 38 jne 12dc3f <_Rate_monotonic_Get_status+0x87> 12dc07: 2b 05 14 e7 16 00 sub 0x16e714,%eax 12dc0d: 1b 15 18 e7 16 00 sbb 0x16e718,%edx static inline void _Timestamp64_implementation_Add_to( Timestamp64_Control *_time, const Timestamp64_Control *_add ) { *_time += *_add; 12dc13: 01 c8 add %ecx,%eax 12dc15: 11 da adc %ebx,%edx case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 12dc17: 8b 75 08 mov 0x8(%ebp),%esi 12dc1a: 8b 4e 44 mov 0x44(%esi),%ecx 12dc1d: 8b 5e 48 mov 0x48(%esi),%ebx /* * The cpu usage info was reset while executing. Can't * determine a status. */ if (_Timestamp_Less_than(&used, &the_period->cpu_usage_period_initiated)) 12dc20: 39 da cmp %ebx,%edx 12dc22: 7c 19 jl 12dc3d <_Rate_monotonic_Get_status+0x85><== NEVER TAKEN 12dc24: 7f 04 jg 12dc2a <_Rate_monotonic_Get_status+0x72> 12dc26: 39 c8 cmp %ecx,%eax 12dc28: 72 13 jb 12dc3d <_Rate_monotonic_Get_status+0x85> const Timestamp64_Control *_start, const Timestamp64_Control *_end, Timestamp64_Control *_result ) { *_result = *_end - *_start; 12dc2a: 29 c8 sub %ecx,%eax 12dc2c: 19 da sbb %ebx,%edx 12dc2e: 8b 4d 10 mov 0x10(%ebp),%ecx 12dc31: 89 01 mov %eax,(%ecx) 12dc33: 89 51 04 mov %edx,0x4(%ecx) if (used < the_period->cpu_usage_period_initiated) return false; *cpu_since_last_period = used - the_period->cpu_usage_period_initiated; #endif return true; 12dc36: be 01 00 00 00 mov $0x1,%esi 12dc3b: eb 02 jmp 12dc3f <_Rate_monotonic_Get_status+0x87> /* * The cpu usage info was reset while executing. Can't * determine a status. */ if (_Timestamp_Less_than(&used, &the_period->cpu_usage_period_initiated)) return false; 12dc3d: 31 f6 xor %esi,%esi return false; *cpu_since_last_period = used - the_period->cpu_usage_period_initiated; #endif return true; } 12dc3f: 89 f0 mov %esi,%eax 12dc41: 8d 65 f4 lea -0xc(%ebp),%esp 12dc44: 5b pop %ebx 12dc45: 5e pop %esi 12dc46: 5f pop %edi 12dc47: 5d pop %ebp 12dc48: c3 ret =============================================================================== 0012dedc <_Rate_monotonic_Timeout>: void _Rate_monotonic_Timeout( Objects_Id id, void *ignored ) { 12dedc: 55 push %ebp 12dedd: 89 e5 mov %esp,%ebp 12dedf: 53 push %ebx 12dee0: 83 ec 18 sub $0x18,%esp /* * 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 ); 12dee3: 8d 45 f4 lea -0xc(%ebp),%eax 12dee6: 50 push %eax 12dee7: ff 75 08 pushl 0x8(%ebp) 12deea: 68 a0 ec 16 00 push $0x16eca0 12deef: e8 4c d1 fd ff call 10b040 <_Objects_Get> switch ( location ) { 12def4: 83 c4 10 add $0x10,%esp 12def7: 83 7d f4 00 cmpl $0x0,-0xc(%ebp) 12defb: 75 6b jne 12df68 <_Rate_monotonic_Timeout+0x8c><== NEVER TAKEN 12defd: 89 c3 mov %eax,%ebx case OBJECTS_LOCAL: the_thread = the_period->owner; 12deff: 8b 40 40 mov 0x40(%eax),%eax if ( _States_Is_waiting_for_period( the_thread->current_state ) && 12df02: f6 40 11 40 testb $0x40,0x11(%eax) 12df06: 74 18 je 12df20 <_Rate_monotonic_Timeout+0x44> 12df08: 8b 53 08 mov 0x8(%ebx),%edx 12df0b: 39 50 20 cmp %edx,0x20(%eax) 12df0e: 75 10 jne 12df20 <_Rate_monotonic_Timeout+0x44> RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 12df10: 51 push %ecx 12df11: 51 push %ecx 12df12: 68 f8 ff 03 10 push $0x1003fff8 12df17: 50 push %eax 12df18: e8 27 d9 fd ff call 10b844 <_Thread_Clear_state> the_thread->Wait.id == the_period->Object.id ) { _Thread_Unblock( the_thread ); _Rate_monotonic_Initiate_statistics( the_period ); 12df1d: 58 pop %eax 12df1e: eb 10 jmp 12df30 <_Rate_monotonic_Timeout+0x54> _Watchdog_Insert_ticks( &the_period->Timer, the_period->next_length ); } else if ( the_period->state == RATE_MONOTONIC_OWNER_IS_BLOCKING ) { 12df20: 83 7b 38 01 cmpl $0x1,0x38(%ebx) 12df24: 75 2b jne 12df51 <_Rate_monotonic_Timeout+0x75> the_period->state = RATE_MONOTONIC_EXPIRED_WHILE_BLOCKING; 12df26: c7 43 38 03 00 00 00 movl $0x3,0x38(%ebx) _Rate_monotonic_Initiate_statistics( the_period ); 12df2d: 83 ec 0c sub $0xc,%esp 12df30: 53 push %ebx 12df31: e8 b2 fd ff ff call 12dce8 <_Rate_monotonic_Initiate_statistics> Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 12df36: 8b 43 3c mov 0x3c(%ebx),%eax 12df39: 89 43 1c mov %eax,0x1c(%ebx) _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 12df3c: 58 pop %eax 12df3d: 5a pop %edx _Watchdog_Insert_ticks( &the_period->Timer, the_period->next_length ); 12df3e: 83 c3 10 add $0x10,%ebx 12df41: 53 push %ebx 12df42: 68 a0 e2 16 00 push $0x16e2a0 12df47: e8 20 e7 fd ff call 10c66c <_Watchdog_Insert> 12df4c: 83 c4 10 add $0x10,%esp 12df4f: eb 07 jmp 12df58 <_Rate_monotonic_Timeout+0x7c> } else the_period->state = RATE_MONOTONIC_EXPIRED; 12df51: c7 43 38 04 00 00 00 movl $0x4,0x38(%ebx) * * This routine decrements the thread dispatch level. */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_decrement_disable_level(void) { _Thread_Dispatch_disable_level--; 12df58: a1 fc e1 16 00 mov 0x16e1fc,%eax 12df5d: 48 dec %eax 12df5e: a3 fc e1 16 00 mov %eax,0x16e1fc return _Thread_Dispatch_disable_level; 12df63: a1 fc e1 16 00 mov 0x16e1fc,%eax case OBJECTS_REMOTE: /* impossible */ #endif case OBJECTS_ERROR: break; } } 12df68: 8b 5d fc mov -0x4(%ebp),%ebx 12df6b: c9 leave 12df6c: c3 ret =============================================================================== 0012dc49 <_Rate_monotonic_Update_statistics>: } static void _Rate_monotonic_Update_statistics( Rate_monotonic_Control *the_period ) { 12dc49: 55 push %ebp 12dc4a: 89 e5 mov %esp,%ebp 12dc4c: 56 push %esi 12dc4d: 53 push %ebx 12dc4e: 83 ec 10 sub $0x10,%esp 12dc51: 89 c6 mov %eax,%esi /* * Update the counts. */ stats = &the_period->Statistics; stats->count++; 12dc53: ff 40 54 incl 0x54(%eax) if ( the_period->state == RATE_MONOTONIC_EXPIRED ) 12dc56: 83 78 38 04 cmpl $0x4,0x38(%eax) 12dc5a: 75 03 jne 12dc5f <_Rate_monotonic_Update_statistics+0x16> stats->missed_count++; 12dc5c: ff 40 58 incl 0x58(%eax) /* * Grab status for time statistics. */ valid_status = 12dc5f: 50 push %eax _Rate_monotonic_Get_status( the_period, &since_last_period, &executed ); 12dc60: 8d 45 e8 lea -0x18(%ebp),%eax stats->missed_count++; /* * Grab status for time statistics. */ valid_status = 12dc63: 50 push %eax _Rate_monotonic_Get_status( the_period, &since_last_period, &executed ); 12dc64: 8d 45 f0 lea -0x10(%ebp),%eax stats->missed_count++; /* * Grab status for time statistics. */ valid_status = 12dc67: 50 push %eax 12dc68: 56 push %esi 12dc69: e8 4a ff ff ff call 12dbb8 <_Rate_monotonic_Get_status> _Rate_monotonic_Get_status( the_period, &since_last_period, &executed ); if (!valid_status) 12dc6e: 83 c4 10 add $0x10,%esp 12dc71: 84 c0 test %al,%al 12dc73: 74 6c je 12dce1 <_Rate_monotonic_Update_statistics+0x98> /* * Update CPU time */ #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ _Timestamp_Add_to( &stats->total_cpu_time, &executed ); 12dc75: 8b 4d e8 mov -0x18(%ebp),%ecx 12dc78: 8b 5d ec mov -0x14(%ebp),%ebx static inline void _Timestamp64_implementation_Add_to( Timestamp64_Control *_time, const Timestamp64_Control *_add ) { *_time += *_add; 12dc7b: 01 4e 6c add %ecx,0x6c(%esi) 12dc7e: 11 5e 70 adc %ebx,0x70(%esi) if ( _Timestamp_Less_than( &executed, &stats->min_cpu_time ) ) 12dc81: 3b 5e 60 cmp 0x60(%esi),%ebx 12dc84: 7f 0d jg 12dc93 <_Rate_monotonic_Update_statistics+0x4a><== NEVER TAKEN 12dc86: 7c 05 jl 12dc8d <_Rate_monotonic_Update_statistics+0x44> 12dc88: 3b 4e 5c cmp 0x5c(%esi),%ecx 12dc8b: 73 06 jae 12dc93 <_Rate_monotonic_Update_statistics+0x4a> stats->min_cpu_time = executed; 12dc8d: 89 4e 5c mov %ecx,0x5c(%esi) 12dc90: 89 5e 60 mov %ebx,0x60(%esi) if ( _Timestamp_Greater_than( &executed, &stats->max_cpu_time ) ) 12dc93: 39 5e 68 cmp %ebx,0x68(%esi) 12dc96: 7f 0d jg 12dca5 <_Rate_monotonic_Update_statistics+0x5c><== NEVER TAKEN 12dc98: 7c 05 jl 12dc9f <_Rate_monotonic_Update_statistics+0x56><== NEVER TAKEN 12dc9a: 39 4e 64 cmp %ecx,0x64(%esi) 12dc9d: 73 06 jae 12dca5 <_Rate_monotonic_Update_statistics+0x5c> stats->max_cpu_time = executed; 12dc9f: 89 4e 64 mov %ecx,0x64(%esi) 12dca2: 89 5e 68 mov %ebx,0x68(%esi) /* * Update Wall time */ #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ _Timestamp_Add_to( &stats->total_wall_time, &since_last_period ); 12dca5: 8b 4d f0 mov -0x10(%ebp),%ecx 12dca8: 8b 5d f4 mov -0xc(%ebp),%ebx 12dcab: 01 8e 84 00 00 00 add %ecx,0x84(%esi) 12dcb1: 11 9e 88 00 00 00 adc %ebx,0x88(%esi) if ( _Timestamp_Less_than( &since_last_period, &stats->min_wall_time ) ) 12dcb7: 3b 5e 78 cmp 0x78(%esi),%ebx 12dcba: 7f 0d jg 12dcc9 <_Rate_monotonic_Update_statistics+0x80><== NEVER TAKEN 12dcbc: 7c 05 jl 12dcc3 <_Rate_monotonic_Update_statistics+0x7a> 12dcbe: 3b 4e 74 cmp 0x74(%esi),%ecx 12dcc1: 73 06 jae 12dcc9 <_Rate_monotonic_Update_statistics+0x80> stats->min_wall_time = since_last_period; 12dcc3: 89 4e 74 mov %ecx,0x74(%esi) 12dcc6: 89 5e 78 mov %ebx,0x78(%esi) if ( _Timestamp_Greater_than( &since_last_period, &stats->max_wall_time ) ) 12dcc9: 39 9e 80 00 00 00 cmp %ebx,0x80(%esi) 12dccf: 7f 10 jg 12dce1 <_Rate_monotonic_Update_statistics+0x98> 12dcd1: 7c 05 jl 12dcd8 <_Rate_monotonic_Update_statistics+0x8f><== NEVER TAKEN 12dcd3: 39 4e 7c cmp %ecx,0x7c(%esi) 12dcd6: 73 09 jae 12dce1 <_Rate_monotonic_Update_statistics+0x98> stats->max_wall_time = since_last_period; 12dcd8: 89 4e 7c mov %ecx,0x7c(%esi) 12dcdb: 89 9e 80 00 00 00 mov %ebx,0x80(%esi) stats->min_wall_time = since_last_period; if ( since_last_period > stats->max_wall_time ) stats->max_wall_time = since_last_period; #endif } 12dce1: 8d 65 f8 lea -0x8(%ebp),%esp 12dce4: 5b pop %ebx 12dce5: 5e pop %esi 12dce6: 5d pop %ebp 12dce7: c3 ret =============================================================================== 0010bcd8 <_Scheduler_CBS_Allocate>: #include void *_Scheduler_CBS_Allocate( Thread_Control *the_thread ) { 10bcd8: 55 push %ebp 10bcd9: 89 e5 mov %esp,%ebp 10bcdb: 53 push %ebx 10bcdc: 83 ec 10 sub $0x10,%esp 10bcdf: 8b 5d 08 mov 0x8(%ebp),%ebx void *sched; Scheduler_CBS_Per_thread *schinfo; sched = _Workspace_Allocate(sizeof(Scheduler_CBS_Per_thread)); 10bce2: 6a 1c push $0x1c 10bce4: e8 a7 15 00 00 call 10d290 <_Workspace_Allocate> if ( sched ) { 10bce9: 83 c4 10 add $0x10,%esp 10bcec: 85 c0 test %eax,%eax 10bcee: 74 16 je 10bd06 <_Scheduler_CBS_Allocate+0x2e><== NEVER TAKEN the_thread->scheduler_info = sched; 10bcf0: 89 83 88 00 00 00 mov %eax,0x88(%ebx) schinfo = (Scheduler_CBS_Per_thread *)(the_thread->scheduler_info); schinfo->edf_per_thread.thread = the_thread; 10bcf6: 89 18 mov %ebx,(%eax) schinfo->edf_per_thread.queue_state = SCHEDULER_EDF_QUEUE_STATE_NEVER_HAS_BEEN; 10bcf8: c7 40 14 02 00 00 00 movl $0x2,0x14(%eax) schinfo->cbs_server = NULL; 10bcff: c7 40 18 00 00 00 00 movl $0x0,0x18(%eax) } return sched; } 10bd06: 8b 5d fc mov -0x4(%ebp),%ebx 10bd09: c9 leave 10bd0a: c3 ret =============================================================================== 0010d104 <_Scheduler_CBS_Budget_callout>: Scheduler_CBS_Server **_Scheduler_CBS_Server_list; void _Scheduler_CBS_Budget_callout( Thread_Control *the_thread ) { 10d104: 55 push %ebp 10d105: 89 e5 mov %esp,%ebp 10d107: 53 push %ebx 10d108: 83 ec 14 sub $0x14,%esp 10d10b: 8b 5d 08 mov 0x8(%ebp),%ebx Priority_Control new_priority; Scheduler_CBS_Per_thread *sched_info; Scheduler_CBS_Server_id server_id; /* Put violating task to background until the end of period. */ new_priority = the_thread->Start.initial_priority; 10d10e: 8b 83 ac 00 00 00 mov 0xac(%ebx),%eax if ( the_thread->real_priority != new_priority ) 10d114: 39 43 18 cmp %eax,0x18(%ebx) 10d117: 74 03 je 10d11c <_Scheduler_CBS_Budget_callout+0x18><== NEVER TAKEN the_thread->real_priority = new_priority; 10d119: 89 43 18 mov %eax,0x18(%ebx) if ( the_thread->current_priority != new_priority ) 10d11c: 39 43 14 cmp %eax,0x14(%ebx) 10d11f: 74 0d je 10d12e <_Scheduler_CBS_Budget_callout+0x2a><== NEVER TAKEN _Thread_Change_priority(the_thread, new_priority, true); 10d121: 52 push %edx 10d122: 6a 01 push $0x1 10d124: 50 push %eax 10d125: 53 push %ebx 10d126: e8 b5 04 00 00 call 10d5e0 <_Thread_Change_priority> 10d12b: 83 c4 10 add $0x10,%esp /* Invoke callback function if any. */ sched_info = (Scheduler_CBS_Per_thread *) the_thread->scheduler_info; 10d12e: 8b 9b 88 00 00 00 mov 0x88(%ebx),%ebx if ( sched_info->cbs_server->cbs_budget_overrun ) { 10d134: 8b 43 18 mov 0x18(%ebx),%eax 10d137: 83 78 0c 00 cmpl $0x0,0xc(%eax) 10d13b: 74 1a je 10d157 <_Scheduler_CBS_Budget_callout+0x53> _Scheduler_CBS_Get_server_id( 10d13d: 52 push %edx 10d13e: 52 push %edx 10d13f: 8d 55 f4 lea -0xc(%ebp),%edx 10d142: 52 push %edx 10d143: ff 30 pushl (%eax) 10d145: e8 7e ff ff ff call 10d0c8 <_Scheduler_CBS_Get_server_id> sched_info->cbs_server->task_id, &server_id ); sched_info->cbs_server->cbs_budget_overrun( server_id ); 10d14a: 59 pop %ecx 10d14b: 8b 43 18 mov 0x18(%ebx),%eax 10d14e: ff 75 f4 pushl -0xc(%ebp) 10d151: ff 50 0c call *0xc(%eax) 10d154: 83 c4 10 add $0x10,%esp } } 10d157: 8b 5d fc mov -0x4(%ebp),%ebx 10d15a: c9 leave 10d15b: c3 ret =============================================================================== 0010cdcc <_Scheduler_CBS_Create_server>: int _Scheduler_CBS_Create_server ( Scheduler_CBS_Parameters *params, Scheduler_CBS_Budget_overrun budget_overrun_callback, rtems_id *server_id ) { 10cdcc: 55 push %ebp 10cdcd: 89 e5 mov %esp,%ebp 10cdcf: 57 push %edi 10cdd0: 56 push %esi 10cdd1: 53 push %ebx 10cdd2: 83 ec 0c sub $0xc,%esp 10cdd5: 8b 5d 08 mov 0x8(%ebp),%ebx 10cdd8: 8b 75 10 mov 0x10(%ebp),%esi unsigned int i; Scheduler_CBS_Server *the_server; if ( params->budget <= 0 || 10cddb: 83 7b 04 00 cmpl $0x0,0x4(%ebx) 10cddf: 7e 42 jle 10ce23 <_Scheduler_CBS_Create_server+0x57> 10cde1: 83 3b 00 cmpl $0x0,(%ebx) 10cde4: 7e 3d jle 10ce23 <_Scheduler_CBS_Create_server+0x57> params->deadline <= 0 || params->budget >= SCHEDULER_EDF_PRIO_MSB || params->deadline >= SCHEDULER_EDF_PRIO_MSB ) return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; for ( i = 0; i<_Scheduler_CBS_Maximum_servers; i++ ) { 10cde6: 8b 15 6c d2 12 00 mov 0x12d26c,%edx if ( !_Scheduler_CBS_Server_list[i] ) 10cdec: 8b 0d ac 19 13 00 mov 0x1319ac,%ecx 10cdf2: 31 c0 xor %eax,%eax 10cdf4: eb 07 jmp 10cdfd <_Scheduler_CBS_Create_server+0x31> 10cdf6: 83 3c 81 00 cmpl $0x0,(%ecx,%eax,4) 10cdfa: 74 35 je 10ce31 <_Scheduler_CBS_Create_server+0x65> params->deadline <= 0 || params->budget >= SCHEDULER_EDF_PRIO_MSB || params->deadline >= SCHEDULER_EDF_PRIO_MSB ) return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; for ( i = 0; i<_Scheduler_CBS_Maximum_servers; i++ ) { 10cdfc: 40 inc %eax 10cdfd: 39 d0 cmp %edx,%eax 10cdff: 75 f5 jne 10cdf6 <_Scheduler_CBS_Create_server+0x2a> if ( !_Scheduler_CBS_Server_list[i] ) break; } if ( i == _Scheduler_CBS_Maximum_servers ) return SCHEDULER_CBS_ERROR_FULL; 10ce01: b8 e6 ff ff ff mov $0xffffffe6,%eax 10ce06: eb 53 jmp 10ce5b <_Scheduler_CBS_Create_server+0x8f> _Workspace_Allocate( sizeof(Scheduler_CBS_Server) ); the_server = _Scheduler_CBS_Server_list[*server_id]; if ( !the_server ) return SCHEDULER_CBS_ERROR_NO_MEMORY; the_server->parameters = *params; 10ce08: 8b 03 mov (%ebx),%eax 10ce0a: 8b 53 04 mov 0x4(%ebx),%edx 10ce0d: 89 41 04 mov %eax,0x4(%ecx) 10ce10: 89 51 08 mov %edx,0x8(%ecx) the_server->task_id = -1; 10ce13: c7 01 ff ff ff ff movl $0xffffffff,(%ecx) the_server->cbs_budget_overrun = budget_overrun_callback; 10ce19: 8b 45 0c mov 0xc(%ebp),%eax 10ce1c: 89 41 0c mov %eax,0xc(%ecx) return SCHEDULER_CBS_OK; 10ce1f: 31 c0 xor %eax,%eax 10ce21: eb 38 jmp 10ce5b <_Scheduler_CBS_Create_server+0x8f> if ( params->budget <= 0 || params->deadline <= 0 || params->budget >= SCHEDULER_EDF_PRIO_MSB || params->deadline >= SCHEDULER_EDF_PRIO_MSB ) return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; 10ce23: b8 ee ff ff ff mov $0xffffffee,%eax 10ce28: eb 31 jmp 10ce5b <_Scheduler_CBS_Create_server+0x8f> *server_id = i; _Scheduler_CBS_Server_list[*server_id] = (Scheduler_CBS_Server *) _Workspace_Allocate( sizeof(Scheduler_CBS_Server) ); the_server = _Scheduler_CBS_Server_list[*server_id]; if ( !the_server ) return SCHEDULER_CBS_ERROR_NO_MEMORY; 10ce2a: b8 ef ff ff ff mov $0xffffffef,%eax <== NOT EXECUTED 10ce2f: eb 2a jmp 10ce5b <_Scheduler_CBS_Create_server+0x8f><== NOT EXECUTED } if ( i == _Scheduler_CBS_Maximum_servers ) return SCHEDULER_CBS_ERROR_FULL; *server_id = i; 10ce31: 89 06 mov %eax,(%esi) _Scheduler_CBS_Server_list[*server_id] = (Scheduler_CBS_Server *) 10ce33: 8b 15 ac 19 13 00 mov 0x1319ac,%edx 10ce39: 8d 3c 82 lea (%edx,%eax,4),%edi _Workspace_Allocate( sizeof(Scheduler_CBS_Server) ); 10ce3c: 83 ec 0c sub $0xc,%esp 10ce3f: 6a 10 push $0x10 10ce41: e8 c2 18 00 00 call 10e708 <_Workspace_Allocate> if ( i == _Scheduler_CBS_Maximum_servers ) return SCHEDULER_CBS_ERROR_FULL; *server_id = i; _Scheduler_CBS_Server_list[*server_id] = (Scheduler_CBS_Server *) 10ce46: 89 07 mov %eax,(%edi) _Workspace_Allocate( sizeof(Scheduler_CBS_Server) ); the_server = _Scheduler_CBS_Server_list[*server_id]; 10ce48: 8b 16 mov (%esi),%edx 10ce4a: a1 ac 19 13 00 mov 0x1319ac,%eax 10ce4f: 8b 0c 90 mov (%eax,%edx,4),%ecx if ( !the_server ) 10ce52: 83 c4 10 add $0x10,%esp 10ce55: 85 c9 test %ecx,%ecx 10ce57: 75 af jne 10ce08 <_Scheduler_CBS_Create_server+0x3c><== ALWAYS TAKEN 10ce59: eb cf jmp 10ce2a <_Scheduler_CBS_Create_server+0x5e><== NOT EXECUTED the_server->parameters = *params; the_server->task_id = -1; the_server->cbs_budget_overrun = budget_overrun_callback; return SCHEDULER_CBS_OK; } 10ce5b: 8d 65 f4 lea -0xc(%ebp),%esp 10ce5e: 5b pop %ebx 10ce5f: 5e pop %esi 10ce60: 5f pop %edi 10ce61: 5d pop %ebp 10ce62: c3 ret =============================================================================== 0010ced4 <_Scheduler_CBS_Detach_thread>: int _Scheduler_CBS_Detach_thread ( Scheduler_CBS_Server_id server_id, rtems_id task_id ) { 10ced4: 55 push %ebp 10ced5: 89 e5 mov %esp,%ebp 10ced7: 57 push %edi 10ced8: 56 push %esi 10ced9: 53 push %ebx 10ceda: 83 ec 24 sub $0x24,%esp 10cedd: 8b 7d 08 mov 0x8(%ebp),%edi 10cee0: 8b 75 0c mov 0xc(%ebp),%esi Objects_Locations location; Thread_Control *the_thread; Scheduler_CBS_Per_thread *sched_info; the_thread = _Thread_Get(task_id, &location); 10cee3: 8d 45 e4 lea -0x1c(%ebp),%eax 10cee6: 50 push %eax 10cee7: 56 push %esi 10cee8: e8 03 0b 00 00 call 10d9f0 <_Thread_Get> 10ceed: 89 c3 mov %eax,%ebx /* The routine _Thread_Get may disable dispatch and not enable again. */ if ( the_thread ) { 10ceef: 83 c4 10 add $0x10,%esp 10cef2: 85 c0 test %eax,%eax 10cef4: 74 05 je 10cefb <_Scheduler_CBS_Detach_thread+0x27> _Thread_Enable_dispatch(); 10cef6: e8 d5 0a 00 00 call 10d9d0 <_Thread_Enable_dispatch> } if ( server_id >= _Scheduler_CBS_Maximum_servers ) 10cefb: 3b 3d 6c d2 12 00 cmp 0x12d26c,%edi 10cf01: 73 4d jae 10cf50 <_Scheduler_CBS_Detach_thread+0x7c> return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; if ( !the_thread ) 10cf03: 85 db test %ebx,%ebx 10cf05: 74 49 je 10cf50 <_Scheduler_CBS_Detach_thread+0x7c> return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; /* Server is not valid. */ if ( !_Scheduler_CBS_Server_list[server_id] ) 10cf07: a1 ac 19 13 00 mov 0x1319ac,%eax 10cf0c: 8b 04 b8 mov (%eax,%edi,4),%eax 10cf0f: 85 c0 test %eax,%eax 10cf11: 74 36 je 10cf49 <_Scheduler_CBS_Detach_thread+0x75> return SCHEDULER_CBS_ERROR_NOSERVER; /* Thread and server are not attached. */ if ( _Scheduler_CBS_Server_list[server_id]->task_id != task_id ) 10cf13: 39 30 cmp %esi,(%eax) 10cf15: 75 39 jne 10cf50 <_Scheduler_CBS_Detach_thread+0x7c><== NEVER TAKEN return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; _Scheduler_CBS_Server_list[server_id]->task_id = -1; 10cf17: c7 00 ff ff ff ff movl $0xffffffff,(%eax) sched_info = (Scheduler_CBS_Per_thread *) the_thread->scheduler_info; sched_info->cbs_server = NULL; 10cf1d: 8b 83 88 00 00 00 mov 0x88(%ebx),%eax 10cf23: c7 40 18 00 00 00 00 movl $0x0,0x18(%eax) the_thread->budget_algorithm = the_thread->Start.budget_algorithm; 10cf2a: 8b 83 a0 00 00 00 mov 0xa0(%ebx),%eax 10cf30: 89 43 78 mov %eax,0x78(%ebx) the_thread->budget_callout = the_thread->Start.budget_callout; 10cf33: 8b 83 a4 00 00 00 mov 0xa4(%ebx),%eax 10cf39: 89 43 7c mov %eax,0x7c(%ebx) the_thread->is_preemptible = the_thread->Start.is_preemptible; 10cf3c: 8a 83 9c 00 00 00 mov 0x9c(%ebx),%al 10cf42: 88 43 70 mov %al,0x70(%ebx) return SCHEDULER_CBS_OK; 10cf45: 31 c0 xor %eax,%eax 10cf47: eb 0c jmp 10cf55 <_Scheduler_CBS_Detach_thread+0x81> return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; if ( !the_thread ) return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; /* Server is not valid. */ if ( !_Scheduler_CBS_Server_list[server_id] ) return SCHEDULER_CBS_ERROR_NOSERVER; 10cf49: b8 e7 ff ff ff mov $0xffffffe7,%eax 10cf4e: eb 05 jmp 10cf55 <_Scheduler_CBS_Detach_thread+0x81> if ( the_thread ) { _Thread_Enable_dispatch(); } if ( server_id >= _Scheduler_CBS_Maximum_servers ) return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; 10cf50: b8 ee ff ff ff mov $0xffffffee,%eax the_thread->budget_algorithm = the_thread->Start.budget_algorithm; the_thread->budget_callout = the_thread->Start.budget_callout; the_thread->is_preemptible = the_thread->Start.is_preemptible; return SCHEDULER_CBS_OK; } 10cf55: 8d 65 f4 lea -0xc(%ebp),%esp 10cf58: 5b pop %ebx 10cf59: 5e pop %esi 10cf5a: 5f pop %edi 10cf5b: 5d pop %ebp 10cf5c: c3 ret =============================================================================== 0010cf98 <_Scheduler_CBS_Get_execution_time>: int _Scheduler_CBS_Get_execution_time ( Scheduler_CBS_Server_id server_id, time_t *exec_time, time_t *abs_time ) { 10cf98: 55 push %ebp 10cf99: 89 e5 mov %esp,%ebp 10cf9b: 57 push %edi 10cf9c: 56 push %esi 10cf9d: 53 push %ebx 10cf9e: 83 ec 1c sub $0x1c,%esp 10cfa1: 8b 5d 08 mov 0x8(%ebp),%ebx 10cfa4: 8b 75 0c mov 0xc(%ebp),%esi Objects_Locations location; Thread_Control *the_thread; if ( server_id >= _Scheduler_CBS_Maximum_servers ) 10cfa7: 3b 1d 6c d2 12 00 cmp 0x12d26c,%ebx 10cfad: 73 58 jae 10d007 <_Scheduler_CBS_Get_execution_time+0x6f> return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; if ( !_Scheduler_CBS_Server_list[server_id] ) 10cfaf: a1 ac 19 13 00 mov 0x1319ac,%eax 10cfb4: 8b 04 98 mov (%eax,%ebx,4),%eax 10cfb7: 85 c0 test %eax,%eax 10cfb9: 74 53 je 10d00e <_Scheduler_CBS_Get_execution_time+0x76> return SCHEDULER_CBS_ERROR_NOSERVER; if ( _Scheduler_CBS_Server_list[server_id]->task_id == -1 ) { 10cfbb: 8b 00 mov (%eax),%eax 10cfbd: 83 f8 ff cmp $0xffffffff,%eax 10cfc0: 75 08 jne 10cfca <_Scheduler_CBS_Get_execution_time+0x32> *exec_time = 0; 10cfc2: c7 06 00 00 00 00 movl $0x0,(%esi) 10cfc8: eb 39 jmp 10d003 <_Scheduler_CBS_Get_execution_time+0x6b> return SCHEDULER_CBS_OK; } the_thread = _Thread_Get( 10cfca: 52 push %edx 10cfcb: 52 push %edx 10cfcc: 8d 55 e4 lea -0x1c(%ebp),%edx 10cfcf: 52 push %edx 10cfd0: 50 push %eax 10cfd1: e8 1a 0a 00 00 call 10d9f0 <_Thread_Get> 10cfd6: 89 c7 mov %eax,%edi _Scheduler_CBS_Server_list[server_id]->task_id, &location ); /* The routine _Thread_Get may disable dispatch and not enable again. */ if ( the_thread ) { 10cfd8: 83 c4 10 add $0x10,%esp 10cfdb: 85 c0 test %eax,%eax 10cfdd: 74 17 je 10cff6 <_Scheduler_CBS_Get_execution_time+0x5e><== NEVER TAKEN _Thread_Enable_dispatch(); 10cfdf: e8 ec 09 00 00 call 10d9d0 <_Thread_Enable_dispatch> *exec_time = _Scheduler_CBS_Server_list[server_id]->parameters.budget - 10cfe4: a1 ac 19 13 00 mov 0x1319ac,%eax 10cfe9: 8b 04 98 mov (%eax,%ebx,4),%eax 10cfec: 8b 50 08 mov 0x8(%eax),%edx 10cfef: 2b 57 74 sub 0x74(%edi),%edx 10cff2: 89 16 mov %edx,(%esi) 10cff4: eb 0d jmp 10d003 <_Scheduler_CBS_Get_execution_time+0x6b> the_thread->cpu_time_budget; } else { *exec_time = _Scheduler_CBS_Server_list[server_id]->parameters.budget; 10cff6: a1 ac 19 13 00 mov 0x1319ac,%eax <== NOT EXECUTED 10cffb: 8b 04 98 mov (%eax,%ebx,4),%eax <== NOT EXECUTED 10cffe: 8b 40 08 mov 0x8(%eax),%eax <== NOT EXECUTED 10d001: 89 06 mov %eax,(%esi) <== NOT EXECUTED } return SCHEDULER_CBS_OK; 10d003: 31 c0 xor %eax,%eax 10d005: eb 0c jmp 10d013 <_Scheduler_CBS_Get_execution_time+0x7b> { Objects_Locations location; Thread_Control *the_thread; if ( server_id >= _Scheduler_CBS_Maximum_servers ) return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; 10d007: b8 ee ff ff ff mov $0xffffffee,%eax 10d00c: eb 05 jmp 10d013 <_Scheduler_CBS_Get_execution_time+0x7b> if ( !_Scheduler_CBS_Server_list[server_id] ) return SCHEDULER_CBS_ERROR_NOSERVER; 10d00e: b8 e7 ff ff ff mov $0xffffffe7,%eax } else { *exec_time = _Scheduler_CBS_Server_list[server_id]->parameters.budget; } return SCHEDULER_CBS_OK; } 10d013: 8d 65 f4 lea -0xc(%ebp),%esp 10d016: 5b pop %ebx 10d017: 5e pop %esi 10d018: 5f pop %edi 10d019: 5d pop %ebp 10d01a: c3 ret =============================================================================== 0010d058 <_Scheduler_CBS_Get_remaining_budget>: int _Scheduler_CBS_Get_remaining_budget ( Scheduler_CBS_Server_id server_id, time_t *remaining_budget ) { 10d058: 55 push %ebp 10d059: 89 e5 mov %esp,%ebp 10d05b: 56 push %esi 10d05c: 53 push %ebx 10d05d: 83 ec 10 sub $0x10,%esp 10d060: 8b 45 08 mov 0x8(%ebp),%eax 10d063: 8b 5d 0c mov 0xc(%ebp),%ebx Objects_Locations location; Thread_Control *the_thread; if ( server_id >= _Scheduler_CBS_Maximum_servers ) 10d066: 3b 05 6c d2 12 00 cmp 0x12d26c,%eax 10d06c: 73 44 jae 10d0b2 <_Scheduler_CBS_Get_remaining_budget+0x5a> return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; if ( !_Scheduler_CBS_Server_list[server_id] ) 10d06e: 8b 15 ac 19 13 00 mov 0x1319ac,%edx 10d074: 8b 04 82 mov (%edx,%eax,4),%eax 10d077: 85 c0 test %eax,%eax 10d079: 74 3e je 10d0b9 <_Scheduler_CBS_Get_remaining_budget+0x61> return SCHEDULER_CBS_ERROR_NOSERVER; if ( _Scheduler_CBS_Server_list[server_id]->task_id == -1 ) { 10d07b: 8b 10 mov (%eax),%edx 10d07d: 83 fa ff cmp $0xffffffff,%edx 10d080: 75 05 jne 10d087 <_Scheduler_CBS_Get_remaining_budget+0x2f> *remaining_budget = _Scheduler_CBS_Server_list[server_id]->parameters.budget; 10d082: 8b 40 08 mov 0x8(%eax),%eax 10d085: eb 1d jmp 10d0a4 <_Scheduler_CBS_Get_remaining_budget+0x4c> return SCHEDULER_CBS_OK; } the_thread = _Thread_Get( 10d087: 50 push %eax 10d088: 50 push %eax 10d089: 8d 45 f4 lea -0xc(%ebp),%eax 10d08c: 50 push %eax 10d08d: 52 push %edx 10d08e: e8 5d 09 00 00 call 10d9f0 <_Thread_Get> 10d093: 89 c6 mov %eax,%esi _Scheduler_CBS_Server_list[server_id]->task_id, &location ); /* The routine _Thread_Get may disable dispatch and not enable again. */ if ( the_thread ) { 10d095: 83 c4 10 add $0x10,%esp 10d098: 85 c0 test %eax,%eax 10d09a: 74 0c je 10d0a8 <_Scheduler_CBS_Get_remaining_budget+0x50><== NEVER TAKEN _Thread_Enable_dispatch(); 10d09c: e8 2f 09 00 00 call 10d9d0 <_Thread_Enable_dispatch> *remaining_budget = the_thread->cpu_time_budget; 10d0a1: 8b 46 74 mov 0x74(%esi),%eax 10d0a4: 89 03 mov %eax,(%ebx) 10d0a6: eb 06 jmp 10d0ae <_Scheduler_CBS_Get_remaining_budget+0x56> } else { *remaining_budget = 0; 10d0a8: c7 03 00 00 00 00 movl $0x0,(%ebx) <== NOT EXECUTED } return SCHEDULER_CBS_OK; 10d0ae: 31 c0 xor %eax,%eax 10d0b0: eb 0c jmp 10d0be <_Scheduler_CBS_Get_remaining_budget+0x66> { Objects_Locations location; Thread_Control *the_thread; if ( server_id >= _Scheduler_CBS_Maximum_servers ) return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; 10d0b2: b8 ee ff ff ff mov $0xffffffee,%eax 10d0b7: eb 05 jmp 10d0be <_Scheduler_CBS_Get_remaining_budget+0x66> if ( !_Scheduler_CBS_Server_list[server_id] ) return SCHEDULER_CBS_ERROR_NOSERVER; 10d0b9: b8 e7 ff ff ff mov $0xffffffe7,%eax else { *remaining_budget = 0; } return SCHEDULER_CBS_OK; } 10d0be: 8d 65 f8 lea -0x8(%ebp),%esp 10d0c1: 5b pop %ebx 10d0c2: 5e pop %esi 10d0c3: 5d pop %ebp 10d0c4: c3 ret =============================================================================== 0010d15c <_Scheduler_CBS_Initialize>: int _Scheduler_CBS_Initialize(void) { 10d15c: 55 push %ebp 10d15d: 89 e5 mov %esp,%ebp 10d15f: 83 ec 14 sub $0x14,%esp unsigned int i; _Scheduler_CBS_Server_list = (Scheduler_CBS_Server **) _Workspace_Allocate( 10d162: a1 6c d2 12 00 mov 0x12d26c,%eax 10d167: c1 e0 02 shl $0x2,%eax 10d16a: 50 push %eax 10d16b: e8 98 15 00 00 call 10e708 <_Workspace_Allocate> 10d170: a3 ac 19 13 00 mov %eax,0x1319ac _Scheduler_CBS_Maximum_servers * sizeof(Scheduler_CBS_Server*) ); if ( !_Scheduler_CBS_Server_list ) 10d175: 83 c4 10 add $0x10,%esp 10d178: 85 c0 test %eax,%eax 10d17a: 74 20 je 10d19c <_Scheduler_CBS_Initialize+0x40><== NEVER TAKEN return SCHEDULER_CBS_ERROR_NO_MEMORY; for (i = 0; i<_Scheduler_CBS_Maximum_servers; i++) { 10d17c: 8b 15 6c d2 12 00 mov 0x12d26c,%edx 10d182: 31 c0 xor %eax,%eax 10d184: eb 0e jmp 10d194 <_Scheduler_CBS_Initialize+0x38> _Scheduler_CBS_Server_list[i] = NULL; 10d186: 8b 0d ac 19 13 00 mov 0x1319ac,%ecx 10d18c: c7 04 81 00 00 00 00 movl $0x0,(%ecx,%eax,4) unsigned int i; _Scheduler_CBS_Server_list = (Scheduler_CBS_Server **) _Workspace_Allocate( _Scheduler_CBS_Maximum_servers * sizeof(Scheduler_CBS_Server*) ); if ( !_Scheduler_CBS_Server_list ) return SCHEDULER_CBS_ERROR_NO_MEMORY; for (i = 0; i<_Scheduler_CBS_Maximum_servers; i++) { 10d193: 40 inc %eax 10d194: 39 d0 cmp %edx,%eax 10d196: 75 ee jne 10d186 <_Scheduler_CBS_Initialize+0x2a> _Scheduler_CBS_Server_list[i] = NULL; } return SCHEDULER_CBS_OK; 10d198: 31 c0 xor %eax,%eax 10d19a: eb 05 jmp 10d1a1 <_Scheduler_CBS_Initialize+0x45> { unsigned int i; _Scheduler_CBS_Server_list = (Scheduler_CBS_Server **) _Workspace_Allocate( _Scheduler_CBS_Maximum_servers * sizeof(Scheduler_CBS_Server*) ); if ( !_Scheduler_CBS_Server_list ) return SCHEDULER_CBS_ERROR_NO_MEMORY; 10d19c: b8 ef ff ff ff mov $0xffffffef,%eax <== NOT EXECUTED for (i = 0; i<_Scheduler_CBS_Maximum_servers; i++) { _Scheduler_CBS_Server_list[i] = NULL; } return SCHEDULER_CBS_OK; } 10d1a1: c9 leave 10d1a2: c3 ret =============================================================================== 0010bd0c <_Scheduler_CBS_Release_job>: void _Scheduler_CBS_Release_job( Thread_Control *the_thread, uint32_t deadline ) { 10bd0c: 55 push %ebp 10bd0d: 89 e5 mov %esp,%ebp 10bd0f: 83 ec 08 sub $0x8,%esp 10bd12: 8b 55 08 mov 0x8(%ebp),%edx 10bd15: 8b 45 0c mov 0xc(%ebp),%eax Priority_Control new_priority; Scheduler_CBS_Per_thread *sched_info = (Scheduler_CBS_Per_thread *) the_thread->scheduler_info; Scheduler_CBS_Server *serv_info = (Scheduler_CBS_Server *) sched_info->cbs_server; 10bd18: 8b 8a 88 00 00 00 mov 0x88(%edx),%ecx ) { Priority_Control new_priority; Scheduler_CBS_Per_thread *sched_info = (Scheduler_CBS_Per_thread *) the_thread->scheduler_info; Scheduler_CBS_Server *serv_info = 10bd1e: 8b 49 18 mov 0x18(%ecx),%ecx (Scheduler_CBS_Server *) sched_info->cbs_server; if (deadline) { 10bd21: 85 c0 test %eax,%eax 10bd23: 74 22 je 10bd47 <_Scheduler_CBS_Release_job+0x3b> /* Initializing or shifting deadline. */ if (serv_info) 10bd25: 85 c9 test %ecx,%ecx 10bd27: 74 0f je 10bd38 <_Scheduler_CBS_Release_job+0x2c> new_priority = (_Watchdog_Ticks_since_boot + serv_info->parameters.deadline) 10bd29: a1 40 f5 12 00 mov 0x12f540,%eax 10bd2e: 03 41 04 add 0x4(%ecx),%eax 10bd31: 25 ff ff ff 7f and $0x7fffffff,%eax 10bd36: eb 19 jmp 10bd51 <_Scheduler_CBS_Release_job+0x45> & ~SCHEDULER_EDF_PRIO_MSB; else new_priority = (_Watchdog_Ticks_since_boot + deadline) 10bd38: 8b 0d 40 f5 12 00 mov 0x12f540,%ecx 10bd3e: 01 c8 add %ecx,%eax 10bd40: 25 ff ff ff 7f and $0x7fffffff,%eax 10bd45: eb 10 jmp 10bd57 <_Scheduler_CBS_Release_job+0x4b> & ~SCHEDULER_EDF_PRIO_MSB; } else { /* Switch back to background priority. */ new_priority = the_thread->Start.initial_priority; 10bd47: 8b 82 ac 00 00 00 mov 0xac(%edx),%eax } /* Budget replenishment for the next job. */ if (serv_info) 10bd4d: 85 c9 test %ecx,%ecx 10bd4f: 74 06 je 10bd57 <_Scheduler_CBS_Release_job+0x4b><== NEVER TAKEN the_thread->cpu_time_budget = serv_info->parameters.budget; 10bd51: 8b 49 08 mov 0x8(%ecx),%ecx 10bd54: 89 4a 74 mov %ecx,0x74(%edx) the_thread->real_priority = new_priority; 10bd57: 89 42 18 mov %eax,0x18(%edx) _Thread_Change_priority(the_thread, new_priority, true); 10bd5a: 51 push %ecx 10bd5b: 6a 01 push $0x1 10bd5d: 50 push %eax 10bd5e: 52 push %edx 10bd5f: e8 9c 03 00 00 call 10c100 <_Thread_Change_priority> 10bd64: 83 c4 10 add $0x10,%esp } 10bd67: c9 leave 10bd68: c3 ret =============================================================================== 0010bd6c <_Scheduler_CBS_Unblock>: #include void _Scheduler_CBS_Unblock( Thread_Control *the_thread ) { 10bd6c: 55 push %ebp 10bd6d: 89 e5 mov %esp,%ebp 10bd6f: 56 push %esi 10bd70: 53 push %ebx 10bd71: 8b 5d 08 mov 0x8(%ebp),%ebx Scheduler_CBS_Per_thread *sched_info; Scheduler_CBS_Server *serv_info; Priority_Control new_priority; _Scheduler_EDF_Enqueue(the_thread); 10bd74: 83 ec 0c sub $0xc,%esp 10bd77: 53 push %ebx 10bd78: e8 cf 00 00 00 call 10be4c <_Scheduler_EDF_Enqueue> /* TODO: flash critical section? */ sched_info = (Scheduler_CBS_Per_thread *) the_thread->scheduler_info; serv_info = (Scheduler_CBS_Server *) sched_info->cbs_server; 10bd7d: 8b 83 88 00 00 00 mov 0x88(%ebx),%eax 10bd83: 8b 40 18 mov 0x18(%eax),%eax * Late unblock rule for deadline-driven tasks. The remaining time to * deadline must be sufficient to serve the remaining computation time * without increased utilization of this task. It might cause a deadline * miss of another task. */ if (serv_info) { 10bd86: 83 c4 10 add $0x10,%esp 10bd89: 85 c0 test %eax,%eax 10bd8b: 74 3d je 10bdca <_Scheduler_CBS_Unblock+0x5e> time_t deadline = serv_info->parameters.deadline; time_t budget = serv_info->parameters.budget; time_t deadline_left = the_thread->cpu_time_budget; time_t budget_left = the_thread->real_priority - 10bd8d: 8b 4b 18 mov 0x18(%ebx),%ecx 10bd90: 8b 15 40 f5 12 00 mov 0x12f540,%edx 10bd96: 89 ce mov %ecx,%esi 10bd98: 29 d6 sub %edx,%esi _Watchdog_Ticks_since_boot; if ( deadline*budget_left > budget*deadline_left ) { 10bd9a: 8b 50 04 mov 0x4(%eax),%edx 10bd9d: 0f af d6 imul %esi,%edx 10bda0: 8b 40 08 mov 0x8(%eax),%eax 10bda3: 0f af 43 74 imul 0x74(%ebx),%eax 10bda7: 39 c2 cmp %eax,%edx 10bda9: 7e 1f jle 10bdca <_Scheduler_CBS_Unblock+0x5e> /* Put late unblocked task to background until the end of period. */ new_priority = the_thread->Start.initial_priority; 10bdab: 8b 83 ac 00 00 00 mov 0xac(%ebx),%eax if ( the_thread->real_priority != new_priority ) 10bdb1: 39 c1 cmp %eax,%ecx 10bdb3: 74 03 je 10bdb8 <_Scheduler_CBS_Unblock+0x4c> the_thread->real_priority = new_priority; 10bdb5: 89 43 18 mov %eax,0x18(%ebx) if ( the_thread->current_priority != new_priority ) 10bdb8: 39 43 14 cmp %eax,0x14(%ebx) 10bdbb: 74 0d je 10bdca <_Scheduler_CBS_Unblock+0x5e> _Thread_Change_priority(the_thread, new_priority, true); 10bdbd: 52 push %edx 10bdbe: 6a 01 push $0x1 10bdc0: 50 push %eax 10bdc1: 53 push %ebx 10bdc2: e8 39 03 00 00 call 10c100 <_Thread_Change_priority> 10bdc7: 83 c4 10 add $0x10,%esp 10bdca: 50 push %eax 10bdcb: 50 push %eax * a context switch. * Pseudo-ISR case: * Even if the thread isn't preemptible, if the new heir is * a pseudo-ISR system task, we need to do a context switch. */ if ( _Scheduler_Is_priority_higher_than( the_thread->current_priority, 10bdcc: a1 58 f9 12 00 mov 0x12f958,%eax 10bdd1: ff 70 14 pushl 0x14(%eax) 10bdd4: ff 73 14 pushl 0x14(%ebx) 10bdd7: ff 15 60 b2 12 00 call *0x12b260 10bddd: 83 c4 10 add $0x10,%esp 10bde0: 85 c0 test %eax,%eax 10bde2: 7e 1e jle 10be02 <_Scheduler_CBS_Unblock+0x96> _Thread_Heir->current_priority)) { _Thread_Heir = the_thread; 10bde4: 89 1d 58 f9 12 00 mov %ebx,0x12f958 if ( _Thread_Executing->is_preemptible || 10bdea: a1 54 f9 12 00 mov 0x12f954,%eax 10bdef: 80 78 70 00 cmpb $0x0,0x70(%eax) 10bdf3: 75 06 jne 10bdfb <_Scheduler_CBS_Unblock+0x8f> 10bdf5: 83 7b 14 00 cmpl $0x0,0x14(%ebx) 10bdf9: 75 07 jne 10be02 <_Scheduler_CBS_Unblock+0x96><== ALWAYS TAKEN the_thread->current_priority == 0 ) _Thread_Dispatch_necessary = true; 10bdfb: c6 05 60 f9 12 00 01 movb $0x1,0x12f960 } } 10be02: 8d 65 f8 lea -0x8(%ebp),%esp 10be05: 5b pop %ebx 10be06: 5e pop %esi 10be07: 5d pop %ebp 10be08: c3 ret =============================================================================== 0010bcd8 <_Scheduler_EDF_Allocate>: #include void *_Scheduler_EDF_Allocate( Thread_Control *the_thread ) { 10bcd8: 55 push %ebp 10bcd9: 89 e5 mov %esp,%ebp 10bcdb: 53 push %ebx 10bcdc: 83 ec 10 sub $0x10,%esp 10bcdf: 8b 5d 08 mov 0x8(%ebp),%ebx void *sched; Scheduler_EDF_Per_thread *schinfo; sched = _Workspace_Allocate( sizeof(Scheduler_EDF_Per_thread) ); 10bce2: 6a 18 push $0x18 10bce4: e8 27 15 00 00 call 10d210 <_Workspace_Allocate> if ( sched ) { 10bce9: 83 c4 10 add $0x10,%esp 10bcec: 85 c0 test %eax,%eax 10bcee: 74 0f je 10bcff <_Scheduler_EDF_Allocate+0x27><== NEVER TAKEN the_thread->scheduler_info = sched; 10bcf0: 89 83 88 00 00 00 mov %eax,0x88(%ebx) schinfo = (Scheduler_EDF_Per_thread *)(the_thread->scheduler_info); schinfo->thread = the_thread; 10bcf6: 89 18 mov %ebx,(%eax) schinfo->queue_state = SCHEDULER_EDF_QUEUE_STATE_NEVER_HAS_BEEN; 10bcf8: c7 40 14 02 00 00 00 movl $0x2,0x14(%eax) } return sched; } 10bcff: 8b 5d fc mov -0x4(%ebp),%ebx 10bd02: c9 leave 10bd03: c3 ret =============================================================================== 0010bea0 <_Scheduler_EDF_Unblock>: #include void _Scheduler_EDF_Unblock( Thread_Control *the_thread ) { 10bea0: 55 push %ebp 10bea1: 89 e5 mov %esp,%ebp 10bea3: 53 push %ebx 10bea4: 83 ec 10 sub $0x10,%esp 10bea7: 8b 5d 08 mov 0x8(%ebp),%ebx _Scheduler_EDF_Enqueue(the_thread); 10beaa: 53 push %ebx 10beab: e8 94 fe ff ff call 10bd44 <_Scheduler_EDF_Enqueue> 10beb0: 58 pop %eax 10beb1: 5a pop %edx 10beb2: ff 73 14 pushl 0x14(%ebx) * a context switch. * Pseudo-ISR case: * Even if the thread isn't preemptible, if the new heir is * a pseudo-ISR system task, we need to do a context switch. */ if ( _Scheduler_Is_priority_lower_than( 10beb5: a1 58 f9 12 00 mov 0x12f958,%eax 10beba: ff 70 14 pushl 0x14(%eax) 10bebd: ff 15 60 b2 12 00 call *0x12b260 10bec3: 83 c4 10 add $0x10,%esp 10bec6: 85 c0 test %eax,%eax 10bec8: 79 1e jns 10bee8 <_Scheduler_EDF_Unblock+0x48> _Thread_Heir->current_priority, the_thread->current_priority )) { _Thread_Heir = the_thread; 10beca: 89 1d 58 f9 12 00 mov %ebx,0x12f958 if ( _Thread_Executing->is_preemptible || 10bed0: a1 54 f9 12 00 mov 0x12f954,%eax 10bed5: 80 78 70 00 cmpb $0x0,0x70(%eax) 10bed9: 75 06 jne 10bee1 <_Scheduler_EDF_Unblock+0x41> 10bedb: 83 7b 14 00 cmpl $0x0,0x14(%ebx) 10bedf: 75 07 jne 10bee8 <_Scheduler_EDF_Unblock+0x48><== ALWAYS TAKEN the_thread->current_priority == 0 ) _Thread_Dispatch_necessary = true; 10bee1: c6 05 60 f9 12 00 01 movb $0x1,0x12f960 } } 10bee8: 8b 5d fc mov -0x4(%ebp),%ebx 10beeb: c9 leave 10beec: c3 ret =============================================================================== 0010b854 <_Scheduler_priority_Tick>: #include #include void _Scheduler_priority_Tick( void ) { 10b854: 55 push %ebp 10b855: 89 e5 mov %esp,%ebp 10b857: 53 push %ebx 10b858: 50 push %eax Thread_Control *executing; executing = _Thread_Executing; 10b859: 8b 1d ec e8 12 00 mov 0x12e8ec,%ebx /* * If the thread is not preemptible or is not ready, then * just return. */ if ( !executing->is_preemptible ) 10b85f: 80 7b 70 00 cmpb $0x0,0x70(%ebx) 10b863: 74 44 je 10b8a9 <_Scheduler_priority_Tick+0x55> return; if ( !_States_Is_ready( executing->current_state ) ) 10b865: 83 7b 10 00 cmpl $0x0,0x10(%ebx) 10b869: 75 3e jne 10b8a9 <_Scheduler_priority_Tick+0x55> /* * The cpu budget algorithm determines what happens next. */ switch ( executing->budget_algorithm ) { 10b86b: 8b 43 78 mov 0x78(%ebx),%eax 10b86e: 83 f8 01 cmp $0x1,%eax 10b871: 72 36 jb 10b8a9 <_Scheduler_priority_Tick+0x55> 10b873: 83 f8 02 cmp $0x2,%eax 10b876: 76 07 jbe 10b87f <_Scheduler_priority_Tick+0x2b> 10b878: 83 f8 03 cmp $0x3,%eax 10b87b: 75 2c jne 10b8a9 <_Scheduler_priority_Tick+0x55><== NEVER TAKEN 10b87d: eb 1b jmp 10b89a <_Scheduler_priority_Tick+0x46> 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 ) { 10b87f: 8b 43 74 mov 0x74(%ebx),%eax 10b882: 48 dec %eax 10b883: 89 43 74 mov %eax,0x74(%ebx) 10b886: 85 c0 test %eax,%eax 10b888: 7f 1f jg 10b8a9 <_Scheduler_priority_Tick+0x55> * always operates on the scheduler that 'owns' the currently executing * thread. */ RTEMS_INLINE_ROUTINE void _Scheduler_Yield( void ) { _Scheduler.Operations.yield(); 10b88a: ff 15 3c a2 12 00 call *0x12a23c * executing thread's timeslice is reset. Otherwise, the * currently executing thread is placed at the rear of the * FIFO for this priority and a new heir is selected. */ _Scheduler_Yield(); executing->cpu_time_budget = _Thread_Ticks_per_timeslice; 10b890: a1 b8 e3 12 00 mov 0x12e3b8,%eax 10b895: 89 43 74 mov %eax,0x74(%ebx) 10b898: eb 0f jmp 10b8a9 <_Scheduler_priority_Tick+0x55> } break; #if defined(RTEMS_SCORE_THREAD_ENABLE_SCHEDULER_CALLOUT) case THREAD_CPU_BUDGET_ALGORITHM_CALLOUT: if ( --executing->cpu_time_budget == 0 ) 10b89a: ff 4b 74 decl 0x74(%ebx) 10b89d: 75 0a jne 10b8a9 <_Scheduler_priority_Tick+0x55> (*executing->budget_callout)( executing ); 10b89f: 83 ec 0c sub $0xc,%esp 10b8a2: 53 push %ebx 10b8a3: ff 53 7c call *0x7c(%ebx) 10b8a6: 83 c4 10 add $0x10,%esp break; #endif } } 10b8a9: 8b 5d fc mov -0x4(%ebp),%ebx 10b8ac: c9 leave 10b8ad: c3 ret =============================================================================== 0010a6b8 <_TOD_Validate>: */ bool _TOD_Validate( const rtems_time_of_day *the_tod ) { 10a6b8: 55 push %ebp 10a6b9: 89 e5 mov %esp,%ebp 10a6bb: 53 push %ebx 10a6bc: 8b 4d 08 mov 0x8(%ebp),%ecx uint32_t days_in_month; uint32_t ticks_per_second; ticks_per_second = TOD_MICROSECONDS_PER_SECOND / 10a6bf: b8 40 42 0f 00 mov $0xf4240,%eax 10a6c4: 31 d2 xor %edx,%edx 10a6c6: f7 35 0c c8 12 00 divl 0x12c80c (the_tod->hour >= TOD_HOURS_PER_DAY) || (the_tod->month == 0) || (the_tod->month > TOD_MONTHS_PER_YEAR) || (the_tod->year < TOD_BASE_YEAR) || (the_tod->day == 0) ) return false; 10a6cc: 31 db xor %ebx,%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) || 10a6ce: 85 c9 test %ecx,%ecx 10a6d0: 74 4c je 10a71e <_TOD_Validate+0x66> <== NEVER TAKEN 10a6d2: 39 41 18 cmp %eax,0x18(%ecx) 10a6d5: 73 47 jae 10a71e <_TOD_Validate+0x66> (the_tod->ticks >= ticks_per_second) || 10a6d7: 83 79 14 3b cmpl $0x3b,0x14(%ecx) 10a6db: 77 41 ja 10a71e <_TOD_Validate+0x66> (the_tod->second >= TOD_SECONDS_PER_MINUTE) || 10a6dd: 83 79 10 3b cmpl $0x3b,0x10(%ecx) 10a6e1: 77 3b ja 10a71e <_TOD_Validate+0x66> (the_tod->minute >= TOD_MINUTES_PER_HOUR) || 10a6e3: 83 79 0c 17 cmpl $0x17,0xc(%ecx) 10a6e7: 77 35 ja 10a71e <_TOD_Validate+0x66> (the_tod->hour >= TOD_HOURS_PER_DAY) || (the_tod->month == 0) || 10a6e9: 8b 51 04 mov 0x4(%ecx),%edx rtems_configuration_get_microseconds_per_tick(); if ((!the_tod) || (the_tod->ticks >= ticks_per_second) || (the_tod->second >= TOD_SECONDS_PER_MINUTE) || (the_tod->minute >= TOD_MINUTES_PER_HOUR) || (the_tod->hour >= TOD_HOURS_PER_DAY) || 10a6ec: 85 d2 test %edx,%edx 10a6ee: 74 2e je 10a71e <_TOD_Validate+0x66> <== NEVER TAKEN (the_tod->month == 0) || 10a6f0: 83 fa 0c cmp $0xc,%edx 10a6f3: 77 29 ja 10a71e <_TOD_Validate+0x66> (the_tod->month > TOD_MONTHS_PER_YEAR) || (the_tod->year < TOD_BASE_YEAR) || 10a6f5: 8b 01 mov (%ecx),%eax (the_tod->ticks >= ticks_per_second) || (the_tod->second >= TOD_SECONDS_PER_MINUTE) || (the_tod->minute >= TOD_MINUTES_PER_HOUR) || (the_tod->hour >= TOD_HOURS_PER_DAY) || (the_tod->month == 0) || (the_tod->month > TOD_MONTHS_PER_YEAR) || 10a6f7: 3d c3 07 00 00 cmp $0x7c3,%eax 10a6fc: 76 20 jbe 10a71e <_TOD_Validate+0x66> (the_tod->year < TOD_BASE_YEAR) || (the_tod->day == 0) ) 10a6fe: 8b 49 08 mov 0x8(%ecx),%ecx (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) || 10a701: 85 c9 test %ecx,%ecx 10a703: 74 19 je 10a71e <_TOD_Validate+0x66> <== NEVER TAKEN (the_tod->day == 0) ) return false; if ( (the_tod->year % 4) == 0 ) 10a705: a8 03 test $0x3,%al 10a707: 75 09 jne 10a712 <_TOD_Validate+0x5a> days_in_month = _TOD_Days_per_month[ 1 ][ the_tod->month ]; 10a709: 8b 04 95 b8 18 12 00 mov 0x1218b8(,%edx,4),%eax 10a710: eb 07 jmp 10a719 <_TOD_Validate+0x61> else days_in_month = _TOD_Days_per_month[ 0 ][ the_tod->month ]; 10a712: 8b 04 95 84 18 12 00 mov 0x121884(,%edx,4),%eax if ( the_tod->day > days_in_month ) 10a719: 39 c1 cmp %eax,%ecx 10a71b: 0f 96 c3 setbe %bl return false; return true; } 10a71e: 88 d8 mov %bl,%al 10a720: 5b pop %ebx 10a721: 5d pop %ebp 10a722: c3 ret =============================================================================== 0010ba1c <_Thread_Change_priority>: void _Thread_Change_priority( Thread_Control *the_thread, Priority_Control new_priority, bool prepend_it ) { 10ba1c: 55 push %ebp 10ba1d: 89 e5 mov %esp,%ebp 10ba1f: 57 push %edi 10ba20: 56 push %esi 10ba21: 53 push %ebx 10ba22: 83 ec 28 sub $0x28,%esp 10ba25: 8b 7d 08 mov 0x8(%ebp),%edi 10ba28: 8b 5d 0c mov 0xc(%ebp),%ebx 10ba2b: 8a 45 10 mov 0x10(%ebp),%al 10ba2e: 88 45 e7 mov %al,-0x19(%ebp) States_Control state, original_state; /* * Save original state */ original_state = the_thread->current_state; 10ba31: 8b 77 10 mov 0x10(%edi),%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 ); 10ba34: 57 push %edi 10ba35: e8 72 0b 00 00 call 10c5ac <_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 ) 10ba3a: 83 c4 10 add $0x10,%esp 10ba3d: 39 5f 14 cmp %ebx,0x14(%edi) 10ba40: 74 0c je 10ba4e <_Thread_Change_priority+0x32> _Thread_Set_priority( the_thread, new_priority ); 10ba42: 50 push %eax 10ba43: 50 push %eax 10ba44: 53 push %ebx 10ba45: 57 push %edi 10ba46: e8 15 0b 00 00 call 10c560 <_Thread_Set_priority> 10ba4b: 83 c4 10 add $0x10,%esp _ISR_Disable( level ); 10ba4e: 9c pushf 10ba4f: fa cli 10ba50: 5b pop %ebx /* * 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; 10ba51: 8b 47 10 mov 0x10(%edi),%eax if ( state != STATES_TRANSIENT ) { 10ba54: 83 f8 04 cmp $0x4,%eax 10ba57: 74 2b je 10ba84 <_Thread_Change_priority+0x68> /* Only clear the transient state if it wasn't set already */ if ( ! _States_Is_transient( original_state ) ) 10ba59: 83 e6 04 and $0x4,%esi 10ba5c: 75 08 jne 10ba66 <_Thread_Change_priority+0x4a><== NEVER TAKEN RTEMS_INLINE_ROUTINE States_Control _States_Clear ( States_Control states_to_clear, States_Control current_state ) { return (current_state & ~states_to_clear); 10ba5e: 89 c2 mov %eax,%edx 10ba60: 83 e2 fb and $0xfffffffb,%edx 10ba63: 89 57 10 mov %edx,0x10(%edi) the_thread->current_state = _States_Clear( STATES_TRANSIENT, state ); _ISR_Enable( level ); 10ba66: 53 push %ebx 10ba67: 9d popf if ( _States_Is_waiting_on_thread_queue( state ) ) { 10ba68: a9 e0 be 03 00 test $0x3bee0,%eax 10ba6d: 74 65 je 10bad4 <_Thread_Change_priority+0xb8> _Thread_queue_Requeue( the_thread->Wait.queue, the_thread ); 10ba6f: 89 7d 0c mov %edi,0xc(%ebp) 10ba72: 8b 47 44 mov 0x44(%edi),%eax 10ba75: 89 45 08 mov %eax,0x8(%ebp) if ( !_Thread_Is_executing_also_the_heir() && _Thread_Executing->is_preemptible ) _Thread_Dispatch_necessary = true; _ISR_Enable( level ); } 10ba78: 8d 65 f4 lea -0xc(%ebp),%esp 10ba7b: 5b pop %ebx 10ba7c: 5e pop %esi 10ba7d: 5f pop %edi 10ba7e: 5d pop %ebp /* 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 ); 10ba7f: e9 4c 0a 00 00 jmp 10c4d0 <_Thread_queue_Requeue> } return; } /* Only clear the transient state if it wasn't set already */ if ( ! _States_Is_transient( original_state ) ) { 10ba84: 83 e6 04 and $0x4,%esi 10ba87: 75 26 jne 10baaf <_Thread_Change_priority+0x93><== 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 ); 10ba89: c7 47 10 00 00 00 00 movl $0x0,0x10(%edi) if ( prepend_it ) 10ba90: 80 7d e7 00 cmpb $0x0,-0x19(%ebp) 10ba94: 74 0c je 10baa2 <_Thread_Change_priority+0x86> */ RTEMS_INLINE_ROUTINE void _Scheduler_Enqueue_first( Thread_Control *the_thread ) { _Scheduler.Operations.enqueue_first( the_thread ); 10ba96: 83 ec 0c sub $0xc,%esp 10ba99: 57 push %edi 10ba9a: ff 15 58 a2 12 00 call *0x12a258 10baa0: eb 0a jmp 10baac <_Thread_Change_priority+0x90> */ RTEMS_INLINE_ROUTINE void _Scheduler_Enqueue( Thread_Control *the_thread ) { _Scheduler.Operations.enqueue( the_thread ); 10baa2: 83 ec 0c sub $0xc,%esp 10baa5: 57 push %edi 10baa6: ff 15 54 a2 12 00 call *0x12a254 10baac: 83 c4 10 add $0x10,%esp _Scheduler_Enqueue_first( the_thread ); else _Scheduler_Enqueue( the_thread ); } _ISR_Flash( level ); 10baaf: 53 push %ebx 10bab0: 9d popf 10bab1: fa cli * This kernel routine implements the scheduling decision logic for * the scheduler. It does NOT dispatch. */ RTEMS_INLINE_ROUTINE void _Scheduler_Schedule( void ) { _Scheduler.Operations.schedule(); 10bab2: ff 15 38 a2 12 00 call *0x12a238 * is also the heir thread, and false otherwise. */ RTEMS_INLINE_ROUTINE bool _Thread_Is_executing_also_the_heir( void ) { return ( _Thread_Executing == _Thread_Heir ); 10bab8: a1 ec e8 12 00 mov 0x12e8ec,%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. */ _Scheduler_Schedule(); if ( !_Thread_Is_executing_also_the_heir() && 10babd: 3b 05 f0 e8 12 00 cmp 0x12e8f0,%eax 10bac3: 74 0d je 10bad2 <_Thread_Change_priority+0xb6> 10bac5: 80 78 70 00 cmpb $0x0,0x70(%eax) 10bac9: 74 07 je 10bad2 <_Thread_Change_priority+0xb6> _Thread_Executing->is_preemptible ) _Thread_Dispatch_necessary = true; 10bacb: c6 05 f8 e8 12 00 01 movb $0x1,0x12e8f8 _ISR_Enable( level ); 10bad2: 53 push %ebx 10bad3: 9d popf } 10bad4: 8d 65 f4 lea -0xc(%ebp),%esp 10bad7: 5b pop %ebx 10bad8: 5e pop %esi 10bad9: 5f pop %edi 10bada: 5d pop %ebp 10badb: c3 ret =============================================================================== 0010bc90 <_Thread_Delay_ended>: void _Thread_Delay_ended( Objects_Id id, void *ignored __attribute__((unused)) ) { 10bc90: 55 push %ebp 10bc91: 89 e5 mov %esp,%ebp 10bc93: 83 ec 20 sub $0x20,%esp Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); 10bc96: 8d 45 f4 lea -0xc(%ebp),%eax 10bc99: 50 push %eax 10bc9a: ff 75 08 pushl 0x8(%ebp) 10bc9d: e8 8a 01 00 00 call 10be2c <_Thread_Get> switch ( location ) { 10bca2: 83 c4 10 add $0x10,%esp 10bca5: 83 7d f4 00 cmpl $0x0,-0xc(%ebp) 10bca9: 75 20 jne 10bccb <_Thread_Delay_ended+0x3b><== NEVER TAKEN #if defined(RTEMS_MULTIPROCESSING) case OBJECTS_REMOTE: /* impossible */ #endif break; case OBJECTS_LOCAL: _Thread_Clear_state( 10bcab: 52 push %edx 10bcac: 52 push %edx 10bcad: 68 18 00 00 10 push $0x10000018 10bcb2: 50 push %eax 10bcb3: e8 24 fe ff ff call 10badc <_Thread_Clear_state> * * This routine decrements the thread dispatch level. */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_decrement_disable_level(void) { _Thread_Dispatch_disable_level--; 10bcb8: a1 e4 e3 12 00 mov 0x12e3e4,%eax 10bcbd: 48 dec %eax 10bcbe: a3 e4 e3 12 00 mov %eax,0x12e3e4 return _Thread_Dispatch_disable_level; 10bcc3: a1 e4 e3 12 00 mov 0x12e3e4,%eax 10bcc8: 83 c4 10 add $0x10,%esp | STATES_INTERRUPTIBLE_BY_SIGNAL ); _Thread_Unnest_dispatch(); break; } } 10bccb: c9 leave 10bccc: c3 ret =============================================================================== 0010bcd0 <_Thread_Dispatch>: * INTERRUPT LATENCY: * dispatch thread * no dispatch thread */ void _Thread_Dispatch( void ) { 10bcd0: 55 push %ebp 10bcd1: 89 e5 mov %esp,%ebp 10bcd3: 57 push %edi 10bcd4: 56 push %esi 10bcd5: 53 push %ebx 10bcd6: 83 ec 1c sub $0x1c,%esp * * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { _Thread_Dispatch_disable_level++; 10bcd9: a1 e4 e3 12 00 mov 0x12e3e4,%eax 10bcde: 40 inc %eax 10bcdf: a3 e4 e3 12 00 mov %eax,0x12e3e4 return _Thread_Dispatch_disable_level; 10bce4: a1 e4 e3 12 00 mov 0x12e3e4,%eax void _Thread_Disable_dispatch( void ); #else RTEMS_INLINE_ROUTINE void _Thread_Disable_dispatch( void ) { _Thread_Dispatch_increment_disable_level(); RTEMS_COMPILER_MEMORY_BARRIER(); 10bce9: e9 f9 00 00 00 jmp 10bde7 <_Thread_Dispatch+0x117> */ executing = _Thread_Executing; _ISR_Disable( level ); while ( _Thread_Dispatch_necessary == true ) { heir = _Thread_Heir; 10bcee: 8b 35 f0 e8 12 00 mov 0x12e8f0,%esi _Thread_Dispatch_necessary = false; 10bcf4: c6 05 f8 e8 12 00 00 movb $0x0,0x12e8f8 _Thread_Executing = heir; 10bcfb: 89 35 ec e8 12 00 mov %esi,0x12e8ec /* * When the heir and executing are the same, then we are being * requested to do the post switch dispatching. This is normally * done to dispatch signals. */ if ( heir == executing ) 10bd01: 39 fe cmp %edi,%esi 10bd03: 75 1c jne 10bd21 <_Thread_Dispatch+0x51> _ISR_Disable( level ); } post_switch: _ISR_Enable( level ); 10bd05: 50 push %eax 10bd06: 9d popf * * This routine decrements the thread dispatch level. */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_decrement_disable_level(void) { _Thread_Dispatch_disable_level--; 10bd07: a1 e4 e3 12 00 mov 0x12e3e4,%eax 10bd0c: 48 dec %eax 10bd0d: a3 e4 e3 12 00 mov %eax,0x12e3e4 return _Thread_Dispatch_disable_level; 10bd12: a1 e4 e3 12 00 mov 0x12e3e4,%eax _Thread_Unnest_dispatch(); _API_extensions_Run_postswitch(); 10bd17: e8 39 e8 ff ff call 10a555 <_API_extensions_Run_postswitch> 10bd1c: e9 e2 00 00 00 jmp 10be03 <_Thread_Dispatch+0x133> */ #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 ) 10bd21: 83 7e 78 01 cmpl $0x1,0x78(%esi) 10bd25: 75 09 jne 10bd30 <_Thread_Dispatch+0x60> heir->cpu_time_budget = _Thread_Ticks_per_timeslice; 10bd27: 8b 15 b8 e3 12 00 mov 0x12e3b8,%edx 10bd2d: 89 56 74 mov %edx,0x74(%esi) _ISR_Enable( level ); 10bd30: 50 push %eax 10bd31: 9d popf #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ { Timestamp_Control uptime, ran; _TOD_Get_uptime( &uptime ); 10bd32: 83 ec 0c sub $0xc,%esp 10bd35: 8d 45 e0 lea -0x20(%ebp),%eax 10bd38: 50 push %eax 10bd39: e8 06 34 00 00 call 10f144 <_TOD_Get_uptime> _Timestamp_Subtract( 10bd3e: 8b 45 e0 mov -0x20(%ebp),%eax 10bd41: 8b 55 e4 mov -0x1c(%ebp),%edx const Timestamp64_Control *_start, const Timestamp64_Control *_end, Timestamp64_Control *_result ) { *_result = *_end - *_start; 10bd44: 89 c1 mov %eax,%ecx 10bd46: 89 d3 mov %edx,%ebx 10bd48: 2b 0d fc e8 12 00 sub 0x12e8fc,%ecx 10bd4e: 1b 1d 00 e9 12 00 sbb 0x12e900,%ebx static inline void _Timestamp64_implementation_Add_to( Timestamp64_Control *_time, const Timestamp64_Control *_add ) { *_time += *_add; 10bd54: 01 8f 80 00 00 00 add %ecx,0x80(%edi) 10bd5a: 11 9f 84 00 00 00 adc %ebx,0x84(%edi) &_Thread_Time_of_last_context_switch, &uptime, &ran ); _Timestamp_Add_to( &executing->cpu_time_used, &ran ); _Thread_Time_of_last_context_switch = uptime; 10bd60: a3 fc e8 12 00 mov %eax,0x12e8fc 10bd65: 89 15 00 e9 12 00 mov %edx,0x12e900 #endif /* * Switch libc's task specific data. */ if ( _Thread_libc_reent ) { 10bd6b: a1 5c e4 12 00 mov 0x12e45c,%eax 10bd70: 83 c4 10 add $0x10,%esp 10bd73: 85 c0 test %eax,%eax 10bd75: 74 10 je 10bd87 <_Thread_Dispatch+0xb7> <== NEVER TAKEN executing->libc_reent = *_Thread_libc_reent; 10bd77: 8b 10 mov (%eax),%edx 10bd79: 89 97 e0 00 00 00 mov %edx,0xe0(%edi) *_Thread_libc_reent = heir->libc_reent; 10bd7f: 8b 96 e0 00 00 00 mov 0xe0(%esi),%edx 10bd85: 89 10 mov %edx,(%eax) } _User_extensions_Thread_switch( executing, heir ); 10bd87: 50 push %eax 10bd88: 50 push %eax 10bd89: 56 push %esi 10bd8a: 57 push %edi 10bd8b: e8 48 0b 00 00 call 10c8d8 <_User_extensions_Thread_switch> if ( executing->fp_context != NULL ) _Context_Save_fp( &executing->fp_context ); #endif #endif _Context_Switch( &executing->Registers, &heir->Registers ); 10bd90: 5a pop %edx 10bd91: 59 pop %ecx 10bd92: 8d 86 c4 00 00 00 lea 0xc4(%esi),%eax 10bd98: 50 push %eax 10bd99: 8d 87 c4 00 00 00 lea 0xc4(%edi),%eax 10bd9f: 50 push %eax 10bda0: e8 0b 0e 00 00 call 10cbb0 <_CPU_Context_switch> #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) #if ( CPU_USE_DEFERRED_FP_SWITCH == TRUE ) if ( (executing->fp_context != NULL) && 10bda5: 83 c4 10 add $0x10,%esp 10bda8: 83 bf dc 00 00 00 00 cmpl $0x0,0xdc(%edi) 10bdaf: 74 36 je 10bde7 <_Thread_Dispatch+0x117> #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 ); 10bdb1: a1 58 e4 12 00 mov 0x12e458,%eax 10bdb6: 39 c7 cmp %eax,%edi 10bdb8: 74 2d je 10bde7 <_Thread_Dispatch+0x117> !_Thread_Is_allocated_fp( executing ) ) { if ( _Thread_Allocated_fp != NULL ) 10bdba: 85 c0 test %eax,%eax 10bdbc: 74 11 je 10bdcf <_Thread_Dispatch+0xff> _Context_Save_fp( &_Thread_Allocated_fp->fp_context ); 10bdbe: 83 ec 0c sub $0xc,%esp 10bdc1: 05 dc 00 00 00 add $0xdc,%eax 10bdc6: 50 push %eax 10bdc7: e8 18 0e 00 00 call 10cbe4 <_CPU_Context_save_fp> 10bdcc: 83 c4 10 add $0x10,%esp _Context_Restore_fp( &executing->fp_context ); 10bdcf: 83 ec 0c sub $0xc,%esp 10bdd2: 8d 87 dc 00 00 00 lea 0xdc(%edi),%eax 10bdd8: 50 push %eax 10bdd9: e8 10 0e 00 00 call 10cbee <_CPU_Context_restore_fp> _Thread_Allocated_fp = executing; 10bdde: 89 3d 58 e4 12 00 mov %edi,0x12e458 10bde4: 83 c4 10 add $0x10,%esp if ( executing->fp_context != NULL ) _Context_Restore_fp( &executing->fp_context ); #endif #endif executing = _Thread_Executing; 10bde7: 8b 3d ec e8 12 00 mov 0x12e8ec,%edi _ISR_Disable( level ); 10bded: 9c pushf 10bdee: fa cli 10bdef: 58 pop %eax /* * Now determine if we need to perform a dispatch on the current CPU. */ executing = _Thread_Executing; _ISR_Disable( level ); while ( _Thread_Dispatch_necessary == true ) { 10bdf0: 8a 15 f8 e8 12 00 mov 0x12e8f8,%dl 10bdf6: 84 d2 test %dl,%dl 10bdf8: 0f 85 f0 fe ff ff jne 10bcee <_Thread_Dispatch+0x1e> 10bdfe: e9 02 ff ff ff jmp 10bd05 <_Thread_Dispatch+0x35> _ISR_Enable( level ); _Thread_Unnest_dispatch(); _API_extensions_Run_postswitch(); } 10be03: 8d 65 f4 lea -0xc(%ebp),%esp 10be06: 5b pop %ebx 10be07: 5e pop %esi 10be08: 5f pop %edi 10be09: 5d pop %ebp 10be0a: c3 ret =============================================================================== 00110d08 <_Thread_Handler>: * Input parameters: NONE * * Output parameters: NONE */ void _Thread_Handler( void ) { 110d08: 55 push %ebp 110d09: 89 e5 mov %esp,%ebp 110d0b: 53 push %ebx 110d0c: 83 ec 14 sub $0x14,%esp #if defined(EXECUTE_GLOBAL_CONSTRUCTORS) static bool doneConstructors; bool doCons; #endif executing = _Thread_Executing; 110d0f: 8b 1d ec e8 12 00 mov 0x12e8ec,%ebx /* * have to put level into a register for those cpu's that use * inline asm here */ level = executing->Start.isr_level; 110d15: 8b 83 a8 00 00 00 mov 0xa8(%ebx),%eax _ISR_Set_level(level); 110d1b: 85 c0 test %eax,%eax 110d1d: 74 03 je 110d22 <_Thread_Handler+0x1a> 110d1f: fa cli 110d20: eb 01 jmp 110d23 <_Thread_Handler+0x1b> 110d22: fb sti doCons = !doneConstructors && _Objects_Get_API( executing->Object.id ) != OBJECTS_INTERNAL_API; if (doCons) doneConstructors = true; #else doCons = !doneConstructors; 110d23: a0 d4 e0 12 00 mov 0x12e0d4,%al 110d28: 88 45 f7 mov %al,-0x9(%ebp) doneConstructors = true; 110d2b: c6 05 d4 e0 12 00 01 movb $0x1,0x12e0d4 #endif #endif #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) #if ( CPU_USE_DEFERRED_FP_SWITCH == TRUE ) if ( (executing->fp_context != NULL) && 110d32: 83 bb dc 00 00 00 00 cmpl $0x0,0xdc(%ebx) 110d39: 74 24 je 110d5f <_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 ); 110d3b: a1 58 e4 12 00 mov 0x12e458,%eax 110d40: 39 c3 cmp %eax,%ebx 110d42: 74 1b je 110d5f <_Thread_Handler+0x57> !_Thread_Is_allocated_fp( executing ) ) { if ( _Thread_Allocated_fp != NULL ) 110d44: 85 c0 test %eax,%eax 110d46: 74 11 je 110d59 <_Thread_Handler+0x51> _Context_Save_fp( &_Thread_Allocated_fp->fp_context ); 110d48: 83 ec 0c sub $0xc,%esp 110d4b: 05 dc 00 00 00 add $0xdc,%eax 110d50: 50 push %eax 110d51: e8 8e be ff ff call 10cbe4 <_CPU_Context_save_fp> 110d56: 83 c4 10 add $0x10,%esp _Thread_Allocated_fp = executing; 110d59: 89 1d 58 e4 12 00 mov %ebx,0x12e458 /* * 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 ); 110d5f: 83 ec 0c sub $0xc,%esp 110d62: 53 push %ebx 110d63: e8 34 ba ff ff call 10c79c <_User_extensions_Thread_begin> /* * At this point, the dispatch disable level BETTER be 1. */ _Thread_Enable_dispatch(); 110d68: e8 9f b0 ff ff call 10be0c <_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 (doCons) /* && (volatile void *)_init) */ { 110d6d: 83 c4 10 add $0x10,%esp 110d70: 80 7d f7 00 cmpb $0x0,-0x9(%ebp) 110d74: 75 05 jne 110d7b <_Thread_Handler+0x73> INIT_NAME (); 110d76: e8 b1 d0 00 00 call 11de2c <__start_set_sysctl_set> _Thread_Enable_dispatch(); #endif } #endif if ( executing->Start.prototype == THREAD_START_NUMERIC ) { 110d7b: 8b 83 90 00 00 00 mov 0x90(%ebx),%eax 110d81: 85 c0 test %eax,%eax 110d83: 75 0b jne 110d90 <_Thread_Handler+0x88> executing->Wait.return_argument = (*(Thread_Entry_numeric) executing->Start.entry_point)( 110d85: 83 ec 0c sub $0xc,%esp 110d88: ff b3 98 00 00 00 pushl 0x98(%ebx) 110d8e: eb 0c jmp 110d9c <_Thread_Handler+0x94> executing->Start.numeric_argument ); } #if defined(RTEMS_POSIX_API) else if ( executing->Start.prototype == THREAD_START_POINTER ) { 110d90: 48 dec %eax 110d91: 75 15 jne 110da8 <_Thread_Handler+0xa0> <== NEVER TAKEN executing->Wait.return_argument = (*(Thread_Entry_pointer) executing->Start.entry_point)( 110d93: 83 ec 0c sub $0xc,%esp 110d96: ff b3 94 00 00 00 pushl 0x94(%ebx) 110d9c: ff 93 8c 00 00 00 call *0x8c(%ebx) executing->Start.numeric_argument ); } #if defined(RTEMS_POSIX_API) else if ( executing->Start.prototype == THREAD_START_POINTER ) { executing->Wait.return_argument = 110da2: 89 43 28 mov %eax,0x28(%ebx) 110da5: 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 ); 110da8: 83 ec 0c sub $0xc,%esp 110dab: 53 push %ebx 110dac: e8 19 ba ff ff call 10c7ca <_User_extensions_Thread_exitted> _Internal_error_Occurred( 110db1: 83 c4 0c add $0xc,%esp 110db4: 6a 05 push $0x5 110db6: 6a 01 push $0x1 110db8: 6a 00 push $0x0 110dba: e8 0d a0 ff ff call 10adcc <_Internal_error_Occurred> =============================================================================== 0010c0d8 <_Thread_Handler_initialization>: * * Output parameters: NONE */ void _Thread_Handler_initialization(void) { 10c0d8: 55 push %ebp 10c0d9: 89 e5 mov %esp,%ebp 10c0db: 56 push %esi 10c0dc: 53 push %ebx uint32_t ticks_per_timeslice = 10c0dd: 8b 1d 54 a1 12 00 mov 0x12a154,%ebx rtems_configuration_get_ticks_per_timeslice(); uint32_t maximum_extensions = 10c0e3: 8b 35 48 a1 12 00 mov 0x12a148,%esi rtems_configuration_get_maximum_extensions(); rtems_stack_allocate_init_hook stack_allocate_init_hook = 10c0e9: a1 64 a1 12 00 mov 0x12a164,%eax #if defined(RTEMS_MULTIPROCESSING) uint32_t maximum_proxies = _Configuration_MP_table->maximum_proxies; #endif if ( rtems_configuration_get_stack_allocate_hook() == NULL || 10c0ee: 83 3d 68 a1 12 00 00 cmpl $0x0,0x12a168 10c0f5: 74 09 je 10c100 <_Thread_Handler_initialization+0x28> 10c0f7: 83 3d 6c a1 12 00 00 cmpl $0x0,0x12a16c 10c0fe: 75 0c jne 10c10c <_Thread_Handler_initialization+0x34><== ALWAYS TAKEN rtems_configuration_get_stack_free_hook() == NULL) _Internal_error_Occurred( 10c100: 52 push %edx 10c101: 6a 0e push $0xe 10c103: 6a 01 push $0x1 10c105: 6a 00 push $0x0 10c107: e8 c0 ec ff ff call 10adcc <_Internal_error_Occurred> INTERNAL_ERROR_CORE, true, INTERNAL_ERROR_BAD_STACK_HOOK ); if ( stack_allocate_init_hook != NULL ) 10c10c: 85 c0 test %eax,%eax 10c10e: 74 0e je 10c11e <_Thread_Handler_initialization+0x46> (*stack_allocate_init_hook)( rtems_configuration_get_stack_space_size() ); 10c110: 83 ec 0c sub $0xc,%esp 10c113: ff 35 44 a1 12 00 pushl 0x12a144 10c119: ff d0 call *%eax 10c11b: 83 c4 10 add $0x10,%esp _Thread_Dispatch_necessary = false; 10c11e: c6 05 f8 e8 12 00 00 movb $0x0,0x12e8f8 _Thread_Executing = NULL; 10c125: c7 05 ec e8 12 00 00 movl $0x0,0x12e8ec 10c12c: 00 00 00 _Thread_Heir = NULL; 10c12f: c7 05 f0 e8 12 00 00 movl $0x0,0x12e8f0 10c136: 00 00 00 #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) _Thread_Allocated_fp = NULL; 10c139: c7 05 58 e4 12 00 00 movl $0x0,0x12e458 10c140: 00 00 00 #endif _Thread_Maximum_extensions = maximum_extensions; 10c143: 89 35 60 e4 12 00 mov %esi,0x12e460 _Thread_Ticks_per_timeslice = ticks_per_timeslice; 10c149: 89 1d b8 e3 12 00 mov %ebx,0x12e3b8 #if defined(RTEMS_MULTIPROCESSING) if ( _System_state_Is_multiprocessing ) maximum_internal_threads += 1; #endif _Objects_Initialize_information( 10c14f: 50 push %eax 10c150: 6a 08 push $0x8 10c152: 6a 00 push $0x0 10c154: 68 f4 00 00 00 push $0xf4 10c159: 6a 01 push $0x1 10c15b: 6a 01 push $0x1 10c15d: 6a 01 push $0x1 10c15f: 68 e0 e4 12 00 push $0x12e4e0 10c164: e8 5f f1 ff ff call 10b2c8 <_Objects_Initialize_information> 10c169: 83 c4 20 add $0x20,%esp false, /* true if this is a global object class */ NULL /* Proxy extraction support callout */ #endif ); } 10c16c: 8d 65 f8 lea -0x8(%ebp),%esp 10c16f: 5b pop %ebx 10c170: 5e pop %esi 10c171: 5d pop %ebp 10c172: c3 ret =============================================================================== 0010beac <_Thread_Initialize>: Thread_CPU_budget_algorithms budget_algorithm, Thread_CPU_budget_algorithm_callout budget_callout, uint32_t isr_level, Objects_Name name ) { 10beac: 55 push %ebp 10bead: 89 e5 mov %esp,%ebp 10beaf: 57 push %edi 10beb0: 56 push %esi 10beb1: 53 push %ebx 10beb2: 83 ec 1c sub $0x1c,%esp 10beb5: 8b 5d 0c mov 0xc(%ebp),%ebx 10beb8: 8b 4d 10 mov 0x10(%ebp),%ecx 10bebb: 8b 75 14 mov 0x14(%ebp),%esi 10bebe: 8a 55 18 mov 0x18(%ebp),%dl 10bec1: 8a 45 20 mov 0x20(%ebp),%al 10bec4: 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; 10bec7: c7 83 e4 00 00 00 00 movl $0x0,0xe4(%ebx) 10bece: 00 00 00 10bed1: c7 83 e8 00 00 00 00 movl $0x0,0xe8(%ebx) 10bed8: 00 00 00 extensions_area = NULL; the_thread->libc_reent = NULL; 10bedb: c7 83 e0 00 00 00 00 movl $0x0,0xe0(%ebx) 10bee2: 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 ) { 10bee5: 85 c9 test %ecx,%ecx 10bee7: 75 31 jne 10bf1a <_Thread_Initialize+0x6e> actual_stack_size = _Thread_Stack_Allocate( the_thread, stack_size ); 10bee9: 57 push %edi 10beea: 57 push %edi 10beeb: 56 push %esi 10beec: 53 push %ebx 10beed: 88 55 e0 mov %dl,-0x20(%ebp) 10bef0: e8 e7 06 00 00 call 10c5dc <_Thread_Stack_Allocate> if ( !actual_stack_size || actual_stack_size < stack_size ) 10bef5: 83 c4 10 add $0x10,%esp 10bef8: 39 f0 cmp %esi,%eax 10befa: 8a 55 e0 mov -0x20(%ebp),%dl 10befd: 0f 82 c7 01 00 00 jb 10c0ca <_Thread_Initialize+0x21e> 10bf03: 85 c0 test %eax,%eax 10bf05: 0f 84 bf 01 00 00 je 10c0ca <_Thread_Initialize+0x21e><== NEVER TAKEN return false; /* stack allocation failed */ stack = the_thread->Start.stack; 10bf0b: 8b 8b c0 00 00 00 mov 0xc0(%ebx),%ecx the_thread->Start.core_allocated_stack = true; 10bf11: c6 83 b0 00 00 00 01 movb $0x1,0xb0(%ebx) 10bf18: eb 09 jmp 10bf23 <_Thread_Initialize+0x77> } else { stack = stack_area; actual_stack_size = stack_size; the_thread->Start.core_allocated_stack = false; 10bf1a: c6 83 b0 00 00 00 00 movb $0x0,0xb0(%ebx) 10bf21: 89 f0 mov %esi,%eax Stack_Control *the_stack, void *starting_address, size_t size ) { the_stack->area = starting_address; 10bf23: 89 8b b8 00 00 00 mov %ecx,0xb8(%ebx) the_stack->size = size; 10bf29: 89 83 b4 00 00 00 mov %eax,0xb4(%ebx) extensions_area = NULL; the_thread->libc_reent = NULL; #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) fp_area = NULL; 10bf2f: 31 ff xor %edi,%edi /* * Allocate the floating point area for this thread */ #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) if ( is_fp ) { 10bf31: 84 d2 test %dl,%dl 10bf33: 74 17 je 10bf4c <_Thread_Initialize+0xa0> fp_area = _Workspace_Allocate( CONTEXT_FP_SIZE ); 10bf35: 83 ec 0c sub $0xc,%esp 10bf38: 6a 6c push $0x6c 10bf3a: e8 05 0c 00 00 call 10cb44 <_Workspace_Allocate> 10bf3f: 89 c7 mov %eax,%edi if ( !fp_area ) 10bf41: 83 c4 10 add $0x10,%esp 10bf44: 85 c0 test %eax,%eax 10bf46: 0f 84 2b 01 00 00 je 10c077 <_Thread_Initialize+0x1cb><== NEVER TAKEN goto failed; fp_area = _Context_Fp_start( fp_area, 0 ); } the_thread->fp_context = fp_area; 10bf4c: 89 bb dc 00 00 00 mov %edi,0xdc(%ebx) the_thread->Start.fp_context = fp_area; 10bf52: 89 bb bc 00 00 00 mov %edi,0xbc(%ebx) Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 10bf58: c7 43 50 00 00 00 00 movl $0x0,0x50(%ebx) the_watchdog->routine = routine; 10bf5f: c7 43 64 00 00 00 00 movl $0x0,0x64(%ebx) the_watchdog->id = id; 10bf66: c7 43 68 00 00 00 00 movl $0x0,0x68(%ebx) the_watchdog->user_data = user_data; 10bf6d: c7 43 6c 00 00 00 00 movl $0x0,0x6c(%ebx) #endif /* * Allocate the extensions area for this thread */ if ( _Thread_Maximum_extensions ) { 10bf74: a1 60 e4 12 00 mov 0x12e460,%eax * Zero out all the allocated memory fields */ for ( i=0 ; i <= THREAD_API_LAST ; i++ ) the_thread->API_Extensions[i] = NULL; extensions_area = NULL; 10bf79: 31 f6 xor %esi,%esi #endif /* * Allocate the extensions area for this thread */ if ( _Thread_Maximum_extensions ) { 10bf7b: 85 c0 test %eax,%eax 10bf7d: 74 1d je 10bf9c <_Thread_Initialize+0xf0> extensions_area = _Workspace_Allocate( 10bf7f: 83 ec 0c sub $0xc,%esp 10bf82: 8d 04 85 04 00 00 00 lea 0x4(,%eax,4),%eax 10bf89: 50 push %eax 10bf8a: e8 b5 0b 00 00 call 10cb44 <_Workspace_Allocate> 10bf8f: 89 c6 mov %eax,%esi (_Thread_Maximum_extensions + 1) * sizeof( void * ) ); if ( !extensions_area ) 10bf91: 83 c4 10 add $0x10,%esp 10bf94: 85 c0 test %eax,%eax 10bf96: 0f 84 dd 00 00 00 je 10c079 <_Thread_Initialize+0x1cd><== NEVER TAKEN goto failed; } the_thread->extensions = (void **) extensions_area; 10bf9c: 89 b3 ec 00 00 00 mov %esi,0xec(%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 ) { 10bfa2: 85 f6 test %esi,%esi 10bfa4: 75 23 jne 10bfc9 <_Thread_Initialize+0x11d> /* * General initialization */ the_thread->Start.is_preemptible = is_preemptible; 10bfa6: 8a 45 e7 mov -0x19(%ebp),%al 10bfa9: 88 83 9c 00 00 00 mov %al,0x9c(%ebx) the_thread->Start.budget_algorithm = budget_algorithm; 10bfaf: 8b 45 24 mov 0x24(%ebp),%eax 10bfb2: 89 83 a0 00 00 00 mov %eax,0xa0(%ebx) the_thread->Start.budget_callout = budget_callout; 10bfb8: 8b 45 28 mov 0x28(%ebp),%eax 10bfbb: 89 83 a4 00 00 00 mov %eax,0xa4(%ebx) switch ( budget_algorithm ) { 10bfc1: 83 7d 24 02 cmpl $0x2,0x24(%ebp) 10bfc5: 75 28 jne 10bfef <_Thread_Initialize+0x143> 10bfc7: eb 1e jmp 10bfe7 <_Thread_Initialize+0x13b> * 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++ ) 10bfc9: 8b 15 60 e4 12 00 mov 0x12e460,%edx 10bfcf: 31 c0 xor %eax,%eax 10bfd1: eb 0e jmp 10bfe1 <_Thread_Initialize+0x135> the_thread->extensions[i] = NULL; 10bfd3: 8b 8b ec 00 00 00 mov 0xec(%ebx),%ecx 10bfd9: c7 04 81 00 00 00 00 movl $0x0,(%ecx,%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++ ) 10bfe0: 40 inc %eax 10bfe1: 39 d0 cmp %edx,%eax 10bfe3: 76 ee jbe 10bfd3 <_Thread_Initialize+0x127> 10bfe5: eb bf jmp 10bfa6 <_Thread_Initialize+0xfa> 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; 10bfe7: a1 b8 e3 12 00 mov 0x12e3b8,%eax 10bfec: 89 43 74 mov %eax,0x74(%ebx) case THREAD_CPU_BUDGET_ALGORITHM_CALLOUT: break; #endif } the_thread->Start.isr_level = isr_level; 10bfef: 8b 45 2c mov 0x2c(%ebp),%eax 10bff2: 89 83 a8 00 00 00 mov %eax,0xa8(%ebx) the_thread->current_state = STATES_DORMANT; 10bff8: c7 43 10 01 00 00 00 movl $0x1,0x10(%ebx) the_thread->Wait.queue = NULL; 10bfff: c7 43 44 00 00 00 00 movl $0x0,0x44(%ebx) the_thread->resource_count = 0; 10c006: c7 43 1c 00 00 00 00 movl $0x0,0x1c(%ebx) the_thread->real_priority = priority; 10c00d: 8b 45 1c mov 0x1c(%ebp),%eax 10c010: 89 43 18 mov %eax,0x18(%ebx) the_thread->Start.initial_priority = priority; 10c013: 89 83 ac 00 00 00 mov %eax,0xac(%ebx) */ RTEMS_INLINE_ROUTINE void* _Scheduler_Allocate( Thread_Control *the_thread ) { return _Scheduler.Operations.allocate( the_thread ); 10c019: 83 ec 0c sub $0xc,%esp 10c01c: 53 push %ebx 10c01d: ff 15 48 a2 12 00 call *0x12a248 10c023: 89 c2 mov %eax,%edx sched =_Scheduler_Allocate( the_thread ); if ( !sched ) 10c025: 83 c4 10 add $0x10,%esp 10c028: 85 c0 test %eax,%eax 10c02a: 74 4f je 10c07b <_Thread_Initialize+0x1cf> goto failed; _Thread_Set_priority( the_thread, priority ); 10c02c: 51 push %ecx 10c02d: 51 push %ecx 10c02e: ff 75 1c pushl 0x1c(%ebp) 10c031: 53 push %ebx 10c032: 89 45 e0 mov %eax,-0x20(%ebp) 10c035: e8 26 05 00 00 call 10c560 <_Thread_Set_priority> static inline void _Timestamp64_implementation_Set_to_zero( Timestamp64_Control *_time ) { *_time = 0; 10c03a: c7 83 80 00 00 00 00 movl $0x0,0x80(%ebx) 10c041: 00 00 00 10c044: c7 83 84 00 00 00 00 movl $0x0,0x84(%ebx) 10c04b: 00 00 00 Objects_Information *information, Objects_Control *the_object, Objects_Name name ) { _Objects_Set_local_object( 10c04e: 0f b7 4b 08 movzwl 0x8(%ebx),%ecx #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 10c052: 8b 45 08 mov 0x8(%ebp),%eax 10c055: 8b 40 1c mov 0x1c(%eax),%eax 10c058: 89 1c 88 mov %ebx,(%eax,%ecx,4) information, _Objects_Get_index( the_object->id ), the_object ); the_object->name = name; 10c05b: 8b 45 30 mov 0x30(%ebp),%eax 10c05e: 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 ); 10c061: 89 1c 24 mov %ebx,(%esp) 10c064: e8 c7 07 00 00 call 10c830 <_User_extensions_Thread_create> if ( extension_status ) 10c069: 83 c4 10 add $0x10,%esp return true; 10c06c: b1 01 mov $0x1,%cl * 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 ); if ( extension_status ) 10c06e: 84 c0 test %al,%al 10c070: 8b 55 e0 mov -0x20(%ebp),%edx 10c073: 74 06 je 10c07b <_Thread_Initialize+0x1cf> 10c075: eb 55 jmp 10c0cc <_Thread_Initialize+0x220> * Zero out all the allocated memory fields */ for ( i=0 ; i <= THREAD_API_LAST ; i++ ) the_thread->API_Extensions[i] = NULL; extensions_area = NULL; 10c077: 31 f6 xor %esi,%esi size_t actual_stack_size = 0; void *stack = NULL; #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) void *fp_area; #endif void *sched = NULL; 10c079: 31 d2 xor %edx,%edx extension_status = _User_extensions_Thread_create( the_thread ); if ( extension_status ) return true; failed: _Workspace_Free( the_thread->libc_reent ); 10c07b: 83 ec 0c sub $0xc,%esp 10c07e: ff b3 e0 00 00 00 pushl 0xe0(%ebx) 10c084: 89 55 e0 mov %edx,-0x20(%ebp) 10c087: e8 d1 0a 00 00 call 10cb5d <_Workspace_Free> for ( i=0 ; i <= THREAD_API_LAST ; i++ ) _Workspace_Free( the_thread->API_Extensions[i] ); 10c08c: 58 pop %eax 10c08d: ff b3 e4 00 00 00 pushl 0xe4(%ebx) 10c093: e8 c5 0a 00 00 call 10cb5d <_Workspace_Free> 10c098: 5a pop %edx 10c099: ff b3 e8 00 00 00 pushl 0xe8(%ebx) 10c09f: e8 b9 0a 00 00 call 10cb5d <_Workspace_Free> _Workspace_Free( extensions_area ); 10c0a4: 89 34 24 mov %esi,(%esp) 10c0a7: e8 b1 0a 00 00 call 10cb5d <_Workspace_Free> #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) _Workspace_Free( fp_area ); 10c0ac: 89 3c 24 mov %edi,(%esp) 10c0af: e8 a9 0a 00 00 call 10cb5d <_Workspace_Free> #endif _Workspace_Free( sched ); 10c0b4: 8b 55 e0 mov -0x20(%ebp),%edx 10c0b7: 89 14 24 mov %edx,(%esp) 10c0ba: e8 9e 0a 00 00 call 10cb5d <_Workspace_Free> _Thread_Stack_Free( the_thread ); 10c0bf: 89 1c 24 mov %ebx,(%esp) 10c0c2: e8 51 05 00 00 call 10c618 <_Thread_Stack_Free> return false; 10c0c7: 83 c4 10 add $0x10,%esp stack = the_thread->Start.stack; #else if ( !stack_area ) { actual_stack_size = _Thread_Stack_Allocate( the_thread, stack_size ); if ( !actual_stack_size || actual_stack_size < stack_size ) return false; /* stack allocation failed */ 10c0ca: 31 c9 xor %ecx,%ecx _Workspace_Free( sched ); _Thread_Stack_Free( the_thread ); return false; } 10c0cc: 88 c8 mov %cl,%al 10c0ce: 8d 65 f4 lea -0xc(%ebp),%esp 10c0d1: 5b pop %ebx 10c0d2: 5e pop %esi 10c0d3: 5f pop %edi 10c0d4: 5d pop %ebp 10c0d5: c3 ret =============================================================================== 0010c618 <_Thread_Stack_Free>: */ void _Thread_Stack_Free( Thread_Control *the_thread ) { 10c618: 55 push %ebp 10c619: 89 e5 mov %esp,%ebp 10c61b: 8b 45 08 mov 0x8(%ebp),%eax rtems_stack_free_hook stack_free_hook = 10c61e: 8b 15 6c a1 12 00 mov 0x12a16c,%edx #if defined(RTEMS_SCORE_THREAD_ENABLE_USER_PROVIDED_STACK_VIA_API) /* * If the API provided the stack space, then don't free it. */ if ( !the_thread->Start.core_allocated_stack ) 10c624: 80 b8 b0 00 00 00 00 cmpb $0x0,0xb0(%eax) 10c62b: 74 0c je 10c639 <_Thread_Stack_Free+0x21><== NEVER TAKEN * Call ONLY the CPU table stack free hook, or the * the RTEMS workspace free. This is so the free * routine properly matches the allocation of the stack. */ (*stack_free_hook)( the_thread->Start.Initial_stack.area ); 10c62d: 8b 80 b8 00 00 00 mov 0xb8(%eax),%eax 10c633: 89 45 08 mov %eax,0x8(%ebp) } 10c636: 5d pop %ebp * Call ONLY the CPU table stack free hook, or the * the RTEMS workspace free. This is so the free * routine properly matches the allocation of the stack. */ (*stack_free_hook)( the_thread->Start.Initial_stack.area ); 10c637: ff e2 jmp *%edx } 10c639: 5d pop %ebp <== NOT EXECUTED 10c63a: c3 ret <== NOT EXECUTED =============================================================================== 0010c4d0 <_Thread_queue_Requeue>: void _Thread_queue_Requeue( Thread_queue_Control *the_thread_queue, Thread_Control *the_thread ) { 10c4d0: 55 push %ebp 10c4d1: 89 e5 mov %esp,%ebp 10c4d3: 57 push %edi 10c4d4: 56 push %esi 10c4d5: 53 push %ebx 10c4d6: 83 ec 1c sub $0x1c,%esp 10c4d9: 8b 5d 08 mov 0x8(%ebp),%ebx 10c4dc: 8b 75 0c mov 0xc(%ebp),%esi /* * Just in case the thread really wasn't blocked on a thread queue * when we get here. */ if ( !the_thread_queue ) 10c4df: 85 db test %ebx,%ebx 10c4e1: 74 36 je 10c519 <_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 ) { 10c4e3: 83 7b 34 01 cmpl $0x1,0x34(%ebx) 10c4e7: 75 30 jne 10c519 <_Thread_queue_Requeue+0x49><== NEVER TAKEN Thread_queue_Control *tq = the_thread_queue; ISR_Level level; ISR_Level level_ignored; _ISR_Disable( level ); 10c4e9: 9c pushf 10c4ea: fa cli 10c4eb: 5f pop %edi if ( _States_Is_waiting_on_thread_queue( the_thread->current_state ) ) { 10c4ec: f7 46 10 e0 be 03 00 testl $0x3bee0,0x10(%esi) 10c4f3: 74 22 je 10c517 <_Thread_queue_Requeue+0x47><== NEVER TAKEN RTEMS_INLINE_ROUTINE void _Thread_queue_Enter_critical_section ( Thread_queue_Control *the_thread_queue ) { the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; 10c4f5: c7 43 30 01 00 00 00 movl $0x1,0x30(%ebx) _Thread_queue_Enter_critical_section( tq ); _Thread_queue_Extract_priority_helper( tq, the_thread, true ); 10c4fc: 50 push %eax 10c4fd: 6a 01 push $0x1 10c4ff: 56 push %esi 10c500: 53 push %ebx 10c501: e8 0a 32 00 00 call 10f710 <_Thread_queue_Extract_priority_helper> (void) _Thread_queue_Enqueue_priority( tq, the_thread, &level_ignored ); 10c506: 83 c4 0c add $0xc,%esp 10c509: 8d 45 e4 lea -0x1c(%ebp),%eax 10c50c: 50 push %eax 10c50d: 56 push %esi 10c50e: 53 push %ebx 10c50f: e8 e4 fd ff ff call 10c2f8 <_Thread_queue_Enqueue_priority> 10c514: 83 c4 10 add $0x10,%esp } _ISR_Enable( level ); 10c517: 57 push %edi 10c518: 9d popf } } 10c519: 8d 65 f4 lea -0xc(%ebp),%esp 10c51c: 5b pop %ebx 10c51d: 5e pop %esi 10c51e: 5f pop %edi 10c51f: 5d pop %ebp 10c520: c3 ret =============================================================================== 0010c524 <_Thread_queue_Timeout>: void _Thread_queue_Timeout( Objects_Id id, void *ignored __attribute__((unused)) ) { 10c524: 55 push %ebp 10c525: 89 e5 mov %esp,%ebp 10c527: 83 ec 20 sub $0x20,%esp Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); 10c52a: 8d 45 f4 lea -0xc(%ebp),%eax 10c52d: 50 push %eax 10c52e: ff 75 08 pushl 0x8(%ebp) 10c531: e8 f6 f8 ff ff call 10be2c <_Thread_Get> switch ( location ) { 10c536: 83 c4 10 add $0x10,%esp 10c539: 83 7d f4 00 cmpl $0x0,-0xc(%ebp) 10c53d: 75 1c jne 10c55b <_Thread_queue_Timeout+0x37><== NEVER TAKEN #if defined(RTEMS_MULTIPROCESSING) case OBJECTS_REMOTE: /* impossible */ #endif break; case OBJECTS_LOCAL: _Thread_queue_Process_timeout( the_thread ); 10c53f: 83 ec 0c sub $0xc,%esp 10c542: 50 push %eax 10c543: e8 78 32 00 00 call 10f7c0 <_Thread_queue_Process_timeout> * * This routine decrements the thread dispatch level. */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_decrement_disable_level(void) { _Thread_Dispatch_disable_level--; 10c548: a1 e4 e3 12 00 mov 0x12e3e4,%eax 10c54d: 48 dec %eax 10c54e: a3 e4 e3 12 00 mov %eax,0x12e3e4 return _Thread_Dispatch_disable_level; 10c553: a1 e4 e3 12 00 mov 0x12e3e4,%eax 10c558: 83 c4 10 add $0x10,%esp _Thread_Unnest_dispatch(); break; } } 10c55b: c9 leave 10c55c: c3 ret =============================================================================== 00116732 <_Timer_server_Body>: * @a arg points to the corresponding timer server control block. */ static rtems_task _Timer_server_Body( rtems_task_argument arg ) { 116732: 55 push %ebp 116733: 89 e5 mov %esp,%ebp 116735: 57 push %edi 116736: 56 push %esi 116737: 53 push %ebx 116738: 83 ec 3c sub $0x3c,%esp 11673b: 8b 5d 08 mov 0x8(%ebp),%ebx ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; 11673e: 8d 45 d0 lea -0x30(%ebp),%eax 116741: 8d 55 d4 lea -0x2c(%ebp),%edx 116744: 89 55 d0 mov %edx,-0x30(%ebp) head->previous = NULL; 116747: c7 45 d4 00 00 00 00 movl $0x0,-0x2c(%ebp) tail->previous = head; 11674e: 89 45 d8 mov %eax,-0x28(%ebp) ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; 116751: 8d 75 dc lea -0x24(%ebp),%esi 116754: 8d 55 e0 lea -0x20(%ebp),%edx 116757: 89 55 dc mov %edx,-0x24(%ebp) head->previous = NULL; 11675a: c7 45 e0 00 00 00 00 movl $0x0,-0x20(%ebp) tail->previous = head; 116761: 89 75 e4 mov %esi,-0x1c(%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; 116764: 8d 45 d0 lea -0x30(%ebp),%eax 116767: 89 43 78 mov %eax,0x78(%ebx) */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; watchdogs->last_snapshot = snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 11676a: 8d 7b 30 lea 0x30(%ebx),%edi static void _Timer_server_Process_interval_watchdogs( Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = _Watchdog_Ticks_since_boot; 11676d: a1 48 7f 14 00 mov 0x147f48,%eax /* * We assume adequate unsigned arithmetic here. */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; 116772: 8b 53 3c mov 0x3c(%ebx),%edx watchdogs->last_snapshot = snapshot; 116775: 89 43 3c mov %eax,0x3c(%ebx) _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 116778: 51 push %ecx 116779: 56 push %esi Watchdog_Interval snapshot = _Watchdog_Ticks_since_boot; /* * We assume adequate unsigned arithmetic here. */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; 11677a: 29 d0 sub %edx,%eax watchdogs->last_snapshot = snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 11677c: 50 push %eax 11677d: 57 push %edi 11677e: e8 25 38 00 00 call 119fa8 <_Watchdog_Adjust_to_chain> 116783: 6a 00 push $0x0 116785: 68 00 ca 9a 3b push $0x3b9aca00 11678a: ff 35 14 7e 14 00 pushl 0x147e14 116790: ff 35 10 7e 14 00 pushl 0x147e10 116796: e8 59 3e 01 00 call 12a5f4 <__divdi3> Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); Watchdog_Interval last_snapshot = watchdogs->last_snapshot; 11679b: 8b 53 74 mov 0x74(%ebx),%edx /* * 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 ) { 11679e: 83 c4 20 add $0x20,%esp 1167a1: 39 d0 cmp %edx,%eax 1167a3: 76 15 jbe 1167ba <_Timer_server_Body+0x88> /* * 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 ); 1167a5: 51 push %ecx 1167a6: 56 push %esi if ( snapshot > last_snapshot ) { /* * This path is for normal forward movement and cases where the * TOD has been set forward. */ delta = snapshot - last_snapshot; 1167a7: 89 c1 mov %eax,%ecx 1167a9: 29 d1 sub %edx,%ecx _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 1167ab: 51 push %ecx 1167ac: 8d 53 68 lea 0x68(%ebx),%edx 1167af: 52 push %edx 1167b0: 89 45 c0 mov %eax,-0x40(%ebp) 1167b3: e8 f0 37 00 00 call 119fa8 <_Watchdog_Adjust_to_chain> 1167b8: eb 14 jmp 1167ce <_Timer_server_Body+0x9c> } else if ( snapshot < last_snapshot ) { 1167ba: 73 18 jae 1167d4 <_Timer_server_Body+0xa2> /* * 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 ); 1167bc: 51 push %ecx } else if ( snapshot < last_snapshot ) { /* * The current TOD is before the last TOD which indicates that * TOD has been set backwards. */ delta = last_snapshot - snapshot; 1167bd: 29 c2 sub %eax,%edx _Watchdog_Adjust( &watchdogs->Chain, WATCHDOG_BACKWARD, delta ); 1167bf: 52 push %edx 1167c0: 6a 01 push $0x1 1167c2: 8d 53 68 lea 0x68(%ebx),%edx 1167c5: 52 push %edx 1167c6: 89 45 c0 mov %eax,-0x40(%ebp) 1167c9: e8 72 37 00 00 call 119f40 <_Watchdog_Adjust> 1167ce: 83 c4 10 add $0x10,%esp 1167d1: 8b 45 c0 mov -0x40(%ebp),%eax } watchdogs->last_snapshot = snapshot; 1167d4: 89 43 74 mov %eax,0x74(%ebx) ) { if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); } else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) { _Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker ); 1167d7: 8d 4b 68 lea 0x68(%ebx),%ecx 1167da: 89 4d c4 mov %ecx,-0x3c(%ebp) } static void _Timer_server_Process_insertions( Timer_server_Control *ts ) { while ( true ) { Timer_Control *timer = (Timer_Control *) _Chain_Get( ts->insert_chain ); 1167dd: 8b 43 78 mov 0x78(%ebx),%eax 1167e0: 83 ec 0c sub $0xc,%esp 1167e3: 50 push %eax 1167e4: e8 cf 07 00 00 call 116fb8 <_Chain_Get> if ( timer == NULL ) { 1167e9: 83 c4 10 add $0x10,%esp 1167ec: 85 c0 test %eax,%eax 1167ee: 74 29 je 116819 <_Timer_server_Body+0xe7><== ALWAYS TAKEN static void _Timer_server_Insert_timer( Timer_server_Control *ts, Timer_Control *timer ) { if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { 1167f0: 8b 50 38 mov 0x38(%eax),%edx <== NOT EXECUTED 1167f3: 83 fa 01 cmp $0x1,%edx <== NOT EXECUTED 1167f6: 75 09 jne 116801 <_Timer_server_Body+0xcf><== NOT EXECUTED _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); 1167f8: 52 push %edx <== NOT EXECUTED 1167f9: 52 push %edx <== NOT EXECUTED 1167fa: 83 c0 10 add $0x10,%eax <== NOT EXECUTED 1167fd: 50 push %eax <== NOT EXECUTED 1167fe: 57 push %edi <== NOT EXECUTED 1167ff: eb 0e jmp 11680f <_Timer_server_Body+0xdd><== NOT EXECUTED } else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) { 116801: 83 fa 03 cmp $0x3,%edx <== NOT EXECUTED 116804: 75 d7 jne 1167dd <_Timer_server_Body+0xab><== NOT EXECUTED _Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker ); 116806: 51 push %ecx <== NOT EXECUTED 116807: 51 push %ecx <== NOT EXECUTED 116808: 83 c0 10 add $0x10,%eax <== NOT EXECUTED 11680b: 50 push %eax <== NOT EXECUTED 11680c: ff 75 c4 pushl -0x3c(%ebp) <== NOT EXECUTED 11680f: e8 18 38 00 00 call 11a02c <_Watchdog_Insert> <== NOT EXECUTED 116814: 83 c4 10 add $0x10,%esp <== NOT EXECUTED 116817: eb c4 jmp 1167dd <_Timer_server_Body+0xab><== 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 ); 116819: 9c pushf 11681a: fa cli 11681b: 58 pop %eax RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 11681c: 8d 55 d4 lea -0x2c(%ebp),%edx if ( _Chain_Is_empty( insert_chain ) ) { 11681f: 39 55 d0 cmp %edx,-0x30(%ebp) 116822: 75 13 jne 116837 <_Timer_server_Body+0x105><== NEVER TAKEN ts->insert_chain = NULL; 116824: c7 43 78 00 00 00 00 movl $0x0,0x78(%ebx) _ISR_Enable( level ); 11682b: 50 push %eax 11682c: 9d popf 11682d: 8d 7d e0 lea -0x20(%ebp),%edi _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 ) ) { 116830: 39 7d dc cmp %edi,-0x24(%ebp) 116833: 75 09 jne 11683e <_Timer_server_Body+0x10c> 116835: eb 39 jmp 116870 <_Timer_server_Body+0x13e> ts->insert_chain = NULL; _ISR_Enable( level ); break; } else { _ISR_Enable( level ); 116837: 50 push %eax <== NOT EXECUTED 116838: 9d popf <== NOT EXECUTED 116839: e9 2f ff ff ff jmp 11676d <_Timer_server_Body+0x3b><== 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 ); 11683e: 9c pushf 11683f: fa cli 116840: 5a pop %edx */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; 116841: 8b 45 dc mov -0x24(%ebp),%eax */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected( Chain_Control *the_chain ) { if ( !_Chain_Is_empty(the_chain)) 116844: 39 f8 cmp %edi,%eax 116846: 74 21 je 116869 <_Timer_server_Body+0x137> Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *old_first = head->next; Chain_Node *new_first = old_first->next; 116848: 8b 08 mov (%eax),%ecx head->next = new_first; 11684a: 89 4d dc mov %ecx,-0x24(%ebp) new_first->previous = head; 11684d: 89 71 04 mov %esi,0x4(%ecx) watchdog = (Watchdog_Control *) _Chain_Get_unprotected( &fire_chain ); if ( watchdog != NULL ) { watchdog->state = WATCHDOG_INACTIVE; 116850: c7 40 08 00 00 00 00 movl $0x0,0x8(%eax) _ISR_Enable( level ); 116857: 52 push %edx 116858: 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 ); 116859: 52 push %edx 11685a: 52 push %edx 11685b: ff 70 24 pushl 0x24(%eax) 11685e: ff 70 20 pushl 0x20(%eax) 116861: ff 50 1c call *0x1c(%eax) } 116864: 83 c4 10 add $0x10,%esp 116867: eb d5 jmp 11683e <_Timer_server_Body+0x10c> watchdog = (Watchdog_Control *) _Chain_Get_unprotected( &fire_chain ); if ( watchdog != NULL ) { watchdog->state = WATCHDOG_INACTIVE; _ISR_Enable( level ); } else { _ISR_Enable( level ); 116869: 52 push %edx 11686a: 9d popf 11686b: e9 f4 fe ff ff jmp 116764 <_Timer_server_Body+0x32> * the active flag of the timer server is true. */ (*watchdog->routine)( watchdog->id, watchdog->user_data ); } } else { ts->active = false; 116870: c6 43 7c 00 movb $0x0,0x7c(%ebx) 116874: e8 ef fc ff ff call 116568 <_Thread_Dispatch_increment_disable_level> /* * Block until there is something to do. */ _Thread_Disable_dispatch(); _Thread_Set_state( ts->thread, STATES_DELAYING ); 116879: 57 push %edi 11687a: 57 push %edi 11687b: 6a 08 push $0x8 11687d: ff 33 pushl (%ebx) 11687f: e8 f8 32 00 00 call 119b7c <_Thread_Set_state> _Timer_server_Reset_interval_system_watchdog( ts ); 116884: 89 d8 mov %ebx,%eax 116886: e8 f2 fc ff ff call 11657d <_Timer_server_Reset_interval_system_watchdog> _Timer_server_Reset_tod_system_watchdog( ts ); 11688b: 89 d8 mov %ebx,%eax 11688d: e8 31 fd ff ff call 1165c3 <_Timer_server_Reset_tod_system_watchdog> _Thread_Enable_dispatch(); 116892: e8 fd 2a 00 00 call 119394 <_Thread_Enable_dispatch> ts->active = true; 116897: 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 ); 11689b: 8d 43 08 lea 0x8(%ebx),%eax 11689e: 89 04 24 mov %eax,(%esp) 1168a1: e8 9a 38 00 00 call 11a140 <_Watchdog_Remove> static void _Timer_server_Stop_tod_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->TOD_watchdogs.System_watchdog ); 1168a6: 8d 43 40 lea 0x40(%ebx),%eax 1168a9: 89 04 24 mov %eax,(%esp) 1168ac: e8 8f 38 00 00 call 11a140 <_Watchdog_Remove> 1168b1: 83 c4 10 add $0x10,%esp 1168b4: e9 ab fe ff ff jmp 116764 <_Timer_server_Body+0x32> =============================================================================== 00116609 <_Timer_server_Schedule_operation_method>: static void _Timer_server_Schedule_operation_method( Timer_server_Control *ts, Timer_Control *timer ) { 116609: 55 push %ebp 11660a: 89 e5 mov %esp,%ebp 11660c: 57 push %edi 11660d: 56 push %esi 11660e: 53 push %ebx 11660f: 83 ec 1c sub $0x1c,%esp 116612: 8b 5d 08 mov 0x8(%ebp),%ebx 116615: 8b 7d 0c mov 0xc(%ebp),%edi if ( ts->insert_chain == NULL ) { 116618: 8b 43 78 mov 0x78(%ebx),%eax 11661b: 85 c0 test %eax,%eax 11661d: 0f 85 fa 00 00 00 jne 11671d <_Timer_server_Schedule_operation_method+0x114><== NEVER TAKEN #if defined ( __THREAD_DO_NOT_INLINE_DISABLE_DISPATCH__ ) void _Thread_Disable_dispatch( void ); #else RTEMS_INLINE_ROUTINE void _Thread_Disable_dispatch( void ) { _Thread_Dispatch_increment_disable_level(); 116623: e8 40 ff ff ff call 116568 <_Thread_Dispatch_increment_disable_level> * being inserted. This could result in an integer overflow. */ _Thread_Disable_dispatch(); if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { 116628: 8b 47 38 mov 0x38(%edi),%eax 11662b: 83 f8 01 cmp $0x1,%eax 11662e: 75 61 jne 116691 <_Timer_server_Schedule_operation_method+0x88> /* * We have to advance the last known ticks value of the server and update * the watchdog chain accordingly. */ _ISR_Disable( level ); 116630: 9c pushf 116631: fa cli 116632: 8f 45 e0 popl -0x20(%ebp) snapshot = _Watchdog_Ticks_since_boot; 116635: 8b 15 48 7f 14 00 mov 0x147f48,%edx last_snapshot = ts->Interval_watchdogs.last_snapshot; 11663b: 8b 4b 3c mov 0x3c(%ebx),%ecx */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; 11663e: 8b 43 30 mov 0x30(%ebx),%eax RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 116641: 8d 73 34 lea 0x34(%ebx),%esi if ( !_Chain_Is_empty( &ts->Interval_watchdogs.Chain ) ) { 116644: 39 f0 cmp %esi,%eax 116646: 74 19 je 116661 <_Timer_server_Schedule_operation_method+0x58> first_watchdog = _Watchdog_First( &ts->Interval_watchdogs.Chain ); /* * We assume adequate unsigned arithmetic here. */ delta = snapshot - last_snapshot; 116648: 89 d6 mov %edx,%esi 11664a: 29 ce sub %ecx,%esi 11664c: 89 75 e4 mov %esi,-0x1c(%ebp) delta_interval = first_watchdog->delta_interval; 11664f: 8b 70 10 mov 0x10(%eax),%esi if (delta_interval > delta) { delta_interval -= delta; } else { delta_interval = 0; 116652: 31 c9 xor %ecx,%ecx * We assume adequate unsigned arithmetic here. */ delta = snapshot - last_snapshot; delta_interval = first_watchdog->delta_interval; if (delta_interval > delta) { 116654: 3b 75 e4 cmp -0x1c(%ebp),%esi 116657: 76 05 jbe 11665e <_Timer_server_Schedule_operation_method+0x55> delta_interval -= delta; 116659: 89 f1 mov %esi,%ecx 11665b: 2b 4d e4 sub -0x1c(%ebp),%ecx } else { delta_interval = 0; } first_watchdog->delta_interval = delta_interval; 11665e: 89 48 10 mov %ecx,0x10(%eax) } ts->Interval_watchdogs.last_snapshot = snapshot; 116661: 89 53 3c mov %edx,0x3c(%ebx) _ISR_Enable( level ); 116664: ff 75 e0 pushl -0x20(%ebp) 116667: 9d popf _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); 116668: 56 push %esi 116669: 56 push %esi 11666a: 8d 47 10 lea 0x10(%edi),%eax 11666d: 50 push %eax 11666e: 8d 43 30 lea 0x30(%ebx),%eax 116671: 50 push %eax 116672: e8 b5 39 00 00 call 11a02c <_Watchdog_Insert> if ( !ts->active ) { 116677: 8a 43 7c mov 0x7c(%ebx),%al 11667a: 83 c4 10 add $0x10,%esp 11667d: 84 c0 test %al,%al 11667f: 0f 85 8c 00 00 00 jne 116711 <_Timer_server_Schedule_operation_method+0x108> _Timer_server_Reset_interval_system_watchdog( ts ); 116685: 89 d8 mov %ebx,%eax 116687: e8 f1 fe ff ff call 11657d <_Timer_server_Reset_interval_system_watchdog> 11668c: e9 80 00 00 00 jmp 116711 <_Timer_server_Schedule_operation_method+0x108> } } else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) { 116691: 83 f8 03 cmp $0x3,%eax 116694: 75 7b jne 116711 <_Timer_server_Schedule_operation_method+0x108> /* * We have to advance the last known seconds value of the server and update * the watchdog chain accordingly. */ _ISR_Disable( level ); 116696: 9c pushf 116697: fa cli 116698: 8f 45 e0 popl -0x20(%ebp) 11669b: 6a 00 push $0x0 11669d: 68 00 ca 9a 3b push $0x3b9aca00 1166a2: ff 35 14 7e 14 00 pushl 0x147e14 1166a8: ff 35 10 7e 14 00 pushl 0x147e10 1166ae: e8 41 3f 01 00 call 12a5f4 <__divdi3> 1166b3: 83 c4 10 add $0x10,%esp snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); last_snapshot = ts->TOD_watchdogs.last_snapshot; 1166b6: 8b 53 74 mov 0x74(%ebx),%edx */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; 1166b9: 8b 4b 68 mov 0x68(%ebx),%ecx RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 1166bc: 8d 73 6c lea 0x6c(%ebx),%esi if ( !_Chain_Is_empty( &ts->TOD_watchdogs.Chain ) ) { 1166bf: 39 f1 cmp %esi,%ecx 1166c1: 74 27 je 1166ea <_Timer_server_Schedule_operation_method+0xe1> first_watchdog = _Watchdog_First( &ts->TOD_watchdogs.Chain ); delta_interval = first_watchdog->delta_interval; 1166c3: 8b 71 10 mov 0x10(%ecx),%esi 1166c6: 89 75 dc mov %esi,-0x24(%ebp) if ( snapshot > last_snapshot ) { 1166c9: 39 d0 cmp %edx,%eax 1166cb: 76 15 jbe 1166e2 <_Timer_server_Schedule_operation_method+0xd9> /* * We advanced in time. */ delta = snapshot - last_snapshot; 1166cd: 89 c6 mov %eax,%esi 1166cf: 29 d6 sub %edx,%esi 1166d1: 89 75 e4 mov %esi,-0x1c(%ebp) if (delta_interval > delta) { delta_interval -= delta; } else { delta_interval = 0; 1166d4: 31 d2 xor %edx,%edx if ( snapshot > last_snapshot ) { /* * We advanced in time. */ delta = snapshot - last_snapshot; if (delta_interval > delta) { 1166d6: 39 75 dc cmp %esi,-0x24(%ebp) 1166d9: 76 0c jbe 1166e7 <_Timer_server_Schedule_operation_method+0xde><== NEVER TAKEN delta_interval -= delta; 1166db: 8b 55 dc mov -0x24(%ebp),%edx 1166de: 29 f2 sub %esi,%edx 1166e0: eb 05 jmp 1166e7 <_Timer_server_Schedule_operation_method+0xde> } } else { /* * Someone put us in the past. */ delta = last_snapshot - snapshot; 1166e2: 03 55 dc add -0x24(%ebp),%edx delta_interval += delta; 1166e5: 29 c2 sub %eax,%edx } first_watchdog->delta_interval = delta_interval; 1166e7: 89 51 10 mov %edx,0x10(%ecx) } ts->TOD_watchdogs.last_snapshot = snapshot; 1166ea: 89 43 74 mov %eax,0x74(%ebx) _ISR_Enable( level ); 1166ed: ff 75 e0 pushl -0x20(%ebp) 1166f0: 9d popf _Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker ); 1166f1: 51 push %ecx 1166f2: 51 push %ecx 1166f3: 8d 47 10 lea 0x10(%edi),%eax 1166f6: 50 push %eax 1166f7: 8d 43 68 lea 0x68(%ebx),%eax 1166fa: 50 push %eax 1166fb: e8 2c 39 00 00 call 11a02c <_Watchdog_Insert> if ( !ts->active ) { 116700: 8a 43 7c mov 0x7c(%ebx),%al 116703: 83 c4 10 add $0x10,%esp 116706: 84 c0 test %al,%al 116708: 75 07 jne 116711 <_Timer_server_Schedule_operation_method+0x108> _Timer_server_Reset_tod_system_watchdog( ts ); 11670a: 89 d8 mov %ebx,%eax 11670c: e8 b2 fe ff ff call 1165c3 <_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 ); } } 116711: 8d 65 f4 lea -0xc(%ebp),%esp 116714: 5b pop %ebx 116715: 5e pop %esi 116716: 5f pop %edi 116717: 5d pop %ebp if ( !ts->active ) { _Timer_server_Reset_tod_system_watchdog( ts ); } } _Thread_Enable_dispatch(); 116718: e9 77 2c 00 00 jmp 119394 <_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 ); 11671d: 8b 43 78 mov 0x78(%ebx),%eax <== NOT EXECUTED 116720: 89 7d 0c mov %edi,0xc(%ebp) <== NOT EXECUTED 116723: 89 45 08 mov %eax,0x8(%ebp) <== NOT EXECUTED } } 116726: 8d 65 f4 lea -0xc(%ebp),%esp <== NOT EXECUTED 116729: 5b pop %ebx <== NOT EXECUTED 11672a: 5e pop %esi <== NOT EXECUTED 11672b: 5f pop %edi <== NOT EXECUTED 11672c: 5d pop %ebp <== 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 ); 11672d: e9 62 08 00 00 jmp 116f94 <_Chain_Append> <== NOT EXECUTED =============================================================================== 0010d974 <_Timestamp64_Divide>: const Timestamp64_Control *_lhs, const Timestamp64_Control *_rhs, uint32_t *_ival_percentage, uint32_t *_fval_percentage ) { 10d974: 55 push %ebp 10d975: 89 e5 mov %esp,%ebp 10d977: 57 push %edi 10d978: 56 push %esi 10d979: 53 push %ebx 10d97a: 83 ec 0c sub $0xc,%esp 10d97d: 8b 55 08 mov 0x8(%ebp),%edx Timestamp64_Control answer; if ( *_rhs == 0 ) { 10d980: 8b 45 0c mov 0xc(%ebp),%eax 10d983: 8b 08 mov (%eax),%ecx 10d985: 8b 58 04 mov 0x4(%eax),%ebx 10d988: 89 d8 mov %ebx,%eax 10d98a: 09 c8 or %ecx,%eax 10d98c: 75 14 jne 10d9a2 <_Timestamp64_Divide+0x2e><== ALWAYS TAKEN *_ival_percentage = 0; 10d98e: 8b 55 10 mov 0x10(%ebp),%edx <== NOT EXECUTED 10d991: c7 02 00 00 00 00 movl $0x0,(%edx) <== NOT EXECUTED *_fval_percentage = 0; 10d997: 8b 45 14 mov 0x14(%ebp),%eax <== NOT EXECUTED 10d99a: c7 00 00 00 00 00 movl $0x0,(%eax) <== NOT EXECUTED return; 10d9a0: eb 4c jmp 10d9ee <_Timestamp64_Divide+0x7a><== NOT EXECUTED * This looks odd but gives the results the proper precision. * * TODO: Rounding on the last digit of the fval. */ answer = (*_lhs * 100000) / *_rhs; 10d9a2: 69 72 04 a0 86 01 00 imul $0x186a0,0x4(%edx),%esi 10d9a9: b8 a0 86 01 00 mov $0x186a0,%eax 10d9ae: f7 22 mull (%edx) 10d9b0: 01 f2 add %esi,%edx 10d9b2: 53 push %ebx 10d9b3: 51 push %ecx 10d9b4: 52 push %edx 10d9b5: 50 push %eax 10d9b6: e8 5d 10 01 00 call 11ea18 <__divdi3> 10d9bb: 83 c4 10 add $0x10,%esp 10d9be: 89 c6 mov %eax,%esi 10d9c0: 89 d7 mov %edx,%edi *_ival_percentage = answer / 1000; 10d9c2: 6a 00 push $0x0 10d9c4: 68 e8 03 00 00 push $0x3e8 10d9c9: 52 push %edx 10d9ca: 50 push %eax 10d9cb: e8 48 10 01 00 call 11ea18 <__divdi3> 10d9d0: 83 c4 10 add $0x10,%esp 10d9d3: 8b 55 10 mov 0x10(%ebp),%edx 10d9d6: 89 02 mov %eax,(%edx) *_fval_percentage = answer % 1000; 10d9d8: 6a 00 push $0x0 10d9da: 68 e8 03 00 00 push $0x3e8 10d9df: 57 push %edi 10d9e0: 56 push %esi 10d9e1: e8 86 11 01 00 call 11eb6c <__moddi3> 10d9e6: 83 c4 10 add $0x10,%esp 10d9e9: 8b 55 14 mov 0x14(%ebp),%edx 10d9ec: 89 02 mov %eax,(%edx) } 10d9ee: 8d 65 f4 lea -0xc(%ebp),%esp 10d9f1: 5b pop %ebx 10d9f2: 5e pop %esi 10d9f3: 5f pop %edi 10d9f4: 5d pop %ebp 10d9f5: c3 ret =============================================================================== 0010c6ec <_User_extensions_Handler_initialization>: #include #include #include void _User_extensions_Handler_initialization(void) { 10c6ec: 55 push %ebp 10c6ed: 89 e5 mov %esp,%ebp 10c6ef: 57 push %edi 10c6f0: 56 push %esi 10c6f1: 53 push %ebx 10c6f2: 83 ec 1c sub $0x1c,%esp User_extensions_Control *extension; uint32_t i; uint32_t number_of_extensions; User_extensions_Table *initial_extensions; number_of_extensions = Configuration.number_of_initial_extensions; 10c6f5: a1 80 a1 12 00 mov 0x12a180,%eax 10c6fa: 89 45 e4 mov %eax,-0x1c(%ebp) initial_extensions = Configuration.User_extension_table; 10c6fd: 8b 1d 84 a1 12 00 mov 0x12a184,%ebx ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; 10c703: c7 05 90 e5 12 00 94 movl $0x12e594,0x12e590 10c70a: e5 12 00 head->previous = NULL; 10c70d: c7 05 94 e5 12 00 00 movl $0x0,0x12e594 10c714: 00 00 00 tail->previous = head; 10c717: c7 05 98 e5 12 00 90 movl $0x12e590,0x12e598 10c71e: e5 12 00 ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; 10c721: c7 05 e8 e3 12 00 ec movl $0x12e3ec,0x12e3e8 10c728: e3 12 00 head->previous = NULL; 10c72b: c7 05 ec e3 12 00 00 movl $0x0,0x12e3ec 10c732: 00 00 00 tail->previous = head; 10c735: c7 05 f0 e3 12 00 e8 movl $0x12e3e8,0x12e3f0 10c73c: e3 12 00 _Chain_Initialize_empty( &_User_extensions_List ); _Chain_Initialize_empty( &_User_extensions_Switches_list ); if ( initial_extensions ) { 10c73f: 85 db test %ebx,%ebx 10c741: 74 4f je 10c792 <_User_extensions_Handler_initialization+0xa6><== NEVER TAKEN extension = (User_extensions_Control *) _Workspace_Allocate_or_fatal_error( 10c743: 6b f0 34 imul $0x34,%eax,%esi _Chain_Initialize_empty( &_User_extensions_List ); _Chain_Initialize_empty( &_User_extensions_Switches_list ); if ( initial_extensions ) { extension = (User_extensions_Control *) 10c746: 83 ec 0c sub $0xc,%esp 10c749: 56 push %esi 10c74a: e8 26 04 00 00 call 10cb75 <_Workspace_Allocate_or_fatal_error> 10c74f: 89 c2 mov %eax,%edx _Workspace_Allocate_or_fatal_error( number_of_extensions * sizeof( User_extensions_Control ) ); memset ( 10c751: 31 c0 xor %eax,%eax 10c753: 89 d7 mov %edx,%edi 10c755: 89 f1 mov %esi,%ecx 10c757: f3 aa rep stos %al,%es:(%edi) extension, 0, number_of_extensions * sizeof( User_extensions_Control ) ); for ( i = 0 ; i < number_of_extensions ; i++ ) { 10c759: 83 c4 10 add $0x10,%esp 10c75c: 31 c0 xor %eax,%eax 10c75e: eb 2d jmp 10c78d <_User_extensions_Handler_initialization+0xa1> #include #include #include #include void _User_extensions_Handler_initialization(void) 10c760: 89 c6 mov %eax,%esi 10c762: c1 e6 05 shl $0x5,%esi RTEMS_INLINE_ROUTINE void _User_extensions_Add_set_with_table( User_extensions_Control *extension, const User_extensions_Table *extension_table ) { extension->Callouts = *extension_table; 10c765: 8d 7a 14 lea 0x14(%edx),%edi 10c768: 01 de add %ebx,%esi 10c76a: b9 08 00 00 00 mov $0x8,%ecx 10c76f: f3 a5 rep movsl %ds:(%esi),%es:(%edi) _User_extensions_Add_set( extension ); 10c771: 83 ec 0c sub $0xc,%esp 10c774: 52 push %edx 10c775: 89 45 dc mov %eax,-0x24(%ebp) 10c778: 89 55 e0 mov %edx,-0x20(%ebp) 10c77b: e8 e4 30 00 00 call 10f864 <_User_extensions_Add_set> number_of_extensions * sizeof( User_extensions_Control ) ); for ( i = 0 ; i < number_of_extensions ; i++ ) { _User_extensions_Add_set_with_table (extension, &initial_extensions[i]); extension++; 10c780: 8b 55 e0 mov -0x20(%ebp),%edx 10c783: 83 c2 34 add $0x34,%edx extension, 0, number_of_extensions * sizeof( User_extensions_Control ) ); for ( i = 0 ; i < number_of_extensions ; i++ ) { 10c786: 8b 45 dc mov -0x24(%ebp),%eax 10c789: 40 inc %eax 10c78a: 83 c4 10 add $0x10,%esp 10c78d: 3b 45 e4 cmp -0x1c(%ebp),%eax 10c790: 75 ce jne 10c760 <_User_extensions_Handler_initialization+0x74> _User_extensions_Add_set_with_table (extension, &initial_extensions[i]); extension++; } } } 10c792: 8d 65 f4 lea -0xc(%ebp),%esp 10c795: 5b pop %ebx 10c796: 5e pop %esi 10c797: 5f pop %edi 10c798: 5d pop %ebp 10c799: c3 ret =============================================================================== 0010dc4c <_Watchdog_Adjust>: void _Watchdog_Adjust( Chain_Control *header, Watchdog_Adjust_directions direction, Watchdog_Interval units ) { 10dc4c: 55 push %ebp 10dc4d: 89 e5 mov %esp,%ebp 10dc4f: 57 push %edi 10dc50: 56 push %esi 10dc51: 53 push %ebx 10dc52: 83 ec 0c sub $0xc,%esp 10dc55: 8b 75 08 mov 0x8(%ebp),%esi 10dc58: 8b 4d 0c mov 0xc(%ebp),%ecx 10dc5b: 8b 5d 10 mov 0x10(%ebp),%ebx ISR_Level level; _ISR_Disable( level ); 10dc5e: 9c pushf 10dc5f: fa cli 10dc60: 58 pop %eax */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; 10dc61: 8b 16 mov (%esi),%edx RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 10dc63: 8d 7e 04 lea 0x4(%esi),%edi * hence the compiler must not assume *header to remain * unmodified across that call. * * Till Straumann, 7/2003 */ if ( !_Chain_Is_empty( header ) ) { 10dc66: 39 fa cmp %edi,%edx 10dc68: 74 3e je 10dca8 <_Watchdog_Adjust+0x5c> switch ( direction ) { 10dc6a: 85 c9 test %ecx,%ecx 10dc6c: 74 36 je 10dca4 <_Watchdog_Adjust+0x58> 10dc6e: 49 dec %ecx 10dc6f: 75 37 jne 10dca8 <_Watchdog_Adjust+0x5c> <== NEVER TAKEN case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; 10dc71: 01 5a 10 add %ebx,0x10(%edx) break; 10dc74: eb 32 jmp 10dca8 <_Watchdog_Adjust+0x5c> */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; 10dc76: 8b 16 mov (%esi),%edx case WATCHDOG_FORWARD: while ( units ) { if ( units < _Watchdog_First( header )->delta_interval ) { 10dc78: 8b 4a 10 mov 0x10(%edx),%ecx 10dc7b: 39 cb cmp %ecx,%ebx 10dc7d: 73 07 jae 10dc86 <_Watchdog_Adjust+0x3a> _Watchdog_First( header )->delta_interval -= units; 10dc7f: 29 d9 sub %ebx,%ecx 10dc81: 89 4a 10 mov %ecx,0x10(%edx) break; 10dc84: eb 22 jmp 10dca8 <_Watchdog_Adjust+0x5c> } else { units -= _Watchdog_First( header )->delta_interval; 10dc86: 29 cb sub %ecx,%ebx _Watchdog_First( header )->delta_interval = 1; 10dc88: c7 42 10 01 00 00 00 movl $0x1,0x10(%edx) _ISR_Enable( level ); 10dc8f: 50 push %eax 10dc90: 9d popf _Watchdog_Tickle( header ); 10dc91: 83 ec 0c sub $0xc,%esp 10dc94: 56 push %esi 10dc95: e8 96 01 00 00 call 10de30 <_Watchdog_Tickle> _ISR_Disable( level ); 10dc9a: 9c pushf 10dc9b: fa cli 10dc9c: 58 pop %eax if ( _Chain_Is_empty( header ) ) 10dc9d: 83 c4 10 add $0x10,%esp 10dca0: 39 3e cmp %edi,(%esi) 10dca2: 74 04 je 10dca8 <_Watchdog_Adjust+0x5c> switch ( direction ) { case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; break; case WATCHDOG_FORWARD: while ( units ) { 10dca4: 85 db test %ebx,%ebx 10dca6: 75 ce jne 10dc76 <_Watchdog_Adjust+0x2a> <== ALWAYS TAKEN } break; } } _ISR_Enable( level ); 10dca8: 50 push %eax 10dca9: 9d popf } 10dcaa: 8d 65 f4 lea -0xc(%ebp),%esp 10dcad: 5b pop %ebx 10dcae: 5e pop %esi 10dcaf: 5f pop %edi 10dcb0: 5d pop %ebp 10dcb1: c3 ret =============================================================================== 0010ca18 <_Watchdog_Remove>: */ Watchdog_States _Watchdog_Remove( Watchdog_Control *the_watchdog ) { 10ca18: 55 push %ebp 10ca19: 89 e5 mov %esp,%ebp 10ca1b: 56 push %esi 10ca1c: 53 push %ebx 10ca1d: 8b 55 08 mov 0x8(%ebp),%edx ISR_Level level; Watchdog_States previous_state; Watchdog_Control *next_watchdog; _ISR_Disable( level ); 10ca20: 9c pushf 10ca21: fa cli 10ca22: 5e pop %esi previous_state = the_watchdog->state; 10ca23: 8b 42 08 mov 0x8(%edx),%eax switch ( previous_state ) { 10ca26: 83 f8 01 cmp $0x1,%eax 10ca29: 74 09 je 10ca34 <_Watchdog_Remove+0x1c> 10ca2b: 72 42 jb 10ca6f <_Watchdog_Remove+0x57> 10ca2d: 83 f8 03 cmp $0x3,%eax 10ca30: 77 3d ja 10ca6f <_Watchdog_Remove+0x57> <== NEVER TAKEN 10ca32: eb 09 jmp 10ca3d <_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; 10ca34: c7 42 08 00 00 00 00 movl $0x0,0x8(%edx) break; 10ca3b: eb 32 jmp 10ca6f <_Watchdog_Remove+0x57> case WATCHDOG_ACTIVE: case WATCHDOG_REMOVE_IT: the_watchdog->state = WATCHDOG_INACTIVE; 10ca3d: c7 42 08 00 00 00 00 movl $0x0,0x8(%edx) } the_watchdog->stop_time = _Watchdog_Ticks_since_boot; _ISR_Enable( level ); return( previous_state ); } 10ca44: 8b 0a mov (%edx),%ecx case WATCHDOG_REMOVE_IT: the_watchdog->state = WATCHDOG_INACTIVE; next_watchdog = _Watchdog_Next( the_watchdog ); if ( _Watchdog_Next(next_watchdog) ) 10ca46: 83 39 00 cmpl $0x0,(%ecx) 10ca49: 74 06 je 10ca51 <_Watchdog_Remove+0x39> next_watchdog->delta_interval += the_watchdog->delta_interval; 10ca4b: 8b 5a 10 mov 0x10(%edx),%ebx 10ca4e: 01 59 10 add %ebx,0x10(%ecx) if ( _Watchdog_Sync_count ) 10ca51: 8b 1d d4 e4 12 00 mov 0x12e4d4,%ebx 10ca57: 85 db test %ebx,%ebx 10ca59: 74 0c je 10ca67 <_Watchdog_Remove+0x4f> _Watchdog_Sync_level = _ISR_Nest_level; 10ca5b: 8b 1d e8 e8 12 00 mov 0x12e8e8,%ebx 10ca61: 89 1d 74 e4 12 00 mov %ebx,0x12e474 { Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; 10ca67: 8b 5a 04 mov 0x4(%edx),%ebx next->previous = previous; 10ca6a: 89 59 04 mov %ebx,0x4(%ecx) previous->next = next; 10ca6d: 89 0b mov %ecx,(%ebx) _Chain_Extract_unprotected( &the_watchdog->Node ); break; } the_watchdog->stop_time = _Watchdog_Ticks_since_boot; 10ca6f: 8b 0d d8 e4 12 00 mov 0x12e4d8,%ecx 10ca75: 89 4a 18 mov %ecx,0x18(%edx) _ISR_Enable( level ); 10ca78: 56 push %esi 10ca79: 9d popf return( previous_state ); } 10ca7a: 5b pop %ebx 10ca7b: 5e pop %esi 10ca7c: 5d pop %ebp 10ca7d: c3 ret =============================================================================== 0010ca80 <_Watchdog_Tickle>: */ void _Watchdog_Tickle( Chain_Control *header ) { 10ca80: 55 push %ebp 10ca81: 89 e5 mov %esp,%ebp 10ca83: 57 push %edi 10ca84: 56 push %esi 10ca85: 53 push %ebx 10ca86: 83 ec 1c sub $0x1c,%esp 10ca89: 8b 75 08 mov 0x8(%ebp),%esi * 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 ); 10ca8c: 9c pushf 10ca8d: fa cli 10ca8e: 5a pop %edx */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; 10ca8f: 8b 1e mov (%esi),%ebx RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 10ca91: 8d 7e 04 lea 0x4(%esi),%edi if ( _Chain_Is_empty( header ) ) 10ca94: 39 fb cmp %edi,%ebx 10ca96: 74 45 je 10cadd <_Watchdog_Tickle+0x5d> * 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) { 10ca98: 8b 43 10 mov 0x10(%ebx),%eax 10ca9b: 85 c0 test %eax,%eax 10ca9d: 74 08 je 10caa7 <_Watchdog_Tickle+0x27> the_watchdog->delta_interval--; 10ca9f: 48 dec %eax 10caa0: 89 43 10 mov %eax,0x10(%ebx) if ( the_watchdog->delta_interval != 0 ) 10caa3: 85 c0 test %eax,%eax 10caa5: 75 36 jne 10cadd <_Watchdog_Tickle+0x5d> goto leave; } do { watchdog_state = _Watchdog_Remove( the_watchdog ); 10caa7: 83 ec 0c sub $0xc,%esp 10caaa: 53 push %ebx 10caab: 89 55 e4 mov %edx,-0x1c(%ebp) 10caae: e8 65 ff ff ff call 10ca18 <_Watchdog_Remove> _ISR_Enable( level ); 10cab3: 8b 55 e4 mov -0x1c(%ebp),%edx 10cab6: 52 push %edx 10cab7: 9d popf switch( watchdog_state ) { 10cab8: 83 c4 10 add $0x10,%esp 10cabb: 83 f8 02 cmp $0x2,%eax 10cabe: 75 0e jne 10cace <_Watchdog_Tickle+0x4e> <== NEVER TAKEN case WATCHDOG_ACTIVE: (*the_watchdog->routine)( 10cac0: 50 push %eax 10cac1: 50 push %eax 10cac2: ff 73 24 pushl 0x24(%ebx) 10cac5: ff 73 20 pushl 0x20(%ebx) 10cac8: ff 53 1c call *0x1c(%ebx) the_watchdog->id, the_watchdog->user_data ); break; 10cacb: 83 c4 10 add $0x10,%esp case WATCHDOG_REMOVE_IT: break; } _ISR_Disable( level ); 10cace: 9c pushf 10cacf: fa cli 10cad0: 5a pop %edx */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; 10cad1: 8b 1e mov (%esi),%ebx the_watchdog = _Watchdog_First( header ); } while ( !_Chain_Is_empty( header ) && (the_watchdog->delta_interval == 0) ); 10cad3: 39 fb cmp %edi,%ebx 10cad5: 74 06 je 10cadd <_Watchdog_Tickle+0x5d> } _ISR_Disable( level ); the_watchdog = _Watchdog_First( header ); } while ( !_Chain_Is_empty( header ) && 10cad7: 83 7b 10 00 cmpl $0x0,0x10(%ebx) 10cadb: eb c8 jmp 10caa5 <_Watchdog_Tickle+0x25> (the_watchdog->delta_interval == 0) ); leave: _ISR_Enable(level); 10cadd: 52 push %edx 10cade: 9d popf } 10cadf: 8d 65 f4 lea -0xc(%ebp),%esp 10cae2: 5b pop %ebx 10cae3: 5e pop %esi 10cae4: 5f pop %edi 10cae5: 5d pop %ebp 10cae6: c3 ret =============================================================================== 00109dc4 : * operation(s) cannot be canceled */ int aio_cancel(int fildes, struct aiocb *aiocbp) { 109dc4: 55 push %ebp 109dc5: 89 e5 mov %esp,%ebp 109dc7: 57 push %edi 109dc8: 56 push %esi 109dc9: 53 push %ebx 109dca: 83 ec 18 sub $0x18,%esp 109dcd: 8b 75 08 mov 0x8(%ebp),%esi 109dd0: 8b 5d 0c mov 0xc(%ebp),%ebx rtems_aio_request_chain *r_chain; int result; pthread_mutex_lock (&aio_request_queue.mutex); 109dd3: 68 08 03 13 00 push $0x130308 109dd8: e8 2b 10 00 00 call 10ae08 if (fcntl (fildes, F_GETFD) < 0) { 109ddd: 58 pop %eax 109dde: 5a pop %edx 109ddf: 6a 01 push $0x1 109de1: 56 push %esi 109de2: e8 a9 5b 00 00 call 10f990 109de7: 83 c4 10 add $0x10,%esp 109dea: 85 c0 test %eax,%eax 109dec: 79 1d jns 109e0b pthread_mutex_unlock(&aio_request_queue.mutex); 109dee: 83 ec 0c sub $0xc,%esp 109df1: 68 08 03 13 00 push $0x130308 109df6: e8 8d 10 00 00 call 10ae88 rtems_set_errno_and_return_minus_one (EBADF); 109dfb: e8 1c 8f 00 00 call 112d1c <__errno> 109e00: c7 00 09 00 00 00 movl $0x9,(%eax) 109e06: e9 20 01 00 00 jmp 109f2b } /* if aiocbp is NULL remove all request for given file descriptor */ if (aiocbp == NULL) { 109e0b: 85 db test %ebx,%ebx 109e0d: 0f 85 bc 00 00 00 jne 109ecf AIO_printf ("Cancel all requests\n"); r_chain = rtems_aio_search_fd (&aio_request_queue.work_req, fildes, 0); 109e13: 50 push %eax 109e14: 6a 00 push $0x0 109e16: 56 push %esi 109e17: 68 50 03 13 00 push $0x130350 109e1c: e8 9e 05 00 00 call 10a3bf 109e21: 89 c3 mov %eax,%ebx if (r_chain == NULL) { 109e23: 83 c4 10 add $0x10,%esp 109e26: 85 c0 test %eax,%eax 109e28: 75 6b jne 109e95 AIO_printf ("Request chain not on [WQ]\n"); if (!rtems_chain_is_empty (&aio_request_queue.idle_req)) { 109e2a: 81 3d 5c 03 13 00 60 cmpl $0x130360,0x13035c 109e31: 03 13 00 109e34: 74 17 je 109e4d <== NEVER TAKEN r_chain = rtems_aio_search_fd (&aio_request_queue.idle_req, fildes, 0); 109e36: 50 push %eax 109e37: 6a 00 push $0x0 109e39: 56 push %esi 109e3a: 68 5c 03 13 00 push $0x13035c 109e3f: e8 7b 05 00 00 call 10a3bf 109e44: 89 c3 mov %eax,%ebx if (r_chain == NULL) { 109e46: 83 c4 10 add $0x10,%esp 109e49: 85 c0 test %eax,%eax 109e4b: 75 1a jne 109e67 pthread_mutex_unlock(&aio_request_queue.mutex); 109e4d: 83 ec 0c sub $0xc,%esp 109e50: 68 08 03 13 00 push $0x130308 109e55: e8 2e 10 00 00 call 10ae88 return AIO_ALLDONE; 109e5a: 83 c4 10 add $0x10,%esp 109e5d: bb 02 00 00 00 mov $0x2,%ebx 109e62: e9 0d 01 00 00 jmp 109f74 */ RTEMS_INLINE_ROUTINE void rtems_chain_extract( rtems_chain_node *the_node ) { _Chain_Extract( the_node ); 109e67: 83 ec 0c sub $0xc,%esp 109e6a: 50 push %eax 109e6b: e8 94 26 00 00 call 10c504 <_Chain_Extract> } AIO_printf ("Request chain on [IQ]\n"); rtems_chain_extract (&r_chain->next_fd); rtems_aio_remove_fd (r_chain); 109e70: 89 1c 24 mov %ebx,(%esp) 109e73: e8 d5 05 00 00 call 10a44d pthread_mutex_destroy (&r_chain->mutex); 109e78: 8d 73 1c lea 0x1c(%ebx),%esi 109e7b: 89 34 24 mov %esi,(%esp) 109e7e: e8 59 0d 00 00 call 10abdc pthread_cond_destroy (&r_chain->mutex); 109e83: 89 34 24 mov %esi,(%esp) 109e86: e8 4d 0a 00 00 call 10a8d8 free (r_chain); 109e8b: 89 1c 24 mov %ebx,(%esp) 109e8e: e8 c5 cc ff ff call 106b58 109e93: eb 24 jmp 109eb9 return AIO_ALLDONE; } AIO_printf ("Request chain on [WQ]\n"); pthread_mutex_lock (&r_chain->mutex); 109e95: 8d 70 1c lea 0x1c(%eax),%esi 109e98: 83 ec 0c sub $0xc,%esp 109e9b: 56 push %esi 109e9c: e8 67 0f 00 00 call 10ae08 109ea1: 89 1c 24 mov %ebx,(%esp) 109ea4: e8 5b 26 00 00 call 10c504 <_Chain_Extract> rtems_chain_extract (&r_chain->next_fd); rtems_aio_remove_fd (r_chain); 109ea9: 89 1c 24 mov %ebx,(%esp) 109eac: e8 9c 05 00 00 call 10a44d pthread_mutex_unlock (&r_chain->mutex); 109eb1: 89 34 24 mov %esi,(%esp) 109eb4: e8 cf 0f 00 00 call 10ae88 pthread_mutex_unlock (&aio_request_queue.mutex); 109eb9: c7 04 24 08 03 13 00 movl $0x130308,(%esp) 109ec0: e8 c3 0f 00 00 call 10ae88 return AIO_CANCELED; 109ec5: 83 c4 10 add $0x10,%esp 109ec8: 31 db xor %ebx,%ebx 109eca: e9 a5 00 00 00 jmp 109f74 } else { AIO_printf ("Cancel request\n"); if (aiocbp->aio_fildes != fildes) { 109ecf: 8b 3b mov (%ebx),%edi 109ed1: 39 f7 cmp %esi,%edi 109ed3: 74 02 je 109ed7 109ed5: eb 3c jmp 109f13 pthread_mutex_unlock (&aio_request_queue.mutex); rtems_set_errno_and_return_minus_one (EINVAL); } r_chain = rtems_aio_search_fd (&aio_request_queue.work_req, fildes, 0); 109ed7: 50 push %eax 109ed8: 6a 00 push $0x0 109eda: 57 push %edi 109edb: 68 50 03 13 00 push $0x130350 109ee0: e8 da 04 00 00 call 10a3bf 109ee5: 89 c6 mov %eax,%esi if (r_chain == NULL) { 109ee7: 83 c4 10 add $0x10,%esp 109eea: 85 c0 test %eax,%eax 109eec: 75 55 jne 109f43 if (!rtems_chain_is_empty (&aio_request_queue.idle_req)) { 109eee: 81 3d 5c 03 13 00 60 cmpl $0x130360,0x13035c 109ef5: 03 13 00 109ef8: 0f 84 4f ff ff ff je 109e4d <== NEVER TAKEN r_chain = rtems_aio_search_fd (&aio_request_queue.idle_req, fildes, 0); 109efe: 56 push %esi 109eff: 6a 00 push $0x0 109f01: 57 push %edi 109f02: 68 5c 03 13 00 push $0x13035c 109f07: e8 b3 04 00 00 call 10a3bf if (r_chain == NULL) { 109f0c: 83 c4 10 add $0x10,%esp 109f0f: 85 c0 test %eax,%eax 109f11: 75 20 jne 109f33 pthread_mutex_unlock (&aio_request_queue.mutex); 109f13: 83 ec 0c sub $0xc,%esp 109f16: 68 08 03 13 00 push $0x130308 109f1b: e8 68 0f 00 00 call 10ae88 rtems_set_errno_and_return_minus_one (EINVAL); 109f20: e8 f7 8d 00 00 call 112d1c <__errno> 109f25: c7 00 16 00 00 00 movl $0x16,(%eax) 109f2b: 83 c4 10 add $0x10,%esp 109f2e: 83 cb ff or $0xffffffff,%ebx 109f31: eb 41 jmp 109f74 } AIO_printf ("Request on [IQ]\n"); result = rtems_aio_remove_req (&r_chain->perfd, aiocbp); 109f33: 51 push %ecx 109f34: 51 push %ecx 109f35: 53 push %ebx 109f36: 83 c0 08 add $0x8,%eax 109f39: 50 push %eax 109f3a: e8 57 05 00 00 call 10a496 109f3f: 89 c3 mov %eax,%ebx 109f41: eb 22 jmp 109f65 return AIO_ALLDONE; } } AIO_printf ("Request on [WQ]\n"); pthread_mutex_lock (&r_chain->mutex); 109f43: 8d 78 1c lea 0x1c(%eax),%edi 109f46: 83 ec 0c sub $0xc,%esp 109f49: 57 push %edi 109f4a: e8 b9 0e 00 00 call 10ae08 result = rtems_aio_remove_req (&r_chain->perfd, aiocbp); 109f4f: 58 pop %eax 109f50: 5a pop %edx 109f51: 53 push %ebx 109f52: 83 c6 08 add $0x8,%esi 109f55: 56 push %esi 109f56: e8 3b 05 00 00 call 10a496 109f5b: 89 c3 mov %eax,%ebx pthread_mutex_unlock (&r_chain->mutex); 109f5d: 89 3c 24 mov %edi,(%esp) 109f60: e8 23 0f 00 00 call 10ae88 pthread_mutex_unlock (&aio_request_queue.mutex); 109f65: c7 04 24 08 03 13 00 movl $0x130308,(%esp) 109f6c: e8 17 0f 00 00 call 10ae88 return result; 109f71: 83 c4 10 add $0x10,%esp } return AIO_ALLDONE; } 109f74: 89 d8 mov %ebx,%eax 109f76: 8d 65 f4 lea -0xc(%ebp),%esp 109f79: 5b pop %ebx 109f7a: 5e pop %esi 109f7b: 5f pop %edi 109f7c: 5d pop %ebp 109f7d: c3 ret =============================================================================== 00109f8c : int aio_fsync( int op, struct aiocb *aiocbp ) { 109f8c: 55 push %ebp 109f8d: 89 e5 mov %esp,%ebp 109f8f: 53 push %ebx 109f90: 52 push %edx 109f91: 8b 5d 0c mov 0xc(%ebp),%ebx rtems_aio_request *req; int mode; if (op != O_SYNC) 109f94: 81 7d 08 00 20 00 00 cmpl $0x2000,0x8(%ebp) 109f9b: 74 1b je 109fb8 rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); 109f9d: c7 43 30 16 00 00 00 movl $0x16,0x30(%ebx) 109fa4: c7 43 34 ff ff ff ff movl $0xffffffff,0x34(%ebx) 109fab: e8 6c 8d 00 00 call 112d1c <__errno> 109fb0: c7 00 16 00 00 00 movl $0x16,(%eax) 109fb6: eb 74 jmp 10a02c mode = fcntl (aiocbp->aio_fildes, F_GETFL); 109fb8: 50 push %eax 109fb9: 50 push %eax 109fba: 6a 03 push $0x3 109fbc: ff 33 pushl (%ebx) 109fbe: e8 cd 59 00 00 call 10f990 if (!(((mode & O_ACCMODE) == O_WRONLY) || ((mode & O_ACCMODE) == O_RDWR))) 109fc3: 83 e0 03 and $0x3,%eax 109fc6: 48 dec %eax 109fc7: 83 c4 10 add $0x10,%esp 109fca: 83 f8 01 cmp $0x1,%eax 109fcd: 76 1b jbe 109fea rtems_aio_set_errno_return_minus_one (EBADF, aiocbp); 109fcf: c7 43 30 09 00 00 00 movl $0x9,0x30(%ebx) 109fd6: c7 43 34 ff ff ff ff movl $0xffffffff,0x34(%ebx) 109fdd: e8 3a 8d 00 00 call 112d1c <__errno> 109fe2: c7 00 09 00 00 00 movl $0x9,(%eax) 109fe8: eb 42 jmp 10a02c req = malloc (sizeof (rtems_aio_request)); 109fea: 83 ec 0c sub $0xc,%esp 109fed: 6a 18 push $0x18 109fef: e8 3c cf ff ff call 106f30 if (req == NULL) 109ff4: 83 c4 10 add $0x10,%esp 109ff7: 85 c0 test %eax,%eax 109ff9: 75 1b jne 10a016 <== ALWAYS TAKEN rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); 109ffb: c7 43 30 0b 00 00 00 movl $0xb,0x30(%ebx) <== NOT EXECUTED 10a002: c7 43 34 ff ff ff ff movl $0xffffffff,0x34(%ebx) <== NOT EXECUTED 10a009: e8 0e 8d 00 00 call 112d1c <__errno> <== NOT EXECUTED 10a00e: c7 00 0b 00 00 00 movl $0xb,(%eax) <== NOT EXECUTED 10a014: eb 16 jmp 10a02c <== NOT EXECUTED req->aiocbp = aiocbp; 10a016: 89 58 14 mov %ebx,0x14(%eax) req->aiocbp->aio_lio_opcode = LIO_SYNC; 10a019: c7 43 2c 03 00 00 00 movl $0x3,0x2c(%ebx) return rtems_aio_enqueue (req); 10a020: 89 45 08 mov %eax,0x8(%ebp) } 10a023: 8b 5d fc mov -0x4(%ebp),%ebx 10a026: c9 leave rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); req->aiocbp = aiocbp; req->aiocbp->aio_lio_opcode = LIO_SYNC; return rtems_aio_enqueue (req); 10a027: e9 ce 04 00 00 jmp 10a4fa } 10a02c: 83 c8 ff or $0xffffffff,%eax 10a02f: 8b 5d fc mov -0x4(%ebp),%ebx 10a032: c9 leave 10a033: c3 ret =============================================================================== 0010a6dc : * 0 - otherwise */ int aio_read (struct aiocb *aiocbp) { 10a6dc: 55 push %ebp 10a6dd: 89 e5 mov %esp,%ebp 10a6df: 53 push %ebx 10a6e0: 83 ec 0c sub $0xc,%esp 10a6e3: 8b 5d 08 mov 0x8(%ebp),%ebx rtems_aio_request *req; int mode; mode = fcntl (aiocbp->aio_fildes, F_GETFL); 10a6e6: 6a 03 push $0x3 10a6e8: ff 33 pushl (%ebx) 10a6ea: e8 a1 52 00 00 call 10f990 if (!(((mode & O_ACCMODE) == O_RDONLY) || ((mode & O_ACCMODE) == O_RDWR))) 10a6ef: 83 c4 10 add $0x10,%esp 10a6f2: a8 01 test $0x1,%al 10a6f4: 74 1b je 10a711 rtems_aio_set_errno_return_minus_one (EBADF, aiocbp); 10a6f6: c7 43 30 09 00 00 00 movl $0x9,0x30(%ebx) 10a6fd: c7 43 34 ff ff ff ff movl $0xffffffff,0x34(%ebx) 10a704: e8 13 86 00 00 call 112d1c <__errno> 10a709: c7 00 09 00 00 00 movl $0x9,(%eax) 10a70f: eb 6b jmp 10a77c if (aiocbp->aio_reqprio < 0 || aiocbp->aio_reqprio > AIO_PRIO_DELTA_MAX) 10a711: 83 7b 14 00 cmpl $0x0,0x14(%ebx) 10a715: 74 02 je 10a719 10a717: eb 06 jmp 10a71f rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); if (aiocbp->aio_offset < 0) 10a719: 83 7b 08 00 cmpl $0x0,0x8(%ebx) 10a71d: 79 1b jns 10a73a rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); 10a71f: c7 43 30 16 00 00 00 movl $0x16,0x30(%ebx) 10a726: c7 43 34 ff ff ff ff movl $0xffffffff,0x34(%ebx) 10a72d: e8 ea 85 00 00 call 112d1c <__errno> 10a732: c7 00 16 00 00 00 movl $0x16,(%eax) 10a738: eb 42 jmp 10a77c req = malloc (sizeof (rtems_aio_request)); 10a73a: 83 ec 0c sub $0xc,%esp 10a73d: 6a 18 push $0x18 10a73f: e8 ec c7 ff ff call 106f30 if (req == NULL) 10a744: 83 c4 10 add $0x10,%esp 10a747: 85 c0 test %eax,%eax 10a749: 75 1b jne 10a766 <== ALWAYS TAKEN rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); 10a74b: c7 43 30 0b 00 00 00 movl $0xb,0x30(%ebx) <== NOT EXECUTED 10a752: c7 43 34 ff ff ff ff movl $0xffffffff,0x34(%ebx) <== NOT EXECUTED 10a759: e8 be 85 00 00 call 112d1c <__errno> <== NOT EXECUTED 10a75e: c7 00 0b 00 00 00 movl $0xb,(%eax) <== NOT EXECUTED 10a764: eb 16 jmp 10a77c <== NOT EXECUTED req->aiocbp = aiocbp; 10a766: 89 58 14 mov %ebx,0x14(%eax) req->aiocbp->aio_lio_opcode = LIO_READ; 10a769: c7 43 2c 01 00 00 00 movl $0x1,0x2c(%ebx) return rtems_aio_enqueue (req); 10a770: 89 45 08 mov %eax,0x8(%ebp) } 10a773: 8b 5d fc mov -0x4(%ebp),%ebx 10a776: c9 leave rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); req->aiocbp = aiocbp; req->aiocbp->aio_lio_opcode = LIO_READ; return rtems_aio_enqueue (req); 10a777: e9 7e fd ff ff jmp 10a4fa } 10a77c: 83 c8 ff or $0xffffffff,%eax 10a77f: 8b 5d fc mov -0x4(%ebp),%ebx 10a782: c9 leave 10a783: c3 ret =============================================================================== 0010a790 : * 0 - otherwise */ int aio_write (struct aiocb *aiocbp) { 10a790: 55 push %ebp 10a791: 89 e5 mov %esp,%ebp 10a793: 53 push %ebx 10a794: 83 ec 0c sub $0xc,%esp 10a797: 8b 5d 08 mov 0x8(%ebp),%ebx rtems_aio_request *req; int mode; mode = fcntl (aiocbp->aio_fildes, F_GETFL); 10a79a: 6a 03 push $0x3 10a79c: ff 33 pushl (%ebx) 10a79e: e8 ed 51 00 00 call 10f990 if (!(((mode & O_ACCMODE) == O_WRONLY) || ((mode & O_ACCMODE) == O_RDWR))) 10a7a3: 83 e0 03 and $0x3,%eax 10a7a6: 48 dec %eax 10a7a7: 83 c4 10 add $0x10,%esp 10a7aa: 83 f8 01 cmp $0x1,%eax 10a7ad: 76 1b jbe 10a7ca rtems_aio_set_errno_return_minus_one (EBADF, aiocbp); 10a7af: c7 43 30 09 00 00 00 movl $0x9,0x30(%ebx) 10a7b6: c7 43 34 ff ff ff ff movl $0xffffffff,0x34(%ebx) 10a7bd: e8 5a 85 00 00 call 112d1c <__errno> 10a7c2: c7 00 09 00 00 00 movl $0x9,(%eax) 10a7c8: eb 6b jmp 10a835 if (aiocbp->aio_reqprio < 0 || aiocbp->aio_reqprio > AIO_PRIO_DELTA_MAX) 10a7ca: 83 7b 14 00 cmpl $0x0,0x14(%ebx) 10a7ce: 74 02 je 10a7d2 10a7d0: eb 06 jmp 10a7d8 rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); if (aiocbp->aio_offset < 0) 10a7d2: 83 7b 08 00 cmpl $0x0,0x8(%ebx) 10a7d6: 79 1b jns 10a7f3 rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); 10a7d8: c7 43 30 16 00 00 00 movl $0x16,0x30(%ebx) 10a7df: c7 43 34 ff ff ff ff movl $0xffffffff,0x34(%ebx) 10a7e6: e8 31 85 00 00 call 112d1c <__errno> 10a7eb: c7 00 16 00 00 00 movl $0x16,(%eax) 10a7f1: eb 42 jmp 10a835 req = malloc (sizeof (rtems_aio_request)); 10a7f3: 83 ec 0c sub $0xc,%esp 10a7f6: 6a 18 push $0x18 10a7f8: e8 33 c7 ff ff call 106f30 if (req == NULL) 10a7fd: 83 c4 10 add $0x10,%esp 10a800: 85 c0 test %eax,%eax 10a802: 75 1b jne 10a81f <== ALWAYS TAKEN rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); 10a804: c7 43 30 0b 00 00 00 movl $0xb,0x30(%ebx) <== NOT EXECUTED 10a80b: c7 43 34 ff ff ff ff movl $0xffffffff,0x34(%ebx) <== NOT EXECUTED 10a812: e8 05 85 00 00 call 112d1c <__errno> <== NOT EXECUTED 10a817: c7 00 0b 00 00 00 movl $0xb,(%eax) <== NOT EXECUTED 10a81d: eb 16 jmp 10a835 <== NOT EXECUTED req->aiocbp = aiocbp; 10a81f: 89 58 14 mov %ebx,0x14(%eax) req->aiocbp->aio_lio_opcode = LIO_WRITE; 10a822: c7 43 2c 02 00 00 00 movl $0x2,0x2c(%ebx) return rtems_aio_enqueue (req); 10a829: 89 45 08 mov %eax,0x8(%ebp) } 10a82c: 8b 5d fc mov -0x4(%ebp),%ebx 10a82f: c9 leave rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); req->aiocbp = aiocbp; req->aiocbp->aio_lio_opcode = LIO_WRITE; return rtems_aio_enqueue (req); 10a830: e9 c5 fc ff ff jmp 10a4fa } 10a835: 83 c8 ff or $0xffffffff,%eax 10a838: 8b 5d fc mov -0x4(%ebp),%ebx 10a83b: c9 leave 10a83c: c3 ret =============================================================================== 00109a54 : int clock_gettime( clockid_t clock_id, struct timespec *tp ) { 109a54: 55 push %ebp 109a55: 89 e5 mov %esp,%ebp 109a57: 57 push %edi 109a58: 56 push %esi 109a59: 53 push %ebx 109a5a: 83 ec 1c sub $0x1c,%esp 109a5d: 8b 45 08 mov 0x8(%ebp),%eax 109a60: 8b 5d 0c mov 0xc(%ebp),%ebx if ( !tp ) 109a63: 85 db test %ebx,%ebx 109a65: 75 02 jne 109a69 109a67: eb 6c jmp 109ad5 rtems_set_errno_and_return_minus_one( EINVAL ); if ( clock_id == CLOCK_REALTIME ) { 109a69: 83 f8 01 cmp $0x1,%eax 109a6c: 75 3b jne 109aa9 struct timespec *tod_as_timespec ) { Timestamp_Control tod_as_timestamp; _TOD_Get_as_timestamp( &tod_as_timestamp ); 109a6e: 83 ec 0c sub $0xc,%esp 109a71: 8d 45 e0 lea -0x20(%ebp),%eax 109a74: 50 push %eax 109a75: e8 ba 1a 00 00 call 10b534 <_TOD_Get_as_timestamp> _Timestamp_To_timespec( &tod_as_timestamp, tod_as_timespec ); 109a7a: 8b 75 e0 mov -0x20(%ebp),%esi 109a7d: 8b 7d e4 mov -0x1c(%ebp),%edi static inline void _Timestamp64_implementation_To_timespec( const Timestamp64_Control *_timestamp, struct timespec *_timespec ) { _timespec->tv_sec = (time_t) (*_timestamp / 1000000000L); 109a80: 6a 00 push $0x0 109a82: 68 00 ca 9a 3b push $0x3b9aca00 109a87: 57 push %edi 109a88: 56 push %esi 109a89: e8 86 52 01 00 call 11ed14 <__divdi3> 109a8e: 83 c4 10 add $0x10,%esp 109a91: 89 03 mov %eax,(%ebx) _timespec->tv_nsec = (long) (*_timestamp % 1000000000L); 109a93: 6a 00 push $0x0 109a95: 68 00 ca 9a 3b push $0x3b9aca00 109a9a: 57 push %edi 109a9b: 56 push %esi 109a9c: e8 c7 53 01 00 call 11ee68 <__moddi3> 109aa1: 83 c4 10 add $0x10,%esp 109aa4: 89 43 04 mov %eax,0x4(%ebx) 109aa7: eb 0e jmp 109ab7 _TOD_Get(tp); return 0; } #ifdef CLOCK_MONOTONIC if ( clock_id == CLOCK_MONOTONIC ) { 109aa9: 83 f8 04 cmp $0x4,%eax 109aac: 75 10 jne 109abe <== ALWAYS TAKEN _TOD_Get_uptime_as_timespec( tp ); 109aae: 83 ec 0c sub $0xc,%esp 109ab1: 53 push %ebx 109ab2: e8 b5 1a 00 00 call 10b56c <_TOD_Get_uptime_as_timespec> return 0; 109ab7: 83 c4 10 add $0x10,%esp 109aba: 31 c0 xor %eax,%eax 109abc: eb 25 jmp 109ae3 } #endif #ifdef _POSIX_CPUTIME if ( clock_id == CLOCK_PROCESS_CPUTIME_ID ) { 109abe: 83 f8 02 cmp $0x2,%eax 109ac1: 74 eb je 109aae return 0; } #endif #ifdef _POSIX_THREAD_CPUTIME if ( clock_id == CLOCK_THREAD_CPUTIME_ID ) 109ac3: 83 f8 03 cmp $0x3,%eax 109ac6: 75 0d jne 109ad5 rtems_set_errno_and_return_minus_one( ENOSYS ); 109ac8: e8 cf 80 00 00 call 111b9c <__errno> 109acd: c7 00 58 00 00 00 movl $0x58,(%eax) 109ad3: eb 0b jmp 109ae0 #endif rtems_set_errno_and_return_minus_one( EINVAL ); 109ad5: e8 c2 80 00 00 call 111b9c <__errno> 109ada: c7 00 16 00 00 00 movl $0x16,(%eax) 109ae0: 83 c8 ff or $0xffffffff,%eax return 0; } 109ae3: 8d 65 f4 lea -0xc(%ebp),%esp 109ae6: 5b pop %ebx 109ae7: 5e pop %esi 109ae8: 5f pop %edi 109ae9: 5d pop %ebp 109aea: c3 ret =============================================================================== 001233a0 : int clock_settime( clockid_t clock_id, const struct timespec *tp ) { 1233a0: 55 push %ebp 1233a1: 89 e5 mov %esp,%ebp 1233a3: 53 push %ebx 1233a4: 83 ec 14 sub $0x14,%esp 1233a7: 8b 45 08 mov 0x8(%ebp),%eax 1233aa: 8b 4d 0c mov 0xc(%ebp),%ecx if ( !tp ) 1233ad: 85 c9 test %ecx,%ecx 1233af: 75 02 jne 1233b3 <== ALWAYS TAKEN 1233b1: eb 69 jmp 12341c <== NOT EXECUTED rtems_set_errno_and_return_minus_one( EINVAL ); if ( clock_id == CLOCK_REALTIME ) { 1233b3: 83 f8 01 cmp $0x1,%eax 1233b6: 75 4b jne 123403 if ( tp->tv_sec < TOD_SECONDS_1970_THROUGH_1988 ) 1233b8: 81 39 ff e4 da 21 cmpl $0x21dae4ff,(%ecx) 1233be: 77 02 ja 1233c2 1233c0: eb 5a jmp 12341c * * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { _Thread_Dispatch_disable_level++; 1233c2: a1 fc e1 16 00 mov 0x16e1fc,%eax 1233c7: 40 inc %eax 1233c8: a3 fc e1 16 00 mov %eax,0x16e1fc return _Thread_Dispatch_disable_level; 1233cd: a1 fc e1 16 00 mov 0x16e1fc,%eax Timestamp64_Control *_time, Timestamp64_Control _seconds, Timestamp64_Control _nanoseconds ) { *_time = _seconds * 1000000000L + _nanoseconds; 1233d2: b8 00 ca 9a 3b mov $0x3b9aca00,%eax 1233d7: f7 29 imull (%ecx) const struct timespec *tod_as_timespec ) { Timestamp_Control tod_as_timestamp; _Timestamp_Set( 1233d9: 8b 49 04 mov 0x4(%ecx),%ecx 1233dc: 89 cb mov %ecx,%ebx 1233de: c1 fb 1f sar $0x1f,%ebx 1233e1: 01 c8 add %ecx,%eax 1233e3: 11 da adc %ebx,%edx 1233e5: 89 45 f0 mov %eax,-0x10(%ebp) 1233e8: 89 55 f4 mov %edx,-0xc(%ebp) &tod_as_timestamp, tod_as_timespec->tv_sec, tod_as_timespec->tv_nsec ); _TOD_Set_with_timestamp( &tod_as_timestamp ); 1233eb: 83 ec 0c sub $0xc,%esp 1233ee: 8d 45 f0 lea -0x10(%ebp),%eax 1233f1: 50 push %eax 1233f2: e8 0d 0e 00 00 call 124204 <_TOD_Set_with_timestamp> rtems_set_errno_and_return_minus_one( EINVAL ); _Thread_Disable_dispatch(); _TOD_Set( tp ); _Thread_Enable_dispatch(); 1233f7: e8 78 87 fe ff call 10bb74 <_Thread_Enable_dispatch> rtems_set_errno_and_return_minus_one( ENOSYS ); #endif else rtems_set_errno_and_return_minus_one( EINVAL ); return 0; 1233fc: 83 c4 10 add $0x10,%esp 1233ff: 31 c0 xor %eax,%eax 123401: eb 27 jmp 12342a _Thread_Disable_dispatch(); _TOD_Set( tp ); _Thread_Enable_dispatch(); } #ifdef _POSIX_CPUTIME else if ( clock_id == CLOCK_PROCESS_CPUTIME_ID ) 123403: 83 f8 02 cmp $0x2,%eax 123406: 75 02 jne 12340a 123408: eb 05 jmp 12340f rtems_set_errno_and_return_minus_one( ENOSYS ); #endif #ifdef _POSIX_THREAD_CPUTIME else if ( clock_id == CLOCK_THREAD_CPUTIME_ID ) 12340a: 83 f8 03 cmp $0x3,%eax 12340d: 75 0d jne 12341c rtems_set_errno_and_return_minus_one( ENOSYS ); 12340f: e8 74 da 00 00 call 130e88 <__errno> 123414: c7 00 58 00 00 00 movl $0x58,(%eax) 12341a: eb 0b jmp 123427 #endif else rtems_set_errno_and_return_minus_one( EINVAL ); 12341c: e8 67 da 00 00 call 130e88 <__errno> 123421: c7 00 16 00 00 00 movl $0x16,(%eax) 123427: 83 c8 ff or $0xffffffff,%eax return 0; } 12342a: 8b 5d fc mov -0x4(%ebp),%ebx 12342d: c9 leave 12342e: c3 ret =============================================================================== 0011d990 : int killinfo( pid_t pid, int sig, const union sigval *value ) { 11d990: 55 push %ebp 11d991: 89 e5 mov %esp,%ebp 11d993: 57 push %edi 11d994: 56 push %esi 11d995: 53 push %ebx 11d996: 83 ec 3c sub $0x3c,%esp 11d999: 8b 5d 0c mov 0xc(%ebp),%ebx 11d99c: 8b 75 10 mov 0x10(%ebp),%esi POSIX_signals_Siginfo_node *psiginfo; /* * Only supported for the "calling process" (i.e. this node). */ if ( pid != getpid() ) 11d99f: e8 f0 fd ff ff call 11d794 11d9a4: 39 45 08 cmp %eax,0x8(%ebp) 11d9a7: 74 10 je 11d9b9 rtems_set_errno_and_return_minus_one( ESRCH ); 11d9a9: e8 2e 35 ff ff call 110edc <__errno> 11d9ae: c7 00 03 00 00 00 movl $0x3,(%eax) 11d9b4: e9 f1 01 00 00 jmp 11dbaa /* * Validate the signal passed. */ if ( !sig ) 11d9b9: 85 db test %ebx,%ebx 11d9bb: 75 02 jne 11d9bf 11d9bd: eb 08 jmp 11d9c7 static inline bool is_valid_signo( int signo ) { return ((signo) >= 1 && (signo) <= 32 ); 11d9bf: 8d 4b ff lea -0x1(%ebx),%ecx rtems_set_errno_and_return_minus_one( EINVAL ); if ( !is_valid_signo(sig) ) 11d9c2: 83 f9 1f cmp $0x1f,%ecx 11d9c5: 76 10 jbe 11d9d7 rtems_set_errno_and_return_minus_one( EINVAL ); 11d9c7: e8 10 35 ff ff call 110edc <__errno> 11d9cc: c7 00 16 00 00 00 movl $0x16,(%eax) 11d9d2: e9 d3 01 00 00 jmp 11dbaa /* * If the signal is being ignored, then we are out of here. */ if ( _POSIX_signals_Vectors[ sig ].sa_handler == SIG_IGN ) 11d9d7: 6b c3 0c imul $0xc,%ebx,%eax 11d9da: 83 b8 30 e9 12 00 01 cmpl $0x1,0x12e930(%eax) 11d9e1: 0f 84 e9 01 00 00 je 11dbd0 /* * 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 ) ) 11d9e7: 83 fb 04 cmp $0x4,%ebx 11d9ea: 74 0a je 11d9f6 11d9ec: 83 fb 08 cmp $0x8,%ebx 11d9ef: 74 05 je 11d9f6 11d9f1: 83 fb 0b cmp $0xb,%ebx 11d9f4: 75 16 jne 11da0c return pthread_kill( pthread_self(), sig ); 11d9f6: e8 9d 03 00 00 call 11dd98 11d9fb: 56 push %esi 11d9fc: 56 push %esi 11d9fd: 53 push %ebx 11d9fe: 50 push %eax 11d9ff: e8 ec 02 00 00 call 11dcf0 11da04: 83 c4 10 add $0x10,%esp 11da07: e9 c6 01 00 00 jmp 11dbd2 static inline sigset_t signo_to_mask( uint32_t sig ) { return 1u << (sig - 1); 11da0c: bf 01 00 00 00 mov $0x1,%edi 11da11: d3 e7 shl %cl,%edi /* * Build up a siginfo structure */ siginfo = &siginfo_struct; siginfo->si_signo = sig; 11da13: 89 5d dc mov %ebx,-0x24(%ebp) siginfo->si_code = SI_USER; 11da16: c7 45 e0 01 00 00 00 movl $0x1,-0x20(%ebp) if ( !value ) { 11da1d: 85 f6 test %esi,%esi 11da1f: 75 09 jne 11da2a siginfo->si_value.sival_int = 0; 11da21: c7 45 e4 00 00 00 00 movl $0x0,-0x1c(%ebp) 11da28: eb 05 jmp 11da2f } else { siginfo->si_value = *value; 11da2a: 8b 06 mov (%esi),%eax 11da2c: 89 45 e4 mov %eax,-0x1c(%ebp) * * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { _Thread_Dispatch_disable_level++; 11da2f: a1 e4 e3 12 00 mov 0x12e3e4,%eax 11da34: 40 inc %eax 11da35: a3 e4 e3 12 00 mov %eax,0x12e3e4 return _Thread_Dispatch_disable_level; 11da3a: a1 e4 e3 12 00 mov 0x12e3e4,%eax /* * 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; 11da3f: a1 ec e8 12 00 mov 0x12e8ec,%eax api = the_thread->API_Extensions[ THREAD_API_POSIX ]; if ( _POSIX_signals_Is_interested( api, mask ) ) { 11da44: 8b 90 e8 00 00 00 mov 0xe8(%eax),%edx 11da4a: 8b 92 d0 00 00 00 mov 0xd0(%edx),%edx 11da50: f7 d2 not %edx 11da52: 85 d7 test %edx,%edi 11da54: 0f 85 fa 00 00 00 jne 11db54 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; 11da5a: a1 b4 ea 12 00 mov 0x12eab4,%eax /* XXX violation of visibility -- need to define thread queue support */ the_chain = &_POSIX_signals_Wait_queue.Queues.Fifo; for ( the_node = _Chain_First( the_chain ); 11da5f: eb 21 jmp 11da82 !_Chain_Is_tail( the_chain, the_node ) ; the_node = the_node->next ) { the_thread = (Thread_Control *)the_node; api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 11da61: 8b 90 e8 00 00 00 mov 0xe8(%eax),%edx #endif /* * Is this thread is actually blocked waiting for the signal? */ if (the_thread->Wait.option & mask) 11da67: 85 78 30 test %edi,0x30(%eax) 11da6a: 0f 85 e4 00 00 00 jne 11db54 /* * Is this thread is blocked waiting for another signal but has * not blocked this one? */ if (~api->signals_blocked & mask) 11da70: 8b 92 d0 00 00 00 mov 0xd0(%edx),%edx 11da76: f7 d2 not %edx 11da78: 85 d7 test %edx,%edi 11da7a: 0f 85 d4 00 00 00 jne 11db54 the_chain = &_POSIX_signals_Wait_queue.Queues.Fifo; for ( the_node = _Chain_First( the_chain ); !_Chain_Is_tail( the_chain, the_node ) ; the_node = the_node->next ) { 11da80: 8b 00 mov (%eax),%eax /* XXX violation of visibility -- need to define thread queue support */ the_chain = &_POSIX_signals_Wait_queue.Queues.Fifo; for ( the_node = _Chain_First( the_chain ); 11da82: 3d b8 ea 12 00 cmp $0x12eab8,%eax 11da87: 75 d8 jne 11da61 * NOTES: * * + rtems internal threads do not receive signals. */ interested = NULL; interested_priority = PRIORITY_MAXIMUM + 1; 11da89: 0f b6 05 88 a1 12 00 movzbl 0x12a188,%eax 11da90: 40 inc %eax 11da91: 89 45 bc mov %eax,-0x44(%ebp) * * NOTES: * * + rtems internal threads do not receive signals. */ interested = NULL; 11da94: 31 c0 xor %eax,%eax interested_priority = PRIORITY_MAXIMUM + 1; for (the_api = OBJECTS_CLASSIC_API; the_api <= OBJECTS_APIS_LAST; the_api++) { 11da96: c7 45 cc 02 00 00 00 movl $0x2,-0x34(%ebp) /* * This can occur when no one is interested and an API is not configured. */ if ( !_Objects_Information_table[ the_api ] ) 11da9d: 8b 4d cc mov -0x34(%ebp),%ecx 11daa0: 8b 14 8d bc e3 12 00 mov 0x12e3bc(,%ecx,4),%edx 11daa7: 85 d2 test %edx,%edx 11daa9: 0f 84 94 00 00 00 je 11db43 <== NEVER TAKEN continue; the_info = _Objects_Information_table[ the_api ][ 1 ]; 11daaf: 8b 52 04 mov 0x4(%edx),%edx */ if ( !the_info ) continue; #endif maximum = the_info->maximum; 11dab2: 0f b7 72 10 movzwl 0x10(%edx),%esi 11dab6: 89 75 c4 mov %esi,-0x3c(%ebp) object_table = the_info->local_table; 11dab9: 8b 52 1c mov 0x1c(%edx),%edx 11dabc: 89 55 c0 mov %edx,-0x40(%ebp) for ( index = 1 ; index <= maximum ; index++ ) { 11dabf: c7 45 d0 01 00 00 00 movl $0x1,-0x30(%ebp) 11dac6: eb 73 jmp 11db3b the_thread = (Thread_Control *) object_table[ index ]; 11dac8: 8b 4d d0 mov -0x30(%ebp),%ecx 11dacb: 8b 75 c0 mov -0x40(%ebp),%esi 11dace: 8b 14 8e mov (%esi,%ecx,4),%edx if ( !the_thread ) 11dad1: 85 d2 test %edx,%edx 11dad3: 74 63 je 11db38 /* * If this thread is of lower priority than the interested thread, * go on to the next thread. */ if ( the_thread->current_priority > interested_priority ) 11dad5: 8b 4a 14 mov 0x14(%edx),%ecx 11dad8: 89 4d d4 mov %ecx,-0x2c(%ebp) 11dadb: 8b 75 bc mov -0x44(%ebp),%esi 11dade: 39 f1 cmp %esi,%ecx 11dae0: 77 56 ja 11db38 #if defined(RTEMS_DEBUG) if ( !api ) continue; #endif if ( !_POSIX_signals_Is_interested( api, mask ) ) 11dae2: 8b b2 e8 00 00 00 mov 0xe8(%edx),%esi 11dae8: 8b b6 d0 00 00 00 mov 0xd0(%esi),%esi 11daee: f7 d6 not %esi 11daf0: 85 f7 test %esi,%edi 11daf2: 74 44 je 11db38 * * 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 ) { 11daf4: 8b 75 bc mov -0x44(%ebp),%esi 11daf7: 39 f1 cmp %esi,%ecx 11daf9: 72 2d jb 11db28 * and blocking interruptibutable by signal. * * If the interested thread is ready, don't think about changing. */ if ( interested && !_States_Is_ready( interested->current_state ) ) { 11dafb: 85 c0 test %eax,%eax 11dafd: 74 39 je 11db38 <== NEVER TAKEN 11daff: 8b 48 10 mov 0x10(%eax),%ecx 11db02: 89 4d c8 mov %ecx,-0x38(%ebp) 11db05: 85 c9 test %ecx,%ecx 11db07: 74 2f je 11db38 <== NEVER TAKEN /* preferred ready over blocked */ DEBUG_STEP("5"); if ( _States_Is_ready( the_thread->current_state ) ) { 11db09: 8b 72 10 mov 0x10(%edx),%esi 11db0c: 85 f6 test %esi,%esi 11db0e: 74 20 je 11db30 continue; } DEBUG_STEP("6"); /* prefer blocked/interruptible over blocked/not interruptible */ if ( !_States_Is_interruptible_by_signal(interested->current_state) ) { 11db10: 81 e1 00 00 00 10 and $0x10000000,%ecx 11db16: 75 20 jne 11db38 DEBUG_STEP("7"); if ( _States_Is_interruptible_by_signal(the_thread->current_state) ) { 11db18: 81 e6 00 00 00 10 and $0x10000000,%esi 11db1e: 74 18 je 11db38 11db20: 8b 75 d4 mov -0x2c(%ebp),%esi 11db23: 89 75 bc mov %esi,-0x44(%ebp) 11db26: eb 0e jmp 11db36 * * 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 ) { 11db28: 8b 45 d4 mov -0x2c(%ebp),%eax 11db2b: 89 45 bc mov %eax,-0x44(%ebp) 11db2e: eb 06 jmp 11db36 */ if ( interested && !_States_Is_ready( interested->current_state ) ) { /* preferred ready over blocked */ DEBUG_STEP("5"); if ( _States_Is_ready( the_thread->current_state ) ) { 11db30: 8b 4d d4 mov -0x2c(%ebp),%ecx 11db33: 89 4d bc mov %ecx,-0x44(%ebp) 11db36: 89 d0 mov %edx,%eax #endif maximum = the_info->maximum; object_table = the_info->local_table; for ( index = 1 ; index <= maximum ; index++ ) { 11db38: ff 45 d0 incl -0x30(%ebp) 11db3b: 8b 75 c4 mov -0x3c(%ebp),%esi 11db3e: 39 75 d0 cmp %esi,-0x30(%ebp) 11db41: 76 85 jbe 11dac8 * + 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++) { 11db43: ff 45 cc incl -0x34(%ebp) 11db46: 83 7d cc 04 cmpl $0x4,-0x34(%ebp) 11db4a: 0f 85 4d ff ff ff jne 11da9d } } } } if ( interested ) { 11db50: 85 c0 test %eax,%eax 11db52: 74 1a je 11db6e /* * 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 ) ) { 11db54: 51 push %ecx mask = signo_to_mask( sig ); /* * Build up a siginfo structure */ siginfo = &siginfo_struct; 11db55: 8d 55 dc lea -0x24(%ebp),%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 ) ) { 11db58: 52 push %edx 11db59: 53 push %ebx 11db5a: 50 push %eax 11db5b: e8 90 00 00 00 call 11dbf0 <_POSIX_signals_Unblock_thread> 11db60: 83 c4 10 add $0x10,%esp 11db63: 84 c0 test %al,%al 11db65: 74 07 je 11db6e _Thread_Enable_dispatch(); 11db67: e8 a0 e2 fe ff call 10be0c <_Thread_Enable_dispatch> 11db6c: eb 62 jmp 11dbd0 /* * 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 ); 11db6e: 83 ec 0c sub $0xc,%esp 11db71: 57 push %edi 11db72: e8 65 00 00 00 call 11dbdc <_POSIX_signals_Set_process_signals> if ( _POSIX_signals_Vectors[ sig ].sa_flags == SA_SIGINFO ) { 11db77: 6b db 0c imul $0xc,%ebx,%ebx 11db7a: 83 c4 10 add $0x10,%esp 11db7d: 83 bb 28 e9 12 00 02 cmpl $0x2,0x12e928(%ebx) 11db84: 75 e1 jne 11db67 psiginfo = (POSIX_signals_Siginfo_node *) 11db86: 83 ec 0c sub $0xc,%esp 11db89: 68 a8 ea 12 00 push $0x12eaa8 11db8e: e8 ed ca fe ff call 10a680 <_Chain_Get> _Chain_Get( &_POSIX_signals_Inactive_siginfo ); if ( !psiginfo ) { 11db93: 83 c4 10 add $0x10,%esp 11db96: 85 c0 test %eax,%eax 11db98: 75 15 jne 11dbaf _Thread_Enable_dispatch(); 11db9a: e8 6d e2 fe ff call 10be0c <_Thread_Enable_dispatch> rtems_set_errno_and_return_minus_one( EAGAIN ); 11db9f: e8 38 33 ff ff call 110edc <__errno> 11dba4: c7 00 0b 00 00 00 movl $0xb,(%eax) 11dbaa: 83 c8 ff or $0xffffffff,%eax 11dbad: eb 23 jmp 11dbd2 } psiginfo->Info = *siginfo; 11dbaf: 8d 78 08 lea 0x8(%eax),%edi 11dbb2: 8d 75 dc lea -0x24(%ebp),%esi 11dbb5: b9 03 00 00 00 mov $0x3,%ecx 11dbba: f3 a5 rep movsl %ds:(%esi),%es:(%edi) _Chain_Append( &_POSIX_signals_Siginfo[ sig ], &psiginfo->Node ); 11dbbc: 52 push %edx 11dbbd: 52 push %edx 11dbbe: 50 push %eax 11dbbf: 81 c3 20 eb 12 00 add $0x12eb20,%ebx 11dbc5: 53 push %ebx 11dbc6: e8 91 ca fe ff call 10a65c <_Chain_Append> 11dbcb: 83 c4 10 add $0x10,%esp 11dbce: eb 97 jmp 11db67 /* * If the signal is being ignored, then we are out of here. */ if ( _POSIX_signals_Vectors[ sig ].sa_handler == SIG_IGN ) return 0; 11dbd0: 31 c0 xor %eax,%eax } DEBUG_STEP("\n"); _Thread_Enable_dispatch(); return 0; } 11dbd2: 8d 65 f4 lea -0xc(%ebp),%esp 11dbd5: 5b pop %ebx 11dbd6: 5e pop %esi 11dbd7: 5f pop %edi 11dbd8: 5d pop %ebp 11dbd9: c3 ret =============================================================================== 0010e4d4 : int pthread_attr_setschedpolicy( pthread_attr_t *attr, int policy ) { 10e4d4: 55 push %ebp 10e4d5: 89 e5 mov %esp,%ebp 10e4d7: 8b 55 08 mov 0x8(%ebp),%edx 10e4da: 8b 4d 0c mov 0xc(%ebp),%ecx if ( !attr || !attr->is_initialized ) return EINVAL; 10e4dd: b8 16 00 00 00 mov $0x16,%eax int pthread_attr_setschedpolicy( pthread_attr_t *attr, int policy ) { if ( !attr || !attr->is_initialized ) 10e4e2: 85 d2 test %edx,%edx 10e4e4: 74 1e je 10e504 10e4e6: 83 3a 00 cmpl $0x0,(%edx) 10e4e9: 74 19 je 10e504 return EINVAL; switch ( policy ) { 10e4eb: 83 f9 04 cmp $0x4,%ecx 10e4ee: 77 0f ja 10e4ff 10e4f0: b0 01 mov $0x1,%al 10e4f2: d3 e0 shl %cl,%eax 10e4f4: a8 17 test $0x17,%al 10e4f6: 74 07 je 10e4ff <== NEVER TAKEN case SCHED_OTHER: case SCHED_FIFO: case SCHED_RR: case SCHED_SPORADIC: attr->schedpolicy = policy; 10e4f8: 89 4a 14 mov %ecx,0x14(%edx) return 0; 10e4fb: 31 c0 xor %eax,%eax 10e4fd: eb 05 jmp 10e504 default: return ENOTSUP; 10e4ff: b8 86 00 00 00 mov $0x86,%eax } } 10e504: 5d pop %ebp 10e505: c3 ret =============================================================================== 00109fd8 : int pthread_barrier_init( pthread_barrier_t *barrier, const pthread_barrierattr_t *attr, unsigned int count ) { 109fd8: 55 push %ebp 109fd9: 89 e5 mov %esp,%ebp 109fdb: 57 push %edi 109fdc: 56 push %esi 109fdd: 53 push %ebx 109fde: 83 ec 1c sub $0x1c,%esp 109fe1: 8b 75 08 mov 0x8(%ebp),%esi 109fe4: 8b 5d 10 mov 0x10(%ebp),%ebx const pthread_barrierattr_t *the_attr; /* * Error check parameters */ if ( !barrier ) 109fe7: 85 f6 test %esi,%esi 109fe9: 75 05 jne 109ff0 109feb: e9 9a 00 00 00 jmp 10a08a return EINVAL; if ( count == 0 ) 109ff0: 85 db test %ebx,%ebx 109ff2: 0f 84 92 00 00 00 je 10a08a <== NEVER TAKEN return EINVAL; /* * If the user passed in NULL, use the default attributes */ if ( attr ) { 109ff8: 8b 45 0c mov 0xc(%ebp),%eax 109ffb: 85 c0 test %eax,%eax 109ffd: 75 11 jne 10a010 the_attr = attr; } else { (void) pthread_barrierattr_init( &my_attr ); 109fff: 83 ec 0c sub $0xc,%esp 10a002: 8d 7d e0 lea -0x20(%ebp),%edi 10a005: 57 push %edi 10a006: e8 19 ff ff ff call 109f24 10a00b: 83 c4 10 add $0x10,%esp the_attr = &my_attr; 10a00e: 89 f8 mov %edi,%eax } /* * Now start error checking the attributes that we are going to use */ if ( !the_attr->is_initialized ) 10a010: 83 38 00 cmpl $0x0,(%eax) 10a013: 74 75 je 10a08a return EINVAL; switch ( the_attr->process_shared ) { 10a015: 83 78 04 00 cmpl $0x0,0x4(%eax) 10a019: 75 6f jne 10a08a <== NEVER TAKEN } /* * Convert from POSIX attributes to Core Barrier attributes */ the_attributes.discipline = CORE_BARRIER_AUTOMATIC_RELEASE; 10a01b: c7 45 d8 00 00 00 00 movl $0x0,-0x28(%ebp) the_attributes.maximum_count = count; 10a022: 89 5d dc mov %ebx,-0x24(%ebp) * * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { _Thread_Dispatch_disable_level++; 10a025: a1 dc f3 12 00 mov 0x12f3dc,%eax 10a02a: 40 inc %eax 10a02b: a3 dc f3 12 00 mov %eax,0x12f3dc return _Thread_Dispatch_disable_level; 10a030: a1 dc f3 12 00 mov 0x12f3dc,%eax * 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 *) 10a035: 83 ec 0c sub $0xc,%esp 10a038: 68 60 f7 12 00 push $0x12f760 10a03d: e8 ae 1c 00 00 call 10bcf0 <_Objects_Allocate> 10a042: 89 c3 mov %eax,%ebx */ _Thread_Disable_dispatch(); /* prevents deletion */ the_barrier = _POSIX_Barrier_Allocate(); if ( !the_barrier ) { 10a044: 83 c4 10 add $0x10,%esp 10a047: 85 c0 test %eax,%eax 10a049: 75 0c jne 10a057 _Thread_Enable_dispatch(); 10a04b: e8 e0 2b 00 00 call 10cc30 <_Thread_Enable_dispatch> return EAGAIN; 10a050: b8 0b 00 00 00 mov $0xb,%eax 10a055: eb 38 jmp 10a08f } _CORE_barrier_Initialize( &the_barrier->Barrier, &the_attributes ); 10a057: 50 push %eax 10a058: 50 push %eax 10a059: 8d 45 d8 lea -0x28(%ebp),%eax 10a05c: 50 push %eax 10a05d: 8d 43 10 lea 0x10(%ebx),%eax 10a060: 50 push %eax 10a061: e8 56 14 00 00 call 10b4bc <_CORE_barrier_Initialize> uint32_t name ) { _Objects_Set_local_object( information, _Objects_Get_index( the_object->id ), 10a066: 8b 43 08 mov 0x8(%ebx),%eax Objects_Information *information, Objects_Control *the_object, uint32_t name ) { _Objects_Set_local_object( 10a069: 0f b7 c8 movzwl %ax,%ecx #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 10a06c: 8b 15 7c f7 12 00 mov 0x12f77c,%edx 10a072: 89 1c 8a mov %ebx,(%edx,%ecx,4) _Objects_Get_index( the_object->id ), the_object ); /* ASSERT: information->is_string == false */ the_object->name.name_u32 = name; 10a075: c7 43 0c 00 00 00 00 movl $0x0,0xc(%ebx) ); /* * Exit the critical section and return the user an operational barrier */ *barrier = the_barrier->Object.id; 10a07c: 89 06 mov %eax,(%esi) _Thread_Enable_dispatch(); 10a07e: e8 ad 2b 00 00 call 10cc30 <_Thread_Enable_dispatch> 10a083: 83 c4 10 add $0x10,%esp return 0; 10a086: 31 c0 xor %eax,%eax 10a088: eb 05 jmp 10a08f switch ( the_attr->process_shared ) { case PTHREAD_PROCESS_PRIVATE: /* only supported values */ break; case PTHREAD_PROCESS_SHARED: default: return EINVAL; 10a08a: b8 16 00 00 00 mov $0x16,%eax * Exit the critical section and return the user an operational barrier */ *barrier = the_barrier->Object.id; _Thread_Enable_dispatch(); return 0; } 10a08f: 8d 65 f4 lea -0xc(%ebp),%esp 10a092: 5b pop %ebx 10a093: 5e pop %esi 10a094: 5f pop %edi 10a095: 5d pop %ebp 10a096: c3 ret =============================================================================== 001099a4 : void pthread_cleanup_push( void (*routine)( void * ), void *arg ) { 1099a4: 55 push %ebp 1099a5: 89 e5 mov %esp,%ebp 1099a7: 56 push %esi 1099a8: 53 push %ebx 1099a9: 8b 5d 08 mov 0x8(%ebp),%ebx 1099ac: 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 ) 1099af: 85 db test %ebx,%ebx 1099b1: 74 50 je 109a03 * * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { _Thread_Dispatch_disable_level++; 1099b3: a1 d4 f3 12 00 mov 0x12f3d4,%eax 1099b8: 40 inc %eax 1099b9: a3 d4 f3 12 00 mov %eax,0x12f3d4 return _Thread_Dispatch_disable_level; 1099be: a1 d4 f3 12 00 mov 0x12f3d4,%eax return; _Thread_Disable_dispatch(); handler = _Workspace_Allocate( sizeof( POSIX_Cancel_Handler_control ) ); 1099c3: 83 ec 0c sub $0xc,%esp 1099c6: 6a 10 push $0x10 1099c8: e8 6b 3a 00 00 call 10d438 <_Workspace_Allocate> if ( handler ) { 1099cd: 83 c4 10 add $0x10,%esp 1099d0: 85 c0 test %eax,%eax 1099d2: 74 24 je 1099f8 <== NEVER TAKEN thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; 1099d4: 8b 15 dc f8 12 00 mov 0x12f8dc,%edx handler_stack = &thread_support->Cancellation_Handlers; 1099da: 8b 92 e8 00 00 00 mov 0xe8(%edx),%edx 1099e0: 81 c2 e4 00 00 00 add $0xe4,%edx handler->routine = routine; 1099e6: 89 58 08 mov %ebx,0x8(%eax) handler->arg = arg; 1099e9: 89 70 0c mov %esi,0xc(%eax) _Chain_Append( handler_stack, &handler->Node ); 1099ec: 51 push %ecx 1099ed: 51 push %ecx 1099ee: 50 push %eax 1099ef: 52 push %edx 1099f0: e8 57 15 00 00 call 10af4c <_Chain_Append> 1099f5: 83 c4 10 add $0x10,%esp } _Thread_Enable_dispatch(); } 1099f8: 8d 65 f8 lea -0x8(%ebp),%esp 1099fb: 5b pop %ebx 1099fc: 5e pop %esi 1099fd: 5d pop %ebp handler->routine = routine; handler->arg = arg; _Chain_Append( handler_stack, &handler->Node ); } _Thread_Enable_dispatch(); 1099fe: e9 89 2c 00 00 jmp 10c68c <_Thread_Enable_dispatch> } 109a03: 8d 65 f8 lea -0x8(%ebp),%esp 109a06: 5b pop %ebx 109a07: 5e pop %esi 109a08: 5d pop %ebp 109a09: c3 ret =============================================================================== 0010a7c4 : int pthread_cond_init( pthread_cond_t *cond, const pthread_condattr_t *attr ) { 10a7c4: 55 push %ebp 10a7c5: 89 e5 mov %esp,%ebp 10a7c7: 56 push %esi 10a7c8: 53 push %ebx POSIX_Condition_variables_Control *the_cond; const pthread_condattr_t *the_attr; if ( attr ) the_attr = attr; 10a7c9: 8b 75 0c mov 0xc(%ebp),%esi 10a7cc: 85 f6 test %esi,%esi 10a7ce: 75 05 jne 10a7d5 else the_attr = &_POSIX_Condition_variables_Default_attributes; 10a7d0: be f0 1d 12 00 mov $0x121df0,%esi /* * Be careful about attributes when global!!! */ if ( the_attr->process_shared == PTHREAD_PROCESS_SHARED ) return EINVAL; 10a7d5: b8 16 00 00 00 mov $0x16,%eax else the_attr = &_POSIX_Condition_variables_Default_attributes; /* * Be careful about attributes when global!!! */ if ( the_attr->process_shared == PTHREAD_PROCESS_SHARED ) 10a7da: 83 7e 04 01 cmpl $0x1,0x4(%esi) 10a7de: 74 7b je 10a85b <== NEVER TAKEN return EINVAL; if ( !the_attr->is_initialized ) 10a7e0: 83 3e 00 cmpl $0x0,(%esi) 10a7e3: 74 76 je 10a85b * * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { _Thread_Dispatch_disable_level++; 10a7e5: a1 e4 03 13 00 mov 0x1303e4,%eax 10a7ea: 40 inc %eax 10a7eb: a3 e4 03 13 00 mov %eax,0x1303e4 return _Thread_Dispatch_disable_level; 10a7f0: a1 e4 03 13 00 mov 0x1303e4,%eax */ RTEMS_INLINE_ROUTINE POSIX_Condition_variables_Control *_POSIX_Condition_variables_Allocate( void ) { return (POSIX_Condition_variables_Control *) 10a7f5: 83 ec 0c sub $0xc,%esp 10a7f8: 68 00 08 13 00 push $0x130800 10a7fd: e8 6e 22 00 00 call 10ca70 <_Objects_Allocate> 10a802: 89 c3 mov %eax,%ebx _Thread_Disable_dispatch(); the_cond = _POSIX_Condition_variables_Allocate(); if ( !the_cond ) { 10a804: 83 c4 10 add $0x10,%esp 10a807: 85 c0 test %eax,%eax 10a809: 75 0c jne 10a817 _Thread_Enable_dispatch(); 10a80b: e8 a0 31 00 00 call 10d9b0 <_Thread_Enable_dispatch> return ENOMEM; 10a810: b8 0c 00 00 00 mov $0xc,%eax 10a815: eb 44 jmp 10a85b } the_cond->process_shared = the_attr->process_shared; 10a817: 8b 46 04 mov 0x4(%esi),%eax 10a81a: 89 43 10 mov %eax,0x10(%ebx) the_cond->Mutex = POSIX_CONDITION_VARIABLES_NO_MUTEX; 10a81d: c7 43 14 00 00 00 00 movl $0x0,0x14(%ebx) _Thread_queue_Initialize( 10a824: 6a 74 push $0x74 10a826: 68 00 08 00 10 push $0x10000800 10a82b: 6a 00 push $0x0 10a82d: 8d 43 18 lea 0x18(%ebx),%eax 10a830: 50 push %eax 10a831: e8 26 38 00 00 call 10e05c <_Thread_queue_Initialize> uint32_t name ) { _Objects_Set_local_object( information, _Objects_Get_index( the_object->id ), 10a836: 8b 43 08 mov 0x8(%ebx),%eax Objects_Information *information, Objects_Control *the_object, uint32_t name ) { _Objects_Set_local_object( 10a839: 0f b7 c8 movzwl %ax,%ecx #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 10a83c: 8b 15 1c 08 13 00 mov 0x13081c,%edx 10a842: 89 1c 8a mov %ebx,(%edx,%ecx,4) _Objects_Get_index( the_object->id ), the_object ); /* ASSERT: information->is_string == false */ the_object->name.name_u32 = name; 10a845: c7 43 0c 00 00 00 00 movl $0x0,0xc(%ebx) &_POSIX_Condition_variables_Information, &the_cond->Object, 0 ); *cond = the_cond->Object.id; 10a84c: 8b 55 08 mov 0x8(%ebp),%edx 10a84f: 89 02 mov %eax,(%edx) _Thread_Enable_dispatch(); 10a851: e8 5a 31 00 00 call 10d9b0 <_Thread_Enable_dispatch> return 0; 10a856: 83 c4 10 add $0x10,%esp 10a859: 31 c0 xor %eax,%eax } 10a85b: 8d 65 f8 lea -0x8(%ebp),%esp 10a85e: 5b pop %ebx 10a85f: 5e pop %esi 10a860: 5d pop %ebp 10a861: c3 ret =============================================================================== 0010a66c : */ int pthread_condattr_destroy( pthread_condattr_t *attr ) { 10a66c: 55 push %ebp 10a66d: 89 e5 mov %esp,%ebp 10a66f: 8b 55 08 mov 0x8(%ebp),%edx if ( !attr || attr->is_initialized == false ) return EINVAL; 10a672: b8 16 00 00 00 mov $0x16,%eax int pthread_condattr_destroy( pthread_condattr_t *attr ) { if ( !attr || attr->is_initialized == false ) 10a677: 85 d2 test %edx,%edx 10a679: 74 0d je 10a688 10a67b: 83 3a 00 cmpl $0x0,(%edx) 10a67e: 74 08 je 10a688 <== NEVER TAKEN return EINVAL; attr->is_initialized = false; 10a680: c7 02 00 00 00 00 movl $0x0,(%edx) return 0; 10a686: 30 c0 xor %al,%al } 10a688: 5d pop %ebp 10a689: c3 ret =============================================================================== 00109cf0 : pthread_t *thread, const pthread_attr_t *attr, void *(*start_routine)( void * ), void *arg ) { 109cf0: 55 push %ebp 109cf1: 89 e5 mov %esp,%ebp 109cf3: 57 push %edi 109cf4: 56 push %esi 109cf5: 53 push %ebx 109cf6: 83 ec 4c sub $0x4c,%esp int schedpolicy = SCHED_RR; struct sched_param schedparam; Objects_Name name; int rc; if ( !start_routine ) 109cf9: 83 7d 10 00 cmpl $0x0,0x10(%ebp) 109cfd: 0f 84 f8 01 00 00 je 109efb return EFAULT; the_attr = (attr) ? attr : &_POSIX_Threads_Default_attributes; 109d03: 8b 55 0c mov 0xc(%ebp),%edx 109d06: 85 d2 test %edx,%edx 109d08: 75 05 jne 109d0f 109d0a: ba 60 09 12 00 mov $0x120960,%edx if ( !the_attr->is_initialized ) 109d0f: 83 3a 00 cmpl $0x0,(%edx) 109d12: 75 05 jne 109d19 109d14: e9 eb 01 00 00 jmp 109f04 * 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) ) 109d19: 83 7a 04 00 cmpl $0x0,0x4(%edx) 109d1d: 74 0e je 109d2d 109d1f: a1 8c b1 12 00 mov 0x12b18c,%eax 109d24: 39 42 08 cmp %eax,0x8(%edx) 109d27: 0f 82 d7 01 00 00 jb 109f04 * 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 ) { 109d2d: 8b 42 10 mov 0x10(%edx),%eax 109d30: 83 f8 01 cmp $0x1,%eax 109d33: 74 0b je 109d40 109d35: 83 f8 02 cmp $0x2,%eax 109d38: 0f 85 c6 01 00 00 jne 109f04 109d3e: eb 1f jmp 109d5f case PTHREAD_INHERIT_SCHED: api = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; 109d40: a1 dc f8 12 00 mov 0x12f8dc,%eax 109d45: 8b b0 e8 00 00 00 mov 0xe8(%eax),%esi schedpolicy = api->schedpolicy; 109d4b: 8b 86 84 00 00 00 mov 0x84(%esi),%eax 109d51: 89 45 ac mov %eax,-0x54(%ebp) schedparam = api->schedparam; 109d54: 8d 7d cc lea -0x34(%ebp),%edi 109d57: 81 c6 88 00 00 00 add $0x88,%esi 109d5d: eb 0c jmp 109d6b break; case PTHREAD_EXPLICIT_SCHED: schedpolicy = the_attr->schedpolicy; 109d5f: 8b 42 14 mov 0x14(%edx),%eax 109d62: 89 45 ac mov %eax,-0x54(%ebp) schedparam = the_attr->schedparam; 109d65: 8d 7d cc lea -0x34(%ebp),%edi 109d68: 8d 72 18 lea 0x18(%edx),%esi 109d6b: b9 07 00 00 00 mov $0x7,%ecx 109d70: 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 ) return ENOTSUP; 109d72: c7 45 b4 86 00 00 00 movl $0x86,-0x4c(%ebp) /* * Check the contentionscope since rtems only supports PROCESS wide * contention (i.e. no system wide contention). */ if ( the_attr->contentionscope != PTHREAD_SCOPE_PROCESS ) 109d79: 83 7a 0c 00 cmpl $0x0,0xc(%edx) 109d7d: 0f 85 88 01 00 00 jne 109f0b return ENOTSUP; /* * Interpret the scheduling parameters. */ if ( !_POSIX_Priority_Is_valid( schedparam.sched_priority ) ) 109d83: 83 ec 0c sub $0xc,%esp 109d86: ff 75 cc pushl -0x34(%ebp) 109d89: 89 55 a8 mov %edx,-0x58(%ebp) 109d8c: e8 5b 54 00 00 call 10f1ec <_POSIX_Priority_Is_valid> 109d91: 83 c4 10 add $0x10,%esp 109d94: 84 c0 test %al,%al 109d96: 0f 84 68 01 00 00 je 109f04 <== NEVER TAKEN return EINVAL; core_priority = _POSIX_Priority_To_core( schedparam.sched_priority ); 109d9c: 8b 5d cc mov -0x34(%ebp),%ebx RTEMS_INLINE_ROUTINE Priority_Control _POSIX_Priority_To_core( int priority ) { return (Priority_Control) (POSIX_SCHEDULER_MAXIMUM_PRIORITY - priority + 1); 109d9f: 0f b6 35 88 b1 12 00 movzbl 0x12b188,%esi /* * Set the core scheduling policy information. */ rc = _POSIX_Thread_Translate_sched_param( 109da6: 8d 45 c8 lea -0x38(%ebp),%eax 109da9: 50 push %eax 109daa: 8d 45 c4 lea -0x3c(%ebp),%eax 109dad: 50 push %eax 109dae: 8d 45 cc lea -0x34(%ebp),%eax 109db1: 50 push %eax 109db2: ff 75 ac pushl -0x54(%ebp) 109db5: e8 52 54 00 00 call 10f20c <_POSIX_Thread_Translate_sched_param> 109dba: 89 45 b4 mov %eax,-0x4c(%ebp) schedpolicy, &schedparam, &budget_algorithm, &budget_callout ); if ( rc ) 109dbd: 83 c4 10 add $0x10,%esp 109dc0: 85 c0 test %eax,%eax 109dc2: 0f 85 43 01 00 00 jne 109f0b #endif /* * Lock the allocator mutex for protection */ _RTEMS_Lock_allocator(); 109dc8: 83 ec 0c sub $0xc,%esp 109dcb: ff 35 60 f4 12 00 pushl 0x12f460 109dd1: e8 66 15 00 00 call 10b33c <_API_Mutex_Lock> * _POSIX_Threads_Allocate */ RTEMS_INLINE_ROUTINE Thread_Control *_POSIX_Threads_Allocate( void ) { return (Thread_Control *) _Objects_Allocate( &_POSIX_Threads_Information ); 109dd6: c7 04 24 d8 f5 12 00 movl $0x12f5d8,(%esp) 109ddd: e8 d6 1d 00 00 call 10bbb8 <_Objects_Allocate> 109de2: 89 45 b0 mov %eax,-0x50(%ebp) * Allocate the thread control block. * * NOTE: Global threads are not currently supported. */ the_thread = _POSIX_Threads_Allocate(); if ( !the_thread ) { 109de5: 83 c4 10 add $0x10,%esp 109de8: 85 c0 test %eax,%eax 109dea: 8b 55 a8 mov -0x58(%ebp),%edx 109ded: 75 05 jne 109df4 _RTEMS_Unlock_allocator(); 109def: 83 ec 0c sub $0xc,%esp 109df2: eb 56 jmp 109e4a /* * Initialize the core thread for this task. */ name.name_p = NULL; /* posix threads don't have a name by default */ status = _Thread_Initialize( 109df4: 8b 4a 08 mov 0x8(%edx),%ecx 109df7: 57 push %edi 109df8: 6a 00 push $0x0 109dfa: 6a 00 push $0x0 109dfc: ff 75 c8 pushl -0x38(%ebp) 109dff: ff 75 c4 pushl -0x3c(%ebp) 109e02: 6a 01 push $0x1 109e04: 81 e6 ff 00 00 00 and $0xff,%esi 109e0a: 29 de sub %ebx,%esi 109e0c: 56 push %esi 109e0d: 6a 01 push $0x1 109e0f: a1 8c b1 12 00 mov 0x12b18c,%eax 109e14: d1 e0 shl %eax 109e16: 39 c8 cmp %ecx,%eax 109e18: 73 02 jae 109e1c 109e1a: 89 c8 mov %ecx,%eax 109e1c: 50 push %eax 109e1d: ff 72 04 pushl 0x4(%edx) 109e20: ff 75 b0 pushl -0x50(%ebp) 109e23: 68 d8 f5 12 00 push $0x12f5d8 109e28: 89 55 a8 mov %edx,-0x58(%ebp) 109e2b: e8 68 2d 00 00 call 10cb98 <_Thread_Initialize> budget_callout, 0, /* isr level */ name /* posix threads don't have a name */ ); if ( !status ) { 109e30: 83 c4 30 add $0x30,%esp 109e33: 84 c0 test %al,%al 109e35: 8b 55 a8 mov -0x58(%ebp),%edx 109e38: 75 2a jne 109e64 RTEMS_INLINE_ROUTINE void _POSIX_Threads_Free ( Thread_Control *the_pthread ) { _Objects_Free( &_POSIX_Threads_Information, &the_pthread->Object ); 109e3a: 51 push %ecx 109e3b: 51 push %ecx 109e3c: ff 75 b0 pushl -0x50(%ebp) 109e3f: 68 d8 f5 12 00 push $0x12f5d8 109e44: e8 4f 20 00 00 call 10be98 <_Objects_Free> _POSIX_Threads_Free( the_thread ); _RTEMS_Unlock_allocator(); 109e49: 5b pop %ebx 109e4a: ff 35 60 f4 12 00 pushl 0x12f460 109e50: e8 2f 15 00 00 call 10b384 <_API_Mutex_Unlock> 109e55: 83 c4 10 add $0x10,%esp return EAGAIN; 109e58: c7 45 b4 0b 00 00 00 movl $0xb,-0x4c(%ebp) 109e5f: e9 a7 00 00 00 jmp 109f0b } /* * finish initializing the per API structure */ api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 109e64: 8b 45 b0 mov -0x50(%ebp),%eax 109e67: 8b 98 e8 00 00 00 mov 0xe8(%eax),%ebx api->Attributes = *the_attr; 109e6d: b9 10 00 00 00 mov $0x10,%ecx 109e72: 89 df mov %ebx,%edi 109e74: 89 d6 mov %edx,%esi 109e76: f3 a5 rep movsl %ds:(%esi),%es:(%edi) api->detachstate = the_attr->detachstate; 109e78: 8b 42 3c mov 0x3c(%edx),%eax 109e7b: 89 43 40 mov %eax,0x40(%ebx) api->schedpolicy = schedpolicy; 109e7e: 8b 45 ac mov -0x54(%ebp),%eax 109e81: 89 83 84 00 00 00 mov %eax,0x84(%ebx) api->schedparam = schedparam; 109e87: 8d bb 88 00 00 00 lea 0x88(%ebx),%edi 109e8d: 8d 75 cc lea -0x34(%ebp),%esi 109e90: b1 07 mov $0x7,%cl 109e92: f3 a5 rep movsl %ds:(%esi),%es:(%edi) /* * POSIX threads are allocated and started in one operation. */ status = _Thread_Start( 109e94: 83 ec 0c sub $0xc,%esp 109e97: 6a 00 push $0x0 109e99: ff 75 14 pushl 0x14(%ebp) 109e9c: ff 75 10 pushl 0x10(%ebp) 109e9f: 6a 01 push $0x1 109ea1: ff 75 b0 pushl -0x50(%ebp) 109ea4: e8 d7 34 00 00 call 10d380 <_Thread_Start> _RTEMS_Unlock_allocator(); return EINVAL; } #endif if ( schedpolicy == SCHED_SPORADIC ) { 109ea9: 83 c4 20 add $0x20,%esp 109eac: 83 7d ac 04 cmpl $0x4,-0x54(%ebp) 109eb0: 75 2b jne 109edd _Watchdog_Insert_ticks( 109eb2: 83 ec 0c sub $0xc,%esp &api->Sporadic_timer, _Timespec_To_ticks( &api->schedparam.sched_ss_repl_period ) 109eb5: 8d 83 90 00 00 00 lea 0x90(%ebx),%eax return EINVAL; } #endif if ( schedpolicy == SCHED_SPORADIC ) { _Watchdog_Insert_ticks( 109ebb: 50 push %eax 109ebc: e8 3f 35 00 00 call 10d400 <_Timespec_To_ticks> Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 109ec1: 89 83 b4 00 00 00 mov %eax,0xb4(%ebx) _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 109ec7: 58 pop %eax 109ec8: 5a pop %edx 109ec9: 81 c3 a8 00 00 00 add $0xa8,%ebx 109ecf: 53 push %ebx 109ed0: 68 78 f4 12 00 push $0x12f478 109ed5: e8 b2 37 00 00 call 10d68c <_Watchdog_Insert> 109eda: 83 c4 10 add $0x10,%esp } /* * Return the id and indicate we successfully created the thread */ *thread = the_thread->Object.id; 109edd: 8b 45 b0 mov -0x50(%ebp),%eax 109ee0: 8b 50 08 mov 0x8(%eax),%edx 109ee3: 8b 45 08 mov 0x8(%ebp),%eax 109ee6: 89 10 mov %edx,(%eax) _RTEMS_Unlock_allocator(); 109ee8: 83 ec 0c sub $0xc,%esp 109eeb: ff 35 60 f4 12 00 pushl 0x12f460 109ef1: e8 8e 14 00 00 call 10b384 <_API_Mutex_Unlock> 109ef6: 83 c4 10 add $0x10,%esp 109ef9: eb 10 jmp 109f0b struct sched_param schedparam; Objects_Name name; int rc; if ( !start_routine ) return EFAULT; 109efb: c7 45 b4 0e 00 00 00 movl $0xe,-0x4c(%ebp) 109f02: eb 07 jmp 109f0b schedpolicy = the_attr->schedpolicy; schedparam = the_attr->schedparam; break; default: return EINVAL; 109f04: c7 45 b4 16 00 00 00 movl $0x16,-0x4c(%ebp) */ *thread = the_thread->Object.id; _RTEMS_Unlock_allocator(); return 0; } 109f0b: 8b 45 b4 mov -0x4c(%ebp),%eax 109f0e: 8d 65 f4 lea -0xc(%ebp),%esp 109f11: 5b pop %ebx 109f12: 5e pop %esi 109f13: 5f pop %edi 109f14: 5d pop %ebp 109f15: c3 ret =============================================================================== 001109fe : } void pthread_exit( void *value_ptr ) { 1109fe: 55 push %ebp 1109ff: 89 e5 mov %esp,%ebp 110a01: 83 ec 10 sub $0x10,%esp _POSIX_Thread_Exit( _Thread_Executing, value_ptr ); 110a04: ff 75 08 pushl 0x8(%ebp) 110a07: ff 35 ec e8 12 00 pushl 0x12e8ec 110a0d: e8 0a ff ff ff call 11091c <_POSIX_Thread_Exit> 110a12: 83 c4 10 add $0x10,%esp <== NOT EXECUTED } 110a15: c9 leave <== NOT EXECUTED 110a16: c3 ret <== NOT EXECUTED =============================================================================== 0011dcf0 : int pthread_kill( pthread_t thread, int sig ) { 11dcf0: 55 push %ebp 11dcf1: 89 e5 mov %esp,%ebp 11dcf3: 57 push %edi 11dcf4: 56 push %esi 11dcf5: 53 push %ebx 11dcf6: 83 ec 1c sub $0x1c,%esp 11dcf9: 8b 5d 0c mov 0xc(%ebp),%ebx POSIX_API_Control *api; Thread_Control *the_thread; Objects_Locations location; if ( !sig ) 11dcfc: 85 db test %ebx,%ebx 11dcfe: 75 02 jne 11dd02 11dd00: eb 08 jmp 11dd0a static inline bool is_valid_signo( int signo ) { return ((signo) >= 1 && (signo) <= 32 ); 11dd02: 8d 7b ff lea -0x1(%ebx),%edi rtems_set_errno_and_return_minus_one( EINVAL ); if ( !is_valid_signo(sig) ) 11dd05: 83 ff 1f cmp $0x1f,%edi 11dd08: 76 0d jbe 11dd17 rtems_set_errno_and_return_minus_one( EINVAL ); 11dd0a: e8 cd 31 ff ff call 110edc <__errno> 11dd0f: c7 00 16 00 00 00 movl $0x16,(%eax) 11dd15: eb 75 jmp 11dd8c the_thread = _Thread_Get( thread, &location ); 11dd17: 52 push %edx 11dd18: 52 push %edx 11dd19: 8d 45 e4 lea -0x1c(%ebp),%eax 11dd1c: 50 push %eax 11dd1d: ff 75 08 pushl 0x8(%ebp) 11dd20: e8 07 e1 fe ff call 10be2c <_Thread_Get> 11dd25: 89 c6 mov %eax,%esi switch ( location ) { 11dd27: 83 c4 10 add $0x10,%esp 11dd2a: 83 7d e4 00 cmpl $0x0,-0x1c(%ebp) 11dd2e: 75 51 jne 11dd81 <== NEVER TAKEN case OBJECTS_LOCAL: /* * If sig == 0 then just validate arguments */ api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 11dd30: 8b 90 e8 00 00 00 mov 0xe8(%eax),%edx if ( sig ) { if ( _POSIX_signals_Vectors[ sig ].sa_handler == SIG_IGN ) { 11dd36: 6b c3 0c imul $0xc,%ebx,%eax 11dd39: 83 b8 30 e9 12 00 01 cmpl $0x1,0x12e930(%eax) 11dd40: 75 09 jne 11dd4b _Thread_Enable_dispatch(); 11dd42: e8 c5 e0 fe ff call 10be0c <_Thread_Enable_dispatch> return 0; 11dd47: 31 c0 xor %eax,%eax 11dd49: eb 44 jmp 11dd8f static inline sigset_t signo_to_mask( uint32_t sig ) { return 1u << (sig - 1); 11dd4b: b8 01 00 00 00 mov $0x1,%eax 11dd50: 89 f9 mov %edi,%ecx 11dd52: d3 e0 shl %cl,%eax } /* XXX critical section */ api->signals_pending |= signo_to_mask( sig ); 11dd54: 09 82 d4 00 00 00 or %eax,0xd4(%edx) (void) _POSIX_signals_Unblock_thread( the_thread, sig, NULL ); 11dd5a: 50 push %eax 11dd5b: 6a 00 push $0x0 11dd5d: 53 push %ebx 11dd5e: 56 push %esi 11dd5f: e8 8c fe ff ff call 11dbf0 <_POSIX_signals_Unblock_thread> if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) 11dd64: 83 c4 10 add $0x10,%esp 11dd67: 83 3d e8 e8 12 00 00 cmpl $0x0,0x12e8e8 11dd6e: 74 d2 je 11dd42 11dd70: 3b 35 ec e8 12 00 cmp 0x12e8ec,%esi 11dd76: 75 ca jne 11dd42 _Thread_Dispatch_necessary = true; 11dd78: c6 05 f8 e8 12 00 01 movb $0x1,0x12e8f8 11dd7f: eb c1 jmp 11dd42 #endif case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( ESRCH ); 11dd81: e8 56 31 ff ff call 110edc <__errno> <== NOT EXECUTED 11dd86: c7 00 03 00 00 00 movl $0x3,(%eax) <== NOT EXECUTED 11dd8c: 83 c8 ff or $0xffffffff,%eax } 11dd8f: 8d 65 f4 lea -0xc(%ebp),%esp 11dd92: 5b pop %ebx 11dd93: 5e pop %esi 11dd94: 5f pop %edi 11dd95: 5d pop %ebp 11dd96: c3 ret =============================================================================== 0010ba38 : int pthread_mutex_timedlock( pthread_mutex_t *mutex, const struct timespec *abstime ) { 10ba38: 55 push %ebp 10ba39: 89 e5 mov %esp,%ebp 10ba3b: 53 push %ebx 10ba3c: 83 ec 2c sub $0x2c,%esp * * 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 ); 10ba3f: 8d 45 f4 lea -0xc(%ebp),%eax 10ba42: 50 push %eax 10ba43: ff 75 0c pushl 0xc(%ebp) 10ba46: e8 b5 00 00 00 call 10bb00 <_POSIX_Absolute_timeout_to_ticks> 10ba4b: 89 c3 mov %eax,%ebx if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE ) 10ba4d: 83 c4 0c add $0xc,%esp 10ba50: 83 f8 03 cmp $0x3,%eax 10ba53: 0f 94 c1 sete %cl do_wait = false; lock_status = _POSIX_Mutex_Lock_support( mutex, do_wait, ticks ); 10ba56: ff 75 f4 pushl -0xc(%ebp) 10ba59: 0f b6 c1 movzbl %cl,%eax 10ba5c: 50 push %eax 10ba5d: ff 75 08 pushl 0x8(%ebp) 10ba60: 88 4d e4 mov %cl,-0x1c(%ebp) 10ba63: e8 e8 fe ff ff call 10b950 <_POSIX_Mutex_Lock_support> * This service only gives us the option to block. We used a polling * attempt to lock if the abstime was not in the future. If we did * not obtain the mutex, then not look at the status immediately, * make sure the right reason is returned. */ if ( !do_wait && (lock_status == EBUSY) ) { 10ba68: 83 c4 10 add $0x10,%esp 10ba6b: 8a 4d e4 mov -0x1c(%ebp),%cl 10ba6e: 84 c9 test %cl,%cl 10ba70: 75 17 jne 10ba89 10ba72: 83 f8 10 cmp $0x10,%eax 10ba75: 75 12 jne 10ba89 if ( status == POSIX_ABSOLUTE_TIMEOUT_INVALID ) return EINVAL; 10ba77: b0 16 mov $0x16,%al * attempt to lock if the abstime was not in the future. If we did * not obtain the mutex, then not look at the status immediately, * make sure the right reason is returned. */ if ( !do_wait && (lock_status == EBUSY) ) { if ( status == POSIX_ABSOLUTE_TIMEOUT_INVALID ) 10ba79: 85 db test %ebx,%ebx 10ba7b: 74 0c je 10ba89 <== NEVER TAKEN return EINVAL; if ( status == POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST || 10ba7d: 4b dec %ebx status == POSIX_ABSOLUTE_TIMEOUT_IS_NOW ) return ETIMEDOUT; 10ba7e: 83 fb 02 cmp $0x2,%ebx 10ba81: 19 c0 sbb %eax,%eax 10ba83: 83 e0 64 and $0x64,%eax 10ba86: 83 c0 10 add $0x10,%eax } return lock_status; } 10ba89: 8b 5d fc mov -0x4(%ebp),%ebx 10ba8c: c9 leave 10ba8d: c3 ret =============================================================================== 0010b6a4 : int pthread_mutexattr_setpshared( pthread_mutexattr_t *attr, int pshared ) { 10b6a4: 55 push %ebp 10b6a5: 89 e5 mov %esp,%ebp 10b6a7: 8b 55 08 mov 0x8(%ebp),%edx 10b6aa: 8b 4d 0c mov 0xc(%ebp),%ecx if ( !attr || !attr->is_initialized ) return EINVAL; 10b6ad: b8 16 00 00 00 mov $0x16,%eax int pthread_mutexattr_setpshared( pthread_mutexattr_t *attr, int pshared ) { if ( !attr || !attr->is_initialized ) 10b6b2: 85 d2 test %edx,%edx 10b6b4: 74 0f je 10b6c5 10b6b6: 83 3a 00 cmpl $0x0,(%edx) 10b6b9: 74 0a je 10b6c5 return EINVAL; switch ( pshared ) { 10b6bb: 83 f9 01 cmp $0x1,%ecx 10b6be: 77 05 ja 10b6c5 <== NEVER TAKEN case PTHREAD_PROCESS_SHARED: case PTHREAD_PROCESS_PRIVATE: attr->process_shared = pshared; 10b6c0: 89 4a 04 mov %ecx,0x4(%edx) return 0; 10b6c3: 30 c0 xor %al,%al default: return EINVAL; } } 10b6c5: 5d pop %ebp 10b6c6: c3 ret =============================================================================== 00109870 : #if defined(_UNIX98_THREAD_MUTEX_ATTRIBUTES) int pthread_mutexattr_settype( pthread_mutexattr_t *attr, int type ) { 109870: 55 push %ebp 109871: 89 e5 mov %esp,%ebp 109873: 8b 55 08 mov 0x8(%ebp),%edx 109876: 8b 4d 0c mov 0xc(%ebp),%ecx if ( !attr || !attr->is_initialized ) return EINVAL; 109879: b8 16 00 00 00 mov $0x16,%eax int pthread_mutexattr_settype( pthread_mutexattr_t *attr, int type ) { if ( !attr || !attr->is_initialized ) 10987e: 85 d2 test %edx,%edx 109880: 74 0f je 109891 109882: 83 3a 00 cmpl $0x0,(%edx) 109885: 74 0a je 109891 <== NEVER TAKEN return EINVAL; switch ( type ) { 109887: 83 f9 03 cmp $0x3,%ecx 10988a: 77 05 ja 109891 case PTHREAD_MUTEX_NORMAL: case PTHREAD_MUTEX_RECURSIVE: case PTHREAD_MUTEX_ERRORCHECK: case PTHREAD_MUTEX_DEFAULT: attr->type = type; 10988c: 89 4a 10 mov %ecx,0x10(%edx) return 0; 10988f: 30 c0 xor %al,%al default: return EINVAL; } } 109891: 5d pop %ebp 109892: c3 ret =============================================================================== 0010a380 : int pthread_once( pthread_once_t *once_control, void (*init_routine)(void) ) { 10a380: 55 push %ebp 10a381: 89 e5 mov %esp,%ebp 10a383: 56 push %esi 10a384: 53 push %ebx 10a385: 83 ec 10 sub $0x10,%esp 10a388: 8b 5d 08 mov 0x8(%ebp),%ebx 10a38b: 8b 75 0c mov 0xc(%ebp),%esi if ( !once_control || !init_routine ) 10a38e: 85 f6 test %esi,%esi 10a390: 74 51 je 10a3e3 10a392: 85 db test %ebx,%ebx 10a394: 74 4d je 10a3e3 once_control->init_executed = true; (*init_routine)(); } rtems_task_mode(saveMode, RTEMS_PREEMPT_MASK, &saveMode); } return 0; 10a396: 31 c0 xor %eax,%eax ) { if ( !once_control || !init_routine ) return EINVAL; if ( !once_control->init_executed ) { 10a398: 83 7b 04 00 cmpl $0x0,0x4(%ebx) 10a39c: 75 4a jne 10a3e8 rtems_mode saveMode; rtems_task_mode(RTEMS_NO_PREEMPT, RTEMS_PREEMPT_MASK, &saveMode); 10a39e: 52 push %edx 10a39f: 8d 45 f4 lea -0xc(%ebp),%eax 10a3a2: 50 push %eax 10a3a3: 68 00 01 00 00 push $0x100 10a3a8: 68 00 01 00 00 push $0x100 10a3ad: e8 16 0a 00 00 call 10adc8 if ( !once_control->init_executed ) { 10a3b2: 83 c4 10 add $0x10,%esp 10a3b5: 83 7b 04 00 cmpl $0x0,0x4(%ebx) 10a3b9: 75 0f jne 10a3ca <== NEVER TAKEN once_control->is_initialized = true; 10a3bb: c7 03 01 00 00 00 movl $0x1,(%ebx) once_control->init_executed = true; 10a3c1: c7 43 04 01 00 00 00 movl $0x1,0x4(%ebx) (*init_routine)(); 10a3c8: ff d6 call *%esi } rtems_task_mode(saveMode, RTEMS_PREEMPT_MASK, &saveMode); 10a3ca: 50 push %eax 10a3cb: 8d 45 f4 lea -0xc(%ebp),%eax 10a3ce: 50 push %eax 10a3cf: 68 00 01 00 00 push $0x100 10a3d4: ff 75 f4 pushl -0xc(%ebp) 10a3d7: e8 ec 09 00 00 call 10adc8 10a3dc: 83 c4 10 add $0x10,%esp } return 0; 10a3df: 31 c0 xor %eax,%eax 10a3e1: eb 05 jmp 10a3e8 pthread_once_t *once_control, void (*init_routine)(void) ) { if ( !once_control || !init_routine ) return EINVAL; 10a3e3: b8 16 00 00 00 mov $0x16,%eax (*init_routine)(); } rtems_task_mode(saveMode, RTEMS_PREEMPT_MASK, &saveMode); } return 0; } 10a3e8: 8d 65 f8 lea -0x8(%ebp),%esp 10a3eb: 5b pop %ebx 10a3ec: 5e pop %esi 10a3ed: 5d pop %ebp 10a3ee: c3 ret =============================================================================== 0010a220 : int pthread_rwlock_init( pthread_rwlock_t *rwlock, const pthread_rwlockattr_t *attr ) { 10a220: 55 push %ebp 10a221: 89 e5 mov %esp,%ebp 10a223: 56 push %esi 10a224: 53 push %ebx 10a225: 83 ec 10 sub $0x10,%esp 10a228: 8b 75 08 mov 0x8(%ebp),%esi const pthread_rwlockattr_t *the_attr; /* * Error check parameters */ if ( !rwlock ) 10a22b: 85 f6 test %esi,%esi 10a22d: 75 05 jne 10a234 10a22f: e9 8f 00 00 00 jmp 10a2c3 return EINVAL; /* * If the user passed in NULL, use the default attributes */ if ( attr ) { 10a234: 8b 45 0c mov 0xc(%ebp),%eax 10a237: 85 c0 test %eax,%eax 10a239: 75 11 jne 10a24c the_attr = attr; } else { (void) pthread_rwlockattr_init( &default_attr ); 10a23b: 83 ec 0c sub $0xc,%esp 10a23e: 8d 5d f0 lea -0x10(%ebp),%ebx 10a241: 53 push %ebx 10a242: e8 a1 06 00 00 call 10a8e8 10a247: 83 c4 10 add $0x10,%esp the_attr = &default_attr; 10a24a: 89 d8 mov %ebx,%eax } /* * Now start error checking the attributes that we are going to use */ if ( !the_attr->is_initialized ) 10a24c: 83 38 00 cmpl $0x0,(%eax) 10a24f: 74 72 je 10a2c3 <== NEVER TAKEN return EINVAL; switch ( the_attr->process_shared ) { 10a251: 83 78 04 00 cmpl $0x0,0x4(%eax) 10a255: 75 6c jne 10a2c3 <== NEVER TAKEN */ RTEMS_INLINE_ROUTINE void _CORE_RWLock_Initialize_attributes( CORE_RWLock_Attributes *the_attributes ) { the_attributes->XXX = 0; 10a257: c7 45 ec 00 00 00 00 movl $0x0,-0x14(%ebp) * * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { _Thread_Dispatch_disable_level++; 10a25e: a1 b4 31 13 00 mov 0x1331b4,%eax 10a263: 40 inc %eax 10a264: a3 b4 31 13 00 mov %eax,0x1331b4 return _Thread_Dispatch_disable_level; 10a269: a1 b4 31 13 00 mov 0x1331b4,%eax * 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 *) 10a26e: 83 ec 0c sub $0xc,%esp 10a271: 68 b8 33 13 00 push $0x1333b8 10a276: e8 3d 24 00 00 call 10c6b8 <_Objects_Allocate> 10a27b: 89 c3 mov %eax,%ebx */ _Thread_Disable_dispatch(); /* prevents deletion */ the_rwlock = _POSIX_RWLock_Allocate(); if ( !the_rwlock ) { 10a27d: 83 c4 10 add $0x10,%esp 10a280: 85 c0 test %eax,%eax 10a282: 75 0c jne 10a290 _Thread_Enable_dispatch(); 10a284: e8 33 34 00 00 call 10d6bc <_Thread_Enable_dispatch> return EAGAIN; 10a289: b8 0b 00 00 00 mov $0xb,%eax 10a28e: eb 38 jmp 10a2c8 } _CORE_RWLock_Initialize( &the_rwlock->RWLock, &the_attributes ); 10a290: 50 push %eax 10a291: 50 push %eax 10a292: 8d 45 ec lea -0x14(%ebp),%eax 10a295: 50 push %eax 10a296: 8d 43 10 lea 0x10(%ebx),%eax 10a299: 50 push %eax 10a29a: e8 c1 1e 00 00 call 10c160 <_CORE_RWLock_Initialize> uint32_t name ) { _Objects_Set_local_object( information, _Objects_Get_index( the_object->id ), 10a29f: 8b 43 08 mov 0x8(%ebx),%eax Objects_Information *information, Objects_Control *the_object, uint32_t name ) { _Objects_Set_local_object( 10a2a2: 0f b7 c8 movzwl %ax,%ecx #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 10a2a5: 8b 15 d4 33 13 00 mov 0x1333d4,%edx 10a2ab: 89 1c 8a mov %ebx,(%edx,%ecx,4) _Objects_Get_index( the_object->id ), the_object ); /* ASSERT: information->is_string == false */ the_object->name.name_u32 = name; 10a2ae: c7 43 0c 00 00 00 00 movl $0x0,0xc(%ebx) &_POSIX_RWLock_Information, &the_rwlock->Object, 0 ); *rwlock = the_rwlock->Object.id; 10a2b5: 89 06 mov %eax,(%esi) _Thread_Enable_dispatch(); 10a2b7: e8 00 34 00 00 call 10d6bc <_Thread_Enable_dispatch> 10a2bc: 83 c4 10 add $0x10,%esp return 0; 10a2bf: 31 c0 xor %eax,%eax 10a2c1: eb 05 jmp 10a2c8 switch ( the_attr->process_shared ) { case PTHREAD_PROCESS_PRIVATE: /* only supported values */ break; case PTHREAD_PROCESS_SHARED: default: return EINVAL; 10a2c3: b8 16 00 00 00 mov $0x16,%eax *rwlock = the_rwlock->Object.id; _Thread_Enable_dispatch(); return 0; } 10a2c8: 8d 65 f8 lea -0x8(%ebp),%esp 10a2cb: 5b pop %ebx 10a2cc: 5e pop %esi 10a2cd: 5d pop %ebp 10a2ce: c3 ret =============================================================================== 0010ac10 : int pthread_rwlock_timedrdlock( pthread_rwlock_t *rwlock, const struct timespec *abstime ) { 10ac10: 55 push %ebp 10ac11: 89 e5 mov %esp,%ebp 10ac13: 56 push %esi 10ac14: 53 push %ebx 10ac15: 83 ec 20 sub $0x20,%esp 10ac18: 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 ) 10ac1b: 85 f6 test %esi,%esi 10ac1d: 75 05 jne 10ac24 10ac1f: e9 8a 00 00 00 jmp 10acae * * 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 ); 10ac24: 50 push %eax 10ac25: 50 push %eax 10ac26: 8d 45 f4 lea -0xc(%ebp),%eax 10ac29: 50 push %eax 10ac2a: ff 75 0c pushl 0xc(%ebp) 10ac2d: e8 ce 56 00 00 call 110300 <_POSIX_Absolute_timeout_to_ticks> 10ac32: 89 c3 mov %eax,%ebx 10ac34: 83 c4 0c add $0xc,%esp if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE ) do_wait = false; the_rwlock = _POSIX_RWLock_Get( rwlock, &location ); 10ac37: 8d 45 f0 lea -0x10(%ebp),%eax 10ac3a: 50 push %eax 10ac3b: ff 36 pushl (%esi) 10ac3d: 68 a0 15 13 00 push $0x1315a0 10ac42: e8 59 25 00 00 call 10d1a0 <_Objects_Get> switch ( location ) { 10ac47: 83 c4 10 add $0x10,%esp 10ac4a: 83 7d f0 00 cmpl $0x0,-0x10(%ebp) 10ac4e: 75 5e jne 10acae * 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 ); if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE ) 10ac50: 83 fb 03 cmp $0x3,%ebx 10ac53: 0f 94 c2 sete %dl the_rwlock = _POSIX_RWLock_Get( rwlock, &location ); switch ( location ) { case OBJECTS_LOCAL: _CORE_RWLock_Obtain_for_reading( 10ac56: 83 ec 0c sub $0xc,%esp 10ac59: 6a 00 push $0x0 10ac5b: ff 75 f4 pushl -0xc(%ebp) 10ac5e: 0f b6 ca movzbl %dl,%ecx 10ac61: 51 push %ecx 10ac62: ff 36 pushl (%esi) 10ac64: 83 c0 10 add $0x10,%eax 10ac67: 50 push %eax 10ac68: 88 55 e4 mov %dl,-0x1c(%ebp) 10ac6b: e8 d0 19 00 00 call 10c640 <_CORE_RWLock_Obtain_for_reading> do_wait, ticks, NULL ); _Thread_Enable_dispatch(); 10ac70: 83 c4 20 add $0x20,%esp 10ac73: e8 5c 30 00 00 call 10dcd4 <_Thread_Enable_dispatch> if ( !do_wait ) { 10ac78: 8a 55 e4 mov -0x1c(%ebp),%dl 10ac7b: 84 d2 test %dl,%dl 10ac7d: 75 1a jne 10ac99 if ( _Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE ) { 10ac7f: a1 e4 18 13 00 mov 0x1318e4,%eax 10ac84: 83 78 34 02 cmpl $0x2,0x34(%eax) 10ac88: 75 0f jne 10ac99 if ( status == POSIX_ABSOLUTE_TIMEOUT_INVALID ) 10ac8a: 85 db test %ebx,%ebx 10ac8c: 74 20 je 10acae <== NEVER TAKEN return EINVAL; if ( status == POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST || 10ac8e: 4b dec %ebx status == POSIX_ABSOLUTE_TIMEOUT_IS_NOW ) return ETIMEDOUT; 10ac8f: b8 74 00 00 00 mov $0x74,%eax _Thread_Enable_dispatch(); if ( !do_wait ) { if ( _Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE ) { if ( status == POSIX_ABSOLUTE_TIMEOUT_INVALID ) return EINVAL; if ( status == POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST || 10ac94: 83 fb 01 cmp $0x1,%ebx 10ac97: 76 1a jbe 10acb3 <== ALWAYS TAKEN status == POSIX_ABSOLUTE_TIMEOUT_IS_NOW ) return ETIMEDOUT; } } return _POSIX_RWLock_Translate_core_RWLock_return_code( 10ac99: 83 ec 0c sub $0xc,%esp (CORE_RWLock_Status) _Thread_Executing->Wait.return_code 10ac9c: a1 e4 18 13 00 mov 0x1318e4,%eax status == POSIX_ABSOLUTE_TIMEOUT_IS_NOW ) return ETIMEDOUT; } } return _POSIX_RWLock_Translate_core_RWLock_return_code( 10aca1: ff 70 34 pushl 0x34(%eax) 10aca4: e8 bf 00 00 00 call 10ad68 <_POSIX_RWLock_Translate_core_RWLock_return_code> 10aca9: 83 c4 10 add $0x10,%esp 10acac: eb 05 jmp 10acb3 #endif case OBJECTS_ERROR: break; } return EINVAL; 10acae: b8 16 00 00 00 mov $0x16,%eax } 10acb3: 8d 65 f8 lea -0x8(%ebp),%esp 10acb6: 5b pop %ebx 10acb7: 5e pop %esi 10acb8: 5d pop %ebp 10acb9: c3 ret =============================================================================== 0010acbc : int pthread_rwlock_timedwrlock( pthread_rwlock_t *rwlock, const struct timespec *abstime ) { 10acbc: 55 push %ebp 10acbd: 89 e5 mov %esp,%ebp 10acbf: 56 push %esi 10acc0: 53 push %ebx 10acc1: 83 ec 20 sub $0x20,%esp 10acc4: 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 ) 10acc7: 85 f6 test %esi,%esi 10acc9: 75 05 jne 10acd0 10accb: e9 8a 00 00 00 jmp 10ad5a * * 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 ); 10acd0: 50 push %eax 10acd1: 50 push %eax 10acd2: 8d 45 f4 lea -0xc(%ebp),%eax 10acd5: 50 push %eax 10acd6: ff 75 0c pushl 0xc(%ebp) 10acd9: e8 22 56 00 00 call 110300 <_POSIX_Absolute_timeout_to_ticks> 10acde: 89 c3 mov %eax,%ebx 10ace0: 83 c4 0c add $0xc,%esp if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE ) do_wait = false; the_rwlock = _POSIX_RWLock_Get( rwlock, &location ); 10ace3: 8d 45 f0 lea -0x10(%ebp),%eax 10ace6: 50 push %eax 10ace7: ff 36 pushl (%esi) 10ace9: 68 a0 15 13 00 push $0x1315a0 10acee: e8 ad 24 00 00 call 10d1a0 <_Objects_Get> switch ( location ) { 10acf3: 83 c4 10 add $0x10,%esp 10acf6: 83 7d f0 00 cmpl $0x0,-0x10(%ebp) 10acfa: 75 5e jne 10ad5a * 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 ); if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE ) 10acfc: 83 fb 03 cmp $0x3,%ebx 10acff: 0f 94 c2 sete %dl the_rwlock = _POSIX_RWLock_Get( rwlock, &location ); switch ( location ) { case OBJECTS_LOCAL: _CORE_RWLock_Obtain_for_writing( 10ad02: 83 ec 0c sub $0xc,%esp 10ad05: 6a 00 push $0x0 10ad07: ff 75 f4 pushl -0xc(%ebp) 10ad0a: 0f b6 ca movzbl %dl,%ecx 10ad0d: 51 push %ecx 10ad0e: ff 36 pushl (%esi) 10ad10: 83 c0 10 add $0x10,%eax 10ad13: 50 push %eax 10ad14: 88 55 e4 mov %dl,-0x1c(%ebp) 10ad17: e8 d4 19 00 00 call 10c6f0 <_CORE_RWLock_Obtain_for_writing> do_wait, ticks, NULL ); _Thread_Enable_dispatch(); 10ad1c: 83 c4 20 add $0x20,%esp 10ad1f: e8 b0 2f 00 00 call 10dcd4 <_Thread_Enable_dispatch> if ( !do_wait && 10ad24: 8a 55 e4 mov -0x1c(%ebp),%dl 10ad27: 84 d2 test %dl,%dl 10ad29: 75 1a jne 10ad45 (_Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE) ) { 10ad2b: a1 e4 18 13 00 mov 0x1318e4,%eax ticks, NULL ); _Thread_Enable_dispatch(); if ( !do_wait && 10ad30: 83 78 34 02 cmpl $0x2,0x34(%eax) 10ad34: 75 0f jne 10ad45 (_Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE) ) { if ( status == POSIX_ABSOLUTE_TIMEOUT_INVALID ) 10ad36: 85 db test %ebx,%ebx 10ad38: 74 20 je 10ad5a <== NEVER TAKEN return EINVAL; if ( status == POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST || 10ad3a: 4b dec %ebx status == POSIX_ABSOLUTE_TIMEOUT_IS_NOW ) return ETIMEDOUT; 10ad3b: b8 74 00 00 00 mov $0x74,%eax _Thread_Enable_dispatch(); if ( !do_wait && (_Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE) ) { if ( status == POSIX_ABSOLUTE_TIMEOUT_INVALID ) return EINVAL; if ( status == POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST || 10ad40: 83 fb 01 cmp $0x1,%ebx 10ad43: 76 1a jbe 10ad5f <== ALWAYS TAKEN status == POSIX_ABSOLUTE_TIMEOUT_IS_NOW ) return ETIMEDOUT; } return _POSIX_RWLock_Translate_core_RWLock_return_code( 10ad45: 83 ec 0c sub $0xc,%esp (CORE_RWLock_Status) _Thread_Executing->Wait.return_code 10ad48: a1 e4 18 13 00 mov 0x1318e4,%eax if ( status == POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST || status == POSIX_ABSOLUTE_TIMEOUT_IS_NOW ) return ETIMEDOUT; } return _POSIX_RWLock_Translate_core_RWLock_return_code( 10ad4d: ff 70 34 pushl 0x34(%eax) 10ad50: e8 13 00 00 00 call 10ad68 <_POSIX_RWLock_Translate_core_RWLock_return_code> 10ad55: 83 c4 10 add $0x10,%esp 10ad58: eb 05 jmp 10ad5f #endif case OBJECTS_ERROR: break; } return EINVAL; 10ad5a: b8 16 00 00 00 mov $0x16,%eax } 10ad5f: 8d 65 f8 lea -0x8(%ebp),%esp 10ad62: 5b pop %ebx 10ad63: 5e pop %esi 10ad64: 5d pop %ebp 10ad65: c3 ret =============================================================================== 0010b4b8 : int pthread_rwlockattr_setpshared( pthread_rwlockattr_t *attr, int pshared ) { 10b4b8: 55 push %ebp 10b4b9: 89 e5 mov %esp,%ebp 10b4bb: 8b 55 08 mov 0x8(%ebp),%edx 10b4be: 8b 4d 0c mov 0xc(%ebp),%ecx if ( !attr ) return EINVAL; 10b4c1: b8 16 00 00 00 mov $0x16,%eax int pthread_rwlockattr_setpshared( pthread_rwlockattr_t *attr, int pshared ) { if ( !attr ) 10b4c6: 85 d2 test %edx,%edx 10b4c8: 74 0f je 10b4d9 return EINVAL; if ( !attr->is_initialized ) 10b4ca: 83 3a 00 cmpl $0x0,(%edx) 10b4cd: 74 0a je 10b4d9 return EINVAL; switch ( pshared ) { 10b4cf: 83 f9 01 cmp $0x1,%ecx 10b4d2: 77 05 ja 10b4d9 <== NEVER TAKEN case PTHREAD_PROCESS_SHARED: case PTHREAD_PROCESS_PRIVATE: attr->process_shared = pshared; 10b4d4: 89 4a 04 mov %ecx,0x4(%edx) return 0; 10b4d7: 30 c0 xor %al,%al default: return EINVAL; } } 10b4d9: 5d pop %ebp 10b4da: c3 ret =============================================================================== 0010c2c4 : int pthread_setschedparam( pthread_t thread, int policy, struct sched_param *param ) { 10c2c4: 55 push %ebp 10c2c5: 89 e5 mov %esp,%ebp 10c2c7: 57 push %edi 10c2c8: 56 push %esi 10c2c9: 53 push %ebx 10c2ca: 83 ec 2c sub $0x2c,%esp 10c2cd: 8b 75 10 mov 0x10(%ebp),%esi /* * Check all the parameters */ if ( !param ) return EINVAL; 10c2d0: c7 45 d4 16 00 00 00 movl $0x16,-0x2c(%ebp) int rc; /* * Check all the parameters */ if ( !param ) 10c2d7: 85 f6 test %esi,%esi 10c2d9: 0f 84 f9 00 00 00 je 10c3d8 return EINVAL; rc = _POSIX_Thread_Translate_sched_param( 10c2df: 8d 45 e0 lea -0x20(%ebp),%eax 10c2e2: 50 push %eax 10c2e3: 8d 45 dc lea -0x24(%ebp),%eax 10c2e6: 50 push %eax 10c2e7: 56 push %esi 10c2e8: ff 75 0c pushl 0xc(%ebp) 10c2eb: e8 8c 4e 00 00 call 11117c <_POSIX_Thread_Translate_sched_param> 10c2f0: 89 45 d4 mov %eax,-0x2c(%ebp) policy, param, &budget_algorithm, &budget_callout ); if ( rc ) 10c2f3: 83 c4 10 add $0x10,%esp 10c2f6: 85 c0 test %eax,%eax 10c2f8: 0f 85 da 00 00 00 jne 10c3d8 return rc; /* * Actually change the scheduling policy and parameters */ the_thread = _Thread_Get( thread, &location ); 10c2fe: 53 push %ebx 10c2ff: 53 push %ebx 10c300: 8d 45 e4 lea -0x1c(%ebp),%eax 10c303: 50 push %eax 10c304: ff 75 08 pushl 0x8(%ebp) 10c307: e8 d4 26 00 00 call 10e9e0 <_Thread_Get> 10c30c: 89 c2 mov %eax,%edx switch ( location ) { 10c30e: 83 c4 10 add $0x10,%esp 10c311: 83 7d e4 00 cmpl $0x0,-0x1c(%ebp) 10c315: 0f 85 b6 00 00 00 jne 10c3d1 case OBJECTS_LOCAL: api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 10c31b: 8b 98 e8 00 00 00 mov 0xe8(%eax),%ebx if ( api->schedpolicy == SCHED_SPORADIC ) 10c321: 83 bb 84 00 00 00 04 cmpl $0x4,0x84(%ebx) 10c328: 75 18 jne 10c342 (void) _Watchdog_Remove( &api->Sporadic_timer ); 10c32a: 83 ec 0c sub $0xc,%esp 10c32d: 8d 83 a8 00 00 00 lea 0xa8(%ebx),%eax 10c333: 50 push %eax 10c334: 89 55 d0 mov %edx,-0x30(%ebp) 10c337: e8 ec 33 00 00 call 10f728 <_Watchdog_Remove> 10c33c: 83 c4 10 add $0x10,%esp 10c33f: 8b 55 d0 mov -0x30(%ebp),%edx api->schedpolicy = policy; 10c342: 8b 45 0c mov 0xc(%ebp),%eax 10c345: 89 83 84 00 00 00 mov %eax,0x84(%ebx) api->schedparam = *param; 10c34b: 8d bb 88 00 00 00 lea 0x88(%ebx),%edi 10c351: b9 07 00 00 00 mov $0x7,%ecx 10c356: f3 a5 rep movsl %ds:(%esi),%es:(%edi) the_thread->budget_algorithm = budget_algorithm; 10c358: 8b 45 dc mov -0x24(%ebp),%eax 10c35b: 89 42 78 mov %eax,0x78(%edx) the_thread->budget_callout = budget_callout; 10c35e: 8b 45 e0 mov -0x20(%ebp),%eax 10c361: 89 42 7c mov %eax,0x7c(%edx) switch ( api->schedpolicy ) { 10c364: 83 7d 0c 00 cmpl $0x0,0xc(%ebp) 10c368: 78 60 js 10c3ca <== NEVER TAKEN 10c36a: 83 7d 0c 02 cmpl $0x2,0xc(%ebp) 10c36e: 7e 08 jle 10c378 10c370: 83 7d 0c 04 cmpl $0x4,0xc(%ebp) 10c374: 75 54 jne 10c3ca <== NEVER TAKEN 10c376: eb 24 jmp 10c39c case SCHED_OTHER: case SCHED_FIFO: case SCHED_RR: the_thread->cpu_time_budget = _Thread_Ticks_per_timeslice; 10c378: a1 08 34 13 00 mov 0x133408,%eax 10c37d: 89 42 74 mov %eax,0x74(%edx) 10c380: 0f b6 05 88 f1 12 00 movzbl 0x12f188,%eax 10c387: 2b 83 88 00 00 00 sub 0x88(%ebx),%eax the_thread->real_priority = 10c38d: 89 42 18 mov %eax,0x18(%edx) _POSIX_Priority_To_core( api->schedparam.sched_priority ); _Thread_Change_priority( 10c390: 51 push %ecx 10c391: 6a 01 push $0x1 10c393: 50 push %eax 10c394: 52 push %edx 10c395: e8 36 22 00 00 call 10e5d0 <_Thread_Change_priority> 10c39a: eb 2b jmp 10c3c7 true ); break; case SCHED_SPORADIC: api->ss_high_priority = api->schedparam.sched_priority; 10c39c: 8b 83 88 00 00 00 mov 0x88(%ebx),%eax 10c3a2: 89 83 a4 00 00 00 mov %eax,0xa4(%ebx) _Watchdog_Remove( &api->Sporadic_timer ); 10c3a8: 83 ec 0c sub $0xc,%esp 10c3ab: 81 c3 a8 00 00 00 add $0xa8,%ebx 10c3b1: 53 push %ebx 10c3b2: 89 55 d0 mov %edx,-0x30(%ebp) 10c3b5: e8 6e 33 00 00 call 10f728 <_Watchdog_Remove> _POSIX_Threads_Sporadic_budget_TSR( 0, the_thread ); 10c3ba: 58 pop %eax 10c3bb: 5a pop %edx 10c3bc: 8b 55 d0 mov -0x30(%ebp),%edx 10c3bf: 52 push %edx 10c3c0: 6a 00 push $0x0 10c3c2: e8 ea fd ff ff call 10c1b1 <_POSIX_Threads_Sporadic_budget_TSR> break; 10c3c7: 83 c4 10 add $0x10,%esp } _Thread_Enable_dispatch(); 10c3ca: e8 f1 25 00 00 call 10e9c0 <_Thread_Enable_dispatch> 10c3cf: eb 07 jmp 10c3d8 #endif case OBJECTS_ERROR: break; } return ESRCH; 10c3d1: c7 45 d4 03 00 00 00 movl $0x3,-0x2c(%ebp) } 10c3d8: 8b 45 d4 mov -0x2c(%ebp),%eax 10c3db: 8d 65 f4 lea -0xc(%ebp),%esp 10c3de: 5b pop %ebx 10c3df: 5e pop %esi 10c3e0: 5f pop %edi 10c3e1: 5d pop %ebp 10c3e2: c3 ret =============================================================================== 0010a130 : * 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() ) 10a130: 83 3d d8 f8 12 00 00 cmpl $0x0,0x12f8d8 10a137: 75 57 jne 10a190 <== NEVER TAKEN /* * 18.2.2 Setting Cancelability State, P1003.1c/Draft 10, p. 183 */ void pthread_testcancel( void ) { 10a139: 55 push %ebp 10a13a: 89 e5 mov %esp,%ebp 10a13c: 53 push %ebx 10a13d: 52 push %edx */ if ( _ISR_Is_in_progress() ) return; thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; 10a13e: a1 dc f8 12 00 mov 0x12f8dc,%eax 10a143: 8b 80 e8 00 00 00 mov 0xe8(%eax),%eax * * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { _Thread_Dispatch_disable_level++; 10a149: 8b 15 d4 f3 12 00 mov 0x12f3d4,%edx 10a14f: 42 inc %edx 10a150: 89 15 d4 f3 12 00 mov %edx,0x12f3d4 return _Thread_Dispatch_disable_level; 10a156: 8b 15 d4 f3 12 00 mov 0x12f3d4,%edx */ void pthread_testcancel( void ) { POSIX_API_Control *thread_support; bool cancel = false; 10a15c: 31 db xor %ebx,%ebx return; thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; _Thread_Disable_dispatch(); if ( thread_support->cancelability_state == PTHREAD_CANCEL_ENABLE && 10a15e: 83 b8 d8 00 00 00 00 cmpl $0x0,0xd8(%eax) 10a165: 75 0a jne 10a171 <== NEVER TAKEN 10a167: 83 b8 e0 00 00 00 00 cmpl $0x0,0xe0(%eax) 10a16e: 0f 95 c3 setne %bl thread_support->cancelation_requested ) cancel = true; _Thread_Enable_dispatch(); 10a171: e8 16 25 00 00 call 10c68c <_Thread_Enable_dispatch> if ( cancel ) 10a176: 84 db test %bl,%bl 10a178: 74 12 je 10a18c _POSIX_Thread_Exit( _Thread_Executing, PTHREAD_CANCELED ); 10a17a: 50 push %eax 10a17b: 50 push %eax 10a17c: 6a ff push $0xffffffff 10a17e: ff 35 dc f8 12 00 pushl 0x12f8dc 10a184: e8 8f 4d 00 00 call 10ef18 <_POSIX_Thread_Exit> 10a189: 83 c4 10 add $0x10,%esp <== NOT EXECUTED } 10a18c: 8b 5d fc mov -0x4(%ebp),%ebx 10a18f: c9 leave 10a190: c3 ret =============================================================================== 0010a4fa : * errno - otherwise */ int rtems_aio_enqueue (rtems_aio_request *req) { 10a4fa: 55 push %ebp 10a4fb: 89 e5 mov %esp,%ebp 10a4fd: 57 push %edi 10a4fe: 56 push %esi 10a4ff: 53 push %ebx 10a500: 83 ec 58 sub $0x58,%esp 10a503: 8b 5d 08 mov 0x8(%ebp),%ebx struct sched_param param; /* The queue should be initialized */ AIO_assert (aio_request_queue.initialized == AIO_QUEUE_INITIALIZED); result = pthread_mutex_lock (&aio_request_queue.mutex); 10a506: 68 08 03 13 00 push $0x130308 10a50b: e8 f8 08 00 00 call 10ae08 10a510: 89 c7 mov %eax,%edi if (result != 0) { 10a512: 83 c4 10 add $0x10,%esp 10a515: 85 c0 test %eax,%eax 10a517: 74 0e je 10a527 <== ALWAYS TAKEN free (req); 10a519: 83 ec 0c sub $0xc,%esp <== NOT EXECUTED 10a51c: 53 push %ebx <== NOT EXECUTED 10a51d: e8 36 c6 ff ff call 106b58 <== NOT EXECUTED 10a522: e9 a8 01 00 00 jmp 10a6cf <== NOT EXECUTED return result; } /* _POSIX_PRIORITIZED_IO and _POSIX_PRIORITY_SCHEDULING are defined, we can use aio_reqprio to lower the priority of the request */ pthread_getschedparam (pthread_self(), &policy, ¶m); 10a527: e8 cc 10 00 00 call 10b5f8 10a52c: 52 push %edx 10a52d: 8d 55 cc lea -0x34(%ebp),%edx 10a530: 52 push %edx 10a531: 8d 55 c8 lea -0x38(%ebp),%edx 10a534: 52 push %edx 10a535: 50 push %eax 10a536: e8 f1 0c 00 00 call 10b22c req->caller_thread = pthread_self (); 10a53b: e8 b8 10 00 00 call 10b5f8 10a540: 89 43 10 mov %eax,0x10(%ebx) req->priority = param.sched_priority - req->aiocbp->aio_reqprio; 10a543: 8b 43 14 mov 0x14(%ebx),%eax 10a546: 8b 55 cc mov -0x34(%ebp),%edx 10a549: 2b 50 14 sub 0x14(%eax),%edx 10a54c: 89 53 0c mov %edx,0xc(%ebx) req->policy = policy; 10a54f: 8b 55 c8 mov -0x38(%ebp),%edx 10a552: 89 53 08 mov %edx,0x8(%ebx) req->aiocbp->error_code = EINPROGRESS; 10a555: c7 40 30 77 00 00 00 movl $0x77,0x30(%eax) req->aiocbp->return_value = 0; 10a55c: c7 40 34 00 00 00 00 movl $0x0,0x34(%eax) if ((aio_request_queue.idle_threads == 0) && 10a563: 83 c4 10 add $0x10,%esp 10a566: 83 3d 70 03 13 00 00 cmpl $0x0,0x130370 10a56d: 0f 85 97 00 00 00 jne 10a60a <== NEVER TAKEN 10a573: 83 3d 6c 03 13 00 04 cmpl $0x4,0x13036c 10a57a: 0f 8f 8a 00 00 00 jg 10a60a aio_request_queue.active_threads < AIO_MAX_THREADS) /* we still have empty places on the active_threads chain */ { chain = &aio_request_queue.work_req; r_chain = rtems_aio_search_fd (chain, req->aiocbp->aio_fildes, 1); 10a580: 56 push %esi 10a581: 6a 01 push $0x1 10a583: ff 30 pushl (%eax) 10a585: 68 50 03 13 00 push $0x130350 10a58a: e8 30 fe ff ff call 10a3bf 10a58f: 89 c6 mov %eax,%esi if (r_chain->new_fd == 1) { 10a591: 83 c4 10 add $0x10,%esp 10a594: 83 78 18 01 cmpl $0x1,0x18(%eax) 10a598: 0f 85 84 00 00 00 jne 10a622 RTEMS_INLINE_ROUTINE void _Chain_Prepend( Chain_Control *the_chain, Chain_Node *the_node ) { _Chain_Insert(_Chain_Head(the_chain), the_node); 10a59e: 50 push %eax 10a59f: 50 push %eax 10a5a0: 53 push %ebx 10a5a1: 8d 46 08 lea 0x8(%esi),%eax 10a5a4: 50 push %eax 10a5a5: e8 96 1f 00 00 call 10c540 <_Chain_Insert> rtems_chain_prepend (&r_chain->perfd, &req->next_prio); r_chain->new_fd = 0; 10a5aa: c7 46 18 00 00 00 00 movl $0x0,0x18(%esi) pthread_mutex_init (&r_chain->mutex, NULL); 10a5b1: 58 pop %eax 10a5b2: 5a pop %edx 10a5b3: 6a 00 push $0x0 10a5b5: 8d 46 1c lea 0x1c(%esi),%eax 10a5b8: 50 push %eax 10a5b9: e8 22 07 00 00 call 10ace0 pthread_cond_init (&r_chain->cond, NULL); 10a5be: 59 pop %ecx 10a5bf: 5b pop %ebx 10a5c0: 6a 00 push $0x0 10a5c2: 8d 46 20 lea 0x20(%esi),%eax 10a5c5: 50 push %eax 10a5c6: e8 c9 03 00 00 call 10a994 AIO_printf ("New thread \n"); result = pthread_create (&thid, &aio_request_queue.attr, 10a5cb: 56 push %esi 10a5cc: 68 34 a0 10 00 push $0x10a034 10a5d1: 68 10 03 13 00 push $0x130310 10a5d6: 8d 45 c4 lea -0x3c(%ebp),%eax 10a5d9: 50 push %eax 10a5da: e8 25 0a 00 00 call 10b004 10a5df: 89 c3 mov %eax,%ebx rtems_aio_handle, (void *) r_chain); if (result != 0) { 10a5e1: 83 c4 20 add $0x20,%esp 10a5e4: 85 c0 test %eax,%eax 10a5e6: 74 17 je 10a5ff <== ALWAYS TAKEN pthread_mutex_unlock (&aio_request_queue.mutex); 10a5e8: 83 ec 0c sub $0xc,%esp <== NOT EXECUTED 10a5eb: 68 08 03 13 00 push $0x130308 <== NOT EXECUTED 10a5f0: e8 93 08 00 00 call 10ae88 <== NOT EXECUTED 10a5f5: 83 c4 10 add $0x10,%esp <== NOT EXECUTED 10a5f8: 89 df mov %ebx,%edi <== NOT EXECUTED 10a5fa: e9 d3 00 00 00 jmp 10a6d2 <== NOT EXECUTED return result; } ++aio_request_queue.active_threads; 10a5ff: ff 05 6c 03 13 00 incl 0x13036c 10a605: e9 b8 00 00 00 jmp 10a6c2 else { /* the maximum number of threads has been already created even though some of them might be idle. The request belongs to one of the active fd chain */ r_chain = rtems_aio_search_fd (&aio_request_queue.work_req, 10a60a: 56 push %esi 10a60b: 6a 00 push $0x0 10a60d: ff 30 pushl (%eax) 10a60f: 68 50 03 13 00 push $0x130350 10a614: e8 a6 fd ff ff call 10a3bf 10a619: 89 c6 mov %eax,%esi req->aiocbp->aio_fildes, 0); if (r_chain != NULL) 10a61b: 83 c4 10 add $0x10,%esp 10a61e: 85 c0 test %eax,%eax 10a620: 74 31 je 10a653 { pthread_mutex_lock (&r_chain->mutex); 10a622: 8d 4e 1c lea 0x1c(%esi),%ecx 10a625: 83 ec 0c sub $0xc,%esp 10a628: 51 push %ecx 10a629: 89 4d b4 mov %ecx,-0x4c(%ebp) 10a62c: e8 d7 07 00 00 call 10ae08 rtems_aio_insert_prio (&r_chain->perfd, req); 10a631: 8d 46 08 lea 0x8(%esi),%eax 10a634: 89 da mov %ebx,%edx 10a636: e8 3d fc ff ff call 10a278 pthread_cond_signal (&r_chain->cond); 10a63b: 83 c6 20 add $0x20,%esi 10a63e: 89 34 24 mov %esi,(%esp) 10a641: e8 ee 03 00 00 call 10aa34 pthread_mutex_unlock (&r_chain->mutex); 10a646: 8b 4d b4 mov -0x4c(%ebp),%ecx 10a649: 89 0c 24 mov %ecx,(%esp) 10a64c: e8 37 08 00 00 call 10ae88 10a651: eb 6c jmp 10a6bf } else { /* or to the idle chain */ chain = &aio_request_queue.idle_req; r_chain = rtems_aio_search_fd (chain, req->aiocbp->aio_fildes, 1); 10a653: 51 push %ecx 10a654: 6a 01 push $0x1 10a656: 8b 43 14 mov 0x14(%ebx),%eax 10a659: ff 30 pushl (%eax) 10a65b: 68 5c 03 13 00 push $0x13035c 10a660: e8 5a fd ff ff call 10a3bf 10a665: 89 c6 mov %eax,%esi if (r_chain->new_fd == 1) { 10a667: 83 c4 10 add $0x10,%esp 10a66a: 83 78 18 01 cmpl $0x1,0x18(%eax) 10a66e: 8d 40 08 lea 0x8(%eax),%eax 10a671: 75 2f jne 10a6a2 10a673: 52 push %edx 10a674: 52 push %edx 10a675: 53 push %ebx 10a676: 50 push %eax 10a677: e8 c4 1e 00 00 call 10c540 <_Chain_Insert> /* If this is a new fd chain we signal the idle threads that might be waiting for requests */ AIO_printf (" New chain on waiting queue \n "); rtems_chain_prepend (&r_chain->perfd, &req->next_prio); r_chain->new_fd = 0; 10a67c: c7 46 18 00 00 00 00 movl $0x0,0x18(%esi) pthread_mutex_init (&r_chain->mutex, NULL); 10a683: 59 pop %ecx 10a684: 5b pop %ebx 10a685: 6a 00 push $0x0 10a687: 8d 46 1c lea 0x1c(%esi),%eax 10a68a: 50 push %eax 10a68b: e8 50 06 00 00 call 10ace0 pthread_cond_init (&r_chain->cond, NULL); 10a690: 58 pop %eax 10a691: 5a pop %edx 10a692: 6a 00 push $0x0 10a694: 83 c6 20 add $0x20,%esi 10a697: 56 push %esi 10a698: e8 f7 02 00 00 call 10a994 10a69d: 83 c4 10 add $0x10,%esp 10a6a0: eb 07 jmp 10a6a9 } else /* just insert the request in the existing fd chain */ rtems_aio_insert_prio (&r_chain->perfd, req); 10a6a2: 89 da mov %ebx,%edx 10a6a4: e8 cf fb ff ff call 10a278 if (aio_request_queue.idle_threads > 0) 10a6a9: 83 3d 70 03 13 00 00 cmpl $0x0,0x130370 10a6b0: 7e 10 jle 10a6c2 <== ALWAYS TAKEN pthread_cond_signal (&aio_request_queue.new_req); 10a6b2: 83 ec 0c sub $0xc,%esp <== NOT EXECUTED 10a6b5: 68 0c 03 13 00 push $0x13030c <== NOT EXECUTED 10a6ba: e8 75 03 00 00 call 10aa34 <== NOT EXECUTED 10a6bf: 83 c4 10 add $0x10,%esp } } pthread_mutex_unlock (&aio_request_queue.mutex); 10a6c2: 83 ec 0c sub $0xc,%esp 10a6c5: 68 08 03 13 00 push $0x130308 10a6ca: e8 b9 07 00 00 call 10ae88 10a6cf: 83 c4 10 add $0x10,%esp return 0; } 10a6d2: 89 f8 mov %edi,%eax 10a6d4: 8d 65 f4 lea -0xc(%ebp),%esp 10a6d7: 5b pop %ebx 10a6d8: 5e pop %esi 10a6d9: 5f pop %edi 10a6da: 5d pop %ebp 10a6db: c3 ret =============================================================================== 0010a034 : * NULL - if error */ static void * rtems_aio_handle (void *arg) { 10a034: 55 push %ebp 10a035: 89 e5 mov %esp,%ebp 10a037: 57 push %edi 10a038: 56 push %esi 10a039: 53 push %ebx 10a03a: 83 ec 4c sub $0x4c,%esp rtems_aio_request_chain *r_chain = arg; 10a03d: 8b 5d 08 mov 0x8(%ebp),%ebx /* acquire the mutex of the current fd chain. we don't need to lock the queue mutex since we can add requests to idle fd chains or even active ones if the working request has been extracted from the chain */ result = pthread_mutex_lock (&r_chain->mutex); 10a040: 8d 7b 1c lea 0x1c(%ebx),%edi 10a043: 83 ec 0c sub $0xc,%esp 10a046: 57 push %edi 10a047: e8 bc 0d 00 00 call 10ae08 if (result != 0) 10a04c: 83 c4 10 add $0x10,%esp 10a04f: 85 c0 test %eax,%eax 10a051: 0f 85 17 02 00 00 jne 10a26e <== NEVER TAKEN */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; 10a057: 8b 73 08 mov 0x8(%ebx),%esi RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 10a05a: 8d 43 0c lea 0xc(%ebx),%eax /* If the locked chain is not empty, take the first request extract it, unlock the chain and process the request, in this way the user can supply more requests to this fd chain */ if (!rtems_chain_is_empty (chain)) { 10a05d: 39 c6 cmp %eax,%esi 10a05f: 0f 84 cc 00 00 00 je 10a131 node = rtems_chain_first (chain); req = (rtems_aio_request *) node; /* See _POSIX_PRIORITIZE_IO and _POSIX_PRIORITY_SCHEDULING discussion in rtems_aio_enqueue () */ pthread_getschedparam (pthread_self(), &policy, ¶m); 10a065: e8 8e 15 00 00 call 10b5f8 10a06a: 52 push %edx 10a06b: 8d 55 cc lea -0x34(%ebp),%edx 10a06e: 52 push %edx 10a06f: 8d 55 c0 lea -0x40(%ebp),%edx 10a072: 52 push %edx 10a073: 50 push %eax 10a074: e8 b3 11 00 00 call 10b22c param.sched_priority = req->priority; 10a079: 8b 46 0c mov 0xc(%esi),%eax 10a07c: 89 45 cc mov %eax,-0x34(%ebp) pthread_setschedparam (pthread_self(), req->policy, ¶m); 10a07f: 8b 56 08 mov 0x8(%esi),%edx 10a082: 89 55 b4 mov %edx,-0x4c(%ebp) 10a085: e8 6e 15 00 00 call 10b5f8 10a08a: 83 c4 0c add $0xc,%esp 10a08d: 8d 4d cc lea -0x34(%ebp),%ecx 10a090: 51 push %ecx 10a091: 8b 55 b4 mov -0x4c(%ebp),%edx 10a094: 52 push %edx 10a095: 50 push %eax 10a096: e8 6d 15 00 00 call 10b608 10a09b: 89 34 24 mov %esi,(%esp) 10a09e: e8 61 24 00 00 call 10c504 <_Chain_Extract> rtems_chain_extract (node); pthread_mutex_unlock (&r_chain->mutex); 10a0a3: 89 3c 24 mov %edi,(%esp) 10a0a6: e8 dd 0d 00 00 call 10ae88 switch (req->aiocbp->aio_lio_opcode) { 10a0ab: 8b 46 14 mov 0x14(%esi),%eax 10a0ae: 83 c4 10 add $0x10,%esp 10a0b1: 8b 50 2c mov 0x2c(%eax),%edx 10a0b4: 83 fa 02 cmp $0x2,%edx 10a0b7: 74 20 je 10a0d9 10a0b9: 83 fa 03 cmp $0x3,%edx 10a0bc: 74 36 je 10a0f4 <== NEVER TAKEN 10a0be: 4a dec %edx 10a0bf: 75 45 jne 10a106 <== NEVER TAKEN case LIO_READ: AIO_printf ("read\n"); result = pread (req->aiocbp->aio_fildes, 10a0c1: 83 ec 0c sub $0xc,%esp 10a0c4: ff 70 08 pushl 0x8(%eax) 10a0c7: ff 70 04 pushl 0x4(%eax) 10a0ca: ff 70 10 pushl 0x10(%eax) 10a0cd: ff 70 0c pushl 0xc(%eax) 10a0d0: ff 30 pushl (%eax) 10a0d2: e8 09 96 00 00 call 1136e0 10a0d7: eb 16 jmp 10a0ef req->aiocbp->aio_nbytes, req->aiocbp->aio_offset); break; case LIO_WRITE: AIO_printf ("write\n"); result = pwrite (req->aiocbp->aio_fildes, 10a0d9: 83 ec 0c sub $0xc,%esp 10a0dc: ff 70 08 pushl 0x8(%eax) 10a0df: ff 70 04 pushl 0x4(%eax) 10a0e2: ff 70 10 pushl 0x10(%eax) 10a0e5: ff 70 0c pushl 0xc(%eax) 10a0e8: ff 30 pushl (%eax) 10a0ea: e8 f1 96 00 00 call 1137e0 (void *) req->aiocbp->aio_buf, req->aiocbp->aio_nbytes, req->aiocbp->aio_offset); break; 10a0ef: 83 c4 20 add $0x20,%esp 10a0f2: eb 0d jmp 10a101 case LIO_SYNC: AIO_printf ("sync\n"); result = fsync (req->aiocbp->aio_fildes); 10a0f4: 83 ec 0c sub $0xc,%esp <== NOT EXECUTED 10a0f7: ff 30 pushl (%eax) <== NOT EXECUTED 10a0f9: e8 56 5a 00 00 call 10fb54 <== NOT EXECUTED break; 10a0fe: 83 c4 10 add $0x10,%esp <== NOT EXECUTED default: result = -1; } if (result == -1) { 10a101: 83 f8 ff cmp $0xffffffff,%eax 10a104: 75 19 jne 10a11f <== ALWAYS TAKEN req->aiocbp->return_value = -1; 10a106: 8b 76 14 mov 0x14(%esi),%esi <== NOT EXECUTED 10a109: c7 46 34 ff ff ff ff movl $0xffffffff,0x34(%esi) <== NOT EXECUTED req->aiocbp->error_code = errno; 10a110: e8 07 8c 00 00 call 112d1c <__errno> <== NOT EXECUTED 10a115: 8b 00 mov (%eax),%eax <== NOT EXECUTED 10a117: 89 46 30 mov %eax,0x30(%esi) <== NOT EXECUTED 10a11a: e9 21 ff ff ff jmp 10a040 <== NOT EXECUTED } else { req->aiocbp->return_value = result; 10a11f: 8b 56 14 mov 0x14(%esi),%edx 10a122: 89 42 34 mov %eax,0x34(%edx) req->aiocbp->error_code = 0; 10a125: c7 42 30 00 00 00 00 movl $0x0,0x30(%edx) 10a12c: e9 0f ff ff ff jmp 10a040 struct timespec timeout; AIO_printf ("Chain is empty [WQ], wait for work\n"); pthread_mutex_unlock (&r_chain->mutex); 10a131: 83 ec 0c sub $0xc,%esp 10a134: 57 push %edi 10a135: e8 4e 0d 00 00 call 10ae88 pthread_mutex_lock (&aio_request_queue.mutex); 10a13a: c7 04 24 08 03 13 00 movl $0x130308,(%esp) 10a141: e8 c2 0c 00 00 call 10ae08 if (rtems_chain_is_empty (chain)) 10a146: 83 c4 10 add $0x10,%esp 10a149: 39 73 08 cmp %esi,0x8(%ebx) 10a14c: 0f 85 07 01 00 00 jne 10a259 <== NEVER TAKEN { clock_gettime (CLOCK_REALTIME, &timeout); 10a152: 56 push %esi 10a153: 56 push %esi 10a154: 8d 45 c4 lea -0x3c(%ebp),%eax 10a157: 50 push %eax 10a158: 6a 01 push $0x1 10a15a: e8 e1 06 00 00 call 10a840 timeout.tv_sec += 3; 10a15f: 83 45 c4 03 addl $0x3,-0x3c(%ebp) timeout.tv_nsec = 0; 10a163: c7 45 c8 00 00 00 00 movl $0x0,-0x38(%ebp) result = pthread_cond_timedwait (&r_chain->cond, 10a16a: 8d 73 20 lea 0x20(%ebx),%esi 10a16d: 83 c4 0c add $0xc,%esp 10a170: 8d 55 c4 lea -0x3c(%ebp),%edx 10a173: 52 push %edx 10a174: 68 08 03 13 00 push $0x130308 10a179: 56 push %esi 10a17a: e8 29 09 00 00 call 10aaa8 &aio_request_queue.mutex, &timeout); /* If no requests were added to the chain we delete the fd chain from the queue and start working with idle fd chains */ if (result == ETIMEDOUT) { 10a17f: 83 c4 10 add $0x10,%esp 10a182: 83 f8 74 cmp $0x74,%eax 10a185: 0f 85 ce 00 00 00 jne 10a259 <== NEVER TAKEN 10a18b: 83 ec 0c sub $0xc,%esp 10a18e: 53 push %ebx 10a18f: e8 70 23 00 00 call 10c504 <_Chain_Extract> rtems_chain_extract (&r_chain->next_fd); pthread_mutex_destroy (&r_chain->mutex); 10a194: 89 3c 24 mov %edi,(%esp) 10a197: e8 40 0a 00 00 call 10abdc pthread_cond_destroy (&r_chain->cond); 10a19c: 89 34 24 mov %esi,(%esp) 10a19f: e8 34 07 00 00 call 10a8d8 free (r_chain); 10a1a4: 89 1c 24 mov %ebx,(%esp) 10a1a7: e8 ac c9 ff ff call 106b58 /* If the idle chain is empty sleep for 3 seconds and wait for a signal. The thread now becomes idle. */ if (rtems_chain_is_empty (&aio_request_queue.idle_req)) { 10a1ac: 83 c4 10 add $0x10,%esp 10a1af: 81 3d 5c 03 13 00 60 cmpl $0x130360,0x13035c 10a1b6: 03 13 00 10a1b9: 75 5a jne 10a215 AIO_printf ("Chain is empty [IQ], wait for work\n"); ++aio_request_queue.idle_threads; 10a1bb: ff 05 70 03 13 00 incl 0x130370 --aio_request_queue.active_threads; 10a1c1: ff 0d 6c 03 13 00 decl 0x13036c clock_gettime (CLOCK_REALTIME, &timeout); 10a1c7: 51 push %ecx 10a1c8: 51 push %ecx 10a1c9: 8d 4d c4 lea -0x3c(%ebp),%ecx 10a1cc: 51 push %ecx 10a1cd: 6a 01 push $0x1 10a1cf: e8 6c 06 00 00 call 10a840 timeout.tv_sec += 3; 10a1d4: 83 45 c4 03 addl $0x3,-0x3c(%ebp) timeout.tv_nsec = 0; 10a1d8: c7 45 c8 00 00 00 00 movl $0x0,-0x38(%ebp) result = pthread_cond_timedwait (&aio_request_queue.new_req, 10a1df: 83 c4 0c add $0xc,%esp 10a1e2: 8d 45 c4 lea -0x3c(%ebp),%eax 10a1e5: 50 push %eax 10a1e6: 68 08 03 13 00 push $0x130308 10a1eb: 68 0c 03 13 00 push $0x13030c 10a1f0: e8 b3 08 00 00 call 10aaa8 &aio_request_queue.mutex, &timeout); /* If no new fd chain was added in the idle requests then this thread is finished */ if (result == ETIMEDOUT) { 10a1f5: 83 c4 10 add $0x10,%esp 10a1f8: 83 f8 74 cmp $0x74,%eax 10a1fb: 75 18 jne 10a215 <== NEVER TAKEN AIO_printf ("Etimeout\n"); --aio_request_queue.idle_threads; 10a1fd: ff 0d 70 03 13 00 decl 0x130370 pthread_mutex_unlock (&aio_request_queue.mutex); 10a203: 83 ec 0c sub $0xc,%esp 10a206: 68 08 03 13 00 push $0x130308 10a20b: e8 78 0c 00 00 call 10ae88 10a210: 83 c4 10 add $0x10,%esp 10a213: eb 59 jmp 10a26e } } /* Otherwise move this chain to the working chain and start the loop all over again */ AIO_printf ("Work on idle\n"); --aio_request_queue.idle_threads; 10a215: ff 0d 70 03 13 00 decl 0x130370 ++aio_request_queue.active_threads; 10a21b: ff 05 6c 03 13 00 incl 0x13036c */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; 10a221: 8b 1d 5c 03 13 00 mov 0x13035c,%ebx 10a227: 83 ec 0c sub $0xc,%esp 10a22a: 53 push %ebx 10a22b: e8 d4 22 00 00 call 10c504 <_Chain_Extract> 10a230: a1 50 03 13 00 mov 0x130350,%eax rtems_chain_node *node; node = rtems_chain_first (&aio_request_queue.work_req); temp = (rtems_aio_request_chain *) node; while (temp->fildes < r_chain->fildes && 10a235: 8b 53 14 mov 0x14(%ebx),%edx 10a238: 83 c4 10 add $0x10,%esp 10a23b: eb 02 jmp 10a23f } } AIO_printf ("Thread finished\n"); return NULL; } 10a23d: 8b 00 mov (%eax),%eax rtems_chain_node *node; node = rtems_chain_first (&aio_request_queue.work_req); temp = (rtems_aio_request_chain *) node; while (temp->fildes < r_chain->fildes && 10a23f: 39 50 14 cmp %edx,0x14(%eax) 10a242: 7d 07 jge 10a24b 10a244: 3d 54 03 13 00 cmp $0x130354,%eax 10a249: 75 f2 jne 10a23d <== ALWAYS TAKEN RTEMS_INLINE_ROUTINE void rtems_chain_insert( rtems_chain_node *after_node, rtems_chain_node *the_node ) { _Chain_Insert( after_node, the_node ); 10a24b: 52 push %edx 10a24c: 52 push %edx 10a24d: 53 push %ebx 10a24e: ff 70 04 pushl 0x4(%eax) 10a251: e8 ea 22 00 00 call 10c540 <_Chain_Insert> 10a256: 83 c4 10 add $0x10,%esp } } /* If there was a request added in the initial fd chain then release the mutex and process it */ pthread_mutex_unlock (&aio_request_queue.mutex); 10a259: 83 ec 0c sub $0xc,%esp 10a25c: 68 08 03 13 00 push $0x130308 10a261: e8 22 0c 00 00 call 10ae88 10a266: 83 c4 10 add $0x10,%esp 10a269: e9 d2 fd ff ff jmp 10a040 } } AIO_printf ("Thread finished\n"); return NULL; } 10a26e: 31 c0 xor %eax,%eax 10a270: 8d 65 f4 lea -0xc(%ebp),%esp 10a273: 5b pop %ebx 10a274: 5e pop %esi 10a275: 5f pop %edi 10a276: 5d pop %ebp 10a277: c3 ret =============================================================================== 0010a2c3 : * 0 - if initialization succeeded */ int rtems_aio_init (void) { 10a2c3: 55 push %ebp 10a2c4: 89 e5 mov %esp,%ebp 10a2c6: 53 push %ebx 10a2c7: 83 ec 10 sub $0x10,%esp int result = 0; result = pthread_attr_init (&aio_request_queue.attr); 10a2ca: 68 10 03 13 00 push $0x130310 10a2cf: e8 e4 0c 00 00 call 10afb8 10a2d4: 89 c3 mov %eax,%ebx if (result != 0) 10a2d6: 83 c4 10 add $0x10,%esp 10a2d9: 85 c0 test %eax,%eax 10a2db: 0f 85 d7 00 00 00 jne 10a3b8 <== NEVER TAKEN return result; result = 10a2e1: 50 push %eax 10a2e2: 50 push %eax 10a2e3: 6a 00 push $0x0 10a2e5: 68 10 03 13 00 push $0x130310 10a2ea: e8 f1 0c 00 00 call 10afe0 pthread_attr_setdetachstate (&aio_request_queue.attr, PTHREAD_CREATE_DETACHED); if (result != 0) 10a2ef: 83 c4 10 add $0x10,%esp 10a2f2: 85 c0 test %eax,%eax 10a2f4: 74 10 je 10a306 <== ALWAYS TAKEN pthread_attr_destroy (&aio_request_queue.attr); 10a2f6: 83 ec 0c sub $0xc,%esp <== NOT EXECUTED 10a2f9: 68 10 03 13 00 push $0x130310 <== NOT EXECUTED 10a2fe: e8 95 0c 00 00 call 10af98 <== NOT EXECUTED 10a303: 83 c4 10 add $0x10,%esp <== NOT EXECUTED result = pthread_mutex_init (&aio_request_queue.mutex, NULL); 10a306: 50 push %eax 10a307: 50 push %eax 10a308: 6a 00 push $0x0 10a30a: 68 08 03 13 00 push $0x130308 10a30f: e8 cc 09 00 00 call 10ace0 if (result != 0) 10a314: 83 c4 10 add $0x10,%esp 10a317: 85 c0 test %eax,%eax 10a319: 74 10 je 10a32b <== ALWAYS TAKEN pthread_attr_destroy (&aio_request_queue.attr); 10a31b: 83 ec 0c sub $0xc,%esp <== NOT EXECUTED 10a31e: 68 10 03 13 00 push $0x130310 <== NOT EXECUTED 10a323: e8 70 0c 00 00 call 10af98 <== NOT EXECUTED 10a328: 83 c4 10 add $0x10,%esp <== NOT EXECUTED result = pthread_cond_init (&aio_request_queue.new_req, NULL); 10a32b: 50 push %eax 10a32c: 50 push %eax 10a32d: 6a 00 push $0x0 10a32f: 68 0c 03 13 00 push $0x13030c 10a334: e8 5b 06 00 00 call 10a994 10a339: 89 c3 mov %eax,%ebx if (result != 0) { 10a33b: 83 c4 10 add $0x10,%esp 10a33e: 85 c0 test %eax,%eax 10a340: 74 1c je 10a35e <== ALWAYS TAKEN pthread_mutex_destroy (&aio_request_queue.mutex); 10a342: 83 ec 0c sub $0xc,%esp <== NOT EXECUTED 10a345: 68 08 03 13 00 push $0x130308 <== NOT EXECUTED 10a34a: e8 8d 08 00 00 call 10abdc <== NOT EXECUTED pthread_attr_destroy (&aio_request_queue.attr); 10a34f: c7 04 24 10 03 13 00 movl $0x130310,(%esp) <== NOT EXECUTED 10a356: e8 3d 0c 00 00 call 10af98 <== NOT EXECUTED 10a35b: 83 c4 10 add $0x10,%esp <== NOT EXECUTED ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; 10a35e: c7 05 50 03 13 00 54 movl $0x130354,0x130350 10a365: 03 13 00 head->previous = NULL; 10a368: c7 05 54 03 13 00 00 movl $0x0,0x130354 10a36f: 00 00 00 tail->previous = head; 10a372: c7 05 58 03 13 00 50 movl $0x130350,0x130358 10a379: 03 13 00 ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; 10a37c: c7 05 5c 03 13 00 60 movl $0x130360,0x13035c 10a383: 03 13 00 head->previous = NULL; 10a386: c7 05 60 03 13 00 00 movl $0x0,0x130360 10a38d: 00 00 00 tail->previous = head; 10a390: c7 05 64 03 13 00 5c movl $0x13035c,0x130364 10a397: 03 13 00 } rtems_chain_initialize_empty (&aio_request_queue.work_req); rtems_chain_initialize_empty (&aio_request_queue.idle_req); aio_request_queue.active_threads = 0; 10a39a: c7 05 6c 03 13 00 00 movl $0x0,0x13036c 10a3a1: 00 00 00 aio_request_queue.idle_threads = 0; 10a3a4: c7 05 70 03 13 00 00 movl $0x0,0x130370 10a3ab: 00 00 00 aio_request_queue.initialized = AIO_QUEUE_INITIALIZED; 10a3ae: c7 05 68 03 13 00 0b movl $0xb00b,0x130368 10a3b5: b0 00 00 return result; } 10a3b8: 89 d8 mov %ebx,%eax 10a3ba: 8b 5d fc mov -0x4(%ebp),%ebx 10a3bd: c9 leave 10a3be: c3 ret =============================================================================== 0010a278 : * NONE */ static void rtems_aio_insert_prio (rtems_chain_control *chain, rtems_aio_request *req) { 10a278: 55 push %ebp 10a279: 89 e5 mov %esp,%ebp 10a27b: 56 push %esi 10a27c: 53 push %ebx 10a27d: 8b 08 mov (%eax),%ecx RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 10a27f: 8d 58 04 lea 0x4(%eax),%ebx rtems_chain_node *node; AIO_printf ("FD exists \n"); node = rtems_chain_first (chain); if (rtems_chain_is_empty (chain)) { 10a282: 39 d9 cmp %ebx,%ecx 10a284: 75 06 jne 10a28c <== ALWAYS TAKEN RTEMS_INLINE_ROUTINE void _Chain_Prepend( Chain_Control *the_chain, Chain_Node *the_node ) { _Chain_Insert(_Chain_Head(the_chain), the_node); 10a286: 56 push %esi <== NOT EXECUTED 10a287: 56 push %esi <== NOT EXECUTED 10a288: 52 push %edx <== NOT EXECUTED 10a289: 50 push %eax <== NOT EXECUTED 10a28a: eb 20 jmp 10a2ac <== NOT EXECUTED AIO_printf ("First in chain \n"); rtems_chain_prepend (chain, &req->next_prio); } else { AIO_printf ("Add by priority \n"); int prio = ((rtems_aio_request *) node)->aiocbp->aio_reqprio; 10a28c: 8b 41 14 mov 0x14(%ecx),%eax 10a28f: 8b 40 14 mov 0x14(%eax),%eax while (req->aiocbp->aio_reqprio > prio && 10a292: 8b 72 14 mov 0x14(%edx),%esi 10a295: 8b 76 14 mov 0x14(%esi),%esi 10a298: eb 08 jmp 10a2a2 } } AIO_printf ("Thread finished\n"); return NULL; } 10a29a: 8b 09 mov (%ecx),%ecx <== NOT EXECUTED int prio = ((rtems_aio_request *) node)->aiocbp->aio_reqprio; while (req->aiocbp->aio_reqprio > prio && !rtems_chain_is_tail (chain, node)) { node = rtems_chain_next (node); prio = ((rtems_aio_request *) node)->aiocbp->aio_reqprio; 10a29c: 8b 41 14 mov 0x14(%ecx),%eax <== NOT EXECUTED 10a29f: 8b 40 14 mov 0x14(%eax),%eax <== NOT EXECUTED rtems_chain_prepend (chain, &req->next_prio); } else { AIO_printf ("Add by priority \n"); int prio = ((rtems_aio_request *) node)->aiocbp->aio_reqprio; while (req->aiocbp->aio_reqprio > prio && 10a2a2: 39 c6 cmp %eax,%esi 10a2a4: 7f 10 jg 10a2b6 <== NEVER TAKEN 10a2a6: 53 push %ebx 10a2a7: 53 push %ebx 10a2a8: 52 push %edx 10a2a9: ff 71 04 pushl 0x4(%ecx) 10a2ac: e8 8f 22 00 00 call 10c540 <_Chain_Insert> 10a2b1: 83 c4 10 add $0x10,%esp 10a2b4: eb 06 jmp 10a2bc 10a2b6: 39 d9 cmp %ebx,%ecx <== NOT EXECUTED 10a2b8: 75 e0 jne 10a29a <== NOT EXECUTED 10a2ba: eb ea jmp 10a2a6 <== NOT EXECUTED } rtems_chain_insert (node->previous, &req->next_prio); } } 10a2bc: 8d 65 f8 lea -0x8(%ebp),%esp 10a2bf: 5b pop %ebx 10a2c0: 5e pop %esi 10a2c1: 5d pop %ebp 10a2c2: c3 ret =============================================================================== 0010a496 : * AIO_NOTCANCELED - if request was not canceled * AIO_CANCELED - if request was canceled */ int rtems_aio_remove_req (rtems_chain_control *chain, struct aiocb *aiocbp) { 10a496: 55 push %ebp 10a497: 89 e5 mov %esp,%ebp 10a499: 53 push %ebx 10a49a: 50 push %eax 10a49b: 8b 55 08 mov 0x8(%ebp),%edx 10a49e: 8b 45 0c mov 0xc(%ebp),%eax */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; 10a4a1: 8b 1a mov (%edx),%ebx RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 10a4a3: 83 c2 04 add $0x4,%edx if (rtems_chain_is_empty (chain)) 10a4a6: 39 d3 cmp %edx,%ebx 10a4a8: 75 0f jne 10a4b9 10a4aa: eb 44 jmp 10a4f0 } } AIO_printf ("Thread finished\n"); return NULL; } 10a4ac: 8b 1b mov (%ebx),%ebx <== NOT EXECUTED rtems_chain_node *node = rtems_chain_first (chain); rtems_aio_request *current; current = (rtems_aio_request *) node; while (!rtems_chain_is_tail (chain, node) && current->aiocbp != aiocbp) { 10a4ae: 39 d3 cmp %edx,%ebx <== NOT EXECUTED 10a4b0: 75 07 jne 10a4b9 <== NOT EXECUTED node = rtems_chain_next (node); current = (rtems_aio_request *) node; } if (rtems_chain_is_tail (chain, node)) return AIO_NOTCANCELED; 10a4b2: b8 01 00 00 00 mov $0x1,%eax <== NOT EXECUTED 10a4b7: eb 3c jmp 10a4f5 <== NOT EXECUTED rtems_chain_node *node = rtems_chain_first (chain); rtems_aio_request *current; current = (rtems_aio_request *) node; while (!rtems_chain_is_tail (chain, node) && current->aiocbp != aiocbp) { 10a4b9: 39 43 14 cmp %eax,0x14(%ebx) 10a4bc: 75 ee jne 10a4ac <== NEVER TAKEN node = rtems_chain_next (node); current = (rtems_aio_request *) node; } if (rtems_chain_is_tail (chain, node)) return AIO_NOTCANCELED; 10a4be: b8 01 00 00 00 mov $0x1,%eax while (!rtems_chain_is_tail (chain, node) && current->aiocbp != aiocbp) { node = rtems_chain_next (node); current = (rtems_aio_request *) node; } if (rtems_chain_is_tail (chain, node)) 10a4c3: 39 d3 cmp %edx,%ebx 10a4c5: 74 2e je 10a4f5 <== NEVER TAKEN 10a4c7: 83 ec 0c sub $0xc,%esp 10a4ca: 53 push %ebx 10a4cb: e8 34 20 00 00 call 10c504 <_Chain_Extract> return AIO_NOTCANCELED; else { rtems_chain_extract (node); current->aiocbp->error_code = ECANCELED; 10a4d0: 8b 43 14 mov 0x14(%ebx),%eax 10a4d3: c7 40 30 8c 00 00 00 movl $0x8c,0x30(%eax) current->aiocbp->return_value = -1; 10a4da: c7 40 34 ff ff ff ff movl $0xffffffff,0x34(%eax) free (current); 10a4e1: 89 1c 24 mov %ebx,(%esp) 10a4e4: e8 6f c6 ff ff call 106b58 } return AIO_CANCELED; 10a4e9: 83 c4 10 add $0x10,%esp 10a4ec: 31 c0 xor %eax,%eax 10a4ee: eb 05 jmp 10a4f5 */ int rtems_aio_remove_req (rtems_chain_control *chain, struct aiocb *aiocbp) { if (rtems_chain_is_empty (chain)) return AIO_ALLDONE; 10a4f0: b8 02 00 00 00 mov $0x2,%eax current->aiocbp->return_value = -1; free (current); } return AIO_CANCELED; } 10a4f5: 8b 5d fc mov -0x4(%ebp),%ebx 10a4f8: c9 leave 10a4f9: c3 ret =============================================================================== 0010a718 : rtems_chain_control *chain, rtems_event_set events, rtems_interval timeout, rtems_chain_node **node_ptr ) { 10a718: 55 push %ebp 10a719: 89 e5 mov %esp,%ebp 10a71b: 56 push %esi 10a71c: 53 push %ebx 10a71d: 83 ec 10 sub $0x10,%esp while ( sc == RTEMS_SUCCESSFUL && (node = rtems_chain_get( chain )) == NULL ) { rtems_event_set out; sc = rtems_event_receive( 10a720: 8d 5d f4 lea -0xc(%ebp),%ebx 10a723: eb 15 jmp 10a73a 10a725: 53 push %ebx 10a726: ff 75 10 pushl 0x10(%ebp) 10a729: 6a 00 push $0x0 10a72b: ff 75 0c pushl 0xc(%ebp) 10a72e: e8 99 f5 ff ff call 109ccc ) { rtems_status_code sc = RTEMS_SUCCESSFUL; rtems_chain_node *node = NULL; while ( 10a733: 83 c4 10 add $0x10,%esp 10a736: 85 c0 test %eax,%eax 10a738: 75 16 jne 10a750 <== ALWAYS TAKEN */ RTEMS_INLINE_ROUTINE rtems_chain_node *rtems_chain_get( rtems_chain_control *the_chain ) { return _Chain_Get( the_chain ); 10a73a: 83 ec 0c sub $0xc,%esp 10a73d: ff 75 08 pushl 0x8(%ebp) 10a740: e8 cf 04 00 00 call 10ac14 <_Chain_Get> 10a745: 89 c6 mov %eax,%esi sc == RTEMS_SUCCESSFUL && (node = rtems_chain_get( chain )) == NULL 10a747: 83 c4 10 add $0x10,%esp 10a74a: 85 c0 test %eax,%eax 10a74c: 74 d7 je 10a725 10a74e: 31 c0 xor %eax,%eax timeout, &out ); } *node_ptr = node; 10a750: 8b 55 14 mov 0x14(%ebp),%edx 10a753: 89 32 mov %esi,(%edx) return sc; } 10a755: 8d 65 f8 lea -0x8(%ebp),%esp 10a758: 5b pop %ebx 10a759: 5e pop %esi 10a75a: 5d pop %ebp 10a75b: c3 ret =============================================================================== 0010c020 : #include #include void rtems_iterate_over_all_threads(rtems_per_thread_routine routine) { 10c020: 55 push %ebp 10c021: 89 e5 mov %esp,%ebp 10c023: 57 push %edi 10c024: 56 push %esi 10c025: 53 push %ebx 10c026: 83 ec 0c sub $0xc,%esp uint32_t i; uint32_t api_index; Thread_Control *the_thread; Objects_Information *information; if ( !routine ) 10c029: bb 01 00 00 00 mov $0x1,%ebx 10c02e: 83 7d 08 00 cmpl $0x0,0x8(%ebp) 10c032: 74 3a je 10c06e #if !defined(RTEMS_POSIX_API) || defined(RTEMS_DEBUG) if ( !_Objects_Information_table[ api_index ] ) continue; #endif information = _Objects_Information_table[ api_index ][ 1 ]; 10c034: 8b 04 9d 3c 0e 13 00 mov 0x130e3c(,%ebx,4),%eax 10c03b: 8b 78 04 mov 0x4(%eax),%edi if ( !information ) 10c03e: be 01 00 00 00 mov $0x1,%esi 10c043: 85 ff test %edi,%edi 10c045: 75 1d jne 10c064 Objects_Information *information; if ( !routine ) return; for ( api_index = 1 ; api_index <= OBJECTS_APIS_LAST ; api_index++ ) { 10c047: 43 inc %ebx 10c048: 83 fb 04 cmp $0x4,%ebx 10c04b: eb e5 jmp 10c032 information = _Objects_Information_table[ api_index ][ 1 ]; if ( !information ) continue; for ( i=1 ; i <= information->maximum ; i++ ) { the_thread = (Thread_Control *)information->local_table[ i ]; 10c04d: 8b 57 1c mov 0x1c(%edi),%edx 10c050: 8b 14 b2 mov (%edx,%esi,4),%edx if ( !the_thread ) 10c053: 85 d2 test %edx,%edx 10c055: 74 0c je 10c063 <== NEVER TAKEN continue; (*routine)(the_thread); 10c057: 83 ec 0c sub $0xc,%esp 10c05a: 52 push %edx 10c05b: 8b 45 08 mov 0x8(%ebp),%eax 10c05e: ff d0 call *%eax 10c060: 83 c4 10 add $0x10,%esp information = _Objects_Information_table[ api_index ][ 1 ]; if ( !information ) continue; for ( i=1 ; i <= information->maximum ; i++ ) { 10c063: 46 inc %esi 10c064: 0f b7 57 10 movzwl 0x10(%edi),%edx 10c068: 39 d6 cmp %edx,%esi 10c06a: 76 e1 jbe 10c04d 10c06c: eb d9 jmp 10c047 (*routine)(the_thread); } } } 10c06e: 8d 65 f4 lea -0xc(%ebp),%esp 10c071: 5b pop %ebx 10c072: 5e pop %esi 10c073: 5f pop %edi 10c074: 5d pop %ebp 10c075: c3 ret =============================================================================== 0010e848 : */ rtems_status_code rtems_message_queue_delete( rtems_id id ) { 10e848: 55 push %ebp 10e849: 89 e5 mov %esp,%ebp 10e84b: 53 push %ebx 10e84c: 83 ec 18 sub $0x18,%esp register Message_queue_Control *the_message_queue; Objects_Locations location; the_message_queue = _Message_queue_Get( id, &location ); 10e84f: 8d 45 f4 lea -0xc(%ebp),%eax RTEMS_INLINE_ROUTINE Message_queue_Control *_Message_queue_Get ( Objects_Id id, Objects_Locations *location ) { return (Message_queue_Control *) 10e852: 50 push %eax 10e853: ff 75 08 pushl 0x8(%ebp) 10e856: 68 94 ed 12 00 push $0x12ed94 10e85b: e8 08 ca ff ff call 10b268 <_Objects_Get> switch ( location ) { 10e860: 83 c4 10 add $0x10,%esp 10e863: 83 7d f4 00 cmpl $0x0,-0xc(%ebp) 10e867: 75 38 jne 10e8a1 <== NEVER TAKEN 10e869: 89 c3 mov %eax,%ebx case OBJECTS_LOCAL: _Objects_Close( &_Message_queue_Information, 10e86b: 50 push %eax 10e86c: 50 push %eax 10e86d: 53 push %ebx 10e86e: 68 94 ed 12 00 push $0x12ed94 10e873: e8 50 c6 ff ff call 10aec8 <_Objects_Close> &the_message_queue->Object ); _CORE_message_queue_Close( 10e878: 83 c4 0c add $0xc,%esp 10e87b: 6a 05 push $0x5 10e87d: 6a 00 push $0x0 10e87f: 8d 43 14 lea 0x14(%ebx),%eax 10e882: 50 push %eax 10e883: e8 a0 04 00 00 call 10ed28 <_CORE_message_queue_Close> */ RTEMS_INLINE_ROUTINE void _Message_queue_Free ( Message_queue_Control *the_message_queue ) { _Objects_Free( &_Message_queue_Information, &the_message_queue->Object ); 10e888: 5a pop %edx 10e889: 59 pop %ecx 10e88a: 53 push %ebx 10e88b: 68 94 ed 12 00 push $0x12ed94 10e890: e8 a7 c8 ff ff call 10b13c <_Objects_Free> 0, /* Not used */ 0 ); } #endif _Thread_Enable_dispatch(); 10e895: e8 72 d5 ff ff call 10be0c <_Thread_Enable_dispatch> 10e89a: 83 c4 10 add $0x10,%esp return RTEMS_SUCCESSFUL; 10e89d: 31 c0 xor %eax,%eax 10e89f: eb 05 jmp 10e8a6 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 10e8a1: b8 04 00 00 00 mov $0x4,%eax } 10e8a6: 8b 5d fc mov -0x4(%ebp),%ebx 10e8a9: c9 leave 10e8aa: c3 ret =============================================================================== 0010ae70 : uint32_t length, uint32_t buffer_size, rtems_attribute attribute_set, rtems_id *id ) { 10ae70: 55 push %ebp 10ae71: 89 e5 mov %esp,%ebp 10ae73: 57 push %edi 10ae74: 56 push %esi 10ae75: 53 push %ebx 10ae76: 83 ec 0c sub $0xc,%esp 10ae79: 8b 7d 0c mov 0xc(%ebp),%edi 10ae7c: 8b 75 14 mov 0x14(%ebp),%esi register Partition_Control *the_partition; if ( !rtems_is_name_valid( name ) ) return RTEMS_INVALID_NAME; 10ae7f: b8 03 00 00 00 mov $0x3,%eax rtems_id *id ) { register Partition_Control *the_partition; if ( !rtems_is_name_valid( name ) ) 10ae84: 83 7d 08 00 cmpl $0x0,0x8(%ebp) 10ae88: 0f 84 d9 00 00 00 je 10af67 return RTEMS_INVALID_NAME; if ( !starting_address ) 10ae8e: 85 ff test %edi,%edi 10ae90: 0f 84 c5 00 00 00 je 10af5b return RTEMS_INVALID_ADDRESS; if ( !id ) 10ae96: 83 7d 1c 00 cmpl $0x0,0x1c(%ebp) 10ae9a: 0f 84 bb 00 00 00 je 10af5b <== NEVER TAKEN return RTEMS_INVALID_ADDRESS; if ( length == 0 || buffer_size == 0 || length < buffer_size || 10aea0: 85 f6 test %esi,%esi 10aea2: 0f 84 ba 00 00 00 je 10af62 10aea8: 83 7d 10 00 cmpl $0x0,0x10(%ebp) 10aeac: 0f 84 b0 00 00 00 je 10af62 !_Partition_Is_buffer_size_aligned( buffer_size ) ) return RTEMS_INVALID_SIZE; 10aeb2: b0 08 mov $0x8,%al return RTEMS_INVALID_ADDRESS; if ( !id ) return RTEMS_INVALID_ADDRESS; if ( length == 0 || buffer_size == 0 || length < buffer_size || 10aeb4: 39 75 10 cmp %esi,0x10(%ebp) 10aeb7: 0f 82 aa 00 00 00 jb 10af67 10aebd: f7 c6 03 00 00 00 test $0x3,%esi 10aec3: 0f 85 9e 00 00 00 jne 10af67 if ( !rtems_is_name_valid( name ) ) return RTEMS_INVALID_NAME; if ( !starting_address ) return RTEMS_INVALID_ADDRESS; 10aec9: b0 09 mov $0x9,%al if ( length == 0 || buffer_size == 0 || length < buffer_size || !_Partition_Is_buffer_size_aligned( buffer_size ) ) return RTEMS_INVALID_SIZE; if ( !_Addresses_Is_aligned( starting_address ) ) 10aecb: f7 c7 03 00 00 00 test $0x3,%edi 10aed1: 0f 85 90 00 00 00 jne 10af67 * * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { _Thread_Dispatch_disable_level++; 10aed7: a1 b4 31 13 00 mov 0x1331b4,%eax 10aedc: 40 inc %eax 10aedd: a3 b4 31 13 00 mov %eax,0x1331b4 return _Thread_Dispatch_disable_level; 10aee2: a1 b4 31 13 00 mov 0x1331b4,%eax * 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 ); 10aee7: 83 ec 0c sub $0xc,%esp 10aeea: 68 30 30 13 00 push $0x133030 10aeef: e8 c4 17 00 00 call 10c6b8 <_Objects_Allocate> 10aef4: 89 c3 mov %eax,%ebx _Thread_Disable_dispatch(); /* prevents deletion */ the_partition = _Partition_Allocate(); if ( !the_partition ) { 10aef6: 83 c4 10 add $0x10,%esp 10aef9: 85 c0 test %eax,%eax 10aefb: 75 0c jne 10af09 _Thread_Enable_dispatch(); 10aefd: e8 ba 27 00 00 call 10d6bc <_Thread_Enable_dispatch> return RTEMS_TOO_MANY; 10af02: b8 05 00 00 00 mov $0x5,%eax 10af07: eb 5e jmp 10af67 _Thread_Enable_dispatch(); return RTEMS_TOO_MANY; } #endif the_partition->starting_address = starting_address; 10af09: 89 78 10 mov %edi,0x10(%eax) the_partition->length = length; 10af0c: 8b 45 10 mov 0x10(%ebp),%eax 10af0f: 89 43 14 mov %eax,0x14(%ebx) the_partition->buffer_size = buffer_size; 10af12: 89 73 18 mov %esi,0x18(%ebx) the_partition->attribute_set = attribute_set; 10af15: 8b 45 18 mov 0x18(%ebp),%eax 10af18: 89 43 1c mov %eax,0x1c(%ebx) the_partition->number_of_used_blocks = 0; 10af1b: c7 43 20 00 00 00 00 movl $0x0,0x20(%ebx) _Chain_Initialize( &the_partition->Memory, starting_address, 10af22: 56 push %esi 10af23: 8b 45 10 mov 0x10(%ebp),%eax 10af26: 31 d2 xor %edx,%edx 10af28: f7 f6 div %esi 10af2a: 50 push %eax 10af2b: 57 push %edi 10af2c: 8d 43 24 lea 0x24(%ebx),%eax 10af2f: 50 push %eax 10af30: e8 3f 0f 00 00 call 10be74 <_Chain_Initialize> Objects_Name name ) { _Objects_Set_local_object( information, _Objects_Get_index( the_object->id ), 10af35: 8b 43 08 mov 0x8(%ebx),%eax Objects_Information *information, Objects_Control *the_object, Objects_Name name ) { _Objects_Set_local_object( 10af38: 0f b7 c8 movzwl %ax,%ecx #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 10af3b: 8b 15 4c 30 13 00 mov 0x13304c,%edx 10af41: 89 1c 8a mov %ebx,(%edx,%ecx,4) information, _Objects_Get_index( the_object->id ), the_object ); the_object->name = name; 10af44: 8b 55 08 mov 0x8(%ebp),%edx 10af47: 89 53 0c mov %edx,0xc(%ebx) &_Partition_Information, &the_partition->Object, (Objects_Name) name ); *id = the_partition->Object.id; 10af4a: 8b 55 1c mov 0x1c(%ebp),%edx 10af4d: 89 02 mov %eax,(%edx) name, 0 /* Not used */ ); #endif _Thread_Enable_dispatch(); 10af4f: e8 68 27 00 00 call 10d6bc <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 10af54: 83 c4 10 add $0x10,%esp 10af57: 31 c0 xor %eax,%eax 10af59: eb 0c jmp 10af67 if ( !rtems_is_name_valid( name ) ) return RTEMS_INVALID_NAME; if ( !starting_address ) return RTEMS_INVALID_ADDRESS; 10af5b: b8 09 00 00 00 mov $0x9,%eax 10af60: eb 05 jmp 10af67 if ( !id ) return RTEMS_INVALID_ADDRESS; if ( length == 0 || buffer_size == 0 || length < buffer_size || !_Partition_Is_buffer_size_aligned( buffer_size ) ) return RTEMS_INVALID_SIZE; 10af62: b8 08 00 00 00 mov $0x8,%eax ); #endif _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } 10af67: 8d 65 f4 lea -0xc(%ebp),%esp 10af6a: 5b pop %ebx 10af6b: 5e pop %esi 10af6c: 5f pop %edi 10af6d: 5d pop %ebp 10af6e: c3 ret =============================================================================== 0011445c : rtems_status_code rtems_partition_return_buffer( rtems_id id, void *buffer ) { 11445c: 55 push %ebp 11445d: 89 e5 mov %esp,%ebp 11445f: 56 push %esi 114460: 53 push %ebx 114461: 83 ec 14 sub $0x14,%esp 114464: 8b 75 0c mov 0xc(%ebp),%esi register Partition_Control *the_partition; Objects_Locations location; the_partition = _Partition_Get( id, &location ); 114467: 8d 45 f4 lea -0xc(%ebp),%eax RTEMS_INLINE_ROUTINE Partition_Control *_Partition_Get ( Objects_Id id, Objects_Locations *location ) { return (Partition_Control *) 11446a: 50 push %eax 11446b: ff 75 08 pushl 0x8(%ebp) 11446e: 68 d0 7c 14 00 push $0x147cd0 114473: e8 78 43 00 00 call 1187f0 <_Objects_Get> switch ( location ) { 114478: 83 c4 10 add $0x10,%esp 11447b: 83 7d f4 00 cmpl $0x0,-0xc(%ebp) 11447f: 75 53 jne 1144d4 114481: 89 c3 mov %eax,%ebx ) { void *starting; void *ending; starting = the_partition->starting_address; 114483: 8b 40 10 mov 0x10(%eax),%eax 114486: 8b 53 14 mov 0x14(%ebx),%edx 114489: 01 c2 add %eax,%edx ending = _Addresses_Add_offset( starting, the_partition->length ); return ( _Addresses_Is_in_range( the_buffer, starting, ending ) && 11448b: 39 d6 cmp %edx,%esi 11448d: 77 18 ja 1144a7 <== NEVER TAKEN 11448f: 39 c6 cmp %eax,%esi 114491: 72 14 jb 1144a7 RTEMS_INLINE_ROUTINE int32_t _Addresses_Subtract ( const void *left, const void *right ) { return (int32_t) ((const char *) left - (const char *) right); 114493: 89 f2 mov %esi,%edx 114495: 29 c2 sub %eax,%edx 114497: 89 d0 mov %edx,%eax offset = (uint32_t) _Addresses_Subtract( the_buffer, the_partition->starting_address ); return ((offset % the_partition->buffer_size) == 0); 114499: 31 d2 xor %edx,%edx 11449b: f7 73 18 divl 0x18(%ebx) starting = the_partition->starting_address; ending = _Addresses_Add_offset( starting, the_partition->length ); return ( _Addresses_Is_in_range( the_buffer, starting, ending ) && 11449e: 31 c0 xor %eax,%eax 1144a0: 85 d2 test %edx,%edx 1144a2: 0f 94 c0 sete %al 1144a5: eb 02 jmp 1144a9 1144a7: 31 c0 xor %eax,%eax case OBJECTS_LOCAL: if ( _Partition_Is_buffer_valid( buffer, the_partition ) ) { 1144a9: 85 c0 test %eax,%eax 1144ab: 74 1b je 1144c8 RTEMS_INLINE_ROUTINE void _Partition_Free_buffer ( Partition_Control *the_partition, Chain_Node *the_buffer ) { _Chain_Append( &the_partition->Memory, the_buffer ); 1144ad: 50 push %eax 1144ae: 50 push %eax 1144af: 56 push %esi 1144b0: 8d 43 24 lea 0x24(%ebx),%eax 1144b3: 50 push %eax 1144b4: e8 db 2a 00 00 call 116f94 <_Chain_Append> _Partition_Free_buffer( the_partition, buffer ); the_partition->number_of_used_blocks -= 1; 1144b9: ff 4b 20 decl 0x20(%ebx) _Thread_Enable_dispatch(); 1144bc: e8 d3 4e 00 00 call 119394 <_Thread_Enable_dispatch> 1144c1: 83 c4 10 add $0x10,%esp return RTEMS_SUCCESSFUL; 1144c4: 31 c0 xor %eax,%eax 1144c6: eb 11 jmp 1144d9 } _Thread_Enable_dispatch(); 1144c8: e8 c7 4e 00 00 call 119394 <_Thread_Enable_dispatch> return RTEMS_INVALID_ADDRESS; 1144cd: b8 09 00 00 00 mov $0x9,%eax 1144d2: eb 05 jmp 1144d9 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 1144d4: b8 04 00 00 00 mov $0x4,%eax } 1144d9: 8d 65 f8 lea -0x8(%ebp),%esp 1144dc: 5b pop %ebx 1144dd: 5e pop %esi 1144de: 5d pop %ebp 1144df: c3 ret =============================================================================== 0012dd58 : rtems_status_code rtems_rate_monotonic_period( rtems_id id, rtems_interval length ) { 12dd58: 55 push %ebp 12dd59: 89 e5 mov %esp,%ebp 12dd5b: 57 push %edi 12dd5c: 56 push %esi 12dd5d: 53 push %ebx 12dd5e: 83 ec 30 sub $0x30,%esp 12dd61: 8b 7d 08 mov 0x8(%ebp),%edi 12dd64: 8b 5d 0c mov 0xc(%ebp),%ebx Objects_Locations location; rtems_status_code return_value; rtems_rate_monotonic_period_states local_state; ISR_Level level; the_period = _Rate_monotonic_Get( id, &location ); 12dd67: 8d 45 e4 lea -0x1c(%ebp),%eax 12dd6a: 50 push %eax 12dd6b: 57 push %edi 12dd6c: 68 a0 ec 16 00 push $0x16eca0 12dd71: e8 ca d2 fd ff call 10b040 <_Objects_Get> switch ( location ) { 12dd76: 83 c4 10 add $0x10,%esp 12dd79: 83 7d e4 00 cmpl $0x0,-0x1c(%ebp) 12dd7d: 0f 85 47 01 00 00 jne 12deca 12dd83: 89 c6 mov %eax,%esi case OBJECTS_LOCAL: if ( !_Thread_Is_executing( the_period->owner ) ) { 12dd85: a1 04 e7 16 00 mov 0x16e704,%eax 12dd8a: 39 46 40 cmp %eax,0x40(%esi) 12dd8d: 74 0f je 12dd9e _Thread_Enable_dispatch(); 12dd8f: e8 e0 dd fd ff call 10bb74 <_Thread_Enable_dispatch> return RTEMS_NOT_OWNER_OF_RESOURCE; 12dd94: bf 17 00 00 00 mov $0x17,%edi 12dd99: e9 31 01 00 00 jmp 12decf } if ( length == RTEMS_PERIOD_STATUS ) { 12dd9e: 85 db test %ebx,%ebx 12dda0: 75 1b jne 12ddbd switch ( the_period->state ) { 12dda2: 8b 46 38 mov 0x38(%esi),%eax 12dda5: 31 ff xor %edi,%edi 12dda7: 83 f8 04 cmp $0x4,%eax 12ddaa: 77 07 ja 12ddb3 <== NEVER TAKEN case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 12ddac: 0f b6 b8 08 31 15 00 movzbl 0x153108(%eax),%edi case RATE_MONOTONIC_ACTIVE: default: /* unreached -- only to remove warnings */ return_value = RTEMS_SUCCESSFUL; break; } _Thread_Enable_dispatch(); 12ddb3: e8 bc dd fd ff call 10bb74 <_Thread_Enable_dispatch> 12ddb8: e9 12 01 00 00 jmp 12decf return( return_value ); } _ISR_Disable( level ); 12ddbd: 9c pushf 12ddbe: fa cli 12ddbf: 8f 45 d4 popl -0x2c(%ebp) if ( the_period->state == RATE_MONOTONIC_INACTIVE ) { 12ddc2: 8b 46 38 mov 0x38(%esi),%eax 12ddc5: 85 c0 test %eax,%eax 12ddc7: 75 4c jne 12de15 _ISR_Enable( level ); 12ddc9: ff 75 d4 pushl -0x2c(%ebp) 12ddcc: 9d popf the_period->next_length = length; 12ddcd: 89 5e 3c mov %ebx,0x3c(%esi) /* * Baseline statistics information for the beginning of a period. */ _Rate_monotonic_Initiate_statistics( the_period ); 12ddd0: 83 ec 0c sub $0xc,%esp 12ddd3: 56 push %esi 12ddd4: e8 0f ff ff ff call 12dce8 <_Rate_monotonic_Initiate_statistics> the_period->state = RATE_MONOTONIC_ACTIVE; 12ddd9: c7 46 38 02 00 00 00 movl $0x2,0x38(%esi) Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 12dde0: c7 46 18 00 00 00 00 movl $0x0,0x18(%esi) the_watchdog->routine = routine; 12dde7: c7 46 2c dc de 12 00 movl $0x12dedc,0x2c(%esi) the_watchdog->id = id; 12ddee: 89 7e 30 mov %edi,0x30(%esi) the_watchdog->user_data = user_data; 12ddf1: c7 46 34 00 00 00 00 movl $0x0,0x34(%esi) Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 12ddf8: 89 5e 1c mov %ebx,0x1c(%esi) _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 12ddfb: 59 pop %ecx 12ddfc: 5b pop %ebx _Rate_monotonic_Timeout, id, NULL ); _Watchdog_Insert_ticks( &the_period->Timer, length ); 12ddfd: 8d 56 10 lea 0x10(%esi),%edx 12de00: 52 push %edx 12de01: 68 a0 e2 16 00 push $0x16e2a0 12de06: e8 61 e8 fd ff call 10c66c <_Watchdog_Insert> _Thread_Enable_dispatch(); 12de0b: e8 64 dd fd ff call 10bb74 <_Thread_Enable_dispatch> 12de10: 83 c4 10 add $0x10,%esp 12de13: eb 63 jmp 12de78 return RTEMS_SUCCESSFUL; } if ( the_period->state == RATE_MONOTONIC_ACTIVE ) { 12de15: 83 f8 02 cmp $0x2,%eax 12de18: 75 62 jne 12de7c /* * Update statistics from the concluding period. */ _Rate_monotonic_Update_statistics( the_period ); 12de1a: 89 f0 mov %esi,%eax 12de1c: e8 28 fe ff ff call 12dc49 <_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; 12de21: c7 46 38 01 00 00 00 movl $0x1,0x38(%esi) the_period->next_length = length; 12de28: 89 5e 3c mov %ebx,0x3c(%esi) _ISR_Enable( level ); 12de2b: ff 75 d4 pushl -0x2c(%ebp) 12de2e: 9d popf _Thread_Executing->Wait.id = the_period->Object.id; 12de2f: a1 04 e7 16 00 mov 0x16e704,%eax 12de34: 8b 4e 08 mov 0x8(%esi),%ecx 12de37: 89 48 20 mov %ecx,0x20(%eax) _Thread_Set_state( _Thread_Executing, STATES_WAITING_FOR_PERIOD ); 12de3a: 52 push %edx 12de3b: 52 push %edx 12de3c: 68 00 40 00 00 push $0x4000 12de41: 50 push %eax 12de42: e8 95 e4 fd ff call 10c2dc <_Thread_Set_state> /* * Did the watchdog timer expire while we were actually blocking * on it? */ _ISR_Disable( level ); 12de47: 9c pushf 12de48: fa cli 12de49: 59 pop %ecx local_state = the_period->state; 12de4a: 8b 46 38 mov 0x38(%esi),%eax the_period->state = RATE_MONOTONIC_ACTIVE; 12de4d: c7 46 38 02 00 00 00 movl $0x2,0x38(%esi) _ISR_Enable( level ); 12de54: 51 push %ecx 12de55: 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 ) 12de56: 83 c4 10 add $0x10,%esp 12de59: 83 f8 03 cmp $0x3,%eax 12de5c: 75 15 jne 12de73 _Thread_Clear_state( _Thread_Executing, STATES_WAITING_FOR_PERIOD ); 12de5e: 50 push %eax 12de5f: 50 push %eax 12de60: 68 00 40 00 00 push $0x4000 12de65: ff 35 04 e7 16 00 pushl 0x16e704 12de6b: e8 d4 d9 fd ff call 10b844 <_Thread_Clear_state> 12de70: 83 c4 10 add $0x10,%esp _Thread_Enable_dispatch(); 12de73: e8 fc dc fd ff call 10bb74 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 12de78: 31 ff xor %edi,%edi 12de7a: eb 53 jmp 12decf #endif case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 12de7c: bf 04 00 00 00 mov $0x4,%edi _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } if ( the_period->state == RATE_MONOTONIC_EXPIRED ) { 12de81: 83 f8 04 cmp $0x4,%eax 12de84: 75 49 jne 12decf <== NEVER TAKEN /* * Update statistics from the concluding period */ _Rate_monotonic_Update_statistics( the_period ); 12de86: 89 f0 mov %esi,%eax 12de88: e8 bc fd ff ff call 12dc49 <_Rate_monotonic_Update_statistics> _ISR_Enable( level ); 12de8d: ff 75 d4 pushl -0x2c(%ebp) 12de90: 9d popf the_period->state = RATE_MONOTONIC_ACTIVE; 12de91: c7 46 38 02 00 00 00 movl $0x2,0x38(%esi) the_period->next_length = length; 12de98: 89 5e 3c mov %ebx,0x3c(%esi) Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 12de9b: 89 5e 1c mov %ebx,0x1c(%esi) _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 12de9e: 51 push %ecx 12de9f: 51 push %ecx _Watchdog_Insert_ticks( &the_period->Timer, length ); 12dea0: 8d 46 10 lea 0x10(%esi),%eax 12dea3: 50 push %eax 12dea4: 68 a0 e2 16 00 push $0x16e2a0 12dea9: e8 be e7 fd ff call 10c66c <_Watchdog_Insert> 12deae: 5b pop %ebx 12deaf: 58 pop %eax 12deb0: ff 76 3c pushl 0x3c(%esi) 12deb3: ff 76 40 pushl 0x40(%esi) 12deb6: ff 15 10 69 16 00 call *0x166910 _Scheduler_Release_job(the_period->owner, the_period->next_length); _Thread_Enable_dispatch(); 12debc: e8 b3 dc fd ff call 10bb74 <_Thread_Enable_dispatch> 12dec1: 83 c4 10 add $0x10,%esp return RTEMS_TIMEOUT; 12dec4: 66 bf 06 00 mov $0x6,%di 12dec8: eb 05 jmp 12decf #endif case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 12deca: bf 04 00 00 00 mov $0x4,%edi } 12decf: 89 f8 mov %edi,%eax 12ded1: 8d 65 f4 lea -0xc(%ebp),%esp 12ded4: 5b pop %ebx 12ded5: 5e pop %esi 12ded6: 5f pop %edi 12ded7: 5d pop %ebp 12ded8: c3 ret =============================================================================== 00123b14 : */ void rtems_rate_monotonic_report_statistics_with_plugin( void *context, rtems_printk_plugin_t print ) { 123b14: 55 push %ebp 123b15: 89 e5 mov %esp,%ebp 123b17: 57 push %edi 123b18: 56 push %esi 123b19: 53 push %ebx 123b1a: 83 ec 7c sub $0x7c,%esp 123b1d: 8b 75 08 mov 0x8(%ebp),%esi 123b20: 8b 5d 0c mov 0xc(%ebp),%ebx rtems_id id; rtems_rate_monotonic_period_statistics the_stats; rtems_rate_monotonic_period_status the_status; char name[5]; if ( !print ) 123b23: 85 db test %ebx,%ebx 123b25: 0f 84 2e 01 00 00 je 123c59 <== NEVER TAKEN return; (*print)( context, "Period information by period\n" ); 123b2b: 57 push %edi 123b2c: 57 push %edi 123b2d: 68 4c 05 15 00 push $0x15054c 123b32: 56 push %esi 123b33: ff d3 call *%ebx #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ (*print)( context, "--- CPU times are in seconds ---\n" ); 123b35: 58 pop %eax 123b36: 5a pop %edx 123b37: 68 6a 05 15 00 push $0x15056a 123b3c: 56 push %esi 123b3d: ff d3 call *%ebx (*print)( context, "--- Wall times are in seconds ---\n" ); 123b3f: 59 pop %ecx 123b40: 5f pop %edi 123b41: 68 8c 05 15 00 push $0x15058c 123b46: 56 push %esi 123b47: ff d3 call *%ebx Be sure to test the various cases. (*print)( context,"\ 1234567890123456789012345678901234567890123456789012345678901234567890123456789\ \n"); */ (*print)( context, " ID OWNER COUNT MISSED " 123b49: 58 pop %eax 123b4a: 5a pop %edx 123b4b: 68 af 05 15 00 push $0x1505af 123b50: 56 push %esi 123b51: ff d3 call *%ebx #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ " " #endif " WALL TIME\n" ); (*print)( context, " " 123b53: 59 pop %ecx 123b54: 5f pop %edi 123b55: 68 fa 05 15 00 push $0x1505fa 123b5a: 56 push %esi 123b5b: ff d3 call *%ebx /* * 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 ; 123b5d: 8b 3d a8 ec 16 00 mov 0x16eca8,%edi 123b63: 83 c4 10 add $0x10,%esp 123b66: e9 e2 00 00 00 jmp 123c4d id <= _Rate_monotonic_Information.maximum_id ; id++ ) { status = rtems_rate_monotonic_get_statistics( id, &the_stats ); 123b6b: 51 push %ecx 123b6c: 51 push %ecx 123b6d: 8d 45 b0 lea -0x50(%ebp),%eax 123b70: 50 push %eax 123b71: 57 push %edi 123b72: e8 b9 9d 00 00 call 12d930 if ( status != RTEMS_SUCCESSFUL ) 123b77: 83 c4 10 add $0x10,%esp 123b7a: 85 c0 test %eax,%eax 123b7c: 0f 85 ca 00 00 00 jne 123c4c #if defined(RTEMS_DEBUG) status = rtems_rate_monotonic_get_status( id, &the_status ); if ( status != RTEMS_SUCCESSFUL ) continue; #else (void) rtems_rate_monotonic_get_status( id, &the_status ); 123b82: 50 push %eax 123b83: 50 push %eax 123b84: 8d 55 98 lea -0x68(%ebp),%edx 123b87: 52 push %edx 123b88: 57 push %edi 123b89: e8 2e 9f 00 00 call 12dabc #endif rtems_object_get_name( the_status.owner, sizeof(name), name ); 123b8e: 83 c4 0c add $0xc,%esp 123b91: 8d 55 8b lea -0x75(%ebp),%edx 123b94: 52 push %edx 123b95: 6a 05 push $0x5 123b97: ff 75 98 pushl -0x68(%ebp) 123b9a: 89 55 84 mov %edx,-0x7c(%ebp) 123b9d: e8 e2 c9 fe ff call 110584 /* * Print part of report line that is not dependent on granularity */ (*print)( context, 123ba2: 58 pop %eax 123ba3: 5a pop %edx 123ba4: ff 75 b4 pushl -0x4c(%ebp) 123ba7: ff 75 b0 pushl -0x50(%ebp) 123baa: 8b 55 84 mov -0x7c(%ebp),%edx 123bad: 52 push %edx 123bae: 57 push %edi 123baf: 68 46 06 15 00 push $0x150646 123bb4: 56 push %esi 123bb5: ff d3 call *%ebx ); /* * If the count is zero, don't print statistics */ if (the_stats.count == 0) { 123bb7: 8b 45 b0 mov -0x50(%ebp),%eax 123bba: 83 c4 20 add $0x20,%esp 123bbd: 85 c0 test %eax,%eax 123bbf: 75 0f jne 123bd0 (*print)( context, "\n" ); 123bc1: 51 push %ecx 123bc2: 51 push %ecx 123bc3: 68 29 b1 14 00 push $0x14b129 123bc8: 56 push %esi 123bc9: ff d3 call *%ebx continue; 123bcb: 83 c4 10 add $0x10,%esp 123bce: eb 7c jmp 123c4c 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 ); 123bd0: 52 push %edx 123bd1: 8d 55 90 lea -0x70(%ebp),%edx 123bd4: 52 push %edx 123bd5: 50 push %eax { #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ struct timespec cpu_average; struct timespec *min_cpu = &the_stats.min_cpu_time; struct timespec *max_cpu = &the_stats.max_cpu_time; struct timespec *total_cpu = &the_stats.total_cpu_time; 123bd6: 8d 45 c8 lea -0x38(%ebp),%eax _Timespec_Divide_by_integer( total_cpu, the_stats.count, &cpu_average ); 123bd9: 50 push %eax 123bda: e8 79 09 00 00 call 124558 <_Timespec_Divide_by_integer> (*print)( context, 123bdf: 8b 45 94 mov -0x6c(%ebp),%eax 123be2: b9 e8 03 00 00 mov $0x3e8,%ecx 123be7: 99 cltd 123be8: f7 f9 idiv %ecx 123bea: 50 push %eax 123beb: ff 75 90 pushl -0x70(%ebp) 123bee: 8b 45 c4 mov -0x3c(%ebp),%eax 123bf1: 99 cltd 123bf2: f7 f9 idiv %ecx 123bf4: 50 push %eax 123bf5: ff 75 c0 pushl -0x40(%ebp) 123bf8: 8b 45 bc mov -0x44(%ebp),%eax 123bfb: 99 cltd 123bfc: f7 f9 idiv %ecx 123bfe: 50 push %eax 123bff: ff 75 b8 pushl -0x48(%ebp) 123c02: 68 5d 06 15 00 push $0x15065d 123c07: 56 push %esi 123c08: 89 4d 84 mov %ecx,-0x7c(%ebp) 123c0b: ff d3 call *%ebx 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); 123c0d: 83 c4 2c add $0x2c,%esp 123c10: 8d 45 90 lea -0x70(%ebp),%eax 123c13: 50 push %eax 123c14: ff 75 b0 pushl -0x50(%ebp) { #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ struct timespec wall_average; struct timespec *min_wall = &the_stats.min_wall_time; struct timespec *max_wall = &the_stats.max_wall_time; struct timespec *total_wall = &the_stats.total_wall_time; 123c17: 8d 45 e0 lea -0x20(%ebp),%eax _Timespec_Divide_by_integer(total_wall, the_stats.count, &wall_average); 123c1a: 50 push %eax 123c1b: e8 38 09 00 00 call 124558 <_Timespec_Divide_by_integer> (*print)( context, 123c20: 8b 45 94 mov -0x6c(%ebp),%eax 123c23: 8b 4d 84 mov -0x7c(%ebp),%ecx 123c26: 99 cltd 123c27: f7 f9 idiv %ecx 123c29: 50 push %eax 123c2a: ff 75 90 pushl -0x70(%ebp) 123c2d: 8b 45 dc mov -0x24(%ebp),%eax 123c30: 99 cltd 123c31: f7 f9 idiv %ecx 123c33: 50 push %eax 123c34: ff 75 d8 pushl -0x28(%ebp) 123c37: 8b 45 d4 mov -0x2c(%ebp),%eax 123c3a: 99 cltd 123c3b: f7 f9 idiv %ecx 123c3d: 50 push %eax 123c3e: ff 75 d0 pushl -0x30(%ebp) 123c41: 68 7c 06 15 00 push $0x15067c 123c46: 56 push %esi 123c47: ff d3 call *%ebx 123c49: 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++ ) { 123c4c: 47 inc %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 ; 123c4d: 3b 3d ac ec 16 00 cmp 0x16ecac,%edi 123c53: 0f 86 12 ff ff ff jbe 123b6b the_stats.min_wall_time, the_stats.max_wall_time, ival_wall, fval_wall ); #endif } } } 123c59: 8d 65 f4 lea -0xc(%ebp),%esp 123c5c: 5b pop %ebx 123c5d: 5e pop %esi 123c5e: 5f pop %edi 123c5f: 5d pop %ebp 123c60: c3 ret =============================================================================== 0010abb5 : return big_enough; } void *rtems_rbheap_allocate(rtems_rbheap_control *control, size_t size) { 10abb5: 55 push %ebp 10abb6: 89 e5 mov %esp,%ebp 10abb8: 57 push %edi 10abb9: 56 push %esi 10abba: 53 push %ebx 10abbb: 83 ec 1c sub $0x1c,%esp 10abbe: 8b 4d 08 mov 0x8(%ebp),%ecx 10abc1: 8b 5d 0c mov 0xc(%ebp),%ebx void *ptr = NULL; rtems_chain_control *free_chain = &control->free_chunk_chain; rtems_rbtree_control *chunk_tree = &control->chunk_tree; uintptr_t alignment = control->alignment; 10abc4: 8b 79 30 mov 0x30(%ecx),%edi #include static uintptr_t align_up(uintptr_t alignment, uintptr_t value) { uintptr_t excess = value % alignment; 10abc7: 89 d8 mov %ebx,%eax 10abc9: 31 d2 xor %edx,%edx 10abcb: f7 f7 div %edi if (excess > 0) { 10abcd: 89 de mov %ebx,%esi 10abcf: 85 d2 test %edx,%edx 10abd1: 74 05 je 10abd8 <== ALWAYS TAKEN value += alignment - excess; 10abd3: 8d 34 3b lea (%ebx,%edi,1),%esi <== NOT EXECUTED 10abd6: 29 d6 sub %edx,%esi <== NOT EXECUTED rtems_chain_control *free_chain = &control->free_chunk_chain; rtems_rbtree_control *chunk_tree = &control->chunk_tree; uintptr_t alignment = control->alignment; uintptr_t aligned_size = align_up(alignment, size); if (size > 0 && size <= aligned_size) { 10abd8: 39 f3 cmp %esi,%ebx 10abda: 77 04 ja 10abe0 <== NEVER TAKEN 10abdc: 85 db test %ebx,%ebx 10abde: 75 07 jne 10abe7 return big_enough; } void *rtems_rbheap_allocate(rtems_rbheap_control *control, size_t size) { void *ptr = NULL; 10abe0: 31 c0 xor %eax,%eax 10abe2: e9 8f 00 00 00 jmp 10ac76 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; 10abe7: 8b 01 mov (%ecx),%eax rtems_chain_control *free_chain, size_t size ) { rtems_chain_node *current = rtems_chain_first(free_chain); const rtems_chain_node *tail = rtems_chain_tail(free_chain); 10abe9: 8d 51 04 lea 0x4(%ecx),%edx rtems_rbheap_chunk *big_enough = NULL; 10abec: 31 db xor %ebx,%ebx 10abee: eb 0e jmp 10abfe while (current != tail && big_enough == NULL) { rtems_rbheap_chunk *free_chunk = (rtems_rbheap_chunk *) current; if (free_chunk->size >= size) { 10abf0: 31 db xor %ebx,%ebx 10abf2: 39 70 1c cmp %esi,0x1c(%eax) 10abf5: 0f 93 c3 setae %bl 10abf8: f7 db neg %ebx 10abfa: 21 c3 and %eax,%ebx rtems_rbheap_chunk *chunk = malloc(sizeof(*chunk)); if (chunk != NULL) { rtems_rbheap_add_to_spare_descriptor_chain(control, chunk); } } 10abfc: 8b 00 mov (%eax),%eax { rtems_chain_node *current = rtems_chain_first(free_chain); const rtems_chain_node *tail = rtems_chain_tail(free_chain); rtems_rbheap_chunk *big_enough = NULL; while (current != tail && big_enough == NULL) { 10abfe: 85 db test %ebx,%ebx 10ac00: 75 04 jne 10ac06 10ac02: 39 d0 cmp %edx,%eax 10ac04: 75 ea jne 10abf0 uintptr_t aligned_size = align_up(alignment, size); if (size > 0 && size <= aligned_size) { rtems_rbheap_chunk *free_chunk = search_free_chunk(free_chain, aligned_size); if (free_chunk != NULL) { 10ac06: 85 db test %ebx,%ebx 10ac08: 74 d6 je 10abe0 uintptr_t free_size = free_chunk->size; 10ac0a: 8b 53 1c mov 0x1c(%ebx),%edx if (free_size > aligned_size) { 10ac0d: 39 f2 cmp %esi,%edx 10ac0f: 76 4b jbe 10ac5c rtems_rbheap_chunk *new_chunk = get_chunk(control); 10ac11: 89 c8 mov %ecx,%eax 10ac13: 89 55 e4 mov %edx,-0x1c(%ebp) 10ac16: 89 4d e0 mov %ecx,-0x20(%ebp) 10ac19: e8 49 fe ff ff call 10aa67 10ac1e: 89 c7 mov %eax,%edi if (new_chunk != NULL) { 10ac20: 85 c0 test %eax,%eax 10ac22: 8b 55 e4 mov -0x1c(%ebp),%edx 10ac25: 8b 4d e0 mov -0x20(%ebp),%ecx 10ac28: 74 b6 je 10abe0 <== NEVER TAKEN uintptr_t new_free_size = free_size - aligned_size; 10ac2a: 29 f2 sub %esi,%edx free_chunk->size = new_free_size; 10ac2c: 89 53 1c mov %edx,0x1c(%ebx) new_chunk->begin = free_chunk->begin + new_free_size; 10ac2f: 03 53 18 add 0x18(%ebx),%edx 10ac32: 89 50 18 mov %edx,0x18(%eax) new_chunk->size = aligned_size; 10ac35: 89 70 1c mov %esi,0x1c(%eax) */ RTEMS_INLINE_ROUTINE void _Chain_Set_off_chain( Chain_Node *node ) { node->next = node->previous = NULL; 10ac38: c7 40 04 00 00 00 00 movl $0x0,0x4(%eax) 10ac3f: c7 00 00 00 00 00 movl $0x0,(%eax) static void insert_into_tree( rtems_rbtree_control *tree, rtems_rbheap_chunk *chunk ) { _RBTree_Insert_unprotected(tree, &chunk->tree_node); 10ac45: 53 push %ebx 10ac46: 53 push %ebx 10ac47: 8d 40 08 lea 0x8(%eax),%eax 10ac4a: 50 push %eax void *rtems_rbheap_allocate(rtems_rbheap_control *control, size_t size) { void *ptr = NULL; rtems_chain_control *free_chain = &control->free_chunk_chain; rtems_rbtree_control *chunk_tree = &control->chunk_tree; 10ac4b: 83 c1 18 add $0x18,%ecx static void insert_into_tree( rtems_rbtree_control *tree, rtems_rbheap_chunk *chunk ) { _RBTree_Insert_unprotected(tree, &chunk->tree_node); 10ac4e: 51 push %ecx 10ac4f: e8 40 15 00 00 call 10c194 <_RBTree_Insert_unprotected> free_chunk->size = new_free_size; new_chunk->begin = free_chunk->begin + new_free_size; new_chunk->size = aligned_size; rtems_chain_set_off_chain(&new_chunk->chain_node); insert_into_tree(chunk_tree, new_chunk); ptr = (void *) new_chunk->begin; 10ac54: 8b 47 18 mov 0x18(%edi),%eax 10ac57: 83 c4 10 add $0x10,%esp 10ac5a: eb 1a jmp 10ac76 ) { Chain_Node *next; Chain_Node *previous; next = the_node->next; 10ac5c: 8b 13 mov (%ebx),%edx previous = the_node->previous; 10ac5e: 8b 43 04 mov 0x4(%ebx),%eax next->previous = previous; 10ac61: 89 42 04 mov %eax,0x4(%edx) previous->next = next; 10ac64: 89 10 mov %edx,(%eax) */ RTEMS_INLINE_ROUTINE void _Chain_Set_off_chain( Chain_Node *node ) { node->next = node->previous = NULL; 10ac66: c7 43 04 00 00 00 00 movl $0x0,0x4(%ebx) 10ac6d: c7 03 00 00 00 00 movl $0x0,(%ebx) } } else { rtems_chain_extract_unprotected(&free_chunk->chain_node); rtems_chain_set_off_chain(&free_chunk->chain_node); ptr = (void *) free_chunk->begin; 10ac73: 8b 43 18 mov 0x18(%ebx),%eax } } } return ptr; } 10ac76: 8d 65 f4 lea -0xc(%ebp),%esp 10ac79: 5b pop %ebx 10ac7a: 5e pop %esi 10ac7b: 5f pop %edi 10ac7c: 5d pop %ebp 10ac7d: c3 ret =============================================================================== 0010ad71 : void rtems_rbheap_extend_descriptors_with_malloc(rtems_rbheap_control *control) { 10ad71: 55 push %ebp <== NOT EXECUTED 10ad72: 89 e5 mov %esp,%ebp <== NOT EXECUTED 10ad74: 53 push %ebx <== NOT EXECUTED 10ad75: 83 ec 10 sub $0x10,%esp <== NOT EXECUTED 10ad78: 8b 5d 08 mov 0x8(%ebp),%ebx <== NOT EXECUTED rtems_rbheap_chunk *chunk = malloc(sizeof(*chunk)); 10ad7b: 6a 20 push $0x20 <== NOT EXECUTED 10ad7d: e8 f2 c1 ff ff call 106f74 <== NOT EXECUTED if (chunk != NULL) { 10ad82: 83 c4 10 add $0x10,%esp <== NOT EXECUTED 10ad85: 85 c0 test %eax,%eax <== NOT EXECUTED 10ad87: 74 11 je 10ad9a <== NOT EXECUTED RTEMS_INLINE_ROUTINE void _Chain_Prepend_unprotected( Chain_Control *the_chain, Chain_Node *the_node ) { _Chain_Insert_unprotected(_Chain_Head(the_chain), the_node); 10ad89: 8d 53 0c lea 0xc(%ebx),%edx <== NOT EXECUTED 10ad8c: 89 50 04 mov %edx,0x4(%eax) <== NOT EXECUTED ) { Chain_Node *before_node; the_node->previous = after_node; before_node = after_node->next; 10ad8f: 8b 53 0c mov 0xc(%ebx),%edx <== NOT EXECUTED after_node->next = the_node; 10ad92: 89 43 0c mov %eax,0xc(%ebx) <== NOT EXECUTED the_node->next = before_node; 10ad95: 89 10 mov %edx,(%eax) <== NOT EXECUTED before_node->previous = the_node; 10ad97: 89 42 04 mov %eax,0x4(%edx) <== NOT EXECUTED rtems_rbheap_add_to_spare_descriptor_chain(control, chunk); } } 10ad9a: 8b 5d fc mov -0x4(%ebp),%ebx <== NOT EXECUTED 10ad9d: c9 leave <== NOT EXECUTED 10ad9e: c3 ret <== NOT EXECUTED =============================================================================== 0010ac7e : _RBTree_Extract_unprotected(chunk_tree, &b->tree_node); } } rtems_status_code rtems_rbheap_free(rtems_rbheap_control *control, void *ptr) { 10ac7e: 55 push %ebp 10ac7f: 89 e5 mov %esp,%ebp 10ac81: 57 push %edi 10ac82: 56 push %esi 10ac83: 53 push %ebx 10ac84: 83 ec 3c sub $0x3c,%esp 10ac87: 8b 5d 08 mov 0x8(%ebp),%ebx 10ac8a: 8b 55 0c mov 0xc(%ebp),%edx rtems_status_code sc = RTEMS_SUCCESSFUL; if (ptr != NULL) { 10ac8d: 85 d2 test %edx,%edx 10ac8f: 0f 84 c6 00 00 00 je 10ad5b rtems_chain_control *free_chain = &control->free_chunk_chain; rtems_rbtree_control *chunk_tree = &control->chunk_tree; 10ac95: 8d 73 18 lea 0x18(%ebx),%esi #define NULL_PAGE rtems_rbheap_chunk_of_node(NULL) static rtems_rbheap_chunk *find(rtems_rbtree_control *chunk_tree, uintptr_t key) { rtems_rbheap_chunk chunk = { .begin = key }; 10ac98: 8d 7d c8 lea -0x38(%ebp),%edi 10ac9b: b9 08 00 00 00 mov $0x8,%ecx 10aca0: 31 c0 xor %eax,%eax 10aca2: f3 ab rep stos %eax,%es:(%edi) 10aca4: 89 55 e0 mov %edx,-0x20(%ebp) RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Find_unprotected( RBTree_Control *the_rbtree, RBTree_Node *the_node ) { RBTree_Node* iter_node = the_rbtree->root; 10aca7: 8b 53 1c mov 0x1c(%ebx),%edx RBTree_Node* found = NULL; 10acaa: 31 ff xor %edi,%edi return rtems_rbheap_chunk_of_node( 10acac: 8d 4d d0 lea -0x30(%ebp),%ecx 10acaf: eb 2e jmp 10acdf int compare_result; while (iter_node) { compare_result = the_rbtree->compare_function(the_node, iter_node); 10acb1: 50 push %eax 10acb2: 50 push %eax 10acb3: 52 push %edx 10acb4: 51 push %ecx 10acb5: 89 55 c0 mov %edx,-0x40(%ebp) 10acb8: 89 4d bc mov %ecx,-0x44(%ebp) 10acbb: ff 56 10 call *0x10(%esi) if ( _RBTree_Is_equal( compare_result ) ) { 10acbe: 83 c4 10 add $0x10,%esp 10acc1: 85 c0 test %eax,%eax 10acc3: 8b 55 c0 mov -0x40(%ebp),%edx 10acc6: 8b 4d bc mov -0x44(%ebp),%ecx 10acc9: 75 08 jne 10acd3 found = iter_node; if ( the_rbtree->is_unique ) 10accb: 80 7e 14 00 cmpb $0x0,0x14(%esi) 10accf: 75 14 jne 10ace5 <== ALWAYS TAKEN 10acd1: 89 d7 mov %edx,%edi <== NOT EXECUTED RTEMS_INLINE_ROUTINE bool _RBTree_Is_greater( int compare_result ) { return compare_result > 0; 10acd3: 85 c0 test %eax,%eax 10acd5: 0f 9f c0 setg %al 10acd8: 0f b6 c0 movzbl %al,%eax break; } RBTree_Direction dir = (RBTree_Direction) _RBTree_Is_greater( compare_result ); iter_node = iter_node->child[dir]; 10acdb: 8b 54 82 04 mov 0x4(%edx,%eax,4),%edx ) { RBTree_Node* iter_node = the_rbtree->root; RBTree_Node* found = NULL; int compare_result; while (iter_node) { 10acdf: 85 d2 test %edx,%edx 10ace1: 75 ce jne 10acb1 10ace3: 89 fa mov %edi,%edx 10ace5: 8d 7a f8 lea -0x8(%edx),%edi if (ptr != NULL) { rtems_chain_control *free_chain = &control->free_chunk_chain; rtems_rbtree_control *chunk_tree = &control->chunk_tree; rtems_rbheap_chunk *chunk = find(chunk_tree, (uintptr_t) ptr); if (chunk != NULL_PAGE) { 10ace8: 83 ff f8 cmp $0xfffffff8,%edi 10aceb: 74 72 je 10ad5f */ RTEMS_INLINE_ROUTINE bool _Chain_Is_node_off_chain( const Chain_Node *node ) { return (node->next == NULL) && (node->previous == NULL); 10aced: 31 c9 xor %ecx,%ecx 10acef: 83 7a f8 00 cmpl $0x0,-0x8(%edx) 10acf3: 75 09 jne 10acfe 10acf5: 31 c9 xor %ecx,%ecx 10acf7: 83 7f 04 00 cmpl $0x0,0x4(%edi) 10acfb: 0f 94 c1 sete %cl check_and_merge(free_chain, chunk_tree, chunk, succ); add_to_chain(free_chain, chunk); check_and_merge(free_chain, chunk_tree, chunk, pred); } else { sc = RTEMS_INCORRECT_STATE; 10acfe: b8 0e 00 00 00 mov $0xe,%eax rtems_chain_control *free_chain = &control->free_chunk_chain; rtems_rbtree_control *chunk_tree = &control->chunk_tree; rtems_rbheap_chunk *chunk = find(chunk_tree, (uintptr_t) ptr); if (chunk != NULL_PAGE) { if (!rtems_rbheap_is_chunk_free(chunk)) { 10ad03: 85 c9 test %ecx,%ecx 10ad05: 74 5d je 10ad64 static rtems_rbheap_chunk *get_next( const rtems_rbheap_chunk *chunk, RBTree_Direction dir ) { return rtems_rbheap_chunk_of_node( 10ad07: 8d 57 08 lea 0x8(%edi),%edx 10ad0a: 50 push %eax 10ad0b: 50 push %eax 10ad0c: 6a 00 push $0x0 10ad0e: 52 push %edx 10ad0f: 89 55 c0 mov %edx,-0x40(%ebp) 10ad12: e8 6d 16 00 00 call 10c384 <_RBTree_Next_unprotected> 10ad17: 89 45 c4 mov %eax,-0x3c(%ebp) 10ad1a: 58 pop %eax 10ad1b: 5a pop %edx 10ad1c: 6a 01 push $0x1 10ad1e: 8b 55 c0 mov -0x40(%ebp),%edx 10ad21: 52 push %edx 10ad22: e8 5d 16 00 00 call 10c384 <_RBTree_Next_unprotected> 10ad27: 83 e8 08 sub $0x8,%eax if (chunk != NULL_PAGE) { if (!rtems_rbheap_is_chunk_free(chunk)) { rtems_rbheap_chunk *pred = get_next(chunk, RBT_LEFT); rtems_rbheap_chunk *succ = get_next(chunk, RBT_RIGHT); check_and_merge(free_chain, chunk_tree, chunk, succ); 10ad2a: 89 04 24 mov %eax,(%esp) 10ad2d: 89 f9 mov %edi,%ecx 10ad2f: 89 f2 mov %esi,%edx 10ad31: 89 d8 mov %ebx,%eax 10ad33: e8 c5 fc ff ff call 10a9fd Chain_Node *the_node ) { Chain_Node *before_node; the_node->previous = after_node; 10ad38: 89 5f 04 mov %ebx,0x4(%edi) before_node = after_node->next; 10ad3b: 8b 03 mov (%ebx),%eax after_node->next = the_node; 10ad3d: 89 3b mov %edi,(%ebx) the_node->next = before_node; 10ad3f: 89 07 mov %eax,(%edi) before_node->previous = the_node; 10ad41: 89 78 04 mov %edi,0x4(%eax) static rtems_rbheap_chunk *get_next( const rtems_rbheap_chunk *chunk, RBTree_Direction dir ) { return rtems_rbheap_chunk_of_node( 10ad44: 8b 45 c4 mov -0x3c(%ebp),%eax 10ad47: 83 e8 08 sub $0x8,%eax rtems_rbheap_chunk *pred = get_next(chunk, RBT_LEFT); rtems_rbheap_chunk *succ = get_next(chunk, RBT_RIGHT); check_and_merge(free_chain, chunk_tree, chunk, succ); add_to_chain(free_chain, chunk); check_and_merge(free_chain, chunk_tree, chunk, pred); 10ad4a: 89 04 24 mov %eax,(%esp) 10ad4d: 89 f9 mov %edi,%ecx 10ad4f: 89 f2 mov %esi,%edx 10ad51: 89 d8 mov %ebx,%eax 10ad53: e8 a5 fc ff ff call 10a9fd 10ad58: 83 c4 10 add $0x10,%esp } } rtems_status_code rtems_rbheap_free(rtems_rbheap_control *control, void *ptr) { rtems_status_code sc = RTEMS_SUCCESSFUL; 10ad5b: 31 c0 xor %eax,%eax 10ad5d: eb 05 jmp 10ad64 check_and_merge(free_chain, chunk_tree, chunk, pred); } else { sc = RTEMS_INCORRECT_STATE; } } else { sc = RTEMS_INVALID_ID; 10ad5f: b8 04 00 00 00 mov $0x4,%eax } } return sc; } 10ad64: 8d 65 f4 lea -0xc(%ebp),%esp 10ad67: 5b pop %ebx 10ad68: 5e pop %esi 10ad69: 5f pop %edi 10ad6a: 5d pop %ebp 10ad6b: c3 ret =============================================================================== 00115724 : rtems_status_code rtems_signal_send( rtems_id id, rtems_signal_set signal_set ) { 115724: 55 push %ebp 115725: 89 e5 mov %esp,%ebp 115727: 53 push %ebx 115728: 83 ec 14 sub $0x14,%esp 11572b: 8b 5d 0c mov 0xc(%ebp),%ebx Objects_Locations location; RTEMS_API_Control *api; ASR_Information *asr; if ( !signal_set ) return RTEMS_INVALID_NUMBER; 11572e: b8 0a 00 00 00 mov $0xa,%eax register Thread_Control *the_thread; Objects_Locations location; RTEMS_API_Control *api; ASR_Information *asr; if ( !signal_set ) 115733: 85 db test %ebx,%ebx 115735: 74 6d je 1157a4 return RTEMS_INVALID_NUMBER; the_thread = _Thread_Get( id, &location ); 115737: 50 push %eax 115738: 50 push %eax 115739: 8d 45 f4 lea -0xc(%ebp),%eax 11573c: 50 push %eax 11573d: ff 75 08 pushl 0x8(%ebp) 115740: e8 6f 3c 00 00 call 1193b4 <_Thread_Get> switch ( location ) { 115745: 83 c4 10 add $0x10,%esp 115748: 83 7d f4 00 cmpl $0x0,-0xc(%ebp) 11574c: 75 51 jne 11579f case OBJECTS_LOCAL: api = the_thread->API_Extensions[ THREAD_API_RTEMS ]; 11574e: 8b 90 e4 00 00 00 mov 0xe4(%eax),%edx asr = &api->Signal; if ( ! _ASR_Is_null_handler( asr->handler ) ) { 115754: 83 7a 0c 00 cmpl $0x0,0xc(%edx) 115758: 74 39 je 115793 if ( asr->is_enabled ) { 11575a: 80 7a 08 00 cmpb $0x0,0x8(%edx) 11575e: 74 22 je 115782 rtems_signal_set *signal_set ) { ISR_Level _level; _ISR_Disable( _level ); 115760: 9c pushf 115761: fa cli 115762: 59 pop %ecx *signal_set |= signals; 115763: 09 5a 14 or %ebx,0x14(%edx) _ISR_Enable( _level ); 115766: 51 push %ecx 115767: 9d popf _ASR_Post_signals( signal_set, &asr->signals_posted ); if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) 115768: 83 3d 60 83 14 00 00 cmpl $0x0,0x148360 11576f: 74 19 je 11578a 115771: 3b 05 64 83 14 00 cmp 0x148364,%eax 115777: 75 11 jne 11578a <== NEVER TAKEN _Thread_Dispatch_necessary = true; 115779: c6 05 70 83 14 00 01 movb $0x1,0x148370 115780: eb 08 jmp 11578a rtems_signal_set *signal_set ) { ISR_Level _level; _ISR_Disable( _level ); 115782: 9c pushf 115783: fa cli 115784: 58 pop %eax *signal_set |= signals; 115785: 09 5a 18 or %ebx,0x18(%edx) _ISR_Enable( _level ); 115788: 50 push %eax 115789: 9d popf } else { _ASR_Post_signals( signal_set, &asr->signals_pending ); } _Thread_Enable_dispatch(); 11578a: e8 05 3c 00 00 call 119394 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 11578f: 31 c0 xor %eax,%eax 115791: eb 11 jmp 1157a4 } _Thread_Enable_dispatch(); 115793: e8 fc 3b 00 00 call 119394 <_Thread_Enable_dispatch> return RTEMS_NOT_DEFINED; 115798: b8 0b 00 00 00 mov $0xb,%eax 11579d: eb 05 jmp 1157a4 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 11579f: b8 04 00 00 00 mov $0x4,%eax } 1157a4: 8b 5d fc mov -0x4(%ebp),%ebx 1157a7: c9 leave 1157a8: c3 ret =============================================================================== 0010b68c : rtems_status_code rtems_task_get_note( rtems_id id, uint32_t notepad, uint32_t *note ) { 10b68c: 55 push %ebp 10b68d: 89 e5 mov %esp,%ebp 10b68f: 56 push %esi 10b690: 53 push %ebx 10b691: 83 ec 10 sub $0x10,%esp 10b694: 8b 55 08 mov 0x8(%ebp),%edx 10b697: 8b 75 0c mov 0xc(%ebp),%esi 10b69a: 8b 5d 10 mov 0x10(%ebp),%ebx register Thread_Control *the_thread; Objects_Locations location; RTEMS_API_Control *api; if ( !rtems_configuration_get_notepads_enabled() ) return RTEMS_NOT_CONFIGURED; 10b69d: b8 16 00 00 00 mov $0x16,%eax { register Thread_Control *the_thread; Objects_Locations location; RTEMS_API_Control *api; if ( !rtems_configuration_get_notepads_enabled() ) 10b6a2: 80 3d 54 cf 12 00 00 cmpb $0x0,0x12cf54 10b6a9: 74 5d je 10b708 <== NEVER TAKEN return RTEMS_NOT_CONFIGURED; if ( !note ) 10b6ab: 85 db test %ebx,%ebx 10b6ad: 74 4d je 10b6fc * NOTE: There is no check for < RTEMS_NOTEPAD_FIRST because that would * be checking an unsigned number for being negative. */ if ( notepad > RTEMS_NOTEPAD_LAST ) return RTEMS_INVALID_NUMBER; 10b6af: b0 0a mov $0xa,%al /* * NOTE: There is no check for < RTEMS_NOTEPAD_FIRST because that would * be checking an unsigned number for being negative. */ if ( notepad > RTEMS_NOTEPAD_LAST ) 10b6b1: 83 fe 0f cmp $0xf,%esi 10b6b4: 77 52 ja 10b708 /* * Optimize the most likely case to avoid the Thread_Dispatch. */ if ( _Objects_Are_ids_equal( id, OBJECTS_ID_OF_SELF ) || 10b6b6: 85 d2 test %edx,%edx 10b6b8: a1 3c 19 13 00 mov 0x13193c,%eax 10b6bd: 74 05 je 10b6c4 10b6bf: 3b 50 08 cmp 0x8(%eax),%edx 10b6c2: 75 0e jne 10b6d2 _Objects_Are_ids_equal( id, _Thread_Executing->Object.id ) ) { api = _Thread_Executing->API_Extensions[ THREAD_API_RTEMS ]; *note = api->Notepads[ notepad ]; 10b6c4: 8b 80 e4 00 00 00 mov 0xe4(%eax),%eax 10b6ca: 8b 44 b0 20 mov 0x20(%eax,%esi,4),%eax 10b6ce: 89 03 mov %eax,(%ebx) 10b6d0: eb 26 jmp 10b6f8 return RTEMS_SUCCESSFUL; } the_thread = _Thread_Get( id, &location ); 10b6d2: 50 push %eax 10b6d3: 50 push %eax 10b6d4: 8d 45 f4 lea -0xc(%ebp),%eax 10b6d7: 50 push %eax 10b6d8: 52 push %edx 10b6d9: e8 fe 1f 00 00 call 10d6dc <_Thread_Get> switch ( location ) { 10b6de: 83 c4 10 add $0x10,%esp 10b6e1: 83 7d f4 00 cmpl $0x0,-0xc(%ebp) 10b6e5: 75 1c jne 10b703 case OBJECTS_LOCAL: api = the_thread->API_Extensions[ THREAD_API_RTEMS ]; *note = api->Notepads[ notepad ]; 10b6e7: 8b 80 e4 00 00 00 mov 0xe4(%eax),%eax 10b6ed: 8b 44 b0 20 mov 0x20(%eax,%esi,4),%eax 10b6f1: 89 03 mov %eax,(%ebx) _Thread_Enable_dispatch(); 10b6f3: e8 c4 1f 00 00 call 10d6bc <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 10b6f8: 31 c0 xor %eax,%eax 10b6fa: eb 0c jmp 10b708 if ( !rtems_configuration_get_notepads_enabled() ) return RTEMS_NOT_CONFIGURED; if ( !note ) return RTEMS_INVALID_ADDRESS; 10b6fc: b8 09 00 00 00 mov $0x9,%eax 10b701: eb 05 jmp 10b708 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 10b703: b8 04 00 00 00 mov $0x4,%eax } 10b708: 8d 65 f8 lea -0x8(%ebp),%esp 10b70b: 5b pop %ebx 10b70c: 5e pop %esi 10b70d: 5d pop %ebp 10b70e: c3 ret =============================================================================== 00110a2c : rtems_status_code rtems_task_mode( rtems_mode mode_set, rtems_mode mask, rtems_mode *previous_mode_set ) { 110a2c: 55 push %ebp 110a2d: 89 e5 mov %esp,%ebp 110a2f: 57 push %edi 110a30: 56 push %esi 110a31: 53 push %ebx 110a32: 83 ec 1c sub $0x1c,%esp ASR_Information *asr; bool is_asr_enabled = false; bool needs_asr_dispatching = false; rtems_mode old_mode; if ( !previous_mode_set ) 110a35: 83 7d 10 00 cmpl $0x0,0x10(%ebp) 110a39: 0f 84 00 01 00 00 je 110b3f return RTEMS_INVALID_ADDRESS; executing = _Thread_Executing; 110a3f: 8b 35 ec e8 12 00 mov 0x12e8ec,%esi api = executing->API_Extensions[ THREAD_API_RTEMS ]; 110a45: 8b 9e e4 00 00 00 mov 0xe4(%esi),%ebx asr = &api->Signal; old_mode = (executing->is_preemptible) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT; 110a4b: 80 7e 70 01 cmpb $0x1,0x70(%esi) 110a4f: 19 ff sbb %edi,%edi 110a51: 81 e7 00 01 00 00 and $0x100,%edi if ( executing->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_NONE ) 110a57: 83 7e 78 00 cmpl $0x0,0x78(%esi) 110a5b: 74 06 je 110a63 old_mode |= RTEMS_NO_TIMESLICE; else old_mode |= RTEMS_TIMESLICE; 110a5d: 81 cf 00 02 00 00 or $0x200,%edi old_mode |= (asr->is_enabled) ? RTEMS_ASR : RTEMS_NO_ASR; 110a63: 80 7b 08 01 cmpb $0x1,0x8(%ebx) 110a67: 19 c9 sbb %ecx,%ecx 110a69: 81 e1 00 04 00 00 and $0x400,%ecx old_mode |= _ISR_Get_level(); 110a6f: 89 4d e4 mov %ecx,-0x1c(%ebp) 110a72: e8 89 c4 ff ff call 10cf00 <_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; 110a77: 8b 4d e4 mov -0x1c(%ebp),%ecx 110a7a: 09 c8 or %ecx,%eax old_mode |= _ISR_Get_level(); 110a7c: 09 f8 or %edi,%eax 110a7e: 8b 55 10 mov 0x10(%ebp),%edx 110a81: 89 02 mov %eax,(%edx) *previous_mode_set = old_mode; /* * These are generic thread scheduling characteristics. */ if ( mask & RTEMS_PREEMPT_MASK ) 110a83: f7 45 0c 00 01 00 00 testl $0x100,0xc(%ebp) 110a8a: 74 0f je 110a9b 110a8c: 8b 45 08 mov 0x8(%ebp),%eax 110a8f: c1 e8 08 shr $0x8,%eax 110a92: 83 f0 01 xor $0x1,%eax 110a95: 83 e0 01 and $0x1,%eax 110a98: 88 46 70 mov %al,0x70(%esi) executing->is_preemptible = _Modes_Is_preempt(mode_set) ? true : false; if ( mask & RTEMS_TIMESLICE_MASK ) { 110a9b: f7 45 0c 00 02 00 00 testl $0x200,0xc(%ebp) 110aa2: 74 21 je 110ac5 if ( _Modes_Is_timeslice(mode_set) ) { 110aa4: f7 45 08 00 02 00 00 testl $0x200,0x8(%ebp) 110aab: 74 11 je 110abe executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE; 110aad: c7 46 78 01 00 00 00 movl $0x1,0x78(%esi) executing->cpu_time_budget = _Thread_Ticks_per_timeslice; 110ab4: a1 b8 e3 12 00 mov 0x12e3b8,%eax 110ab9: 89 46 74 mov %eax,0x74(%esi) 110abc: eb 07 jmp 110ac5 } else executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE; 110abe: c7 46 78 00 00 00 00 movl $0x0,0x78(%esi) } /* * Set the new interrupt level */ if ( mask & RTEMS_INTERRUPT_MASK ) 110ac5: f6 45 0c 01 testb $0x1,0xc(%ebp) 110ac9: 74 0a je 110ad5 */ RTEMS_INLINE_ROUTINE void _Modes_Set_interrupt_level ( Modes_Control mode_set ) { _ISR_Set_level( _Modes_Get_interrupt_level( mode_set ) ); 110acb: f6 45 08 01 testb $0x1,0x8(%ebp) 110acf: 74 03 je 110ad4 110ad1: fa cli 110ad2: eb 01 jmp 110ad5 110ad4: fb sti /* * This is specific to the RTEMS API */ is_asr_enabled = false; needs_asr_dispatching = false; 110ad5: 31 d2 xor %edx,%edx if ( mask & RTEMS_ASR_MASK ) { 110ad7: f7 45 0c 00 04 00 00 testl $0x400,0xc(%ebp) 110ade: 74 2c je 110b0c is_asr_enabled = _Modes_Is_asr_disabled( mode_set ) ? false : true; 110ae0: 8b 45 08 mov 0x8(%ebp),%eax 110ae3: c1 e8 0a shr $0xa,%eax 110ae6: 83 f0 01 xor $0x1,%eax 110ae9: 83 e0 01 and $0x1,%eax if ( is_asr_enabled != asr->is_enabled ) { 110aec: 3a 43 08 cmp 0x8(%ebx),%al 110aef: 74 1b je 110b0c asr->is_enabled = is_asr_enabled; 110af1: 88 43 08 mov %al,0x8(%ebx) ) { rtems_signal_set _signals; ISR_Level _level; _ISR_Disable( _level ); 110af4: 9c pushf 110af5: fa cli 110af6: 58 pop %eax _signals = information->signals_pending; 110af7: 8b 53 18 mov 0x18(%ebx),%edx information->signals_pending = information->signals_posted; 110afa: 8b 4b 14 mov 0x14(%ebx),%ecx 110afd: 89 4b 18 mov %ecx,0x18(%ebx) information->signals_posted = _signals; 110b00: 89 53 14 mov %edx,0x14(%ebx) _ISR_Enable( _level ); 110b03: 50 push %eax 110b04: 9d popf _ASR_Swap_signals( asr ); if ( _ASR_Are_signals_pending( asr ) ) { 110b05: 83 7b 14 00 cmpl $0x0,0x14(%ebx) 110b09: 0f 95 c2 setne %dl if ( _System_state_Is_up( _System_state_Get() ) ) { if (_Thread_Evaluate_is_dispatch_needed( needs_asr_dispatching ) ) _Thread_Dispatch(); } return RTEMS_SUCCESSFUL; 110b0c: 31 c0 xor %eax,%eax needs_asr_dispatching = true; } } } if ( _System_state_Is_up( _System_state_Get() ) ) { 110b0e: 83 3d 20 e5 12 00 03 cmpl $0x3,0x12e520 110b15: 75 2d jne 110b44 bool are_signals_pending ) { Thread_Control *executing; executing = _Thread_Executing; 110b17: 8b 0d ec e8 12 00 mov 0x12e8ec,%ecx if ( are_signals_pending || 110b1d: 84 d2 test %dl,%dl 110b1f: 75 0e jne 110b2f 110b21: 3b 0d f0 e8 12 00 cmp 0x12e8f0,%ecx 110b27: 74 1b je 110b44 (!_Thread_Is_heir( executing ) && executing->is_preemptible) ) { 110b29: 80 79 70 00 cmpb $0x0,0x70(%ecx) 110b2d: 74 15 je 110b44 <== NEVER TAKEN _Thread_Dispatch_necessary = true; 110b2f: c6 05 f8 e8 12 00 01 movb $0x1,0x12e8f8 if (_Thread_Evaluate_is_dispatch_needed( needs_asr_dispatching ) ) _Thread_Dispatch(); 110b36: e8 95 b1 ff ff call 10bcd0 <_Thread_Dispatch> } return RTEMS_SUCCESSFUL; 110b3b: 31 c0 xor %eax,%eax 110b3d: eb 05 jmp 110b44 bool is_asr_enabled = false; bool needs_asr_dispatching = false; rtems_mode old_mode; if ( !previous_mode_set ) return RTEMS_INVALID_ADDRESS; 110b3f: b8 09 00 00 00 mov $0x9,%eax if (_Thread_Evaluate_is_dispatch_needed( needs_asr_dispatching ) ) _Thread_Dispatch(); } return RTEMS_SUCCESSFUL; } 110b44: 83 c4 1c add $0x1c,%esp 110b47: 5b pop %ebx 110b48: 5e pop %esi 110b49: 5f pop %edi 110b4a: 5d pop %ebp 110b4b: c3 ret =============================================================================== 0010d48c : rtems_status_code rtems_task_set_priority( rtems_id id, rtems_task_priority new_priority, rtems_task_priority *old_priority ) { 10d48c: 55 push %ebp 10d48d: 89 e5 mov %esp,%ebp 10d48f: 56 push %esi 10d490: 53 push %ebx 10d491: 83 ec 10 sub $0x10,%esp 10d494: 8b 5d 0c mov 0xc(%ebp),%ebx 10d497: 8b 75 10 mov 0x10(%ebp),%esi register Thread_Control *the_thread; Objects_Locations location; if ( new_priority != RTEMS_CURRENT_PRIORITY && 10d49a: 85 db test %ebx,%ebx 10d49c: 74 10 je 10d4ae RTEMS_INLINE_ROUTINE bool _RTEMS_tasks_Priority_is_valid ( rtems_task_priority the_priority ) { return ( ( the_priority >= RTEMS_MINIMUM_PRIORITY ) && ( the_priority <= RTEMS_MAXIMUM_PRIORITY ) ); 10d49e: 0f b6 15 88 e1 12 00 movzbl 0x12e188,%edx !_RTEMS_tasks_Priority_is_valid( new_priority ) ) return RTEMS_INVALID_PRIORITY; 10d4a5: b8 13 00 00 00 mov $0x13,%eax ) { register Thread_Control *the_thread; Objects_Locations location; if ( new_priority != RTEMS_CURRENT_PRIORITY && 10d4aa: 39 d3 cmp %edx,%ebx 10d4ac: 77 52 ja 10d500 !_RTEMS_tasks_Priority_is_valid( new_priority ) ) return RTEMS_INVALID_PRIORITY; if ( !old_priority ) return RTEMS_INVALID_ADDRESS; 10d4ae: b8 09 00 00 00 mov $0x9,%eax if ( new_priority != RTEMS_CURRENT_PRIORITY && !_RTEMS_tasks_Priority_is_valid( new_priority ) ) return RTEMS_INVALID_PRIORITY; if ( !old_priority ) 10d4b3: 85 f6 test %esi,%esi 10d4b5: 74 49 je 10d500 return RTEMS_INVALID_ADDRESS; the_thread = _Thread_Get( id, &location ); 10d4b7: 51 push %ecx 10d4b8: 51 push %ecx 10d4b9: 8d 45 f4 lea -0xc(%ebp),%eax 10d4bc: 50 push %eax 10d4bd: ff 75 08 pushl 0x8(%ebp) 10d4c0: e8 d7 1d 00 00 call 10f29c <_Thread_Get> switch ( location ) { 10d4c5: 83 c4 10 add $0x10,%esp 10d4c8: 83 7d f4 00 cmpl $0x0,-0xc(%ebp) 10d4cc: 75 2d jne 10d4fb case OBJECTS_LOCAL: /* XXX need helper to "convert" from core priority */ *old_priority = the_thread->current_priority; 10d4ce: 8b 50 14 mov 0x14(%eax),%edx 10d4d1: 89 16 mov %edx,(%esi) if ( new_priority != RTEMS_CURRENT_PRIORITY ) { 10d4d3: 85 db test %ebx,%ebx 10d4d5: 74 1b je 10d4f2 the_thread->real_priority = new_priority; 10d4d7: 89 58 18 mov %ebx,0x18(%eax) if ( the_thread->resource_count == 0 || 10d4da: 83 78 1c 00 cmpl $0x0,0x1c(%eax) 10d4de: 74 05 je 10d4e5 10d4e0: 39 58 14 cmp %ebx,0x14(%eax) 10d4e3: 76 0d jbe 10d4f2 <== ALWAYS TAKEN the_thread->current_priority > new_priority ) _Thread_Change_priority( the_thread, new_priority, false ); 10d4e5: 52 push %edx 10d4e6: 6a 00 push $0x0 10d4e8: 53 push %ebx 10d4e9: 50 push %eax 10d4ea: e8 9d 19 00 00 call 10ee8c <_Thread_Change_priority> 10d4ef: 83 c4 10 add $0x10,%esp } _Thread_Enable_dispatch(); 10d4f2: e8 85 1d 00 00 call 10f27c <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 10d4f7: 31 c0 xor %eax,%eax 10d4f9: eb 05 jmp 10d500 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 10d4fb: b8 04 00 00 00 mov $0x4,%eax } 10d500: 8d 65 f8 lea -0x8(%ebp),%esp 10d503: 5b pop %ebx 10d504: 5e pop %esi 10d505: 5d pop %ebp 10d506: c3 ret =============================================================================== 00115fac : */ rtems_status_code rtems_timer_cancel( rtems_id id ) { 115fac: 55 push %ebp 115fad: 89 e5 mov %esp,%ebp 115faf: 83 ec 1c sub $0x1c,%esp Timer_Control *the_timer; Objects_Locations location; the_timer = _Timer_Get( id, &location ); 115fb2: 8d 45 f4 lea -0xc(%ebp),%eax RTEMS_INLINE_ROUTINE Timer_Control *_Timer_Get ( Objects_Id id, Objects_Locations *location ) { return (Timer_Control *) 115fb5: 50 push %eax 115fb6: ff 75 08 pushl 0x8(%ebp) 115fb9: 68 84 87 14 00 push $0x148784 115fbe: e8 2d 28 00 00 call 1187f0 <_Objects_Get> switch ( location ) { 115fc3: 83 c4 10 add $0x10,%esp 115fc6: 83 7d f4 00 cmpl $0x0,-0xc(%ebp) 115fca: 75 1e jne 115fea case OBJECTS_LOCAL: if ( !_Timer_Is_dormant_class( the_timer->the_class ) ) 115fcc: 83 78 38 04 cmpl $0x4,0x38(%eax) 115fd0: 74 0f je 115fe1 <== NEVER TAKEN (void) _Watchdog_Remove( &the_timer->Ticker ); 115fd2: 83 ec 0c sub $0xc,%esp 115fd5: 83 c0 10 add $0x10,%eax 115fd8: 50 push %eax 115fd9: e8 62 41 00 00 call 11a140 <_Watchdog_Remove> 115fde: 83 c4 10 add $0x10,%esp _Thread_Enable_dispatch(); 115fe1: e8 ae 33 00 00 call 119394 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 115fe6: 31 c0 xor %eax,%eax 115fe8: eb 05 jmp 115fef #endif case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 115fea: b8 04 00 00 00 mov $0x4,%eax } 115fef: c9 leave 115ff0: c3 ret =============================================================================== 001168b9 : rtems_status_code rtems_timer_initiate_server( uint32_t priority, uint32_t stack_size, rtems_attribute attribute_set ) { 1168b9: 55 push %ebp 1168ba: 89 e5 mov %esp,%ebp 1168bc: 53 push %ebx 1168bd: 83 ec 24 sub $0x24,%esp 1168c0: 8b 55 08 mov 0x8(%ebp),%edx */ RTEMS_INLINE_ROUTINE bool _RTEMS_tasks_Priority_is_valid ( rtems_task_priority the_priority ) { return ( ( the_priority >= RTEMS_MINIMUM_PRIORITY ) && 1168c3: 31 c0 xor %eax,%eax 1168c5: 85 d2 test %edx,%edx 1168c7: 74 0f je 1168d8 ( the_priority <= RTEMS_MAXIMUM_PRIORITY ) ); 1168c9: 0f b6 05 48 f8 13 00 movzbl 0x13f848,%eax */ RTEMS_INLINE_ROUTINE bool _RTEMS_tasks_Priority_is_valid ( rtems_task_priority the_priority ) { return ( ( the_priority >= RTEMS_MINIMUM_PRIORITY ) && 1168d0: 39 c2 cmp %eax,%edx 1168d2: 0f 96 c0 setbe %al 1168d5: 0f b6 c0 movzbl %al,%eax * Make sure the requested priority is valid. The if is * structured so we check it is invalid before looking for * a specific invalid value as the default. */ _priority = priority; if ( !_RTEMS_tasks_Priority_is_valid( priority ) ) { 1168d8: 85 c0 test %eax,%eax 1168da: 75 0d jne 1168e9 if ( priority != RTEMS_TIMER_SERVER_DEFAULT_PRIORITY ) return RTEMS_INVALID_PRIORITY; 1168dc: b0 13 mov $0x13,%al * structured so we check it is invalid before looking for * a specific invalid value as the default. */ _priority = priority; if ( !_RTEMS_tasks_Priority_is_valid( priority ) ) { if ( priority != RTEMS_TIMER_SERVER_DEFAULT_PRIORITY ) 1168de: 42 inc %edx 1168df: 0f 85 5c 01 00 00 jne 116a41 return RTEMS_INVALID_PRIORITY; _priority = 0; 1168e5: 31 db xor %ebx,%ebx 1168e7: eb 02 jmp 1168eb * Make sure the requested priority is valid. The if is * structured so we check it is invalid before looking for * a specific invalid value as the default. */ _priority = priority; if ( !_RTEMS_tasks_Priority_is_valid( priority ) ) { 1168e9: 89 d3 mov %edx,%ebx 1168eb: e8 78 fc ff ff call 116568 <_Thread_Dispatch_increment_disable_level> /* * Just to make sure this is only called once. */ _Thread_Disable_dispatch(); tmpInitialized = initialized; 1168f0: 8a 15 c0 37 14 00 mov 0x1437c0,%dl initialized = true; 1168f6: c6 05 c0 37 14 00 01 movb $0x1,0x1437c0 _Thread_Enable_dispatch(); 1168fd: 88 55 e4 mov %dl,-0x1c(%ebp) 116900: e8 8f 2a 00 00 call 119394 <_Thread_Enable_dispatch> if ( tmpInitialized ) return RTEMS_INCORRECT_STATE; 116905: b8 0e 00 00 00 mov $0xe,%eax _Thread_Disable_dispatch(); tmpInitialized = initialized; initialized = true; _Thread_Enable_dispatch(); if ( tmpInitialized ) 11690a: 8a 55 e4 mov -0x1c(%ebp),%dl 11690d: 84 d2 test %dl,%dl 11690f: 0f 85 2c 01 00 00 jne 116a41 <== NEVER TAKEN * other library rules. For example, if using a TSR written in Ada the * Server should run at the same priority as the priority Ada task. * Otherwise, the priority ceiling for the mutex used to protect the * GNAT run-time is violated. */ status = rtems_task_create( 116915: 50 push %eax 116916: 50 push %eax 116917: 8d 45 f4 lea -0xc(%ebp),%eax 11691a: 50 push %eax 11691b: 8b 45 10 mov 0x10(%ebp),%eax 11691e: 80 cc 80 or $0x80,%ah 116921: 50 push %eax 116922: 68 00 01 00 00 push $0x100 116927: ff 75 0c pushl 0xc(%ebp) 11692a: 53 push %ebx 11692b: 68 45 4d 49 54 push $0x54494d45 116930: e8 77 ee ff ff call 1157ac /* user may want floating point but we need */ /* system task specified for 0 priority */ attribute_set | RTEMS_SYSTEM_TASK, &id /* get the id back */ ); if (status) { 116935: 83 c4 20 add $0x20,%esp 116938: 85 c0 test %eax,%eax 11693a: 74 0c je 116948 initialized = false; 11693c: c6 05 c0 37 14 00 00 movb $0x0,0x1437c0 116943: e9 f9 00 00 00 jmp 116a41 * We work with the TCB pointer, not the ID, so we need to convert * to a TCB pointer from here out. */ ts->thread = (Thread_Control *)_Objects_Get_local_object( &_RTEMS_tasks_Information, _Objects_Get_index(id) 116948: 8b 5d f4 mov -0xc(%ebp),%ebx */ #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return NULL; #endif return information->local_table[ index ]; 11694b: 0f b7 d3 movzwl %bx,%edx 11694e: a1 ec 7d 14 00 mov 0x147dec,%eax 116953: 8b 04 90 mov (%eax,%edx,4),%eax /* * We work with the TCB pointer, not the ID, so we need to convert * to a TCB pointer from here out. */ ts->thread = (Thread_Control *)_Objects_Get_local_object( 116956: a3 c4 37 14 00 mov %eax,0x1437c4 ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; 11695b: c7 05 f4 37 14 00 f8 movl $0x1437f8,0x1437f4 116962: 37 14 00 head->previous = NULL; 116965: c7 05 f8 37 14 00 00 movl $0x0,0x1437f8 11696c: 00 00 00 tail->previous = head; 11696f: c7 05 fc 37 14 00 f4 movl $0x1437f4,0x1437fc 116976: 37 14 00 ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; 116979: c7 05 2c 38 14 00 30 movl $0x143830,0x14382c 116980: 38 14 00 head->previous = NULL; 116983: c7 05 30 38 14 00 00 movl $0x0,0x143830 11698a: 00 00 00 tail->previous = head; 11698d: c7 05 34 38 14 00 2c movl $0x14382c,0x143834 116994: 38 14 00 Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 116997: c7 05 d4 37 14 00 00 movl $0x0,0x1437d4 11699e: 00 00 00 the_watchdog->routine = routine; 1169a1: c7 05 e8 37 14 00 18 movl $0x119218,0x1437e8 1169a8: 92 11 00 the_watchdog->id = id; 1169ab: 89 1d ec 37 14 00 mov %ebx,0x1437ec the_watchdog->user_data = user_data; 1169b1: c7 05 f0 37 14 00 00 movl $0x0,0x1437f0 1169b8: 00 00 00 Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 1169bb: c7 05 0c 38 14 00 00 movl $0x0,0x14380c 1169c2: 00 00 00 the_watchdog->routine = routine; 1169c5: c7 05 20 38 14 00 18 movl $0x119218,0x143820 1169cc: 92 11 00 the_watchdog->id = id; 1169cf: 89 1d 24 38 14 00 mov %ebx,0x143824 the_watchdog->user_data = user_data; 1169d5: c7 05 28 38 14 00 00 movl $0x0,0x143828 1169dc: 00 00 00 /* * Initialize the pointer to the timer schedule method so applications that * do not use the Timer Server do not have to pull it in. */ ts->schedule_operation = _Timer_server_Schedule_operation_method; 1169df: c7 05 c8 37 14 00 09 movl $0x116609,0x1437c8 1169e6: 66 11 00 ts->Interval_watchdogs.last_snapshot = _Watchdog_Ticks_since_boot; 1169e9: a1 48 7f 14 00 mov 0x147f48,%eax 1169ee: a3 00 38 14 00 mov %eax,0x143800 1169f3: 6a 00 push $0x0 1169f5: 68 00 ca 9a 3b push $0x3b9aca00 1169fa: ff 35 14 7e 14 00 pushl 0x147e14 116a00: ff 35 10 7e 14 00 pushl 0x147e10 116a06: e8 e9 3b 01 00 call 12a5f4 <__divdi3> 116a0b: 83 c4 0c add $0xc,%esp ts->TOD_watchdogs.last_snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); 116a0e: a3 38 38 14 00 mov %eax,0x143838 ts->insert_chain = NULL; 116a13: c7 05 3c 38 14 00 00 movl $0x0,0x14383c 116a1a: 00 00 00 ts->active = false; 116a1d: c6 05 40 38 14 00 00 movb $0x0,0x143840 /* * The default timer server is now available. */ _Timer_server = ts; 116a24: c7 05 c4 87 14 00 c4 movl $0x1437c4,0x1487c4 116a2b: 37 14 00 /* * Start the timer server */ status = rtems_task_start( 116a2e: 68 c4 37 14 00 push $0x1437c4 116a33: 68 32 67 11 00 push $0x116732 116a38: 53 push %ebx 116a39: e8 56 f3 ff ff call 115d94 116a3e: 83 c4 10 add $0x10,%esp initialized = false; } #endif return status; } 116a41: 8b 5d fc mov -0x4(%ebp),%ebx 116a44: c9 leave 116a45: c3 ret =============================================================================== 0011645c : rtems_id id, rtems_time_of_day *wall_time, rtems_timer_service_routine_entry routine, void *user_data ) { 11645c: 55 push %ebp 11645d: 89 e5 mov %esp,%ebp 11645f: 57 push %edi 116460: 56 push %esi 116461: 53 push %ebx 116462: 83 ec 1c sub $0x1c,%esp 116465: 8b 75 0c mov 0xc(%ebp),%esi Timer_Control *the_timer; Objects_Locations location; rtems_interval seconds; Timer_server_Control *timer_server = _Timer_server; 116468: 8b 1d c4 87 14 00 mov 0x1487c4,%ebx if ( !timer_server ) 11646e: 85 db test %ebx,%ebx 116470: 0f 84 e1 00 00 00 je 116557 return RTEMS_INCORRECT_STATE; if ( !_TOD.is_set ) return RTEMS_NOT_DEFINED; 116476: b8 0b 00 00 00 mov $0xb,%eax Timer_server_Control *timer_server = _Timer_server; if ( !timer_server ) return RTEMS_INCORRECT_STATE; if ( !_TOD.is_set ) 11647b: 80 3d 24 7e 14 00 00 cmpb $0x0,0x147e24 116482: 0f 84 d6 00 00 00 je 11655e <== NEVER TAKEN return RTEMS_NOT_DEFINED; if ( !routine ) return RTEMS_INVALID_ADDRESS; 116488: b0 09 mov $0x9,%al return RTEMS_INCORRECT_STATE; if ( !_TOD.is_set ) return RTEMS_NOT_DEFINED; if ( !routine ) 11648a: 83 7d 10 00 cmpl $0x0,0x10(%ebp) 11648e: 0f 84 ca 00 00 00 je 11655e return RTEMS_INVALID_ADDRESS; if ( !_TOD_Validate( wall_time ) ) 116494: 83 ec 0c sub $0xc,%esp 116497: 56 push %esi 116498: e8 b3 d4 ff ff call 113950 <_TOD_Validate> 11649d: 83 c4 10 add $0x10,%esp 1164a0: 84 c0 test %al,%al 1164a2: 75 0a jne 1164ae return RTEMS_INVALID_CLOCK; 1164a4: b8 14 00 00 00 mov $0x14,%eax 1164a9: e9 b0 00 00 00 jmp 11655e seconds = _TOD_To_seconds( wall_time ); 1164ae: 83 ec 0c sub $0xc,%esp 1164b1: 56 push %esi 1164b2: e8 25 d4 ff ff call 1138dc <_TOD_To_seconds> 1164b7: 89 c6 mov %eax,%esi 1164b9: 6a 00 push $0x0 1164bb: 68 00 ca 9a 3b push $0x3b9aca00 1164c0: ff 35 14 7e 14 00 pushl 0x147e14 1164c6: ff 35 10 7e 14 00 pushl 0x147e10 1164cc: e8 23 41 01 00 call 12a5f4 <__divdi3> if ( seconds <= _TOD_Seconds_since_epoch() ) 1164d1: 83 c4 20 add $0x20,%esp 1164d4: 39 c6 cmp %eax,%esi 1164d6: 76 cc jbe 1164a4 1164d8: 50 push %eax return RTEMS_INVALID_CLOCK; the_timer = _Timer_Get( id, &location ); 1164d9: 8d 45 e4 lea -0x1c(%ebp),%eax 1164dc: 50 push %eax 1164dd: ff 75 08 pushl 0x8(%ebp) 1164e0: 68 84 87 14 00 push $0x148784 1164e5: e8 06 23 00 00 call 1187f0 <_Objects_Get> 1164ea: 89 c7 mov %eax,%edi switch ( location ) { 1164ec: 83 c4 10 add $0x10,%esp #endif case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 1164ef: b8 04 00 00 00 mov $0x4,%eax seconds = _TOD_To_seconds( wall_time ); if ( seconds <= _TOD_Seconds_since_epoch() ) return RTEMS_INVALID_CLOCK; the_timer = _Timer_Get( id, &location ); switch ( location ) { 1164f4: 83 7d e4 00 cmpl $0x0,-0x1c(%ebp) 1164f8: 75 64 jne 11655e case OBJECTS_LOCAL: (void) _Watchdog_Remove( &the_timer->Ticker ); 1164fa: 83 ec 0c sub $0xc,%esp 1164fd: 8d 47 10 lea 0x10(%edi),%eax 116500: 50 push %eax 116501: e8 3a 3c 00 00 call 11a140 <_Watchdog_Remove> the_timer->the_class = TIMER_TIME_OF_DAY_ON_TASK; 116506: c7 47 38 03 00 00 00 movl $0x3,0x38(%edi) Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 11650d: c7 47 18 00 00 00 00 movl $0x0,0x18(%edi) the_watchdog->routine = routine; 116514: 8b 45 10 mov 0x10(%ebp),%eax 116517: 89 47 2c mov %eax,0x2c(%edi) the_watchdog->id = id; 11651a: 8b 45 08 mov 0x8(%ebp),%eax 11651d: 89 47 30 mov %eax,0x30(%edi) the_watchdog->user_data = user_data; 116520: 8b 45 14 mov 0x14(%ebp),%eax 116523: 89 47 34 mov %eax,0x34(%edi) 116526: 6a 00 push $0x0 116528: 68 00 ca 9a 3b push $0x3b9aca00 11652d: ff 35 14 7e 14 00 pushl 0x147e14 116533: ff 35 10 7e 14 00 pushl 0x147e10 116539: e8 b6 40 01 00 call 12a5f4 <__divdi3> _Watchdog_Initialize( &the_timer->Ticker, routine, id, user_data ); the_timer->Ticker.initial = seconds - _TOD_Seconds_since_epoch(); 11653e: 29 c6 sub %eax,%esi 116540: 89 77 1c mov %esi,0x1c(%edi) (*timer_server->schedule_operation)( timer_server, the_timer ); 116543: 83 c4 18 add $0x18,%esp 116546: 57 push %edi 116547: 53 push %ebx 116548: ff 53 04 call *0x4(%ebx) _Thread_Enable_dispatch(); 11654b: e8 44 2e 00 00 call 119394 <_Thread_Enable_dispatch> 116550: 83 c4 10 add $0x10,%esp return RTEMS_SUCCESSFUL; 116553: 31 c0 xor %eax,%eax 116555: eb 07 jmp 11655e Objects_Locations location; rtems_interval seconds; Timer_server_Control *timer_server = _Timer_server; if ( !timer_server ) return RTEMS_INCORRECT_STATE; 116557: b8 0e 00 00 00 mov $0xe,%eax 11655c: eb 00 jmp 11655e case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 11655e: 8d 65 f4 lea -0xc(%ebp),%esp 116561: 5b pop %ebx 116562: 5e pop %esi 116563: 5f pop %edi 116564: 5d pop %ebp 116565: c3 ret =============================================================================== 0010a400 : #include int sched_get_priority_max( int policy ) { 10a400: 55 push %ebp 10a401: 89 e5 mov %esp,%ebp 10a403: 83 ec 08 sub $0x8,%esp 10a406: 8b 4d 08 mov 0x8(%ebp),%ecx switch ( policy ) { 10a409: 83 f9 04 cmp $0x4,%ecx 10a40c: 77 0b ja 10a419 10a40e: b8 01 00 00 00 mov $0x1,%eax 10a413: d3 e0 shl %cl,%eax 10a415: a8 17 test $0x17,%al 10a417: 75 10 jne 10a429 <== ALWAYS TAKEN case SCHED_RR: case SCHED_SPORADIC: break; default: rtems_set_errno_and_return_minus_one( EINVAL ); 10a419: e8 36 74 00 00 call 111854 <__errno> 10a41e: c7 00 16 00 00 00 movl $0x16,(%eax) 10a424: 83 c8 ff or $0xffffffff,%eax 10a427: eb 08 jmp 10a431 } return POSIX_SCHEDULER_MAXIMUM_PRIORITY; 10a429: 0f b6 05 88 b1 12 00 movzbl 0x12b188,%eax 10a430: 48 dec %eax } 10a431: c9 leave 10a432: c3 ret =============================================================================== 0010a434 : #include int sched_get_priority_min( int policy ) { 10a434: 55 push %ebp 10a435: 89 e5 mov %esp,%ebp 10a437: 83 ec 08 sub $0x8,%esp 10a43a: 8b 4d 08 mov 0x8(%ebp),%ecx switch ( policy ) { 10a43d: 83 f9 04 cmp $0x4,%ecx 10a440: 77 11 ja 10a453 10a442: ba 01 00 00 00 mov $0x1,%edx 10a447: d3 e2 shl %cl,%edx default: rtems_set_errno_and_return_minus_one( EINVAL ); } return POSIX_SCHEDULER_MINIMUM_PRIORITY; 10a449: b8 01 00 00 00 mov $0x1,%eax int sched_get_priority_min( int policy ) { switch ( policy ) { 10a44e: 80 e2 17 and $0x17,%dl 10a451: 75 0e jne 10a461 <== ALWAYS TAKEN case SCHED_RR: case SCHED_SPORADIC: break; default: rtems_set_errno_and_return_minus_one( EINVAL ); 10a453: e8 fc 73 00 00 call 111854 <__errno> 10a458: c7 00 16 00 00 00 movl $0x16,(%eax) 10a45e: 83 c8 ff or $0xffffffff,%eax } return POSIX_SCHEDULER_MINIMUM_PRIORITY; } 10a461: c9 leave 10a462: c3 ret =============================================================================== 0010a464 : int sched_rr_get_interval( pid_t pid, struct timespec *interval ) { 10a464: 55 push %ebp 10a465: 89 e5 mov %esp,%ebp 10a467: 56 push %esi 10a468: 53 push %ebx 10a469: 8b 75 08 mov 0x8(%ebp),%esi 10a46c: 8b 5d 0c mov 0xc(%ebp),%ebx /* * Only supported for the "calling process" (i.e. this node). */ if ( pid && pid != getpid() ) 10a46f: 85 f6 test %esi,%esi 10a471: 74 16 je 10a489 <== NEVER TAKEN 10a473: e8 a4 c7 ff ff call 106c1c 10a478: 39 c6 cmp %eax,%esi 10a47a: 74 0d je 10a489 rtems_set_errno_and_return_minus_one( ESRCH ); 10a47c: e8 d3 73 00 00 call 111854 <__errno> 10a481: c7 00 03 00 00 00 movl $0x3,(%eax) 10a487: eb 0f jmp 10a498 if ( !interval ) 10a489: 85 db test %ebx,%ebx 10a48b: 75 10 jne 10a49d rtems_set_errno_and_return_minus_one( EINVAL ); 10a48d: e8 c2 73 00 00 call 111854 <__errno> 10a492: c7 00 16 00 00 00 movl $0x16,(%eax) 10a498: 83 c8 ff or $0xffffffff,%eax 10a49b: eb 13 jmp 10a4b0 _Timespec_From_ticks( _Thread_Ticks_per_timeslice, interval ); 10a49d: 50 push %eax 10a49e: 50 push %eax 10a49f: 53 push %ebx 10a4a0: ff 35 a8 f3 12 00 pushl 0x12f3a8 10a4a6: e8 2d 2f 00 00 call 10d3d8 <_Timespec_From_ticks> return 0; 10a4ab: 83 c4 10 add $0x10,%esp 10a4ae: 31 c0 xor %eax,%eax } 10a4b0: 8d 65 f8 lea -0x8(%ebp),%esp 10a4b3: 5b pop %ebx 10a4b4: 5e pop %esi 10a4b5: 5d pop %ebp 10a4b6: c3 ret =============================================================================== 0010a90c : int oflag, ... /* mode_t mode, */ /* unsigned int value */ ) { 10a90c: 55 push %ebp 10a90d: 89 e5 mov %esp,%ebp 10a90f: 57 push %edi 10a910: 56 push %esi 10a911: 53 push %ebx 10a912: 83 ec 1c sub $0x1c,%esp * * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { _Thread_Dispatch_disable_level++; 10a915: a1 b4 31 13 00 mov 0x1331b4,%eax 10a91a: 40 inc %eax 10a91b: a3 b4 31 13 00 mov %eax,0x1331b4 return _Thread_Dispatch_disable_level; 10a920: a1 b4 31 13 00 mov 0x1331b4,%eax va_list arg; mode_t mode; unsigned int value = 0; 10a925: 31 db xor %ebx,%ebx Objects_Locations location; size_t name_len; _Thread_Disable_dispatch(); if ( oflag & O_CREAT ) { 10a927: 8b 75 0c mov 0xc(%ebp),%esi 10a92a: 81 e6 00 02 00 00 and $0x200,%esi 10a930: 74 03 je 10a935 va_start(arg, oflag); mode = va_arg( arg, mode_t ); value = va_arg( arg, unsigned int ); 10a932: 8b 5d 14 mov 0x14(%ebp),%ebx va_end(arg); } status = _POSIX_Semaphore_Name_to_id( name, &the_semaphore_id, &name_len ); 10a935: 8d 45 e4 lea -0x1c(%ebp),%eax const char *name, Objects_Id *id, size_t *len ) { return _POSIX_Name_to_id( &_POSIX_Semaphore_Information, name, id, len ); 10a938: 50 push %eax 10a939: 8d 45 d8 lea -0x28(%ebp),%eax 10a93c: 50 push %eax 10a93d: ff 75 08 pushl 0x8(%ebp) 10a940: 68 78 34 13 00 push $0x133478 10a945: e8 16 fa ff ff call 10a360 <_POSIX_Name_to_id> 10a94a: 89 c7 mov %eax,%edi * 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 ) { 10a94c: 83 c4 10 add $0x10,%esp 10a94f: 85 c0 test %eax,%eax 10a951: 74 17 je 10a96a /* * 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) ) ) { 10a953: 83 f8 02 cmp $0x2,%eax 10a956: 75 04 jne 10a95c 10a958: 85 f6 test %esi,%esi 10a95a: 75 56 jne 10a9b2 _Thread_Enable_dispatch(); 10a95c: e8 5b 2d 00 00 call 10d6bc <_Thread_Enable_dispatch> rtems_set_errno_and_return_minus_one_cast( status, sem_t * ); 10a961: e8 32 7f 00 00 call 112898 <__errno> 10a966: 89 38 mov %edi,(%eax) 10a968: eb 72 jmp 10a9dc /* * Check for existence with creation. */ if ( (oflag & (O_CREAT | O_EXCL)) == (O_CREAT | O_EXCL) ) { 10a96a: 8b 45 0c mov 0xc(%ebp),%eax 10a96d: 25 00 0a 00 00 and $0xa00,%eax 10a972: 3d 00 0a 00 00 cmp $0xa00,%eax 10a977: 75 12 jne 10a98b _Thread_Enable_dispatch(); 10a979: e8 3e 2d 00 00 call 10d6bc <_Thread_Enable_dispatch> rtems_set_errno_and_return_minus_one_cast( EEXIST, sem_t * ); 10a97e: e8 15 7f 00 00 call 112898 <__errno> 10a983: c7 00 11 00 00 00 movl $0x11,(%eax) 10a989: eb 51 jmp 10a9dc RTEMS_INLINE_ROUTINE POSIX_Semaphore_Control *_POSIX_Semaphore_Get ( sem_t *id, Objects_Locations *location ) { return (POSIX_Semaphore_Control *) 10a98b: 50 push %eax } the_semaphore = _POSIX_Semaphore_Get( (sem_t *) &the_semaphore_id, &location ); 10a98c: 8d 45 e0 lea -0x20(%ebp),%eax 10a98f: 50 push %eax 10a990: ff 75 d8 pushl -0x28(%ebp) 10a993: 68 78 34 13 00 push $0x133478 10a998: e8 27 21 00 00 call 10cac4 <_Objects_Get> 10a99d: 89 45 dc mov %eax,-0x24(%ebp) the_semaphore->open_count += 1; 10a9a0: ff 40 18 incl 0x18(%eax) _Thread_Enable_dispatch(); 10a9a3: e8 14 2d 00 00 call 10d6bc <_Thread_Enable_dispatch> _Thread_Enable_dispatch(); 10a9a8: e8 0f 2d 00 00 call 10d6bc <_Thread_Enable_dispatch> goto return_id; 10a9ad: 83 c4 10 add $0x10,%esp 10a9b0: eb 22 jmp 10a9d4 /* * 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( 10a9b2: 83 ec 0c sub $0xc,%esp 10a9b5: 8d 45 dc lea -0x24(%ebp),%eax 10a9b8: 50 push %eax 10a9b9: 53 push %ebx 10a9ba: 6a 00 push $0x0 10a9bc: ff 75 e4 pushl -0x1c(%ebp) 10a9bf: ff 75 08 pushl 0x8(%ebp) 10a9c2: e8 11 57 00 00 call 1100d8 <_POSIX_Semaphore_Create_support> 10a9c7: 89 c3 mov %eax,%ebx /* * errno was set by Create_support, so don't set it again. */ _Thread_Enable_dispatch(); 10a9c9: 83 c4 20 add $0x20,%esp 10a9cc: e8 eb 2c 00 00 call 10d6bc <_Thread_Enable_dispatch> if ( status == -1 ) 10a9d1: 43 inc %ebx 10a9d2: 74 08 je 10a9dc <== NEVER TAKEN return_id: #if defined(RTEMS_USE_16_BIT_OBJECT) the_semaphore->Semaphore_id = the_semaphore->Object.id; return &the_semaphore->Semaphore_id; #else return (sem_t *)&the_semaphore->Object.id; 10a9d4: 8b 45 dc mov -0x24(%ebp),%eax 10a9d7: 83 c0 08 add $0x8,%eax 10a9da: eb 03 jmp 10a9df */ _Thread_Enable_dispatch(); if ( status == -1 ) return SEM_FAILED; 10a9dc: 83 c8 ff or $0xffffffff,%eax the_semaphore->Semaphore_id = the_semaphore->Object.id; return &the_semaphore->Semaphore_id; #else return (sem_t *)&the_semaphore->Object.id; #endif } 10a9df: 8d 65 f4 lea -0xc(%ebp),%esp 10a9e2: 5b pop %ebx 10a9e3: 5e pop %esi 10a9e4: 5f pop %edi 10a9e5: 5d pop %ebp 10a9e6: c3 ret =============================================================================== 0010cc08 : int sem_timedwait( sem_t *sem, const struct timespec *abstime ) { 10cc08: 55 push %ebp 10cc09: 89 e5 mov %esp,%ebp 10cc0b: 53 push %ebx 10cc0c: 83 ec 1c sub $0x1c,%esp * * 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 ); 10cc0f: 8d 45 f4 lea -0xc(%ebp),%eax 10cc12: 50 push %eax 10cc13: ff 75 0c pushl 0xc(%ebp) 10cc16: e8 49 49 00 00 call 111564 <_POSIX_Absolute_timeout_to_ticks> if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE ) 10cc1b: 83 c4 0c add $0xc,%esp 10cc1e: 83 f8 03 cmp $0x3,%eax 10cc21: 0f 94 c3 sete %bl do_wait = false; lock_status = _POSIX_Semaphore_Wait_support( sem, do_wait, ticks ); 10cc24: ff 75 f4 pushl -0xc(%ebp) 10cc27: 0f b6 c3 movzbl %bl,%eax 10cc2a: 50 push %eax 10cc2b: ff 75 08 pushl 0x8(%ebp) 10cc2e: e8 59 53 00 00 call 111f8c <_POSIX_Semaphore_Wait_support> * This service only gives us the option to block. We used a polling * attempt to obtain if the abstime was not in the future. If we did * not obtain the semaphore, then not look at the status immediately, * make sure the right reason is returned. */ if ( !do_wait && (lock_status == EBUSY) ) { 10cc33: 83 c4 10 add $0x10,%esp 10cc36: 84 db test %bl,%bl 10cc38: 75 00 jne 10cc3a <== ALWAYS TAKEN lock_status == POSIX_ABSOLUTE_TIMEOUT_IS_NOW ) rtems_set_errno_and_return_minus_one( ETIMEDOUT ); } return lock_status; } 10cc3a: 8b 5d fc mov -0x4(%ebp),%ebx 10cc3d: c9 leave 10cc3e: c3 ret =============================================================================== 0010a2a8 : int sigaction( int sig, const struct sigaction *act, struct sigaction *oact ) { 10a2a8: 55 push %ebp 10a2a9: 89 e5 mov %esp,%ebp 10a2ab: 57 push %edi 10a2ac: 56 push %esi 10a2ad: 53 push %ebx 10a2ae: 83 ec 1c sub $0x1c,%esp 10a2b1: 8b 5d 08 mov 0x8(%ebp),%ebx 10a2b4: 8b 45 10 mov 0x10(%ebp),%eax ISR_Level level; if ( oact ) 10a2b7: 85 c0 test %eax,%eax 10a2b9: 74 12 je 10a2cd *oact = _POSIX_signals_Vectors[ sig ]; 10a2bb: 6b f3 0c imul $0xc,%ebx,%esi 10a2be: 81 c6 68 09 13 00 add $0x130968,%esi 10a2c4: b9 03 00 00 00 mov $0x3,%ecx 10a2c9: 89 c7 mov %eax,%edi 10a2cb: f3 a5 rep movsl %ds:(%esi),%es:(%edi) if ( !sig ) 10a2cd: 85 db test %ebx,%ebx 10a2cf: 75 02 jne 10a2d3 10a2d1: eb 0f jmp 10a2e2 static inline bool is_valid_signo( int signo ) { return ((signo) >= 1 && (signo) <= 32 ); 10a2d3: 8d 43 ff lea -0x1(%ebx),%eax rtems_set_errno_and_return_minus_one( EINVAL ); if ( !is_valid_signo(sig) ) 10a2d6: 83 f8 1f cmp $0x1f,%eax 10a2d9: 76 02 jbe 10a2dd 10a2db: eb 05 jmp 10a2e2 * * NOTE: Solaris documentation claims to "silently enforce" this which * contradicts the POSIX specification. */ if ( sig == SIGKILL ) 10a2dd: 83 fb 09 cmp $0x9,%ebx 10a2e0: 75 10 jne 10a2f2 rtems_set_errno_and_return_minus_one( EINVAL ); 10a2e2: e8 b5 78 00 00 call 111b9c <__errno> 10a2e7: c7 00 16 00 00 00 movl $0x16,(%eax) 10a2ed: 83 c8 ff or $0xffffffff,%eax 10a2f0: eb 55 jmp 10a347 /* * Evaluate the new action structure and set the global signal vector * appropriately. */ if ( act ) { 10a2f2: 83 7d 0c 00 cmpl $0x0,0xc(%ebp) 10a2f6: 74 4d je 10a345 <== 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 ); 10a2f8: 9c pushf 10a2f9: fa cli 10a2fa: 8f 45 e4 popl -0x1c(%ebp) if ( act->sa_handler == SIG_DFL ) { 10a2fd: 8b 45 0c mov 0xc(%ebp),%eax 10a300: 83 78 08 00 cmpl $0x0,0x8(%eax) 10a304: 75 1a jne 10a320 _POSIX_signals_Vectors[ sig ] = _POSIX_signals_Default_vectors[ sig ]; 10a306: 6b f3 0c imul $0xc,%ebx,%esi 10a309: 8d 86 68 09 13 00 lea 0x130968(%esi),%eax 10a30f: 81 c6 a8 19 12 00 add $0x1219a8,%esi 10a315: b9 03 00 00 00 mov $0x3,%ecx 10a31a: 89 c7 mov %eax,%edi 10a31c: f3 a5 rep movsl %ds:(%esi),%es:(%edi) 10a31e: eb 21 jmp 10a341 } else { _POSIX_signals_Clear_process_signals( sig ); 10a320: 83 ec 0c sub $0xc,%esp 10a323: 53 push %ebx 10a324: e8 6f 4c 00 00 call 10ef98 <_POSIX_signals_Clear_process_signals> _POSIX_signals_Vectors[ sig ] = *act; 10a329: 6b db 0c imul $0xc,%ebx,%ebx 10a32c: 81 c3 68 09 13 00 add $0x130968,%ebx 10a332: b9 03 00 00 00 mov $0x3,%ecx 10a337: 89 df mov %ebx,%edi 10a339: 8b 75 0c mov 0xc(%ebp),%esi 10a33c: f3 a5 rep movsl %ds:(%esi),%es:(%edi) 10a33e: 83 c4 10 add $0x10,%esp } _ISR_Enable( level ); 10a341: ff 75 e4 pushl -0x1c(%ebp) 10a344: 9d popf * now (signals not posted when SIG_IGN). * + If we are now ignoring a signal that was previously pending, * we clear the pending signal indicator. */ return 0; 10a345: 31 c0 xor %eax,%eax } 10a347: 8d 65 f4 lea -0xc(%ebp),%esp 10a34a: 5b pop %ebx 10a34b: 5e pop %esi 10a34c: 5f pop %edi 10a34d: 5d pop %ebp 10a34e: c3 ret =============================================================================== 0010a702 : int sigtimedwait( const sigset_t *set, siginfo_t *info, const struct timespec *timeout ) { 10a702: 55 push %ebp 10a703: 89 e5 mov %esp,%ebp 10a705: 57 push %edi 10a706: 56 push %esi 10a707: 53 push %ebx 10a708: 83 ec 2c sub $0x2c,%esp 10a70b: 8b 5d 10 mov 0x10(%ebp),%ebx ISR_Level level; /* * Error check parameters before disabling interrupts. */ if ( !set ) 10a70e: 83 7d 08 00 cmpl $0x0,0x8(%ebp) 10a712: 75 02 jne 10a716 10a714: eb 28 jmp 10a73e /* NOTE: This is very specifically a RELATIVE not ABSOLUTE time * in the Open Group specification. */ interval = 0; if ( timeout ) { 10a716: 85 db test %ebx,%ebx 10a718: 74 34 je 10a74e if ( !_Timespec_Is_valid( timeout ) ) 10a71a: 83 ec 0c sub $0xc,%esp 10a71d: 53 push %ebx 10a71e: e8 35 30 00 00 call 10d758 <_Timespec_Is_valid> 10a723: 83 c4 10 add $0x10,%esp 10a726: 84 c0 test %al,%al 10a728: 75 02 jne 10a72c 10a72a: eb 12 jmp 10a73e rtems_set_errno_and_return_minus_one( EINVAL ); interval = _Timespec_To_ticks( timeout ); 10a72c: 83 ec 0c sub $0xc,%esp 10a72f: 53 push %ebx 10a730: e8 47 30 00 00 call 10d77c <_Timespec_To_ticks> 10a735: 89 c1 mov %eax,%ecx if ( !interval ) 10a737: 83 c4 10 add $0x10,%esp 10a73a: 85 c0 test %eax,%eax 10a73c: 75 12 jne 10a750 <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one( EINVAL ); 10a73e: e8 1d 7a 00 00 call 112160 <__errno> 10a743: c7 00 16 00 00 00 movl $0x16,(%eax) 10a749: e9 29 01 00 00 jmp 10a877 /* NOTE: This is very specifically a RELATIVE not ABSOLUTE time * in the Open Group specification. */ interval = 0; 10a74e: 31 c9 xor %ecx,%ecx /* * Initialize local variables. */ the_info = ( info ) ? info : &signal_information; 10a750: 8b 5d 0c mov 0xc(%ebp),%ebx 10a753: 85 db test %ebx,%ebx 10a755: 75 03 jne 10a75a 10a757: 8d 5d dc lea -0x24(%ebp),%ebx the_thread = _Thread_Executing; 10a75a: 8b 15 2c 09 13 00 mov 0x13092c,%edx api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 10a760: 8b b2 e8 00 00 00 mov 0xe8(%edx),%esi * What if they are already pending? */ /* API signals pending? */ _ISR_Disable( level ); 10a766: 9c pushf 10a767: fa cli 10a768: 8f 45 d4 popl -0x2c(%ebp) if ( *set & api->signals_pending ) { 10a76b: 8b 45 08 mov 0x8(%ebp),%eax 10a76e: 8b 38 mov (%eax),%edi 10a770: 8b 86 d4 00 00 00 mov 0xd4(%esi),%eax 10a776: 85 c7 test %eax,%edi 10a778: 74 2c je 10a7a6 /* XXX real info later */ the_info->si_signo = _POSIX_signals_Get_lowest( api->signals_pending ); 10a77a: e8 45 ff ff ff call 10a6c4 <_POSIX_signals_Get_lowest> 10a77f: 89 03 mov %eax,(%ebx) _POSIX_signals_Clear_signals( 10a781: 83 ec 0c sub $0xc,%esp 10a784: 6a 00 push $0x0 10a786: 6a 00 push $0x0 10a788: 53 push %ebx 10a789: 50 push %eax 10a78a: 56 push %esi 10a78b: e8 f4 4e 00 00 call 10f684 <_POSIX_signals_Clear_signals> the_info->si_signo, the_info, false, false ); _ISR_Enable( level ); 10a790: ff 75 d4 pushl -0x2c(%ebp) 10a793: 9d popf the_info->si_code = SI_USER; 10a794: c7 43 04 01 00 00 00 movl $0x1,0x4(%ebx) the_info->si_value.sival_int = 0; 10a79b: c7 43 08 00 00 00 00 movl $0x0,0x8(%ebx) return the_info->si_signo; 10a7a2: 8b 3b mov (%ebx),%edi 10a7a4: eb 33 jmp 10a7d9 } /* Process pending signals? */ if ( *set & _POSIX_signals_Pending ) { 10a7a6: a1 5c 0b 13 00 mov 0x130b5c,%eax 10a7ab: 85 c7 test %eax,%edi 10a7ad: 74 32 je 10a7e1 signo = _POSIX_signals_Get_lowest( _POSIX_signals_Pending ); 10a7af: e8 10 ff ff ff call 10a6c4 <_POSIX_signals_Get_lowest> 10a7b4: 89 c7 mov %eax,%edi _POSIX_signals_Clear_signals( api, signo, the_info, true, false ); 10a7b6: 83 ec 0c sub $0xc,%esp 10a7b9: 6a 00 push $0x0 10a7bb: 6a 01 push $0x1 10a7bd: 53 push %ebx 10a7be: 50 push %eax 10a7bf: 56 push %esi 10a7c0: e8 bf 4e 00 00 call 10f684 <_POSIX_signals_Clear_signals> _ISR_Enable( level ); 10a7c5: ff 75 d4 pushl -0x2c(%ebp) 10a7c8: 9d popf the_info->si_signo = signo; 10a7c9: 89 3b mov %edi,(%ebx) the_info->si_code = SI_USER; 10a7cb: c7 43 04 01 00 00 00 movl $0x1,0x4(%ebx) the_info->si_value.sival_int = 0; 10a7d2: c7 43 08 00 00 00 00 movl $0x0,0x8(%ebx) 10a7d9: 83 c4 20 add $0x20,%esp 10a7dc: e9 99 00 00 00 jmp 10a87a return signo; } the_info->si_signo = -1; 10a7e1: c7 03 ff ff ff ff movl $0xffffffff,(%ebx) * * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { _Thread_Dispatch_disable_level++; 10a7e7: a1 24 04 13 00 mov 0x130424,%eax 10a7ec: 40 inc %eax 10a7ed: a3 24 04 13 00 mov %eax,0x130424 return _Thread_Dispatch_disable_level; 10a7f2: a1 24 04 13 00 mov 0x130424,%eax _Thread_Disable_dispatch(); the_thread->Wait.queue = &_POSIX_signals_Wait_queue; 10a7f7: c7 42 44 f4 0a 13 00 movl $0x130af4,0x44(%edx) the_thread->Wait.return_code = EINTR; 10a7fe: c7 42 34 04 00 00 00 movl $0x4,0x34(%edx) the_thread->Wait.option = *set; 10a805: 8b 7d 08 mov 0x8(%ebp),%edi 10a808: 8b 07 mov (%edi),%eax 10a80a: 89 42 30 mov %eax,0x30(%edx) the_thread->Wait.return_argument = the_info; 10a80d: 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; 10a810: c7 05 24 0b 13 00 01 movl $0x1,0x130b24 10a817: 00 00 00 _Thread_queue_Enter_critical_section( &_POSIX_signals_Wait_queue ); _ISR_Enable( level ); 10a81a: ff 75 d4 pushl -0x2c(%ebp) 10a81d: 9d popf _Thread_queue_Enqueue( &_POSIX_signals_Wait_queue, interval ); 10a81e: 50 push %eax 10a81f: 68 90 d5 10 00 push $0x10d590 10a824: 51 push %ecx 10a825: 68 f4 0a 13 00 push $0x130af4 10a82a: e8 a9 2a 00 00 call 10d2d8 <_Thread_queue_Enqueue_with_handler> _Thread_Enable_dispatch(); 10a82f: e8 44 26 00 00 call 10ce78 <_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 ); 10a834: c7 04 24 00 00 00 00 movl $0x0,(%esp) 10a83b: 6a 00 push $0x0 10a83d: 53 push %ebx 10a83e: ff 33 pushl (%ebx) 10a840: 56 push %esi 10a841: e8 3e 4e 00 00 call 10f684 <_POSIX_signals_Clear_signals> /* Set errno only if return code is not EINTR or * if EINTR was caused by a signal being caught, which * was not in our set. */ if ( (_Thread_Executing->Wait.return_code != EINTR) 10a846: 83 c4 20 add $0x20,%esp 10a849: a1 2c 09 13 00 mov 0x13092c,%eax 10a84e: 83 78 34 04 cmpl $0x4,0x34(%eax) 10a852: 75 13 jne 10a867 || !(*set & signo_to_mask( the_info->si_signo )) ) { 10a854: 8b 3b mov (%ebx),%edi 10a856: 8d 4f ff lea -0x1(%edi),%ecx 10a859: b8 01 00 00 00 mov $0x1,%eax 10a85e: d3 e0 shl %cl,%eax 10a860: 8b 55 08 mov 0x8(%ebp),%edx 10a863: 85 02 test %eax,(%edx) 10a865: 75 13 jne 10a87a errno = _Thread_Executing->Wait.return_code; 10a867: e8 f4 78 00 00 call 112160 <__errno> 10a86c: 8b 15 2c 09 13 00 mov 0x13092c,%edx 10a872: 8b 52 34 mov 0x34(%edx),%edx 10a875: 89 10 mov %edx,(%eax) return -1; 10a877: 83 cf ff or $0xffffffff,%edi } return the_info->si_signo; } 10a87a: 89 f8 mov %edi,%eax 10a87c: 8d 65 f4 lea -0xc(%ebp),%esp 10a87f: 5b pop %ebx 10a880: 5e pop %esi 10a881: 5f pop %edi 10a882: 5d pop %ebp 10a883: c3 ret =============================================================================== 0010c244 : int sigwait( const sigset_t *set, int *sig ) { 10c244: 55 push %ebp 10c245: 89 e5 mov %esp,%ebp 10c247: 53 push %ebx 10c248: 83 ec 08 sub $0x8,%esp 10c24b: 8b 5d 0c mov 0xc(%ebp),%ebx int status; status = sigtimedwait( set, NULL, NULL ); 10c24e: 6a 00 push $0x0 10c250: 6a 00 push $0x0 10c252: ff 75 08 pushl 0x8(%ebp) 10c255: e8 50 fe ff ff call 10c0aa if ( status != -1 ) { 10c25a: 83 c4 10 add $0x10,%esp 10c25d: 83 f8 ff cmp $0xffffffff,%eax 10c260: 74 08 je 10c26a if ( sig ) 10c262: 85 db test %ebx,%ebx 10c264: 74 0d je 10c273 <== NEVER TAKEN *sig = status; 10c266: 89 03 mov %eax,(%ebx) 10c268: eb 09 jmp 10c273 return 0; } return errno; 10c26a: e8 1d 76 00 00 call 11388c <__errno> 10c26f: 8b 00 mov (%eax),%eax 10c271: eb 02 jmp 10c275 status = sigtimedwait( set, NULL, NULL ); if ( status != -1 ) { if ( sig ) *sig = status; return 0; 10c273: 31 c0 xor %eax,%eax } return errno; } 10c275: 8b 5d fc mov -0x4(%ebp),%ebx 10c278: c9 leave 10c279: c3 ret =============================================================================== 00109808 : */ long sysconf( int name ) { 109808: 55 push %ebp 109809: 89 e5 mov %esp,%ebp 10980b: 83 ec 08 sub $0x8,%esp 10980e: 8b 55 08 mov 0x8(%ebp),%edx if ( name == _SC_CLK_TCK ) 109811: 83 fa 02 cmp $0x2,%edx 109814: 75 0f jne 109825 return (TOD_MICROSECONDS_PER_SECOND / 109816: b8 40 42 0f 00 mov $0xf4240,%eax 10981b: 31 d2 xor %edx,%edx 10981d: f7 35 4c a1 12 00 divl 0x12a14c 109823: eb 34 jmp 109859 rtems_configuration_get_microseconds_per_tick()); if ( name == _SC_OPEN_MAX ) return rtems_libio_number_iops; 109825: a1 94 a2 12 00 mov 0x12a294,%eax { if ( name == _SC_CLK_TCK ) return (TOD_MICROSECONDS_PER_SECOND / rtems_configuration_get_microseconds_per_tick()); if ( name == _SC_OPEN_MAX ) 10982a: 83 fa 04 cmp $0x4,%edx 10982d: 74 2a je 109859 return rtems_libio_number_iops; if ( name == _SC_GETPW_R_SIZE_MAX ) return 1024; 10982f: b8 00 04 00 00 mov $0x400,%eax rtems_configuration_get_microseconds_per_tick()); if ( name == _SC_OPEN_MAX ) return rtems_libio_number_iops; if ( name == _SC_GETPW_R_SIZE_MAX ) 109834: 83 fa 33 cmp $0x33,%edx 109837: 74 20 je 109859 return 1024; if ( name == _SC_PAGESIZE ) return PAGE_SIZE; 109839: 66 b8 00 10 mov $0x1000,%ax return rtems_libio_number_iops; if ( name == _SC_GETPW_R_SIZE_MAX ) return 1024; if ( name == _SC_PAGESIZE ) 10983d: 83 fa 08 cmp $0x8,%edx 109840: 74 17 je 109859 return PAGE_SIZE; if ( name == _SC_SYMLOOP_MAX ) return RTEMS_FILESYSTEM_SYMLOOP_MAX; 109842: 66 b8 20 00 mov $0x20,%ax return 1024; if ( name == _SC_PAGESIZE ) return PAGE_SIZE; if ( name == _SC_SYMLOOP_MAX ) 109846: 83 fa 4f cmp $0x4f,%edx 109849: 74 0e je 109859 <== NEVER TAKEN #if defined(__sparc__) if ( name == 515 ) /* Solaris _SC_STACK_PROT */ return 0; #endif rtems_set_errno_and_return_minus_one( EINVAL ); 10984b: e8 5c 79 00 00 call 1111ac <__errno> 109850: c7 00 16 00 00 00 movl $0x16,(%eax) 109856: 83 c8 ff or $0xffffffff,%eax } 109859: c9 leave 10985a: c3 ret =============================================================================== 0010a9e8 : int timer_create( clockid_t clock_id, struct sigevent *evp, timer_t *timerid ) { 10a9e8: 55 push %ebp 10a9e9: 89 e5 mov %esp,%ebp 10a9eb: 56 push %esi 10a9ec: 53 push %ebx 10a9ed: 8b 5d 0c mov 0xc(%ebp),%ebx 10a9f0: 8b 75 10 mov 0x10(%ebp),%esi POSIX_Timer_Control *ptimer; if ( clock_id != CLOCK_REALTIME ) 10a9f3: 83 7d 08 01 cmpl $0x1,0x8(%ebp) 10a9f7: 74 02 je 10a9fb 10a9f9: eb 23 jmp 10aa1e rtems_set_errno_and_return_minus_one( EINVAL ); if ( !timerid ) 10a9fb: 85 f6 test %esi,%esi 10a9fd: 75 02 jne 10aa01 10a9ff: eb 1d jmp 10aa1e /* * The data of the structure evp are checked in order to verify if they * are coherent. */ if (evp != NULL) { 10aa01: 85 db test %ebx,%ebx 10aa03: 74 26 je 10aa2b /* The structure has data */ if ( ( evp->sigev_notify != SIGEV_NONE ) && 10aa05: 8b 03 mov (%ebx),%eax 10aa07: 48 dec %eax 10aa08: 83 f8 01 cmp $0x1,%eax 10aa0b: 76 02 jbe 10aa0f <== ALWAYS TAKEN 10aa0d: eb 0f jmp 10aa1e <== NOT EXECUTED ( evp->sigev_notify != SIGEV_SIGNAL ) ) { /* The value of the field sigev_notify is not valid */ rtems_set_errno_and_return_minus_one( EINVAL ); } if ( !evp->sigev_signo ) 10aa0f: 8b 43 04 mov 0x4(%ebx),%eax 10aa12: 85 c0 test %eax,%eax 10aa14: 75 02 jne 10aa18 <== ALWAYS TAKEN 10aa16: eb 06 jmp 10aa1e <== NOT EXECUTED static inline bool is_valid_signo( int signo ) { return ((signo) >= 1 && (signo) <= 32 ); 10aa18: 48 dec %eax rtems_set_errno_and_return_minus_one( EINVAL ); if ( !is_valid_signo(evp->sigev_signo) ) 10aa19: 83 f8 1f cmp $0x1f,%eax 10aa1c: 76 0d jbe 10aa2b <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one( EINVAL ); 10aa1e: e8 75 7e 00 00 call 112898 <__errno> 10aa23: c7 00 16 00 00 00 movl $0x16,(%eax) 10aa29: eb 34 jmp 10aa5f * * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { _Thread_Dispatch_disable_level++; 10aa2b: a1 b4 31 13 00 mov 0x1331b4,%eax 10aa30: 40 inc %eax 10aa31: a3 b4 31 13 00 mov %eax,0x1331b4 return _Thread_Dispatch_disable_level; 10aa36: a1 b4 31 13 00 mov 0x1331b4,%eax * 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 ); 10aa3b: 83 ec 0c sub $0xc,%esp 10aa3e: 68 b8 34 13 00 push $0x1334b8 10aa43: e8 70 1c 00 00 call 10c6b8 <_Objects_Allocate> /* * Allocate a timer */ ptimer = _POSIX_Timer_Allocate(); if ( !ptimer ) { 10aa48: 83 c4 10 add $0x10,%esp 10aa4b: 85 c0 test %eax,%eax 10aa4d: 75 18 jne 10aa67 _Thread_Enable_dispatch(); 10aa4f: e8 68 2c 00 00 call 10d6bc <_Thread_Enable_dispatch> rtems_set_errno_and_return_minus_one( EAGAIN ); 10aa54: e8 3f 7e 00 00 call 112898 <__errno> 10aa59: c7 00 0b 00 00 00 movl $0xb,(%eax) 10aa5f: 83 c8 ff or $0xffffffff,%eax 10aa62: e9 83 00 00 00 jmp 10aaea } /* The data of the created timer are stored to use them later */ ptimer->state = POSIX_TIMER_STATE_CREATE_NEW; 10aa67: c6 40 3c 02 movb $0x2,0x3c(%eax) ptimer->thread_id = _Thread_Executing->Object.id; 10aa6b: 8b 15 fc 36 13 00 mov 0x1336fc,%edx 10aa71: 8b 52 08 mov 0x8(%edx),%edx 10aa74: 89 50 38 mov %edx,0x38(%eax) if ( evp != NULL ) { 10aa77: 85 db test %ebx,%ebx 10aa79: 74 11 je 10aa8c ptimer->inf.sigev_notify = evp->sigev_notify; 10aa7b: 8b 13 mov (%ebx),%edx 10aa7d: 89 50 40 mov %edx,0x40(%eax) ptimer->inf.sigev_signo = evp->sigev_signo; 10aa80: 8b 53 04 mov 0x4(%ebx),%edx 10aa83: 89 50 44 mov %edx,0x44(%eax) ptimer->inf.sigev_value = evp->sigev_value; 10aa86: 8b 53 08 mov 0x8(%ebx),%edx 10aa89: 89 50 48 mov %edx,0x48(%eax) } ptimer->overrun = 0; 10aa8c: c7 40 68 00 00 00 00 movl $0x0,0x68(%eax) ptimer->timer_data.it_value.tv_sec = 0; 10aa93: c7 40 5c 00 00 00 00 movl $0x0,0x5c(%eax) ptimer->timer_data.it_value.tv_nsec = 0; 10aa9a: c7 40 60 00 00 00 00 movl $0x0,0x60(%eax) ptimer->timer_data.it_interval.tv_sec = 0; 10aaa1: c7 40 54 00 00 00 00 movl $0x0,0x54(%eax) ptimer->timer_data.it_interval.tv_nsec = 0; 10aaa8: 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; 10aaaf: c7 40 18 00 00 00 00 movl $0x0,0x18(%eax) the_watchdog->routine = routine; 10aab6: c7 40 2c 00 00 00 00 movl $0x0,0x2c(%eax) the_watchdog->id = id; 10aabd: c7 40 30 00 00 00 00 movl $0x0,0x30(%eax) the_watchdog->user_data = user_data; 10aac4: c7 40 34 00 00 00 00 movl $0x0,0x34(%eax) uint32_t name ) { _Objects_Set_local_object( information, _Objects_Get_index( the_object->id ), 10aacb: 8b 50 08 mov 0x8(%eax),%edx Objects_Information *information, Objects_Control *the_object, uint32_t name ) { _Objects_Set_local_object( 10aace: 0f b7 da movzwl %dx,%ebx #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 10aad1: 8b 0d d4 34 13 00 mov 0x1334d4,%ecx 10aad7: 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; 10aada: 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; 10aae1: 89 16 mov %edx,(%esi) _Thread_Enable_dispatch(); 10aae3: e8 d4 2b 00 00 call 10d6bc <_Thread_Enable_dispatch> return 0; 10aae8: 31 c0 xor %eax,%eax } 10aaea: 8d 65 f8 lea -0x8(%ebp),%esp 10aaed: 5b pop %ebx 10aaee: 5e pop %esi 10aaef: 5d pop %ebp 10aaf0: c3 ret =============================================================================== 001099d0 : timer_t timerid, int flags, const struct itimerspec *value, struct itimerspec *ovalue ) { 1099d0: 55 push %ebp 1099d1: 89 e5 mov %esp,%ebp 1099d3: 57 push %edi 1099d4: 56 push %esi 1099d5: 53 push %ebx 1099d6: 83 ec 3c sub $0x3c,%esp 1099d9: 8b 5d 0c mov 0xc(%ebp),%ebx Objects_Locations location; bool activated; uint32_t initial_period; struct itimerspec normalize; if ( !value ) 1099dc: 83 7d 10 00 cmpl $0x0,0x10(%ebp) 1099e0: 75 05 jne 1099e7 <== ALWAYS TAKEN 1099e2: e9 ba 01 00 00 jmp 109ba1 <== NOT EXECUTED /* * First, it verifies if the structure "value" is correct * if the number of nanoseconds is not correct return EINVAL */ if ( !_Timespec_Is_valid( &(value->it_value) ) ) { 1099e7: 83 ec 0c sub $0xc,%esp 1099ea: 8b 45 10 mov 0x10(%ebp),%eax 1099ed: 83 c0 08 add $0x8,%eax 1099f0: 50 push %eax 1099f1: e8 06 32 00 00 call 10cbfc <_Timespec_Is_valid> 1099f6: 83 c4 10 add $0x10,%esp 1099f9: 84 c0 test %al,%al 1099fb: 75 05 jne 109a02 1099fd: e9 9f 01 00 00 jmp 109ba1 rtems_set_errno_and_return_minus_one( EINVAL ); } if ( !_Timespec_Is_valid( &(value->it_interval) ) ) { 109a02: 83 ec 0c sub $0xc,%esp 109a05: ff 75 10 pushl 0x10(%ebp) 109a08: e8 ef 31 00 00 call 10cbfc <_Timespec_Is_valid> 109a0d: 83 c4 10 add $0x10,%esp 109a10: 84 c0 test %al,%al 109a12: 75 05 jne 109a19 <== ALWAYS TAKEN 109a14: e9 88 01 00 00 jmp 109ba1 <== NOT EXECUTED rtems_set_errno_and_return_minus_one( EINVAL ); } if ( flags != TIMER_ABSTIME && flags != POSIX_TIMER_RELATIVE ) { 109a19: f7 c3 fb ff ff ff test $0xfffffffb,%ebx 109a1f: 74 05 je 109a26 109a21: e9 7b 01 00 00 jmp 109ba1 rtems_set_errno_and_return_minus_one( EINVAL ); } normalize = *value; 109a26: 8d 7d d8 lea -0x28(%ebp),%edi 109a29: b9 04 00 00 00 mov $0x4,%ecx 109a2e: 8b 75 10 mov 0x10(%ebp),%esi 109a31: f3 a5 rep movsl %ds:(%esi),%es:(%edi) /* Convert absolute to relative time */ if (flags == TIMER_ABSTIME) { 109a33: 83 fb 04 cmp $0x4,%ebx 109a36: 75 5f jne 109a97 struct timespec *tod_as_timespec ) { Timestamp_Control tod_as_timestamp; _TOD_Get_as_timestamp( &tod_as_timestamp ); 109a38: 83 ec 0c sub $0xc,%esp 109a3b: 8d 45 c8 lea -0x38(%ebp),%eax 109a3e: 50 push %eax 109a3f: e8 18 15 00 00 call 10af5c <_TOD_Get_as_timestamp> _Timestamp_To_timespec( &tod_as_timestamp, tod_as_timespec ); 109a44: 8b 75 c8 mov -0x38(%ebp),%esi 109a47: 8b 7d cc mov -0x34(%ebp),%edi static inline void _Timestamp64_implementation_To_timespec( const Timestamp64_Control *_timestamp, struct timespec *_timespec ) { _timespec->tv_sec = (time_t) (*_timestamp / 1000000000L); 109a4a: 6a 00 push $0x0 109a4c: 68 00 ca 9a 3b push $0x3b9aca00 109a51: 57 push %edi 109a52: 56 push %esi 109a53: e8 8c 41 01 00 call 11dbe4 <__divdi3> 109a58: 83 c4 10 add $0x10,%esp 109a5b: 89 45 d0 mov %eax,-0x30(%ebp) _timespec->tv_nsec = (long) (*_timestamp % 1000000000L); 109a5e: 6a 00 push $0x0 109a60: 68 00 ca 9a 3b push $0x3b9aca00 109a65: 57 push %edi 109a66: 56 push %esi 109a67: e8 cc 42 01 00 call 11dd38 <__moddi3> 109a6c: 89 45 d4 mov %eax,-0x2c(%ebp) struct timespec now; _TOD_Get( &now ); /* Check for seconds in the past */ if ( _Timespec_Greater_than( &now, &normalize.it_value ) ) 109a6f: 83 c4 18 add $0x18,%esp 109a72: 8d 75 d0 lea -0x30(%ebp),%esi 109a75: 56 push %esi 109a76: 8d 5d e0 lea -0x20(%ebp),%ebx 109a79: 53 push %ebx 109a7a: e8 a1 31 00 00 call 10cc20 <_Timespec_Less_than> 109a7f: 83 c4 10 add $0x10,%esp 109a82: 84 c0 test %al,%al 109a84: 74 05 je 109a8b 109a86: e9 16 01 00 00 jmp 109ba1 rtems_set_errno_and_return_minus_one( EINVAL ); _Timespec_Subtract( &now, &normalize.it_value, &normalize.it_value ); 109a8b: 52 push %edx 109a8c: 53 push %ebx 109a8d: 53 push %ebx 109a8e: 56 push %esi 109a8f: e8 b0 31 00 00 call 10cc44 <_Timespec_Subtract> 109a94: 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 *) 109a97: 50 push %eax /* If the function reaches this point, then it will be necessary to do * something with the structure of times of the timer: to stop, start * or start it again */ ptimer = _POSIX_Timer_Get( timerid, &location ); 109a98: 8d 45 c4 lea -0x3c(%ebp),%eax 109a9b: 50 push %eax 109a9c: ff 75 08 pushl 0x8(%ebp) 109a9f: 68 b8 e6 12 00 push $0x12e6b8 109aa4: e8 3f 1d 00 00 call 10b7e8 <_Objects_Get> 109aa9: 89 c3 mov %eax,%ebx switch ( location ) { 109aab: 83 c4 10 add $0x10,%esp 109aae: 83 7d c4 00 cmpl $0x0,-0x3c(%ebp) 109ab2: 0f 85 e9 00 00 00 jne 109ba1 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 ) { 109ab8: 83 7d e0 00 cmpl $0x0,-0x20(%ebp) 109abc: 75 3c jne 109afa 109abe: 83 7d e4 00 cmpl $0x0,-0x1c(%ebp) 109ac2: 75 36 jne 109afa /* Stop the timer */ (void) _Watchdog_Remove( &ptimer->Timer ); 109ac4: 83 ec 0c sub $0xc,%esp 109ac7: 8d 40 10 lea 0x10(%eax),%eax 109aca: 50 push %eax 109acb: e8 10 35 00 00 call 10cfe0 <_Watchdog_Remove> /* The old data of the timer are returned */ if ( ovalue ) 109ad0: 83 c4 10 add $0x10,%esp 109ad3: 83 7d 14 00 cmpl $0x0,0x14(%ebp) 109ad7: 8d 43 54 lea 0x54(%ebx),%eax 109ada: 74 0c je 109ae8 *ovalue = ptimer->timer_data; 109adc: b9 04 00 00 00 mov $0x4,%ecx 109ae1: 8b 7d 14 mov 0x14(%ebp),%edi 109ae4: 89 c6 mov %eax,%esi 109ae6: f3 a5 rep movsl %ds:(%esi),%es:(%edi) /* The new data are set */ ptimer->timer_data = normalize; 109ae8: 8d 75 d8 lea -0x28(%ebp),%esi 109aeb: b9 04 00 00 00 mov $0x4,%ecx 109af0: 89 c7 mov %eax,%edi 109af2: f3 a5 rep movsl %ds:(%esi),%es:(%edi) /* Indicates that the timer is created and stopped */ ptimer->state = POSIX_TIMER_STATE_CREATE_STOP; 109af4: c6 43 3c 04 movb $0x4,0x3c(%ebx) 109af8: eb 35 jmp 109b2f _Thread_Enable_dispatch(); return 0; } /* Convert from seconds and nanoseconds to ticks */ ptimer->ticks = _Timespec_To_ticks( &value->it_interval ); 109afa: 83 ec 0c sub $0xc,%esp 109afd: ff 75 10 pushl 0x10(%ebp) 109b00: e8 77 31 00 00 call 10cc7c <_Timespec_To_ticks> 109b05: 89 43 64 mov %eax,0x64(%ebx) initial_period = _Timespec_To_ticks( &normalize.it_value ); 109b08: 8d 45 e0 lea -0x20(%ebp),%eax 109b0b: 89 04 24 mov %eax,(%esp) 109b0e: e8 69 31 00 00 call 10cc7c <_Timespec_To_ticks> activated = _POSIX_Timer_Insert_helper( 109b13: 89 1c 24 mov %ebx,(%esp) 109b16: 68 b8 9b 10 00 push $0x109bb8 109b1b: ff 73 08 pushl 0x8(%ebx) 109b1e: 50 push %eax 109b1f: 8d 43 10 lea 0x10(%ebx),%eax 109b22: 50 push %eax 109b23: e8 28 52 00 00 call 10ed50 <_POSIX_Timer_Insert_helper> initial_period, ptimer->Object.id, _POSIX_Timer_TSR, ptimer ); if ( !activated ) { 109b28: 83 c4 20 add $0x20,%esp 109b2b: 84 c0 test %al,%al 109b2d: 75 07 jne 109b36 _Thread_Enable_dispatch(); 109b2f: e8 e8 27 00 00 call 10c31c <_Thread_Enable_dispatch> 109b34: eb 67 jmp 109b9d /* * The timer has been started and is running. So we return the * old ones in "ovalue" */ if ( ovalue ) 109b36: 83 7d 14 00 cmpl $0x0,0x14(%ebp) 109b3a: 8d 43 54 lea 0x54(%ebx),%eax 109b3d: 74 0c je 109b4b *ovalue = ptimer->timer_data; 109b3f: b9 04 00 00 00 mov $0x4,%ecx 109b44: 8b 7d 14 mov 0x14(%ebp),%edi 109b47: 89 c6 mov %eax,%esi 109b49: f3 a5 rep movsl %ds:(%esi),%es:(%edi) ptimer->timer_data = normalize; 109b4b: 8d 75 d8 lea -0x28(%ebp),%esi 109b4e: b9 04 00 00 00 mov $0x4,%ecx 109b53: 89 c7 mov %eax,%edi 109b55: f3 a5 rep movsl %ds:(%esi),%es:(%edi) /* Indicate that the time is running */ ptimer->state = POSIX_TIMER_STATE_CREATE_RUN; 109b57: c6 43 3c 03 movb $0x3,0x3c(%ebx) struct timespec *tod_as_timespec ) { Timestamp_Control tod_as_timestamp; _TOD_Get_as_timestamp( &tod_as_timestamp ); 109b5b: 83 ec 0c sub $0xc,%esp 109b5e: 8d 45 c8 lea -0x38(%ebp),%eax 109b61: 50 push %eax 109b62: e8 f5 13 00 00 call 10af5c <_TOD_Get_as_timestamp> _Timestamp_To_timespec( &tod_as_timestamp, tod_as_timespec ); 109b67: 8b 75 c8 mov -0x38(%ebp),%esi 109b6a: 8b 7d cc mov -0x34(%ebp),%edi static inline void _Timestamp64_implementation_To_timespec( const Timestamp64_Control *_timestamp, struct timespec *_timespec ) { _timespec->tv_sec = (time_t) (*_timestamp / 1000000000L); 109b6d: 6a 00 push $0x0 109b6f: 68 00 ca 9a 3b push $0x3b9aca00 109b74: 57 push %edi 109b75: 56 push %esi 109b76: e8 69 40 01 00 call 11dbe4 <__divdi3> 109b7b: 83 c4 10 add $0x10,%esp 109b7e: 89 43 6c mov %eax,0x6c(%ebx) _timespec->tv_nsec = (long) (*_timestamp % 1000000000L); 109b81: 6a 00 push $0x0 109b83: 68 00 ca 9a 3b push $0x3b9aca00 109b88: 57 push %edi 109b89: 56 push %esi 109b8a: e8 a9 41 01 00 call 11dd38 <__moddi3> 109b8f: 83 c4 10 add $0x10,%esp 109b92: 89 43 70 mov %eax,0x70(%ebx) _TOD_Get( &ptimer->time ); _Thread_Enable_dispatch(); 109b95: e8 82 27 00 00 call 10c31c <_Thread_Enable_dispatch> 109b9a: 83 c4 10 add $0x10,%esp return 0; 109b9d: 31 c0 xor %eax,%eax 109b9f: eb 0e jmp 109baf #endif case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( EINVAL ); 109ba1: e8 c6 7a 00 00 call 11166c <__errno> 109ba6: c7 00 16 00 00 00 movl $0x16,(%eax) 109bac: 83 c8 ff or $0xffffffff,%eax } 109baf: 8d 65 f4 lea -0xc(%ebp),%esp 109bb2: 5b pop %ebx 109bb3: 5e pop %esi 109bb4: 5f pop %edi 109bb5: 5d pop %ebp 109bb6: c3 ret =============================================================================== 00109aa8 : useconds_t ualarm( useconds_t useconds, useconds_t interval ) { 109aa8: 55 push %ebp 109aa9: 89 e5 mov %esp,%ebp 109aab: 56 push %esi 109aac: 53 push %ebx 109aad: 83 ec 10 sub $0x10,%esp /* * Initialize the timer used to implement alarm(). */ if ( !the_timer->routine ) { 109ab0: 83 3d 0c fd 12 00 00 cmpl $0x0,0x12fd0c 109ab7: 75 2c jne 109ae5 Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 109ab9: c7 05 f8 fc 12 00 00 movl $0x0,0x12fcf8 109ac0: 00 00 00 the_watchdog->routine = routine; 109ac3: c7 05 0c fd 12 00 70 movl $0x109a70,0x12fd0c 109aca: 9a 10 00 the_watchdog->id = id; 109acd: c7 05 10 fd 12 00 00 movl $0x0,0x12fd10 109ad4: 00 00 00 the_watchdog->user_data = user_data; 109ad7: c7 05 14 fd 12 00 00 movl $0x0,0x12fd14 109ade: 00 00 00 useconds_t ualarm( useconds_t useconds, useconds_t interval ) { useconds_t remaining = 0; 109ae1: 31 db xor %ebx,%ebx 109ae3: eb 4f jmp 109b34 if ( !the_timer->routine ) { _Watchdog_Initialize( the_timer, _POSIX_signals_Ualarm_TSR, 0, NULL ); } else { Watchdog_States state; state = _Watchdog_Remove( the_timer ); 109ae5: 83 ec 0c sub $0xc,%esp 109ae8: 68 f0 fc 12 00 push $0x12fcf0 109aed: e8 12 33 00 00 call 10ce04 <_Watchdog_Remove> if ( (state == WATCHDOG_ACTIVE) || (state == WATCHDOG_REMOVE_IT) ) { 109af2: 83 e8 02 sub $0x2,%eax 109af5: 83 c4 10 add $0x10,%esp useconds_t ualarm( useconds_t useconds, useconds_t interval ) { useconds_t remaining = 0; 109af8: 31 db xor %ebx,%ebx _Watchdog_Initialize( the_timer, _POSIX_signals_Ualarm_TSR, 0, NULL ); } else { Watchdog_States state; state = _Watchdog_Remove( the_timer ); if ( (state == WATCHDOG_ACTIVE) || (state == WATCHDOG_REMOVE_IT) ) { 109afa: 83 f8 01 cmp $0x1,%eax 109afd: 77 35 ja 109b34 <== 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); 109aff: 8b 0d 04 fd 12 00 mov 0x12fd04,%ecx 109b05: 03 0d fc fc 12 00 add 0x12fcfc,%ecx /* remaining is now in ticks */ _Timespec_From_ticks( ticks, &tp ); 109b0b: 50 push %eax 109b0c: 50 push %eax 109b0d: 8d 45 f0 lea -0x10(%ebp),%eax 109b10: 50 push %eax * 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); 109b11: 2b 0d 08 fd 12 00 sub 0x12fd08,%ecx /* remaining is now in ticks */ _Timespec_From_ticks( ticks, &tp ); 109b17: 51 push %ecx 109b18: e8 f3 2e 00 00 call 10ca10 <_Timespec_From_ticks> remaining = tp.tv_sec * TOD_MICROSECONDS_PER_SECOND; 109b1d: 69 5d f0 40 42 0f 00 imul $0xf4240,-0x10(%ebp),%ebx remaining += tp.tv_nsec / 1000; 109b24: 8b 45 f4 mov -0xc(%ebp),%eax 109b27: b9 e8 03 00 00 mov $0x3e8,%ecx 109b2c: 99 cltd 109b2d: f7 f9 idiv %ecx 109b2f: 01 c3 add %eax,%ebx 109b31: 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 ) { 109b34: 83 7d 08 00 cmpl $0x0,0x8(%ebp) 109b38: 74 45 je 109b7f Watchdog_Interval ticks; tp.tv_sec = useconds / TOD_MICROSECONDS_PER_SECOND; 109b3a: b9 40 42 0f 00 mov $0xf4240,%ecx 109b3f: 8b 45 08 mov 0x8(%ebp),%eax 109b42: 31 d2 xor %edx,%edx 109b44: f7 f1 div %ecx 109b46: 89 45 f0 mov %eax,-0x10(%ebp) tp.tv_nsec = (useconds % TOD_MICROSECONDS_PER_SECOND) * 1000; 109b49: 69 d2 e8 03 00 00 imul $0x3e8,%edx,%edx 109b4f: 89 55 f4 mov %edx,-0xc(%ebp) ticks = _Timespec_To_ticks( &tp ); 109b52: 83 ec 0c sub $0xc,%esp 109b55: 8d 75 f0 lea -0x10(%ebp),%esi 109b58: 56 push %esi 109b59: e8 da 2e 00 00 call 10ca38 <_Timespec_To_ticks> if ( ticks == 0 ) ticks = 1; _Watchdog_Insert_ticks( the_timer, _Timespec_To_ticks( &tp ) ); 109b5e: 89 34 24 mov %esi,(%esp) 109b61: e8 d2 2e 00 00 call 10ca38 <_Timespec_To_ticks> Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 109b66: a3 fc fc 12 00 mov %eax,0x12fcfc _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 109b6b: 59 pop %ecx 109b6c: 5e pop %esi 109b6d: 68 f0 fc 12 00 push $0x12fcf0 109b72: 68 d8 f4 12 00 push $0x12f4d8 109b77: e8 74 31 00 00 call 10ccf0 <_Watchdog_Insert> 109b7c: 83 c4 10 add $0x10,%esp } return remaining; } 109b7f: 89 d8 mov %ebx,%eax 109b81: 8d 65 f8 lea -0x8(%ebp),%esp 109b84: 5b pop %ebx 109b85: 5e pop %esi 109b86: 5d pop %ebp 109b87: c3 ret