=============================================================================== 0010cb5c <_CORE_RWLock_Obtain_for_reading>: Objects_Id id, bool wait, Watchdog_Interval timeout, CORE_RWLock_API_mp_support_callout api_rwlock_mp_support ) { 10cb5c: 55 push %ebp 10cb5d: 89 e5 mov %esp,%ebp 10cb5f: 57 push %edi 10cb60: 56 push %esi 10cb61: 53 push %ebx 10cb62: 83 ec 1c sub $0x1c,%esp 10cb65: 8b 5d 08 mov 0x8(%ebp),%ebx 10cb68: 8b 4d 0c mov 0xc(%ebp),%ecx 10cb6b: 8b 45 14 mov 0x14(%ebp),%eax 10cb6e: 89 45 e4 mov %eax,-0x1c(%ebp) 10cb71: 8a 55 10 mov 0x10(%ebp),%dl ISR_Level level; Thread_Control *executing = _Thread_Executing; 10cb74: 8b 35 44 77 12 00 mov 0x127744,%esi * If unlocked, then OK to read. * If locked for reading and no waiters, then OK to read. * If any thread is waiting, then we wait. */ _ISR_Disable( level ); 10cb7a: 9c pushf 10cb7b: fa cli 10cb7c: 5f pop %edi switch ( the_rwlock->current_state ) { 10cb7d: 8b 43 44 mov 0x44(%ebx),%eax 10cb80: 85 c0 test %eax,%eax 10cb82: 74 05 je 10cb89 <_CORE_RWLock_Obtain_for_reading+0x2d> 10cb84: 48 dec %eax 10cb85: 75 3a jne 10cbc1 <_CORE_RWLock_Obtain_for_reading+0x65> 10cb87: eb 0e jmp 10cb97 <_CORE_RWLock_Obtain_for_reading+0x3b> case CORE_RWLOCK_UNLOCKED: the_rwlock->current_state = CORE_RWLOCK_LOCKED_FOR_READING; 10cb89: c7 43 44 01 00 00 00 movl $0x1,0x44(%ebx) the_rwlock->number_of_readers += 1; 10cb90: ff 43 48 incl 0x48(%ebx) _ISR_Enable( level ); 10cb93: 57 push %edi 10cb94: 9d popf 10cb95: eb 21 jmp 10cbb8 <_CORE_RWLock_Obtain_for_reading+0x5c> executing->Wait.return_code = CORE_RWLOCK_SUCCESSFUL; return; case CORE_RWLOCK_LOCKED_FOR_READING: { Thread_Control *waiter; waiter = _Thread_queue_First( &the_rwlock->Wait_queue ); 10cb97: 83 ec 0c sub $0xc,%esp 10cb9a: 53 push %ebx 10cb9b: 88 55 dc mov %dl,-0x24(%ebp) 10cb9e: 89 4d e0 mov %ecx,-0x20(%ebp) 10cba1: e8 9e 1a 00 00 call 10e644 <_Thread_queue_First> if ( !waiter ) { 10cba6: 83 c4 10 add $0x10,%esp 10cba9: 85 c0 test %eax,%eax 10cbab: 8a 55 dc mov -0x24(%ebp),%dl 10cbae: 8b 4d e0 mov -0x20(%ebp),%ecx 10cbb1: 75 0e jne 10cbc1 <_CORE_RWLock_Obtain_for_reading+0x65><== NEVER TAKEN the_rwlock->number_of_readers += 1; 10cbb3: ff 43 48 incl 0x48(%ebx) _ISR_Enable( level ); 10cbb6: 57 push %edi 10cbb7: 9d popf executing->Wait.return_code = CORE_RWLOCK_SUCCESSFUL; 10cbb8: c7 46 34 00 00 00 00 movl $0x0,0x34(%esi) return; 10cbbf: eb 48 jmp 10cc09 <_CORE_RWLock_Obtain_for_reading+0xad> /* * If the thread is not willing to wait, then return immediately. */ if ( !wait ) { 10cbc1: 84 d2 test %dl,%dl 10cbc3: 75 0b jne 10cbd0 <_CORE_RWLock_Obtain_for_reading+0x74> _ISR_Enable( level ); 10cbc5: 57 push %edi 10cbc6: 9d popf executing->Wait.return_code = CORE_RWLOCK_UNAVAILABLE; 10cbc7: c7 46 34 02 00 00 00 movl $0x2,0x34(%esi) 10cbce: eb 39 jmp 10cc09 <_CORE_RWLock_Obtain_for_reading+0xad> 10cbd0: c7 43 30 01 00 00 00 movl $0x1,0x30(%ebx) /* * We need to wait to enter this critical section */ _Thread_queue_Enter_critical_section( &the_rwlock->Wait_queue ); executing->Wait.queue = &the_rwlock->Wait_queue; 10cbd7: 89 5e 44 mov %ebx,0x44(%esi) executing->Wait.id = id; 10cbda: 89 4e 20 mov %ecx,0x20(%esi) executing->Wait.option = CORE_RWLOCK_THREAD_WAITING_FOR_READ; 10cbdd: c7 46 30 00 00 00 00 movl $0x0,0x30(%esi) executing->Wait.return_code = CORE_RWLOCK_SUCCESSFUL; 10cbe4: c7 46 34 00 00 00 00 movl $0x0,0x34(%esi) _ISR_Enable( level ); 10cbeb: 57 push %edi 10cbec: 9d popf _Thread_queue_Enqueue_with_handler( 10cbed: c7 45 10 38 cd 10 00 movl $0x10cd38,0x10(%ebp) 10cbf4: 8b 45 e4 mov -0x1c(%ebp),%eax 10cbf7: 89 45 0c mov %eax,0xc(%ebp) 10cbfa: 89 5d 08 mov %ebx,0x8(%ebp) timeout, _CORE_RWLock_Timeout ); /* return to API level so it can dispatch and we block */ } 10cbfd: 8d 65 f4 lea -0xc(%ebp),%esp 10cc00: 5b pop %ebx 10cc01: 5e pop %esi 10cc02: 5f pop %edi 10cc03: c9 leave executing->Wait.id = id; executing->Wait.option = CORE_RWLOCK_THREAD_WAITING_FOR_READ; executing->Wait.return_code = CORE_RWLOCK_SUCCESSFUL; _ISR_Enable( level ); _Thread_queue_Enqueue_with_handler( 10cc04: e9 57 17 00 00 jmp 10e360 <_Thread_queue_Enqueue_with_handler> timeout, _CORE_RWLock_Timeout ); /* return to API level so it can dispatch and we block */ } 10cc09: 8d 65 f4 lea -0xc(%ebp),%esp 10cc0c: 5b pop %ebx 10cc0d: 5e pop %esi 10cc0e: 5f pop %edi 10cc0f: c9 leave 10cc10: c3 ret =============================================================================== 0010cc98 <_CORE_RWLock_Release>: */ CORE_RWLock_Status _CORE_RWLock_Release( CORE_RWLock_Control *the_rwlock ) { 10cc98: 55 push %ebp 10cc99: 89 e5 mov %esp,%ebp 10cc9b: 53 push %ebx 10cc9c: 83 ec 04 sub $0x4,%esp 10cc9f: 8b 5d 08 mov 0x8(%ebp),%ebx ISR_Level level; Thread_Control *executing = _Thread_Executing; 10cca2: 8b 15 44 77 12 00 mov 0x127744,%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 ); 10cca8: 9c pushf 10cca9: fa cli 10ccaa: 58 pop %eax if ( the_rwlock->current_state == CORE_RWLOCK_UNLOCKED){ 10ccab: 8b 4b 44 mov 0x44(%ebx),%ecx 10ccae: 85 c9 test %ecx,%ecx 10ccb0: 75 0b jne 10ccbd <_CORE_RWLock_Release+0x25> _ISR_Enable( level ); 10ccb2: 50 push %eax 10ccb3: 9d popf executing->Wait.return_code = CORE_RWLOCK_UNAVAILABLE; 10ccb4: c7 42 34 02 00 00 00 movl $0x2,0x34(%edx) return CORE_RWLOCK_SUCCESSFUL; 10ccbb: eb 72 jmp 10cd2f <_CORE_RWLock_Release+0x97> } if ( the_rwlock->current_state == CORE_RWLOCK_LOCKED_FOR_READING ) { 10ccbd: 49 dec %ecx 10ccbe: 75 0f jne 10cccf <_CORE_RWLock_Release+0x37> the_rwlock->number_of_readers -= 1; 10ccc0: 8b 4b 48 mov 0x48(%ebx),%ecx 10ccc3: 49 dec %ecx 10ccc4: 89 4b 48 mov %ecx,0x48(%ebx) if ( the_rwlock->number_of_readers != 0 ) { 10ccc7: 85 c9 test %ecx,%ecx 10ccc9: 74 04 je 10cccf <_CORE_RWLock_Release+0x37> /* must be unlocked again */ _ISR_Enable( level ); 10cccb: 50 push %eax 10cccc: 9d popf return CORE_RWLOCK_SUCCESSFUL; 10cccd: eb 60 jmp 10cd2f <_CORE_RWLock_Release+0x97> } } /* CORE_RWLOCK_LOCKED_FOR_WRITING or READING with readers */ executing->Wait.return_code = CORE_RWLOCK_SUCCESSFUL; 10cccf: 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; 10ccd6: c7 43 44 00 00 00 00 movl $0x0,0x44(%ebx) _ISR_Enable( level ); 10ccdd: 50 push %eax 10ccde: 9d popf next = _Thread_queue_Dequeue( &the_rwlock->Wait_queue ); 10ccdf: 83 ec 0c sub $0xc,%esp 10cce2: 53 push %ebx 10cce3: e8 70 15 00 00 call 10e258 <_Thread_queue_Dequeue> if ( next ) { 10cce8: 83 c4 10 add $0x10,%esp 10cceb: 85 c0 test %eax,%eax 10cced: 74 40 je 10cd2f <_CORE_RWLock_Release+0x97> if ( next->Wait.option == CORE_RWLOCK_THREAD_WAITING_FOR_WRITE ) { 10ccef: 83 78 30 01 cmpl $0x1,0x30(%eax) 10ccf3: 75 09 jne 10ccfe <_CORE_RWLock_Release+0x66> the_rwlock->current_state = CORE_RWLOCK_LOCKED_FOR_WRITING; 10ccf5: c7 43 44 02 00 00 00 movl $0x2,0x44(%ebx) return CORE_RWLOCK_SUCCESSFUL; 10ccfc: eb 31 jmp 10cd2f <_CORE_RWLock_Release+0x97> } /* * Must be CORE_RWLOCK_THREAD_WAITING_FOR_READING */ the_rwlock->number_of_readers += 1; 10ccfe: ff 43 48 incl 0x48(%ebx) the_rwlock->current_state = CORE_RWLOCK_LOCKED_FOR_READING; 10cd01: 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 ); 10cd08: 83 ec 0c sub $0xc,%esp 10cd0b: 53 push %ebx 10cd0c: e8 33 19 00 00 call 10e644 <_Thread_queue_First> if ( !next || 10cd11: 83 c4 10 add $0x10,%esp 10cd14: 85 c0 test %eax,%eax 10cd16: 74 17 je 10cd2f <_CORE_RWLock_Release+0x97> 10cd18: 83 78 30 01 cmpl $0x1,0x30(%eax) 10cd1c: 74 11 je 10cd2f <_CORE_RWLock_Release+0x97><== NEVER TAKEN next->Wait.option == CORE_RWLOCK_THREAD_WAITING_FOR_WRITE ) return CORE_RWLOCK_SUCCESSFUL; the_rwlock->number_of_readers += 1; 10cd1e: ff 43 48 incl 0x48(%ebx) _Thread_queue_Extract( &the_rwlock->Wait_queue, next ); 10cd21: 52 push %edx 10cd22: 52 push %edx 10cd23: 50 push %eax 10cd24: 53 push %ebx 10cd25: e8 0e 18 00 00 call 10e538 <_Thread_queue_Extract> } 10cd2a: 83 c4 10 add $0x10,%esp 10cd2d: eb d9 jmp 10cd08 <_CORE_RWLock_Release+0x70> } /* indentation is to match _ISR_Disable at top */ return CORE_RWLOCK_SUCCESSFUL; } 10cd2f: 31 c0 xor %eax,%eax 10cd31: 8b 5d fc mov -0x4(%ebp),%ebx 10cd34: c9 leave 10cd35: c3 ret =============================================================================== 0010cd38 <_CORE_RWLock_Timeout>: void _CORE_RWLock_Timeout( Objects_Id id, void *ignored ) { 10cd38: 55 push %ebp 10cd39: 89 e5 mov %esp,%ebp 10cd3b: 83 ec 20 sub $0x20,%esp Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); 10cd3e: 8d 45 f4 lea -0xc(%ebp),%eax 10cd41: 50 push %eax 10cd42: ff 75 08 pushl 0x8(%ebp) 10cd45: e8 ae 11 00 00 call 10def8 <_Thread_Get> switch ( location ) { 10cd4a: 83 c4 10 add $0x10,%esp 10cd4d: 83 7d f4 00 cmpl $0x0,-0xc(%ebp) 10cd51: 75 17 jne 10cd6a <_CORE_RWLock_Timeout+0x32><== NEVER TAKEN #if defined(RTEMS_MULTIPROCESSING) case OBJECTS_REMOTE: /* impossible */ #endif break; case OBJECTS_LOCAL: _Thread_queue_Process_timeout( the_thread ); 10cd53: 83 ec 0c sub $0xc,%esp 10cd56: 50 push %eax 10cd57: e8 b4 19 00 00 call 10e710 <_Thread_queue_Process_timeout> */ RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void ) { RTEMS_COMPILER_MEMORY_BARRIER(); _Thread_Dispatch_disable_level -= 1; 10cd5c: a1 f4 71 12 00 mov 0x1271f4,%eax 10cd61: 48 dec %eax 10cd62: a3 f4 71 12 00 mov %eax,0x1271f4 10cd67: 83 c4 10 add $0x10,%esp _Thread_Unnest_dispatch(); break; } } 10cd6a: c9 leave 10cd6b: c3 ret =============================================================================== 00117458 <_CORE_message_queue_Broadcast>: Objects_Id id __attribute__((unused)), CORE_message_queue_API_mp_support_callout api_message_queue_mp_support __attribute__((unused)), #endif uint32_t *count ) { 117458: 55 push %ebp 117459: 89 e5 mov %esp,%ebp 11745b: 57 push %edi 11745c: 56 push %esi 11745d: 53 push %ebx 11745e: 83 ec 1c sub $0x1c,%esp 117461: 8b 5d 08 mov 0x8(%ebp),%ebx Thread_Control *the_thread; uint32_t number_broadcasted; Thread_Wait_information *waitp; if ( size > the_message_queue->maximum_message_size ) { return CORE_MESSAGE_QUEUE_STATUS_INVALID_SIZE; 117464: b8 01 00 00 00 mov $0x1,%eax { Thread_Control *the_thread; uint32_t number_broadcasted; Thread_Wait_information *waitp; if ( size > the_message_queue->maximum_message_size ) { 117469: 8b 55 10 mov 0x10(%ebp),%edx 11746c: 3b 53 4c cmp 0x4c(%ebx),%edx 11746f: 77 4e ja 1174bf <_CORE_message_queue_Broadcast+0x67><== NEVER TAKEN * NOTE: This check is critical because threads can block on * send and receive and this ensures that we are broadcasting * the message to threads waiting to receive -- not to send. */ if ( the_message_queue->number_of_pending_messages != 0 ) { 117471: 83 7b 48 00 cmpl $0x0,0x48(%ebx) 117475: 75 09 jne 117480 <_CORE_message_queue_Broadcast+0x28> 117477: c7 45 e4 00 00 00 00 movl $0x0,-0x1c(%ebp) 11747e: eb 23 jmp 1174a3 <_CORE_message_queue_Broadcast+0x4b> *count = 0; 117480: 8b 45 1c mov 0x1c(%ebp),%eax 117483: c7 00 00 00 00 00 movl $0x0,(%eax) 117489: eb 32 jmp 1174bd <_CORE_message_queue_Broadcast+0x65> */ number_broadcasted = 0; while ((the_thread = _Thread_queue_Dequeue(&the_message_queue->Wait_queue))) { waitp = &the_thread->Wait; number_broadcasted += 1; 11748b: ff 45 e4 incl -0x1c(%ebp) const void *source, void *destination, size_t size ) { memcpy(destination, source, size); 11748e: 8b 42 2c mov 0x2c(%edx),%eax 117491: 89 c7 mov %eax,%edi 117493: 8b 75 0c mov 0xc(%ebp),%esi 117496: 8b 4d 10 mov 0x10(%ebp),%ecx 117499: f3 a4 rep movsb %ds:(%esi),%es:(%edi) buffer, waitp->return_argument_second.mutable_object, size ); *(size_t *) the_thread->Wait.return_argument = size; 11749b: 8b 42 28 mov 0x28(%edx),%eax 11749e: 8b 55 10 mov 0x10(%ebp),%edx 1174a1: 89 10 mov %edx,(%eax) /* * There must be no pending messages if there is a thread waiting to * receive a message. */ number_broadcasted = 0; while ((the_thread = 1174a3: 83 ec 0c sub $0xc,%esp 1174a6: 53 push %ebx 1174a7: e8 94 22 00 00 call 119740 <_Thread_queue_Dequeue> 1174ac: 89 c2 mov %eax,%edx 1174ae: 83 c4 10 add $0x10,%esp 1174b1: 85 c0 test %eax,%eax 1174b3: 75 d6 jne 11748b <_CORE_message_queue_Broadcast+0x33> if ( !_Objects_Is_local_id( the_thread->Object.id ) ) (*api_message_queue_mp_support) ( the_thread, id ); #endif } *count = number_broadcasted; 1174b5: 8b 55 e4 mov -0x1c(%ebp),%edx 1174b8: 8b 45 1c mov 0x1c(%ebp),%eax 1174bb: 89 10 mov %edx,(%eax) return CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL; 1174bd: 31 c0 xor %eax,%eax } 1174bf: 8d 65 f4 lea -0xc(%ebp),%esp 1174c2: 5b pop %ebx 1174c3: 5e pop %esi 1174c4: 5f pop %edi 1174c5: c9 leave 1174c6: c3 ret =============================================================================== 00112278 <_CORE_message_queue_Initialize>: CORE_message_queue_Control *the_message_queue, CORE_message_queue_Attributes *the_message_queue_attributes, uint32_t maximum_pending_messages, size_t maximum_message_size ) { 112278: 55 push %ebp 112279: 89 e5 mov %esp,%ebp 11227b: 57 push %edi 11227c: 56 push %esi 11227d: 53 push %ebx 11227e: 83 ec 1c sub $0x1c,%esp 112281: 8b 5d 08 mov 0x8(%ebp),%ebx 112284: 8b 7d 10 mov 0x10(%ebp),%edi 112287: 8b 55 14 mov 0x14(%ebp),%edx size_t message_buffering_required; size_t allocated_message_size; the_message_queue->maximum_pending_messages = maximum_pending_messages; 11228a: 89 7b 44 mov %edi,0x44(%ebx) the_message_queue->number_of_pending_messages = 0; 11228d: c7 43 48 00 00 00 00 movl $0x0,0x48(%ebx) the_message_queue->maximum_message_size = maximum_message_size; 112294: 89 53 4c mov %edx,0x4c(%ebx) CORE_message_queue_Control *the_message_queue, CORE_message_queue_Notify_Handler the_handler, void *the_argument ) { the_message_queue->notify_handler = the_handler; 112297: c7 43 60 00 00 00 00 movl $0x0,0x60(%ebx) the_message_queue->notify_argument = the_argument; 11229e: c7 43 64 00 00 00 00 movl $0x0,0x64(%ebx) /* * Round size up to multiple of a pointer for chain init and * check for overflow on adding overhead to each message. */ allocated_message_size = maximum_message_size; if (allocated_message_size & (sizeof(uint32_t) - 1)) { 1122a5: 89 d0 mov %edx,%eax 1122a7: f6 c2 03 test $0x3,%dl 1122aa: 74 0c je 1122b8 <_CORE_message_queue_Initialize+0x40> allocated_message_size += sizeof(uint32_t); 1122ac: 83 c0 04 add $0x4,%eax allocated_message_size &= ~(sizeof(uint32_t) - 1); 1122af: 83 e0 fc and $0xfffffffc,%eax } if (allocated_message_size < maximum_message_size) return false; 1122b2: 31 f6 xor %esi,%esi if (allocated_message_size & (sizeof(uint32_t) - 1)) { allocated_message_size += sizeof(uint32_t); allocated_message_size &= ~(sizeof(uint32_t) - 1); } if (allocated_message_size < maximum_message_size) 1122b4: 39 d0 cmp %edx,%eax 1122b6: 72 68 jb 112320 <_CORE_message_queue_Initialize+0xa8><== NEVER TAKEN /* * Calculate how much total memory is required for message buffering and * check for overflow on the multiplication. */ message_buffering_required = (size_t) maximum_pending_messages * (allocated_message_size + sizeof(CORE_message_queue_Buffer_control)); 1122b8: 8d 50 14 lea 0x14(%eax),%edx /* * Calculate how much total memory is required for message buffering and * check for overflow on the multiplication. */ message_buffering_required = (size_t) maximum_pending_messages * 1122bb: 89 d1 mov %edx,%ecx 1122bd: 0f af cf imul %edi,%ecx (allocated_message_size + sizeof(CORE_message_queue_Buffer_control)); if (message_buffering_required < allocated_message_size) return false; 1122c0: 31 f6 xor %esi,%esi * check for overflow on the multiplication. */ message_buffering_required = (size_t) maximum_pending_messages * (allocated_message_size + sizeof(CORE_message_queue_Buffer_control)); if (message_buffering_required < allocated_message_size) 1122c2: 39 c1 cmp %eax,%ecx 1122c4: 72 5a jb 112320 <_CORE_message_queue_Initialize+0xa8><== NEVER TAKEN /* * Attempt to allocate the message memory */ the_message_queue->message_buffers = (CORE_message_queue_Buffer *) _Workspace_Allocate( message_buffering_required ); 1122c6: 83 ec 0c sub $0xc,%esp 1122c9: 51 push %ecx 1122ca: 89 55 e4 mov %edx,-0x1c(%ebp) 1122cd: e8 a8 26 00 00 call 11497a <_Workspace_Allocate> return false; /* * Attempt to allocate the message memory */ the_message_queue->message_buffers = (CORE_message_queue_Buffer *) 1122d2: 89 43 5c mov %eax,0x5c(%ebx) _Workspace_Allocate( message_buffering_required ); if (the_message_queue->message_buffers == 0) 1122d5: 83 c4 10 add $0x10,%esp 1122d8: 85 c0 test %eax,%eax 1122da: 8b 55 e4 mov -0x1c(%ebp),%edx 1122dd: 74 41 je 112320 <_CORE_message_queue_Initialize+0xa8> /* * Initialize the pool of inactive messages, pending messages, * and set of waiting threads. */ _Chain_Initialize ( 1122df: 52 push %edx 1122e0: 57 push %edi 1122e1: 50 push %eax 1122e2: 8d 43 68 lea 0x68(%ebx),%eax 1122e5: 50 push %eax 1122e6: e8 7d 49 00 00 call 116c68 <_Chain_Initialize> */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 1122eb: 8d 43 54 lea 0x54(%ebx),%eax 1122ee: 89 43 50 mov %eax,0x50(%ebx) RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); the_chain->permanent_null = NULL; 1122f1: c7 43 54 00 00 00 00 movl $0x0,0x54(%ebx) the_message_queue->message_buffers, (size_t) maximum_pending_messages, allocated_message_size + sizeof( CORE_message_queue_Buffer_control ) ); _Chain_Initialize_empty( &the_message_queue->Pending_messages ); 1122f8: 8d 43 50 lea 0x50(%ebx),%eax 1122fb: 89 43 58 mov %eax,0x58(%ebx) _Thread_queue_Initialize( 1122fe: 6a 06 push $0x6 112300: 68 80 00 00 00 push $0x80 112305: 8b 45 0c mov 0xc(%ebp),%eax 112308: 83 38 01 cmpl $0x1,(%eax) 11230b: 0f 94 c0 sete %al 11230e: 0f b6 c0 movzbl %al,%eax 112311: 50 push %eax 112312: 53 push %ebx 112313: e8 0c 1d 00 00 call 114024 <_Thread_queue_Initialize> THREAD_QUEUE_DISCIPLINE_PRIORITY : THREAD_QUEUE_DISCIPLINE_FIFO, STATES_WAITING_FOR_MESSAGE, CORE_MESSAGE_QUEUE_STATUS_TIMEOUT ); return true; 112318: 83 c4 20 add $0x20,%esp 11231b: be 01 00 00 00 mov $0x1,%esi } 112320: 89 f0 mov %esi,%eax 112322: 8d 65 f4 lea -0xc(%ebp),%esp 112325: 5b pop %ebx 112326: 5e pop %esi 112327: 5f pop %edi 112328: c9 leave 112329: c3 ret =============================================================================== 0011232c <_CORE_message_queue_Seize>: void *buffer, size_t *size_p, bool wait, Watchdog_Interval timeout ) { 11232c: 55 push %ebp 11232d: 89 e5 mov %esp,%ebp 11232f: 57 push %edi 112330: 56 push %esi 112331: 53 push %ebx 112332: 83 ec 2c sub $0x2c,%esp 112335: 8b 55 08 mov 0x8(%ebp),%edx 112338: 8b 45 0c mov 0xc(%ebp),%eax 11233b: 89 45 dc mov %eax,-0x24(%ebp) 11233e: 8b 5d 10 mov 0x10(%ebp),%ebx 112341: 89 5d e0 mov %ebx,-0x20(%ebp) 112344: 8b 4d 14 mov 0x14(%ebp),%ecx 112347: 8b 75 1c mov 0x1c(%ebp),%esi 11234a: 89 75 d4 mov %esi,-0x2c(%ebp) 11234d: 8a 45 18 mov 0x18(%ebp),%al 112350: 88 45 db mov %al,-0x25(%ebp) ISR_Level level; CORE_message_queue_Buffer_control *the_message; Thread_Control *executing; executing = _Thread_Executing; 112353: a1 9c c8 12 00 mov 0x12c89c,%eax executing->Wait.return_code = CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL; 112358: c7 40 34 00 00 00 00 movl $0x0,0x34(%eax) _ISR_Disable( level ); 11235f: 9c pushf 112360: fa cli 112361: 8f 45 e4 popl -0x1c(%ebp) */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 112364: 8b 5a 50 mov 0x50(%edx),%ebx */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 112367: 8d 72 54 lea 0x54(%edx),%esi */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected( Chain_Control *the_chain ) { if ( !_Chain_Is_empty(the_chain)) 11236a: 39 f3 cmp %esi,%ebx 11236c: 0f 84 8a 00 00 00 je 1123fc <_CORE_message_queue_Seize+0xd0> { Chain_Node *return_node; Chain_Node *new_first; return_node = the_chain->first; new_first = return_node->next; 112372: 8b 33 mov (%ebx),%esi the_chain->first = new_first; 112374: 89 72 50 mov %esi,0x50(%edx) CORE_message_queue_Buffer_control *_CORE_message_queue_Get_pending_message ( CORE_message_queue_Control *the_message_queue ) { return (CORE_message_queue_Buffer_control *) _Chain_Get_unprotected( &the_message_queue->Pending_messages ); 112377: 8d 7a 50 lea 0x50(%edx),%edi 11237a: 89 7e 04 mov %edi,0x4(%esi) the_message = _CORE_message_queue_Get_pending_message( the_message_queue ); if ( the_message != NULL ) { 11237d: 85 db test %ebx,%ebx 11237f: 74 7b je 1123fc <_CORE_message_queue_Seize+0xd0><== NEVER TAKEN the_message_queue->number_of_pending_messages -= 1; 112381: ff 4a 48 decl 0x48(%edx) _ISR_Enable( level ); 112384: ff 75 e4 pushl -0x1c(%ebp) 112387: 9d popf *size_p = the_message->Contents.size; 112388: 8b 43 0c mov 0xc(%ebx),%eax 11238b: 89 01 mov %eax,(%ecx) _Thread_Executing->Wait.count = 11238d: 8b 73 08 mov 0x8(%ebx),%esi 112390: a1 9c c8 12 00 mov 0x12c89c,%eax 112395: 89 70 24 mov %esi,0x24(%eax) _CORE_message_queue_Get_message_priority( the_message ); _CORE_message_queue_Copy_buffer( the_message->Contents.buffer, 112398: 8d 73 10 lea 0x10(%ebx),%esi 11239b: 89 75 e4 mov %esi,-0x1c(%ebp) const void *source, void *destination, size_t size ) { memcpy(destination, source, size); 11239e: 8b 09 mov (%ecx),%ecx 1123a0: 8b 7d e0 mov -0x20(%ebp),%edi 1123a3: f3 a4 rep movsb %ds:(%esi),%es:(%edi) * is not, then we can go ahead and free the buffer. * * NOTE: If we note that the queue was not full before this receive, * then we can avoid this dequeue. */ the_thread = _Thread_queue_Dequeue( &the_message_queue->Wait_queue ); 1123a5: 83 ec 0c sub $0xc,%esp 1123a8: 52 push %edx 1123a9: 89 55 d0 mov %edx,-0x30(%ebp) 1123ac: e8 43 19 00 00 call 113cf4 <_Thread_queue_Dequeue> if ( !the_thread ) { 1123b1: 83 c4 10 add $0x10,%esp 1123b4: 85 c0 test %eax,%eax 1123b6: 8b 55 d0 mov -0x30(%ebp),%edx 1123b9: 75 15 jne 1123d0 <_CORE_message_queue_Seize+0xa4> RTEMS_INLINE_ROUTINE void _CORE_message_queue_Free_message_buffer ( CORE_message_queue_Control *the_message_queue, CORE_message_queue_Buffer_control *the_message ) { _Chain_Append( &the_message_queue->Inactive_messages, &the_message->Node ); 1123bb: 89 5d 0c mov %ebx,0xc(%ebp) 1123be: 83 c2 68 add $0x68,%edx 1123c1: 89 55 08 mov %edx,0x8(%ebp) executing->Wait.return_argument = size_p; /* Wait.count will be filled in with the message priority */ _ISR_Enable( level ); _Thread_queue_Enqueue( &the_message_queue->Wait_queue, timeout ); } 1123c4: 8d 65 f4 lea -0xc(%ebp),%esp 1123c7: 5b pop %ebx 1123c8: 5e pop %esi 1123c9: 5f pop %edi 1123ca: c9 leave 1123cb: e9 28 fe ff ff jmp 1121f8 <_Chain_Append> CORE_message_queue_Buffer_control *the_message, int priority ) { #if defined(RTEMS_SCORE_COREMSG_ENABLE_MESSAGE_PRIORITY) the_message->priority = priority; 1123d0: 8b 48 24 mov 0x24(%eax),%ecx 1123d3: 89 4b 08 mov %ecx,0x8(%ebx) */ _CORE_message_queue_Set_message_priority( the_message, the_thread->Wait.count ); the_message->Contents.size = (size_t) the_thread->Wait.option; 1123d6: 8b 48 30 mov 0x30(%eax),%ecx 1123d9: 89 4b 0c mov %ecx,0xc(%ebx) const void *source, void *destination, size_t size ) { memcpy(destination, source, size); 1123dc: 8b 70 2c mov 0x2c(%eax),%esi 1123df: 8b 7d e4 mov -0x1c(%ebp),%edi 1123e2: f3 a4 rep movsb %ds:(%esi),%es:(%edi) the_thread->Wait.return_argument_second.immutable_object, the_message->Contents.buffer, the_message->Contents.size ); _CORE_message_queue_Insert_message( 1123e4: 8b 43 08 mov 0x8(%ebx),%eax 1123e7: 89 45 10 mov %eax,0x10(%ebp) 1123ea: 89 5d 0c mov %ebx,0xc(%ebp) 1123ed: 89 55 08 mov %edx,0x8(%ebp) executing->Wait.return_argument = size_p; /* Wait.count will be filled in with the message priority */ _ISR_Enable( level ); _Thread_queue_Enqueue( &the_message_queue->Wait_queue, timeout ); } 1123f0: 8d 65 f4 lea -0xc(%ebp),%esp 1123f3: 5b pop %ebx 1123f4: 5e pop %esi 1123f5: 5f pop %edi 1123f6: c9 leave the_thread->Wait.return_argument_second.immutable_object, the_message->Contents.buffer, the_message->Contents.size ); _CORE_message_queue_Insert_message( 1123f7: e9 a4 48 00 00 jmp 116ca0 <_CORE_message_queue_Insert_message> return; } #endif } if ( !wait ) { 1123fc: 80 7d db 00 cmpb $0x0,-0x25(%ebp) 112400: 75 13 jne 112415 <_CORE_message_queue_Seize+0xe9> _ISR_Enable( level ); 112402: ff 75 e4 pushl -0x1c(%ebp) 112405: 9d popf executing->Wait.return_code = CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED_NOWAIT; 112406: c7 40 34 04 00 00 00 movl $0x4,0x34(%eax) executing->Wait.return_argument = size_p; /* Wait.count will be filled in with the message priority */ _ISR_Enable( level ); _Thread_queue_Enqueue( &the_message_queue->Wait_queue, timeout ); } 11240d: 8d 65 f4 lea -0xc(%ebp),%esp 112410: 5b pop %ebx 112411: 5e pop %esi 112412: 5f pop %edi 112413: c9 leave 112414: c3 ret RTEMS_INLINE_ROUTINE void _Thread_queue_Enter_critical_section ( Thread_queue_Control *the_thread_queue ) { the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; 112415: c7 42 30 01 00 00 00 movl $0x1,0x30(%edx) executing->Wait.return_code = CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED_NOWAIT; return; } _Thread_queue_Enter_critical_section( &the_message_queue->Wait_queue ); executing->Wait.queue = &the_message_queue->Wait_queue; 11241c: 89 50 44 mov %edx,0x44(%eax) executing->Wait.id = id; 11241f: 8b 5d dc mov -0x24(%ebp),%ebx 112422: 89 58 20 mov %ebx,0x20(%eax) executing->Wait.return_argument_second.mutable_object = buffer; 112425: 8b 75 e0 mov -0x20(%ebp),%esi 112428: 89 70 2c mov %esi,0x2c(%eax) executing->Wait.return_argument = size_p; 11242b: 89 48 28 mov %ecx,0x28(%eax) /* Wait.count will be filled in with the message priority */ _ISR_Enable( level ); 11242e: ff 75 e4 pushl -0x1c(%ebp) 112431: 9d popf _Thread_queue_Enqueue( &the_message_queue->Wait_queue, timeout ); 112432: c7 45 10 d4 40 11 00 movl $0x1140d4,0x10(%ebp) 112439: 8b 45 d4 mov -0x2c(%ebp),%eax 11243c: 89 45 0c mov %eax,0xc(%ebp) 11243f: 89 55 08 mov %edx,0x8(%ebp) } 112442: 8d 65 f4 lea -0xc(%ebp),%esp 112445: 5b pop %ebx 112446: 5e pop %esi 112447: 5f pop %edi 112448: c9 leave executing->Wait.return_argument_second.mutable_object = buffer; executing->Wait.return_argument = size_p; /* Wait.count will be filled in with the message priority */ _ISR_Enable( level ); _Thread_queue_Enqueue( &the_message_queue->Wait_queue, timeout ); 112449: e9 ae 19 00 00 jmp 113dfc <_Thread_queue_Enqueue_with_handler> =============================================================================== 0010ab98 <_CORE_mutex_Initialize>: CORE_mutex_Status _CORE_mutex_Initialize( CORE_mutex_Control *the_mutex, CORE_mutex_Attributes *the_mutex_attributes, uint32_t initial_lock ) { 10ab98: 55 push %ebp 10ab99: 89 e5 mov %esp,%ebp 10ab9b: 57 push %edi 10ab9c: 56 push %esi 10ab9d: 53 push %ebx 10ab9e: 83 ec 0c sub $0xc,%esp 10aba1: 8b 55 08 mov 0x8(%ebp),%edx 10aba4: 8b 5d 0c mov 0xc(%ebp),%ebx 10aba7: 8b 45 10 mov 0x10(%ebp),%eax /* Add this to the RTEMS environment later ????????? rtems_assert( initial_lock == CORE_MUTEX_LOCKED || initial_lock == CORE_MUTEX_UNLOCKED ); */ the_mutex->Attributes = *the_mutex_attributes; 10abaa: 8d 7a 40 lea 0x40(%edx),%edi 10abad: b9 04 00 00 00 mov $0x4,%ecx 10abb2: 89 de mov %ebx,%esi 10abb4: f3 a5 rep movsl %ds:(%esi),%es:(%edi) the_mutex->lock = initial_lock; 10abb6: 89 42 50 mov %eax,0x50(%edx) the_mutex->blocked_count = 0; 10abb9: c7 42 58 00 00 00 00 movl $0x0,0x58(%edx) if ( initial_lock == CORE_MUTEX_LOCKED ) { 10abc0: 85 c0 test %eax,%eax 10abc2: 75 35 jne 10abf9 <_CORE_mutex_Initialize+0x61> the_mutex->nest_count = 1; 10abc4: c7 42 54 01 00 00 00 movl $0x1,0x54(%edx) the_mutex->holder = _Thread_Executing; 10abcb: 8b 0d 34 47 12 00 mov 0x124734,%ecx 10abd1: 89 4a 5c mov %ecx,0x5c(%edx) the_mutex->holder_id = _Thread_Executing->Object.id; 10abd4: 8b 41 08 mov 0x8(%ecx),%eax 10abd7: 89 42 60 mov %eax,0x60(%edx) STATES_WAITING_FOR_MUTEX, CORE_MUTEX_TIMEOUT ); return CORE_MUTEX_STATUS_SUCCESSFUL; } 10abda: 8b 42 48 mov 0x48(%edx),%eax if ( initial_lock == CORE_MUTEX_LOCKED ) { the_mutex->nest_count = 1; the_mutex->holder = _Thread_Executing; the_mutex->holder_id = _Thread_Executing->Object.id; if ( _CORE_mutex_Is_inherit_priority( &the_mutex->Attributes ) || 10abdd: 83 f8 02 cmp $0x2,%eax 10abe0: 74 05 je 10abe7 <_CORE_mutex_Initialize+0x4f> 10abe2: 83 f8 03 cmp $0x3,%eax 10abe5: 75 27 jne 10ac0e <_CORE_mutex_Initialize+0x76> _CORE_mutex_Is_priority_ceiling( &the_mutex->Attributes ) ) { if ( _Thread_Executing->current_priority < the_mutex->Attributes.priority_ceiling ) return CORE_MUTEX_STATUS_CEILING_VIOLATED; 10abe7: b8 06 00 00 00 mov $0x6,%eax the_mutex->holder = _Thread_Executing; the_mutex->holder_id = _Thread_Executing->Object.id; if ( _CORE_mutex_Is_inherit_priority( &the_mutex->Attributes ) || _CORE_mutex_Is_priority_ceiling( &the_mutex->Attributes ) ) { if ( _Thread_Executing->current_priority < 10abec: 8b 72 4c mov 0x4c(%edx),%esi 10abef: 39 71 14 cmp %esi,0x14(%ecx) 10abf2: 72 36 jb 10ac2a <_CORE_mutex_Initialize+0x92><== NEVER TAKEN _Chain_Prepend_unprotected( &_Thread_Executing->lock_mutex, &the_mutex->queue.lock_queue ); the_mutex->queue.priority_before = _Thread_Executing->current_priority; #endif _Thread_Executing->resource_count++; 10abf4: ff 41 1c incl 0x1c(%ecx) 10abf7: eb 15 jmp 10ac0e <_CORE_mutex_Initialize+0x76> } } else { the_mutex->nest_count = 0; 10abf9: c7 42 54 00 00 00 00 movl $0x0,0x54(%edx) the_mutex->holder = NULL; 10ac00: c7 42 5c 00 00 00 00 movl $0x0,0x5c(%edx) the_mutex->holder_id = 0; 10ac07: c7 42 60 00 00 00 00 movl $0x0,0x60(%edx) } _Thread_queue_Initialize( 10ac0e: 6a 05 push $0x5 10ac10: 68 00 04 00 00 push $0x400 10ac15: 31 c0 xor %eax,%eax 10ac17: 83 7b 08 00 cmpl $0x0,0x8(%ebx) 10ac1b: 0f 95 c0 setne %al 10ac1e: 50 push %eax 10ac1f: 52 push %edx 10ac20: e8 c3 19 00 00 call 10c5e8 <_Thread_queue_Initialize> THREAD_QUEUE_DISCIPLINE_FIFO : THREAD_QUEUE_DISCIPLINE_PRIORITY, STATES_WAITING_FOR_MUTEX, CORE_MUTEX_TIMEOUT ); return CORE_MUTEX_STATUS_SUCCESSFUL; 10ac25: 83 c4 10 add $0x10,%esp 10ac28: 31 c0 xor %eax,%eax } 10ac2a: 8d 65 f4 lea -0xc(%ebp),%esp 10ac2d: 5b pop %ebx 10ac2e: 5e pop %esi 10ac2f: 5f pop %edi 10ac30: c9 leave 10ac31: c3 ret =============================================================================== 0010ac81 <_CORE_mutex_Seize>: Objects_Id _id, bool _wait, Watchdog_Interval _timeout, ISR_Level _level ) { 10ac81: 55 push %ebp 10ac82: 89 e5 mov %esp,%ebp 10ac84: 53 push %ebx 10ac85: 83 ec 14 sub $0x14,%esp 10ac88: 8b 5d 08 mov 0x8(%ebp),%ebx 10ac8b: 8a 55 10 mov 0x10(%ebp),%dl _CORE_mutex_Seize_body( _the_mutex, _id, _wait, _timeout, _level ); 10ac8e: a1 e4 41 12 00 mov 0x1241e4,%eax 10ac93: 85 c0 test %eax,%eax 10ac95: 74 19 je 10acb0 <_CORE_mutex_Seize+0x2f> 10ac97: 84 d2 test %dl,%dl 10ac99: 74 15 je 10acb0 <_CORE_mutex_Seize+0x2f><== NEVER TAKEN 10ac9b: 83 3d 64 43 12 00 01 cmpl $0x1,0x124364 10aca2: 76 0c jbe 10acb0 <_CORE_mutex_Seize+0x2f> 10aca4: 53 push %ebx 10aca5: 6a 12 push $0x12 10aca7: 6a 00 push $0x0 10aca9: 6a 00 push $0x0 10acab: e8 f0 05 00 00 call 10b2a0 <_Internal_error_Occurred> 10acb0: 51 push %ecx 10acb1: 51 push %ecx 10acb2: 8d 45 18 lea 0x18(%ebp),%eax 10acb5: 50 push %eax 10acb6: 53 push %ebx 10acb7: 88 55 f4 mov %dl,-0xc(%ebp) 10acba: e8 25 46 00 00 call 10f2e4 <_CORE_mutex_Seize_interrupt_trylock> 10acbf: 83 c4 10 add $0x10,%esp 10acc2: 85 c0 test %eax,%eax 10acc4: 8a 55 f4 mov -0xc(%ebp),%dl 10acc7: 74 48 je 10ad11 <_CORE_mutex_Seize+0x90> 10acc9: 84 d2 test %dl,%dl 10accb: 75 12 jne 10acdf <_CORE_mutex_Seize+0x5e> 10accd: ff 75 18 pushl 0x18(%ebp) 10acd0: 9d popf 10acd1: a1 34 47 12 00 mov 0x124734,%eax 10acd6: c7 40 34 01 00 00 00 movl $0x1,0x34(%eax) 10acdd: eb 32 jmp 10ad11 <_CORE_mutex_Seize+0x90> 10acdf: c7 43 30 01 00 00 00 movl $0x1,0x30(%ebx) 10ace6: a1 34 47 12 00 mov 0x124734,%eax 10aceb: 89 58 44 mov %ebx,0x44(%eax) 10acee: 8b 55 0c mov 0xc(%ebp),%edx 10acf1: 89 50 20 mov %edx,0x20(%eax) 10acf4: a1 e4 41 12 00 mov 0x1241e4,%eax 10acf9: 40 inc %eax 10acfa: a3 e4 41 12 00 mov %eax,0x1241e4 10acff: ff 75 18 pushl 0x18(%ebp) 10ad02: 9d popf 10ad03: 50 push %eax 10ad04: 50 push %eax 10ad05: ff 75 14 pushl 0x14(%ebp) 10ad08: 53 push %ebx 10ad09: e8 26 ff ff ff call 10ac34 <_CORE_mutex_Seize_interrupt_blocking> 10ad0e: 83 c4 10 add $0x10,%esp } 10ad11: 8b 5d fc mov -0x4(%ebp),%ebx 10ad14: c9 leave 10ad15: c3 ret =============================================================================== 0010ae3c <_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 ) { 10ae3c: 55 push %ebp 10ae3d: 89 e5 mov %esp,%ebp 10ae3f: 53 push %ebx 10ae40: 83 ec 10 sub $0x10,%esp 10ae43: 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)) ) { 10ae46: 53 push %ebx 10ae47: e8 6c 14 00 00 call 10c2b8 <_Thread_queue_Dequeue> 10ae4c: 89 c2 mov %eax,%edx 10ae4e: 83 c4 10 add $0x10,%esp { Thread_Control *the_thread; ISR_Level level; CORE_semaphore_Status status; status = CORE_SEMAPHORE_STATUS_SUCCESSFUL; 10ae51: 31 c0 xor %eax,%eax if ( (the_thread = _Thread_queue_Dequeue(&the_semaphore->Wait_queue)) ) { 10ae53: 85 d2 test %edx,%edx 10ae55: 75 15 jne 10ae6c <_CORE_semaphore_Surrender+0x30> if ( !_Objects_Is_local_id( the_thread->Object.id ) ) (*api_semaphore_mp_support) ( the_thread, id ); #endif } else { _ISR_Disable( level ); 10ae57: 9c pushf 10ae58: fa cli 10ae59: 59 pop %ecx if ( the_semaphore->count < the_semaphore->Attributes.maximum_count ) 10ae5a: 8b 53 48 mov 0x48(%ebx),%edx the_semaphore->count += 1; else status = CORE_SEMAPHORE_MAXIMUM_COUNT_EXCEEDED; 10ae5d: b0 04 mov $0x4,%al (*api_semaphore_mp_support) ( the_thread, id ); #endif } else { _ISR_Disable( level ); if ( the_semaphore->count < the_semaphore->Attributes.maximum_count ) 10ae5f: 3b 53 40 cmp 0x40(%ebx),%edx 10ae62: 73 06 jae 10ae6a <_CORE_semaphore_Surrender+0x2e><== NEVER TAKEN the_semaphore->count += 1; 10ae64: 42 inc %edx 10ae65: 89 53 48 mov %edx,0x48(%ebx) { Thread_Control *the_thread; ISR_Level level; CORE_semaphore_Status status; status = CORE_SEMAPHORE_STATUS_SUCCESSFUL; 10ae68: 30 c0 xor %al,%al _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 ); 10ae6a: 51 push %ecx 10ae6b: 9d popf } return status; } 10ae6c: 8b 5d fc mov -0x4(%ebp),%ebx 10ae6f: c9 leave 10ae70: c3 ret =============================================================================== 00109c58 <_Event_Seize>: rtems_event_set event_in, rtems_option option_set, rtems_interval ticks, rtems_event_set *event_out ) { 109c58: 55 push %ebp 109c59: 89 e5 mov %esp,%ebp 109c5b: 57 push %edi 109c5c: 56 push %esi 109c5d: 53 push %ebx 109c5e: 83 ec 1c sub $0x1c,%esp 109c61: 8b 45 08 mov 0x8(%ebp),%eax 109c64: 8b 75 0c mov 0xc(%ebp),%esi 109c67: 8b 55 10 mov 0x10(%ebp),%edx 109c6a: 89 55 dc mov %edx,-0x24(%ebp) 109c6d: 8b 4d 14 mov 0x14(%ebp),%ecx rtems_event_set pending_events; ISR_Level level; RTEMS_API_Control *api; Thread_blocking_operation_States sync_state; executing = _Thread_Executing; 109c70: 8b 1d 34 47 12 00 mov 0x124734,%ebx executing->Wait.return_code = RTEMS_SUCCESSFUL; 109c76: c7 43 34 00 00 00 00 movl $0x0,0x34(%ebx) api = executing->API_Extensions[ THREAD_API_RTEMS ]; 109c7d: 8b bb f4 00 00 00 mov 0xf4(%ebx),%edi _ISR_Disable( level ); 109c83: 9c pushf 109c84: fa cli 109c85: 8f 45 e0 popl -0x20(%ebp) pending_events = api->pending_events; 109c88: 8b 17 mov (%edi),%edx 109c8a: 89 55 e4 mov %edx,-0x1c(%ebp) seized_events = _Event_sets_Get( pending_events, event_in ); if ( !_Event_sets_Is_empty( seized_events ) && 109c8d: 21 c2 and %eax,%edx 109c8f: 74 1b je 109cac <_Event_Seize+0x54> 109c91: 39 c2 cmp %eax,%edx 109c93: 74 08 je 109c9d <_Event_Seize+0x45> (seized_events == event_in || _Options_Is_any( option_set )) ) { 109c95: f7 c6 02 00 00 00 test $0x2,%esi 109c9b: 74 0f je 109cac <_Event_Seize+0x54> <== 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) ); 109c9d: 89 d0 mov %edx,%eax 109c9f: f7 d0 not %eax 109ca1: 23 45 e4 and -0x1c(%ebp),%eax 109ca4: 89 07 mov %eax,(%edi) api->pending_events = _Event_sets_Clear( pending_events, seized_events ); _ISR_Enable( level ); 109ca6: ff 75 e0 pushl -0x20(%ebp) 109ca9: 9d popf 109caa: eb 13 jmp 109cbf <_Event_Seize+0x67> *event_out = seized_events; return; } if ( _Options_Is_no_wait( option_set ) ) { 109cac: f7 c6 01 00 00 00 test $0x1,%esi 109cb2: 74 12 je 109cc6 <_Event_Seize+0x6e> _ISR_Enable( level ); 109cb4: ff 75 e0 pushl -0x20(%ebp) 109cb7: 9d popf executing->Wait.return_code = RTEMS_UNSATISFIED; 109cb8: c7 43 34 0d 00 00 00 movl $0xd,0x34(%ebx) *event_out = seized_events; 109cbf: 89 11 mov %edx,(%ecx) return; 109cc1: e9 91 00 00 00 jmp 109d57 <_Event_Seize+0xff> * set properly when we are marked as in the event critical section. * * NOTE: Since interrupts are disabled, this isn't that much of an * issue but better safe than sorry. */ executing->Wait.option = (uint32_t) option_set; 109cc6: 89 73 30 mov %esi,0x30(%ebx) executing->Wait.count = (uint32_t) event_in; 109cc9: 89 43 24 mov %eax,0x24(%ebx) executing->Wait.return_argument = event_out; 109ccc: 89 4b 28 mov %ecx,0x28(%ebx) _Event_Sync_state = THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; 109ccf: c7 05 e4 4a 12 00 01 movl $0x1,0x124ae4 109cd6: 00 00 00 _ISR_Enable( level ); 109cd9: ff 75 e0 pushl -0x20(%ebp) 109cdc: 9d popf if ( ticks ) { 109cdd: 83 7d dc 00 cmpl $0x0,-0x24(%ebp) 109ce1: 74 34 je 109d17 <_Event_Seize+0xbf> _Watchdog_Initialize( 109ce3: 8b 43 08 mov 0x8(%ebx),%eax Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 109ce6: c7 43 50 00 00 00 00 movl $0x0,0x50(%ebx) the_watchdog->routine = routine; 109ced: c7 43 64 94 9e 10 00 movl $0x109e94,0x64(%ebx) the_watchdog->id = id; 109cf4: 89 43 68 mov %eax,0x68(%ebx) the_watchdog->user_data = user_data; 109cf7: c7 43 6c 00 00 00 00 movl $0x0,0x6c(%ebx) Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 109cfe: 8b 45 dc mov -0x24(%ebp),%eax 109d01: 89 43 54 mov %eax,0x54(%ebx) _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 109d04: 52 push %edx 109d05: 52 push %edx &executing->Timer, _Event_Timeout, executing->Object.id, NULL ); _Watchdog_Insert_ticks( &executing->Timer, ticks ); 109d06: 8d 43 48 lea 0x48(%ebx),%eax 109d09: 50 push %eax 109d0a: 68 ac 42 12 00 push $0x1242ac 109d0f: e8 f8 2f 00 00 call 10cd0c <_Watchdog_Insert> 109d14: 83 c4 10 add $0x10,%esp } _Thread_Set_state( executing, STATES_WAITING_FOR_EVENT ); 109d17: 50 push %eax 109d18: 50 push %eax 109d19: 68 00 01 00 00 push $0x100 109d1e: 53 push %ebx 109d1f: e8 10 2a 00 00 call 10c734 <_Thread_Set_state> _ISR_Disable( level ); 109d24: 9c pushf 109d25: fa cli 109d26: 5a pop %edx sync_state = _Event_Sync_state; 109d27: a1 e4 4a 12 00 mov 0x124ae4,%eax _Event_Sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; 109d2c: c7 05 e4 4a 12 00 00 movl $0x0,0x124ae4 109d33: 00 00 00 if ( sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) { 109d36: 83 c4 10 add $0x10,%esp 109d39: 83 f8 01 cmp $0x1,%eax 109d3c: 75 04 jne 109d42 <_Event_Seize+0xea> _ISR_Enable( level ); 109d3e: 52 push %edx 109d3f: 9d popf 109d40: eb 15 jmp 109d57 <_Event_Seize+0xff> * An interrupt completed the thread's blocking request. * The blocking thread was satisfied by an ISR or timed out. * * WARNING! Returning with interrupts disabled! */ _Thread_blocking_operation_Cancel( sync_state, executing, level ); 109d42: 89 55 10 mov %edx,0x10(%ebp) 109d45: 89 5d 0c mov %ebx,0xc(%ebp) 109d48: 89 45 08 mov %eax,0x8(%ebp) } 109d4b: 8d 65 f4 lea -0xc(%ebp),%esp 109d4e: 5b pop %ebx 109d4f: 5e pop %esi 109d50: 5f pop %edi 109d51: c9 leave * An interrupt completed the thread's blocking request. * The blocking thread was satisfied by an ISR or timed out. * * WARNING! Returning with interrupts disabled! */ _Thread_blocking_operation_Cancel( sync_state, executing, level ); 109d52: e9 01 1d 00 00 jmp 10ba58 <_Thread_blocking_operation_Cancel> } 109d57: 8d 65 f4 lea -0xc(%ebp),%esp 109d5a: 5b pop %ebx 109d5b: 5e pop %esi 109d5c: 5f pop %edi 109d5d: c9 leave 109d5e: c3 ret =============================================================================== 00109dac <_Event_Surrender>: */ void _Event_Surrender( Thread_Control *the_thread ) { 109dac: 55 push %ebp 109dad: 89 e5 mov %esp,%ebp 109daf: 57 push %edi 109db0: 56 push %esi 109db1: 53 push %ebx 109db2: 83 ec 2c sub $0x2c,%esp 109db5: 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 ]; 109db8: 8b bb f4 00 00 00 mov 0xf4(%ebx),%edi option_set = (rtems_option) the_thread->Wait.option; 109dbe: 8b 43 30 mov 0x30(%ebx),%eax 109dc1: 89 45 e0 mov %eax,-0x20(%ebp) _ISR_Disable( level ); 109dc4: 9c pushf 109dc5: fa cli 109dc6: 58 pop %eax pending_events = api->pending_events; 109dc7: 8b 17 mov (%edi),%edx 109dc9: 89 55 d4 mov %edx,-0x2c(%ebp) event_condition = (rtems_event_set) the_thread->Wait.count; 109dcc: 8b 73 24 mov 0x24(%ebx),%esi seized_events = _Event_sets_Get( pending_events, event_condition ); /* * No events were seized in this operation */ if ( _Event_sets_Is_empty( seized_events ) ) { 109dcf: 21 f2 and %esi,%edx 109dd1: 75 07 jne 109dda <_Event_Surrender+0x2e> _ISR_Enable( level ); 109dd3: 50 push %eax 109dd4: 9d popf return; 109dd5: e9 af 00 00 00 jmp 109e89 <_Event_Surrender+0xdd> /* * 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() && 109dda: 83 3d 30 47 12 00 00 cmpl $0x0,0x124730 109de1: 74 49 je 109e2c <_Event_Surrender+0x80> 109de3: 3b 1d 34 47 12 00 cmp 0x124734,%ebx 109de9: 75 41 jne 109e2c <_Event_Surrender+0x80> _Thread_Is_executing( the_thread ) && ((_Event_Sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || 109deb: 8b 0d e4 4a 12 00 mov 0x124ae4,%ecx /* * If we are in an ISR and sending to the current thread, then * we have a critical section issue to deal with. */ if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) && 109df1: 83 f9 02 cmp $0x2,%ecx 109df4: 74 09 je 109dff <_Event_Surrender+0x53> <== NEVER TAKEN ((_Event_Sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || (_Event_Sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED)) ) { 109df6: 8b 0d e4 4a 12 00 mov 0x124ae4,%ecx * If we are in an ISR and sending to the current thread, then * we have a critical section issue to deal with. */ if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) && ((_Event_Sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || 109dfc: 49 dec %ecx 109dfd: 75 2d jne 109e2c <_Event_Surrender+0x80> (_Event_Sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED)) ) { if ( seized_events == event_condition || _Options_Is_any(option_set) ) { 109dff: 39 f2 cmp %esi,%edx 109e01: 74 06 je 109e09 <_Event_Surrender+0x5d> 109e03: f6 45 e0 02 testb $0x2,-0x20(%ebp) 109e07: 74 1f je 109e28 <_Event_Surrender+0x7c> <== 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) ); 109e09: 89 d6 mov %edx,%esi 109e0b: f7 d6 not %esi 109e0d: 23 75 d4 and -0x2c(%ebp),%esi 109e10: 89 37 mov %esi,(%edi) api->pending_events = _Event_sets_Clear( pending_events,seized_events ); the_thread->Wait.count = 0; 109e12: c7 43 24 00 00 00 00 movl $0x0,0x24(%ebx) *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 109e19: 8b 4b 28 mov 0x28(%ebx),%ecx 109e1c: 89 11 mov %edx,(%ecx) _Event_Sync_state = THREAD_BLOCKING_OPERATION_SATISFIED; 109e1e: c7 05 e4 4a 12 00 03 movl $0x3,0x124ae4 109e25: 00 00 00 } _ISR_Enable( level ); 109e28: 50 push %eax 109e29: 9d popf return; 109e2a: eb 5d jmp 109e89 <_Event_Surrender+0xdd> } /* * Otherwise, this is a normal send to another thread */ if ( _States_Is_waiting_for_event( the_thread->current_state ) ) { 109e2c: f6 43 11 01 testb $0x1,0x11(%ebx) 109e30: 74 55 je 109e87 <_Event_Surrender+0xdb> if ( seized_events == event_condition || _Options_Is_any( option_set ) ) { 109e32: 39 f2 cmp %esi,%edx 109e34: 74 06 je 109e3c <_Event_Surrender+0x90> 109e36: f6 45 e0 02 testb $0x2,-0x20(%ebp) 109e3a: 74 4b je 109e87 <_Event_Surrender+0xdb> <== NEVER TAKEN 109e3c: 89 d6 mov %edx,%esi 109e3e: f7 d6 not %esi 109e40: 23 75 d4 and -0x2c(%ebp),%esi 109e43: 89 37 mov %esi,(%edi) api->pending_events = _Event_sets_Clear( pending_events, seized_events ); the_thread->Wait.count = 0; 109e45: c7 43 24 00 00 00 00 movl $0x0,0x24(%ebx) *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 109e4c: 8b 4b 28 mov 0x28(%ebx),%ecx 109e4f: 89 11 mov %edx,(%ecx) _ISR_Flash( level ); 109e51: 50 push %eax 109e52: 9d popf 109e53: fa cli if ( !_Watchdog_Is_active( &the_thread->Timer ) ) { 109e54: 83 7b 50 02 cmpl $0x2,0x50(%ebx) 109e58: 74 06 je 109e60 <_Event_Surrender+0xb4> _ISR_Enable( level ); 109e5a: 50 push %eax 109e5b: 9d popf RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 109e5c: 51 push %ecx 109e5d: 51 push %ecx 109e5e: eb 17 jmp 109e77 <_Event_Surrender+0xcb> RTEMS_INLINE_ROUTINE void _Watchdog_Deactivate( Watchdog_Control *the_watchdog ) { the_watchdog->state = WATCHDOG_REMOVE_IT; 109e60: c7 43 50 03 00 00 00 movl $0x3,0x50(%ebx) _Thread_Unblock( the_thread ); } else { _Watchdog_Deactivate( &the_thread->Timer ); _ISR_Enable( level ); 109e67: 50 push %eax 109e68: 9d popf (void) _Watchdog_Remove( &the_thread->Timer ); 109e69: 83 ec 0c sub $0xc,%esp 109e6c: 8d 43 48 lea 0x48(%ebx),%eax 109e6f: 50 push %eax 109e70: e8 af 2f 00 00 call 10ce24 <_Watchdog_Remove> 109e75: 58 pop %eax 109e76: 5a pop %edx 109e77: 68 f8 ff 03 10 push $0x1003fff8 109e7c: 53 push %ebx 109e7d: e8 42 1d 00 00 call 10bbc4 <_Thread_Clear_state> 109e82: 83 c4 10 add $0x10,%esp 109e85: eb 02 jmp 109e89 <_Event_Surrender+0xdd> _Thread_Unblock( the_thread ); } return; } } _ISR_Enable( level ); 109e87: 50 push %eax 109e88: 9d popf } 109e89: 8d 65 f4 lea -0xc(%ebp),%esp 109e8c: 5b pop %ebx 109e8d: 5e pop %esi 109e8e: 5f pop %edi 109e8f: c9 leave 109e90: c3 ret =============================================================================== 00109e94 <_Event_Timeout>: void _Event_Timeout( Objects_Id id, void *ignored ) { 109e94: 55 push %ebp 109e95: 89 e5 mov %esp,%ebp 109e97: 83 ec 20 sub $0x20,%esp Thread_Control *the_thread; Objects_Locations location; ISR_Level level; the_thread = _Thread_Get( id, &location ); 109e9a: 8d 45 f4 lea -0xc(%ebp),%eax 109e9d: 50 push %eax 109e9e: ff 75 08 pushl 0x8(%ebp) 109ea1: e8 b2 20 00 00 call 10bf58 <_Thread_Get> switch ( location ) { 109ea6: 83 c4 10 add $0x10,%esp 109ea9: 83 7d f4 00 cmpl $0x0,-0xc(%ebp) 109ead: 75 49 jne 109ef8 <_Event_Timeout+0x64> <== NEVER TAKEN * * If it is not satisfied, then it is "nothing happened" and * this is the "timeout" transition. After a request is satisfied, * a timeout is not allowed to occur. */ _ISR_Disable( level ); 109eaf: 9c pushf 109eb0: fa cli 109eb1: 5a pop %edx _ISR_Enable( level ); return; } #endif the_thread->Wait.count = 0; 109eb2: c7 40 24 00 00 00 00 movl $0x0,0x24(%eax) if ( _Thread_Is_executing( the_thread ) ) { 109eb9: 3b 05 34 47 12 00 cmp 0x124734,%eax 109ebf: 75 13 jne 109ed4 <_Event_Timeout+0x40> if ( _Event_Sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) 109ec1: 8b 0d e4 4a 12 00 mov 0x124ae4,%ecx 109ec7: 49 dec %ecx 109ec8: 75 0a jne 109ed4 <_Event_Timeout+0x40> _Event_Sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT; 109eca: c7 05 e4 4a 12 00 02 movl $0x2,0x124ae4 109ed1: 00 00 00 } the_thread->Wait.return_code = RTEMS_TIMEOUT; 109ed4: c7 40 34 06 00 00 00 movl $0x6,0x34(%eax) _ISR_Enable( level ); 109edb: 52 push %edx 109edc: 9d popf 109edd: 52 push %edx 109ede: 52 push %edx 109edf: 68 f8 ff 03 10 push $0x1003fff8 109ee4: 50 push %eax 109ee5: e8 da 1c 00 00 call 10bbc4 <_Thread_Clear_state> */ RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void ) { RTEMS_COMPILER_MEMORY_BARRIER(); _Thread_Dispatch_disable_level -= 1; 109eea: a1 e4 41 12 00 mov 0x1241e4,%eax 109eef: 48 dec %eax 109ef0: a3 e4 41 12 00 mov %eax,0x1241e4 _Thread_Unblock( the_thread ); _Thread_Unnest_dispatch(); break; 109ef5: 83 c4 10 add $0x10,%esp case OBJECTS_REMOTE: /* impossible */ #endif case OBJECTS_ERROR: break; } } 109ef8: c9 leave 109ef9: c3 ret =============================================================================== 0010f424 <_Heap_Allocate_aligned_with_boundary>: Heap_Control *heap, uintptr_t alloc_size, uintptr_t alignment, uintptr_t boundary ) { 10f424: 55 push %ebp 10f425: 89 e5 mov %esp,%ebp 10f427: 57 push %edi 10f428: 56 push %esi 10f429: 53 push %ebx 10f42a: 83 ec 3c sub $0x3c,%esp 10f42d: 8b 75 08 mov 0x8(%ebp),%esi 10f430: 8b 7d 0c mov 0xc(%ebp),%edi if ( stats->max_search < search_count ) { stats->max_search = search_count; } return (void *) alloc_begin; } 10f433: 8b 4e 08 mov 0x8(%esi),%ecx ) { Heap_Statistics *const stats = &heap->stats; Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); Heap_Block *block = _Heap_Free_list_first( heap ); uintptr_t const block_size_floor = alloc_size + HEAP_BLOCK_HEADER_SIZE 10f436: 8d 47 04 lea 0x4(%edi),%eax 10f439: 89 45 d0 mov %eax,-0x30(%ebp) - HEAP_BLOCK_SIZE_OFFSET; uintptr_t const page_size = heap->page_size; 10f43c: 8b 46 10 mov 0x10(%esi),%eax 10f43f: 89 45 e0 mov %eax,-0x20(%ebp) uintptr_t alloc_begin = 0; uint32_t search_count = 0; if ( block_size_floor < alloc_size ) { /* Integer overflow occured */ return NULL; 10f442: 31 c0 xor %eax,%eax - HEAP_BLOCK_SIZE_OFFSET; uintptr_t const page_size = heap->page_size; uintptr_t alloc_begin = 0; uint32_t search_count = 0; if ( block_size_floor < alloc_size ) { 10f444: 39 7d d0 cmp %edi,-0x30(%ebp) 10f447: 0f 82 22 01 00 00 jb 10f56f <_Heap_Allocate_aligned_with_boundary+0x14b> /* Integer overflow occured */ return NULL; } if ( boundary != 0 ) { 10f44d: 83 7d 14 00 cmpl $0x0,0x14(%ebp) 10f451: 74 15 je 10f468 <_Heap_Allocate_aligned_with_boundary+0x44> if ( boundary < alloc_size ) { 10f453: 39 7d 14 cmp %edi,0x14(%ebp) 10f456: 0f 82 13 01 00 00 jb 10f56f <_Heap_Allocate_aligned_with_boundary+0x14b> return NULL; } if ( alignment == 0 ) { 10f45c: 83 7d 10 00 cmpl $0x0,0x10(%ebp) 10f460: 75 06 jne 10f468 <_Heap_Allocate_aligned_with_boundary+0x44> alignment = page_size; 10f462: 8b 45 e0 mov -0x20(%ebp),%eax 10f465: 89 45 10 mov %eax,0x10(%ebp) 10f468: c7 45 e4 00 00 00 00 movl $0x0,-0x1c(%ebp) uintptr_t const block_begin = (uintptr_t) block; uintptr_t const block_size = _Heap_Block_size( block ); uintptr_t const block_end = block_begin + block_size; uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block ); uintptr_t const alloc_begin_ceiling = block_end - min_block_size 10f46f: 8b 45 e0 mov -0x20(%ebp),%eax 10f472: 83 c0 07 add $0x7,%eax 10f475: 89 45 c4 mov %eax,-0x3c(%ebp) + HEAP_BLOCK_HEADER_SIZE + page_size - 1; uintptr_t alloc_end = block_end + HEAP_BLOCK_SIZE_OFFSET; 10f478: c7 45 d4 04 00 00 00 movl $0x4,-0x2c(%ebp) 10f47f: 29 7d d4 sub %edi,-0x2c(%ebp) 10f482: 89 75 dc mov %esi,-0x24(%ebp) 10f485: e9 ca 00 00 00 jmp 10f554 <_Heap_Allocate_aligned_with_boundary+0x130> while ( block != free_list_tail ) { _HAssert( _Heap_Is_prev_used( block ) ); /* Statistics */ ++search_count; 10f48a: ff 45 e4 incl -0x1c(%ebp) /* * The HEAP_PREV_BLOCK_USED flag is always set in the block size_and_flag * field. Thus the value is about one unit larger than the real block * size. The greater than operator takes this into account. */ if ( block->size_and_flag > block_size_floor ) { 10f48d: 8b 59 04 mov 0x4(%ecx),%ebx 10f490: 3b 5d d0 cmp -0x30(%ebp),%ebx 10f493: 0f 86 b8 00 00 00 jbe 10f551 <_Heap_Allocate_aligned_with_boundary+0x12d> if ( alignment == 0 ) { 10f499: 83 7d 10 00 cmpl $0x0,0x10(%ebp) 10f49d: 8d 41 08 lea 0x8(%ecx),%eax 10f4a0: 89 45 d8 mov %eax,-0x28(%ebp) 10f4a3: 75 07 jne 10f4ac <_Heap_Allocate_aligned_with_boundary+0x88> RTEMS_INLINE_ROUTINE uintptr_t _Heap_Alloc_area_of_block( const Heap_Block *block ) { return (uintptr_t) block + HEAP_BLOCK_HEADER_SIZE; 10f4a5: 89 c3 mov %eax,%ebx 10f4a7: e9 8a 00 00 00 jmp 10f536 <_Heap_Allocate_aligned_with_boundary+0x112> uintptr_t alignment, uintptr_t boundary ) { uintptr_t const page_size = heap->page_size; uintptr_t const min_block_size = heap->min_block_size; 10f4ac: 8b 45 dc mov -0x24(%ebp),%eax 10f4af: 8b 40 14 mov 0x14(%eax),%eax 10f4b2: 89 45 cc mov %eax,-0x34(%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; 10f4b5: 83 e3 fe and $0xfffffffe,%ebx uintptr_t const block_begin = (uintptr_t) block; uintptr_t const block_size = _Heap_Block_size( block ); uintptr_t const block_end = block_begin + block_size; 10f4b8: 8d 1c 19 lea (%ecx,%ebx,1),%ebx uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block ); uintptr_t const alloc_begin_ceiling = block_end - min_block_size + HEAP_BLOCK_HEADER_SIZE + page_size - 1; 10f4bb: 8b 75 c4 mov -0x3c(%ebp),%esi 10f4be: 29 c6 sub %eax,%esi uintptr_t const block_begin = (uintptr_t) block; uintptr_t const block_size = _Heap_Block_size( block ); uintptr_t const block_end = block_begin + block_size; uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block ); uintptr_t const alloc_begin_ceiling = block_end - min_block_size 10f4c0: 01 de add %ebx,%esi + HEAP_BLOCK_HEADER_SIZE + page_size - 1; uintptr_t alloc_end = block_end + HEAP_BLOCK_SIZE_OFFSET; uintptr_t alloc_begin = alloc_end - alloc_size; 10f4c2: 03 5d d4 add -0x2c(%ebp),%ebx RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 10f4c5: 89 d8 mov %ebx,%eax 10f4c7: 31 d2 xor %edx,%edx 10f4c9: f7 75 10 divl 0x10(%ebp) 10f4cc: 29 d3 sub %edx,%ebx alloc_begin = _Heap_Align_down( alloc_begin, alignment ); /* Ensure that the we have a valid new block at the end */ if ( alloc_begin > alloc_begin_ceiling ) { 10f4ce: 39 f3 cmp %esi,%ebx 10f4d0: 76 0b jbe 10f4dd <_Heap_Allocate_aligned_with_boundary+0xb9> 10f4d2: 89 f0 mov %esi,%eax 10f4d4: 31 d2 xor %edx,%edx 10f4d6: f7 75 10 divl 0x10(%ebp) 10f4d9: 89 f3 mov %esi,%ebx 10f4db: 29 d3 sub %edx,%ebx } alloc_end = alloc_begin + alloc_size; /* Ensure boundary constaint */ if ( boundary != 0 ) { 10f4dd: 83 7d 14 00 cmpl $0x0,0x14(%ebp) 10f4e1: 74 35 je 10f518 <_Heap_Allocate_aligned_with_boundary+0xf4> /* Ensure that the we have a valid new block at the end */ if ( alloc_begin > alloc_begin_ceiling ) { alloc_begin = _Heap_Align_down( alloc_begin_ceiling, alignment ); } alloc_end = alloc_begin + alloc_size; 10f4e3: 8d 34 3b lea (%ebx,%edi,1),%esi /* Ensure boundary constaint */ if ( boundary != 0 ) { uintptr_t const boundary_floor = alloc_begin_floor + alloc_size; 10f4e6: 8b 45 d8 mov -0x28(%ebp),%eax 10f4e9: 01 f8 add %edi,%eax 10f4eb: 89 45 c8 mov %eax,-0x38(%ebp) 10f4ee: eb 15 jmp 10f505 <_Heap_Allocate_aligned_with_boundary+0xe1> uintptr_t boundary_line = _Heap_Align_down( alloc_end, boundary ); while ( alloc_begin < boundary_line && boundary_line < alloc_end ) { if ( boundary_line < boundary_floor ) { 10f4f0: 3b 45 c8 cmp -0x38(%ebp),%eax 10f4f3: 72 5c jb 10f551 <_Heap_Allocate_aligned_with_boundary+0x12d> return 0; } alloc_begin = boundary_line - alloc_size; 10f4f5: 89 c3 mov %eax,%ebx 10f4f7: 29 fb sub %edi,%ebx 10f4f9: 89 d8 mov %ebx,%eax 10f4fb: 31 d2 xor %edx,%edx 10f4fd: f7 75 10 divl 0x10(%ebp) 10f500: 29 d3 sub %edx,%ebx alloc_begin = _Heap_Align_down( alloc_begin, alignment ); alloc_end = alloc_begin + alloc_size; 10f502: 8d 34 3b lea (%ebx,%edi,1),%esi 10f505: 89 f0 mov %esi,%eax 10f507: 31 d2 xor %edx,%edx 10f509: f7 75 14 divl 0x14(%ebp) 10f50c: 89 f0 mov %esi,%eax 10f50e: 29 d0 sub %edx,%eax /* Ensure boundary constaint */ if ( boundary != 0 ) { uintptr_t const boundary_floor = alloc_begin_floor + alloc_size; uintptr_t boundary_line = _Heap_Align_down( alloc_end, boundary ); while ( alloc_begin < boundary_line && boundary_line < alloc_end ) { 10f510: 39 f0 cmp %esi,%eax 10f512: 73 04 jae 10f518 <_Heap_Allocate_aligned_with_boundary+0xf4> 10f514: 39 c3 cmp %eax,%ebx 10f516: 72 d8 jb 10f4f0 <_Heap_Allocate_aligned_with_boundary+0xcc> boundary_line = _Heap_Align_down( alloc_end, boundary ); } } /* Ensure that the we have a valid new block at the beginning */ if ( alloc_begin >= alloc_begin_floor ) { 10f518: 3b 5d d8 cmp -0x28(%ebp),%ebx 10f51b: 72 34 jb 10f551 <_Heap_Allocate_aligned_with_boundary+0x12d> 10f51d: be f8 ff ff ff mov $0xfffffff8,%esi 10f522: 29 ce sub %ecx,%esi uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) - HEAP_BLOCK_HEADER_SIZE); 10f524: 01 de add %ebx,%esi RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 10f526: 89 d8 mov %ebx,%eax 10f528: 31 d2 xor %edx,%edx 10f52a: f7 75 e0 divl -0x20(%ebp) uintptr_t const alloc_block_begin = (uintptr_t) _Heap_Block_of_alloc_area( alloc_begin, page_size ); uintptr_t const free_size = alloc_block_begin - block_begin; if ( free_size >= min_block_size || free_size == 0 ) { 10f52d: 29 d6 sub %edx,%esi 10f52f: 74 05 je 10f536 <_Heap_Allocate_aligned_with_boundary+0x112> 10f531: 3b 75 cc cmp -0x34(%ebp),%esi 10f534: 72 1b jb 10f551 <_Heap_Allocate_aligned_with_boundary+0x12d> boundary ); } } if ( alloc_begin != 0 ) { 10f536: 85 db test %ebx,%ebx 10f538: 74 17 je 10f551 <_Heap_Allocate_aligned_with_boundary+0x12d><== NEVER TAKEN 10f53a: 8b 75 dc mov -0x24(%ebp),%esi block = block->next; } if ( alloc_begin != 0 ) { /* Statistics */ stats->searches += search_count; 10f53d: 8b 45 e4 mov -0x1c(%ebp),%eax 10f540: 01 46 4c add %eax,0x4c(%esi) block = _Heap_Block_allocate( heap, block, alloc_begin, alloc_size ); 10f543: 57 push %edi 10f544: 53 push %ebx 10f545: 51 push %ecx 10f546: 56 push %esi 10f547: e8 75 bc ff ff call 10b1c1 <_Heap_Block_allocate> 10f54c: 83 c4 10 add $0x10,%esp 10f54f: eb 11 jmp 10f562 <_Heap_Allocate_aligned_with_boundary+0x13e> if ( alloc_begin != 0 ) { break; } block = block->next; 10f551: 8b 49 08 mov 0x8(%ecx),%ecx if ( alignment == 0 ) { alignment = page_size; } } while ( block != free_list_tail ) { 10f554: 3b 4d dc cmp -0x24(%ebp),%ecx 10f557: 0f 85 2d ff ff ff jne 10f48a <_Heap_Allocate_aligned_with_boundary+0x66> 10f55d: 8b 75 dc mov -0x24(%ebp),%esi 10f560: 31 db xor %ebx,%ebx boundary ); } /* Statistics */ if ( stats->max_search < search_count ) { 10f562: 8b 45 e4 mov -0x1c(%ebp),%eax 10f565: 39 46 44 cmp %eax,0x44(%esi) 10f568: 73 03 jae 10f56d <_Heap_Allocate_aligned_with_boundary+0x149> stats->max_search = search_count; 10f56a: 89 46 44 mov %eax,0x44(%esi) } return (void *) alloc_begin; 10f56d: 89 d8 mov %ebx,%eax } 10f56f: 8d 65 f4 lea -0xc(%ebp),%esp 10f572: 5b pop %ebx 10f573: 5e pop %esi 10f574: 5f pop %edi 10f575: c9 leave 10f576: c3 ret =============================================================================== 0010f913 <_Heap_Extend>: Heap_Control *heap, void *extend_area_begin_ptr, uintptr_t extend_area_size, uintptr_t *extended_size_ptr ) { 10f913: 55 push %ebp 10f914: 89 e5 mov %esp,%ebp 10f916: 57 push %edi 10f917: 56 push %esi 10f918: 53 push %ebx 10f919: 83 ec 4c sub $0x4c,%esp 10f91c: 8b 5d 08 mov 0x8(%ebp),%ebx 10f91f: 8b 4d 10 mov 0x10(%ebp),%ecx Heap_Statistics *const stats = &heap->stats; Heap_Block *const first_block = heap->first_block; 10f922: 8b 43 20 mov 0x20(%ebx),%eax 10f925: 89 45 c0 mov %eax,-0x40(%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; 10f928: c7 45 e4 00 00 00 00 movl $0x0,-0x1c(%ebp) Heap_Block *extend_last_block = NULL; 10f92f: c7 45 e0 00 00 00 00 movl $0x0,-0x20(%ebp) uintptr_t const page_size = heap->page_size; 10f936: 8b 53 10 mov 0x10(%ebx),%edx 10f939: 89 55 c4 mov %edx,-0x3c(%ebp) uintptr_t const min_block_size = heap->min_block_size; 10f93c: 8b 43 14 mov 0x14(%ebx),%eax 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; 10f93f: 8b 7b 30 mov 0x30(%ebx),%edi 10f942: 89 7d bc mov %edi,-0x44(%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 ) { return false; 10f945: 31 f6 xor %esi,%esi uintptr_t const free_size = stats->free_size; uintptr_t extend_first_block_size = 0; uintptr_t extended_size = 0; bool extend_area_ok = false; if ( extend_area_end < extend_area_begin ) { 10f947: 8b 7d 0c mov 0xc(%ebp),%edi 10f94a: 01 cf add %ecx,%edi 10f94c: 0f 82 d4 01 00 00 jb 10fb26 <_Heap_Extend+0x213> return false; } extend_area_ok = _Heap_Get_first_and_last_block( 10f952: 52 push %edx 10f953: 52 push %edx 10f954: 8d 55 e0 lea -0x20(%ebp),%edx 10f957: 52 push %edx 10f958: 8d 55 e4 lea -0x1c(%ebp),%edx 10f95b: 52 push %edx 10f95c: 50 push %eax 10f95d: ff 75 c4 pushl -0x3c(%ebp) 10f960: 51 push %ecx 10f961: ff 75 0c pushl 0xc(%ebp) 10f964: e8 4f b9 ff ff call 10b2b8 <_Heap_Get_first_and_last_block> page_size, min_block_size, &extend_first_block, &extend_last_block ); if (!extend_area_ok ) { 10f969: 83 c4 20 add $0x20,%esp 10f96c: 84 c0 test %al,%al 10f96e: 0f 84 b2 01 00 00 je 10fb26 <_Heap_Extend+0x213> 10f974: 8b 4d c0 mov -0x40(%ebp),%ecx 10f977: c7 45 cc 00 00 00 00 movl $0x0,-0x34(%ebp) 10f97e: c7 45 c8 00 00 00 00 movl $0x0,-0x38(%ebp) 10f985: 31 f6 xor %esi,%esi 10f987: c7 45 d0 00 00 00 00 movl $0x0,-0x30(%ebp) return false; } do { uintptr_t const sub_area_begin = (start_block != first_block) ? (uintptr_t) start_block : heap->area_begin; 10f98e: 8b 43 18 mov 0x18(%ebx),%eax 10f991: 89 5d b8 mov %ebx,-0x48(%ebp) 10f994: eb 02 jmp 10f998 <_Heap_Extend+0x85> 10f996: 89 c8 mov %ecx,%eax uintptr_t const sub_area_end = start_block->prev_size; 10f998: 8b 19 mov (%ecx),%ebx Heap_Block *const end_block = _Heap_Block_of_alloc_area( sub_area_end, page_size ); if ( 10f99a: 39 c7 cmp %eax,%edi 10f99c: 76 09 jbe 10f9a7 <_Heap_Extend+0x94> 10f99e: 39 5d 0c cmp %ebx,0xc(%ebp) 10f9a1: 0f 82 7d 01 00 00 jb 10fb24 <_Heap_Extend+0x211> <== NEVER TAKEN sub_area_end > extend_area_begin && extend_area_end > sub_area_begin ) { return false; } if ( extend_area_end == sub_area_begin ) { 10f9a7: 39 c7 cmp %eax,%edi 10f9a9: 74 06 je 10f9b1 <_Heap_Extend+0x9e> merge_below_block = start_block; } else if ( extend_area_end < sub_area_end ) { 10f9ab: 39 df cmp %ebx,%edi 10f9ad: 72 07 jb 10f9b6 <_Heap_Extend+0xa3> 10f9af: eb 08 jmp 10f9b9 <_Heap_Extend+0xa6> sub_area_end > extend_area_begin && extend_area_end > sub_area_begin ) { return false; } if ( extend_area_end == sub_area_begin ) { 10f9b1: 89 4d d0 mov %ecx,-0x30(%ebp) 10f9b4: eb 03 jmp 10f9b9 <_Heap_Extend+0xa6> merge_below_block = start_block; } else if ( extend_area_end < sub_area_end ) { 10f9b6: 89 4d c8 mov %ecx,-0x38(%ebp) RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 10f9b9: 8d 43 f8 lea -0x8(%ebx),%eax 10f9bc: 89 45 d4 mov %eax,-0x2c(%ebp) 10f9bf: 89 d8 mov %ebx,%eax 10f9c1: 31 d2 xor %edx,%edx 10f9c3: f7 75 c4 divl -0x3c(%ebp) uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) - HEAP_BLOCK_HEADER_SIZE); 10f9c6: 29 55 d4 sub %edx,-0x2c(%ebp) link_below_block = start_block; } if ( sub_area_end == extend_area_begin ) { 10f9c9: 3b 5d 0c cmp 0xc(%ebp),%ebx 10f9cc: 75 07 jne 10f9d5 <_Heap_Extend+0xc2> start_block->prev_size = extend_area_end; 10f9ce: 89 39 mov %edi,(%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 ) 10f9d0: 8b 75 d4 mov -0x2c(%ebp),%esi 10f9d3: eb 08 jmp 10f9dd <_Heap_Extend+0xca> merge_above_block = end_block; } else if ( sub_area_end < extend_area_begin ) { 10f9d5: 73 06 jae 10f9dd <_Heap_Extend+0xca> 10f9d7: 8b 55 d4 mov -0x2c(%ebp),%edx 10f9da: 89 55 cc mov %edx,-0x34(%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; 10f9dd: 8b 45 d4 mov -0x2c(%ebp),%eax 10f9e0: 8b 48 04 mov 0x4(%eax),%ecx 10f9e3: 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); 10f9e6: 01 c1 add %eax,%ecx link_above_block = end_block; } start_block = _Heap_Block_at( end_block, _Heap_Block_size( end_block ) ); } while ( start_block != first_block ); 10f9e8: 3b 4d c0 cmp -0x40(%ebp),%ecx 10f9eb: 75 a9 jne 10f996 <_Heap_Extend+0x83> 10f9ed: 8b 5d b8 mov -0x48(%ebp),%ebx if ( extend_area_begin < heap->area_begin ) { 10f9f0: 8b 55 0c mov 0xc(%ebp),%edx 10f9f3: 3b 53 18 cmp 0x18(%ebx),%edx 10f9f6: 73 05 jae 10f9fd <_Heap_Extend+0xea> heap->area_begin = extend_area_begin; 10f9f8: 89 53 18 mov %edx,0x18(%ebx) 10f9fb: eb 08 jmp 10fa05 <_Heap_Extend+0xf2> } else if ( heap->area_end < extend_area_end ) { 10f9fd: 39 7b 1c cmp %edi,0x1c(%ebx) 10fa00: 73 03 jae 10fa05 <_Heap_Extend+0xf2> heap->area_end = extend_area_end; 10fa02: 89 7b 1c mov %edi,0x1c(%ebx) } extend_first_block_size = (uintptr_t) extend_last_block - (uintptr_t) extend_first_block; 10fa05: 8b 45 e0 mov -0x20(%ebp),%eax 10fa08: 8b 55 e4 mov -0x1c(%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 = 10fa0b: 89 c1 mov %eax,%ecx 10fa0d: 29 d1 sub %edx,%ecx 10fa0f: 89 4d d4 mov %ecx,-0x2c(%ebp) (uintptr_t) extend_last_block - (uintptr_t) extend_first_block; extend_first_block->prev_size = extend_area_end; 10fa12: 89 3a mov %edi,(%edx) extend_first_block->size_and_flag = extend_first_block_size | HEAP_PREV_BLOCK_USED; 10fa14: 83 c9 01 or $0x1,%ecx 10fa17: 89 4a 04 mov %ecx,0x4(%edx) extend_last_block->prev_size = extend_first_block_size; 10fa1a: 8b 4d d4 mov -0x2c(%ebp),%ecx 10fa1d: 89 08 mov %ecx,(%eax) extend_last_block->size_and_flag = 0; 10fa1f: c7 40 04 00 00 00 00 movl $0x0,0x4(%eax) if ( (uintptr_t) extend_first_block < (uintptr_t) heap->first_block ) { 10fa26: 39 53 20 cmp %edx,0x20(%ebx) 10fa29: 76 05 jbe 10fa30 <_Heap_Extend+0x11d> heap->first_block = extend_first_block; 10fa2b: 89 53 20 mov %edx,0x20(%ebx) 10fa2e: eb 08 jmp 10fa38 <_Heap_Extend+0x125> } else if ( (uintptr_t) extend_last_block > (uintptr_t) heap->last_block ) { 10fa30: 39 43 24 cmp %eax,0x24(%ebx) 10fa33: 73 03 jae 10fa38 <_Heap_Extend+0x125> heap->last_block = extend_last_block; 10fa35: 89 43 24 mov %eax,0x24(%ebx) } if ( merge_below_block != NULL ) { 10fa38: 83 7d d0 00 cmpl $0x0,-0x30(%ebp) 10fa3c: 74 3b je 10fa79 <_Heap_Extend+0x166> Heap_Control *heap, uintptr_t extend_area_begin, Heap_Block *first_block ) { uintptr_t const page_size = heap->page_size; 10fa3e: 8b 43 10 mov 0x10(%ebx),%eax 10fa41: 89 45 d4 mov %eax,-0x2c(%ebp) uintptr_t const new_first_block_alloc_begin = _Heap_Align_up( extend_area_begin + HEAP_BLOCK_HEADER_SIZE, page_size ); 10fa44: 8b 4d 0c mov 0xc(%ebp),%ecx 10fa47: 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; 10fa4a: 89 c8 mov %ecx,%eax 10fa4c: 31 d2 xor %edx,%edx 10fa4e: f7 75 d4 divl -0x2c(%ebp) if ( remainder != 0 ) { 10fa51: 85 d2 test %edx,%edx 10fa53: 74 05 je 10fa5a <_Heap_Extend+0x147> <== ALWAYS TAKEN return value - remainder + alignment; 10fa55: 03 4d d4 add -0x2c(%ebp),%ecx <== NOT EXECUTED 10fa58: 29 d1 sub %edx,%ecx <== NOT EXECUTED uintptr_t const new_first_block_begin = 10fa5a: 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; 10fa5d: 8b 45 d0 mov -0x30(%ebp),%eax 10fa60: 8b 00 mov (%eax),%eax 10fa62: 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 = 10fa65: 8b 45 d0 mov -0x30(%ebp),%eax 10fa68: 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; 10fa6a: 83 c8 01 or $0x1,%eax 10fa6d: 89 42 04 mov %eax,0x4(%edx) _Heap_Free_block( heap, new_first_block ); 10fa70: 89 d8 mov %ebx,%eax 10fa72: e8 81 fe ff ff call 10f8f8 <_Heap_Free_block> 10fa77: eb 14 jmp 10fa8d <_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 ) { 10fa79: 83 7d c8 00 cmpl $0x0,-0x38(%ebp) 10fa7d: 74 0e je 10fa8d <_Heap_Extend+0x17a> _Heap_Link_below( 10fa7f: 8b 55 e0 mov -0x20(%ebp),%edx { 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; 10fa82: 8b 45 c8 mov -0x38(%ebp),%eax 10fa85: 29 d0 sub %edx,%eax 10fa87: 83 c8 01 or $0x1,%eax 10fa8a: 89 42 04 mov %eax,0x4(%edx) link_below_block, extend_last_block ); } if ( merge_above_block != NULL ) { 10fa8d: 85 f6 test %esi,%esi 10fa8f: 74 30 je 10fac1 <_Heap_Extend+0x1ae> ) { 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, 10fa91: 83 ef 08 sub $0x8,%edi 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( 10fa94: 29 f7 sub %esi,%edi RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 10fa96: 89 f8 mov %edi,%eax 10fa98: 31 d2 xor %edx,%edx 10fa9a: f7 73 10 divl 0x10(%ebx) 10fa9d: 29 d7 sub %edx,%edi ); 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) 10fa9f: 8b 46 04 mov 0x4(%esi),%eax 10faa2: 29 f8 sub %edi,%eax | HEAP_PREV_BLOCK_USED; 10faa4: 83 c8 01 or $0x1,%eax 10faa7: 89 44 37 04 mov %eax,0x4(%edi,%esi,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; 10faab: 8b 46 04 mov 0x4(%esi),%eax 10faae: 83 e0 01 and $0x1,%eax block->size_and_flag = size | flag; 10fab1: 09 f8 or %edi,%eax 10fab3: 89 46 04 mov %eax,0x4(%esi) _Heap_Block_set_size( last_block, last_block_new_size ); _Heap_Free_block( heap, last_block ); 10fab6: 89 f2 mov %esi,%edx 10fab8: 89 d8 mov %ebx,%eax 10faba: e8 39 fe ff ff call 10f8f8 <_Heap_Free_block> 10fabf: eb 21 jmp 10fae2 <_Heap_Extend+0x1cf> ); } if ( merge_above_block != NULL ) { _Heap_Merge_above( heap, merge_above_block, extend_area_end ); } else if ( link_above_block != NULL ) { 10fac1: 83 7d cc 00 cmpl $0x0,-0x34(%ebp) 10fac5: 74 1b je 10fae2 <_Heap_Extend+0x1cf> _Heap_Link_above( 10fac7: 8b 4d e0 mov -0x20(%ebp),%ecx ) { 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 ); 10faca: 8b 45 e4 mov -0x1c(%ebp),%eax 10facd: 2b 45 cc sub -0x34(%ebp),%eax 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; 10fad0: 8b 7d cc mov -0x34(%ebp),%edi 10fad3: 8b 57 04 mov 0x4(%edi),%edx 10fad6: 83 e2 01 and $0x1,%edx block->size_and_flag = size | flag; 10fad9: 09 d0 or %edx,%eax 10fadb: 89 47 04 mov %eax,0x4(%edi) last_block->size_and_flag |= HEAP_PREV_BLOCK_USED; 10fade: 83 49 04 01 orl $0x1,0x4(%ecx) extend_first_block, extend_last_block ); } if ( merge_below_block == NULL && merge_above_block == NULL ) { 10fae2: 85 f6 test %esi,%esi 10fae4: 75 10 jne 10faf6 <_Heap_Extend+0x1e3> 10fae6: 83 7d d0 00 cmpl $0x0,-0x30(%ebp) 10faea: 75 0a jne 10faf6 <_Heap_Extend+0x1e3> _Heap_Free_block( heap, extend_first_block ); 10faec: 8b 55 e4 mov -0x1c(%ebp),%edx 10faef: 89 d8 mov %ebx,%eax 10faf1: e8 02 fe ff ff call 10f8f8 <_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 10faf6: 8b 53 24 mov 0x24(%ebx),%edx * 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( 10faf9: 8b 43 20 mov 0x20(%ebx),%eax 10fafc: 29 d0 sub %edx,%eax 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; 10fafe: 8b 4a 04 mov 0x4(%edx),%ecx 10fb01: 83 e1 01 and $0x1,%ecx block->size_and_flag = size | flag; 10fb04: 09 c8 or %ecx,%eax 10fb06: 89 42 04 mov %eax,0x4(%edx) } _Heap_Set_last_block_size( heap ); extended_size = stats->free_size - free_size; 10fb09: 8b 43 30 mov 0x30(%ebx),%eax 10fb0c: 2b 45 bc sub -0x44(%ebp),%eax /* Statistics */ stats->size += extended_size; 10fb0f: 01 43 2c add %eax,0x2c(%ebx) if ( extended_size_ptr != NULL ) *extended_size_ptr = extended_size; return true; 10fb12: be 01 00 00 00 mov $0x1,%esi extended_size = stats->free_size - free_size; /* Statistics */ stats->size += extended_size; if ( extended_size_ptr != NULL ) 10fb17: 83 7d 14 00 cmpl $0x0,0x14(%ebp) 10fb1b: 74 09 je 10fb26 <_Heap_Extend+0x213> <== NEVER TAKEN *extended_size_ptr = extended_size; 10fb1d: 8b 55 14 mov 0x14(%ebp),%edx 10fb20: 89 02 mov %eax,(%edx) 10fb22: eb 02 jmp 10fb26 <_Heap_Extend+0x213> _Heap_Block_of_alloc_area( sub_area_end, page_size ); if ( sub_area_end > extend_area_begin && extend_area_end > sub_area_begin ) { return false; 10fb24: 31 f6 xor %esi,%esi if ( extended_size_ptr != NULL ) *extended_size_ptr = extended_size; return true; } 10fb26: 89 f0 mov %esi,%eax 10fb28: 8d 65 f4 lea -0xc(%ebp),%esp 10fb2b: 5b pop %ebx 10fb2c: 5e pop %esi 10fb2d: 5f pop %edi 10fb2e: c9 leave 10fb2f: c3 ret =============================================================================== 0010f578 <_Heap_Free>: #include #include #include bool _Heap_Free( Heap_Control *heap, void *alloc_begin_ptr ) { 10f578: 55 push %ebp 10f579: 89 e5 mov %esp,%ebp 10f57b: 57 push %edi 10f57c: 56 push %esi 10f57d: 53 push %ebx 10f57e: 83 ec 14 sub $0x14,%esp 10f581: 8b 4d 08 mov 0x8(%ebp),%ecx 10f584: 8b 45 0c mov 0xc(%ebp),%eax 10f587: 8d 58 f8 lea -0x8(%eax),%ebx 10f58a: 31 d2 xor %edx,%edx 10f58c: 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); 10f58f: 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 10f591: 8b 41 20 mov 0x20(%ecx),%eax 10f594: 89 45 ec mov %eax,-0x14(%ebp) && (uintptr_t) block <= (uintptr_t) heap->last_block; 10f597: 31 d2 xor %edx,%edx 10f599: 39 c3 cmp %eax,%ebx 10f59b: 72 08 jb 10f5a5 <_Heap_Free+0x2d> 10f59d: 31 d2 xor %edx,%edx 10f59f: 39 59 24 cmp %ebx,0x24(%ecx) 10f5a2: 0f 93 c2 setae %dl uintptr_t block_size = 0; uintptr_t next_block_size = 0; bool next_is_free = false; if ( !_Heap_Is_block_in_heap( heap, block ) ) { return false; 10f5a5: 31 c0 xor %eax,%eax Heap_Block *next_block = NULL; uintptr_t block_size = 0; uintptr_t next_block_size = 0; bool next_is_free = false; if ( !_Heap_Is_block_in_heap( heap, block ) ) { 10f5a7: 85 d2 test %edx,%edx 10f5a9: 0f 84 21 01 00 00 je 10f6d0 <_Heap_Free+0x158> --stats->used_blocks; ++stats->frees; stats->free_size += block_size; return( true ); } 10f5af: 8b 43 04 mov 0x4(%ebx),%eax 10f5b2: 89 45 f0 mov %eax,-0x10(%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; 10f5b5: 89 c6 mov %eax,%esi 10f5b7: 83 e6 fe and $0xfffffffe,%esi RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 10f5ba: 8d 14 33 lea (%ebx,%esi,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; 10f5bd: 31 ff xor %edi,%edi 10f5bf: 3b 55 ec cmp -0x14(%ebp),%edx 10f5c2: 72 0a jb 10f5ce <_Heap_Free+0x56> <== NEVER TAKEN 10f5c4: 31 c0 xor %eax,%eax 10f5c6: 39 51 24 cmp %edx,0x24(%ecx) 10f5c9: 0f 93 c0 setae %al 10f5cc: 89 c7 mov %eax,%edi block_size = _Heap_Block_size( block ); next_block = _Heap_Block_at( block, block_size ); if ( !_Heap_Is_block_in_heap( heap, next_block ) ) { _HAssert( false ); return false; 10f5ce: 31 c0 xor %eax,%eax } block_size = _Heap_Block_size( block ); next_block = _Heap_Block_at( block, block_size ); if ( !_Heap_Is_block_in_heap( heap, next_block ) ) { 10f5d0: 85 ff test %edi,%edi 10f5d2: 0f 84 f8 00 00 00 je 10f6d0 <_Heap_Free+0x158> <== NEVER TAKEN --stats->used_blocks; ++stats->frees; stats->free_size += block_size; return( true ); } 10f5d8: 8b 7a 04 mov 0x4(%edx),%edi if ( !_Heap_Is_block_in_heap( heap, next_block ) ) { _HAssert( false ); return false; } if ( !_Heap_Is_prev_used( next_block ) ) { 10f5db: f7 c7 01 00 00 00 test $0x1,%edi 10f5e1: 0f 84 e9 00 00 00 je 10f6d0 <_Heap_Free+0x158> <== 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; 10f5e7: 83 e7 fe and $0xfffffffe,%edi 10f5ea: 89 7d e8 mov %edi,-0x18(%ebp) _HAssert( false ); return false; } next_block_size = _Heap_Block_size( next_block ); next_is_free = next_block != heap->last_block 10f5ed: 8b 41 24 mov 0x24(%ecx),%eax 10f5f0: 89 45 e4 mov %eax,-0x1c(%ebp) && !_Heap_Is_prev_used( _Heap_Block_at( next_block, next_block_size )); 10f5f3: 31 c0 xor %eax,%eax 10f5f5: 3b 55 e4 cmp -0x1c(%ebp),%edx 10f5f8: 74 0a je 10f604 <_Heap_Free+0x8c> 10f5fa: 31 c0 xor %eax,%eax 10f5fc: f6 44 3a 04 01 testb $0x1,0x4(%edx,%edi,1) 10f601: 0f 94 c0 sete %al _HAssert( false ); return false; } next_block_size = _Heap_Block_size( next_block ); next_is_free = next_block != heap->last_block 10f604: 88 45 e3 mov %al,-0x1d(%ebp) && !_Heap_Is_prev_used( _Heap_Block_at( next_block, next_block_size )); if ( !_Heap_Is_prev_used( block ) ) { 10f607: f6 45 f0 01 testb $0x1,-0x10(%ebp) 10f60b: 75 62 jne 10f66f <_Heap_Free+0xf7> uintptr_t const prev_size = block->prev_size; 10f60d: 8b 03 mov (%ebx),%eax 10f60f: 89 45 f0 mov %eax,-0x10(%ebp) RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 10f612: 29 c3 sub %eax,%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; 10f614: 31 ff xor %edi,%edi 10f616: 3b 5d ec cmp -0x14(%ebp),%ebx 10f619: 72 0a jb 10f625 <_Heap_Free+0xad> <== NEVER TAKEN 10f61b: 31 c0 xor %eax,%eax 10f61d: 39 5d e4 cmp %ebx,-0x1c(%ebp) 10f620: 0f 93 c0 setae %al 10f623: 89 c7 mov %eax,%edi Heap_Block * const prev_block = _Heap_Block_at( block, -prev_size ); if ( !_Heap_Is_block_in_heap( heap, prev_block ) ) { _HAssert( false ); return( false ); 10f625: 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 ) ) { 10f627: 85 ff test %edi,%edi 10f629: 0f 84 a1 00 00 00 je 10f6d0 <_Heap_Free+0x158> <== 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) ) { 10f62f: f6 43 04 01 testb $0x1,0x4(%ebx) 10f633: 0f 84 97 00 00 00 je 10f6d0 <_Heap_Free+0x158> <== NEVER TAKEN _HAssert( false ); return( false ); } if ( next_is_free ) { /* coalesce both */ 10f639: 80 7d e3 00 cmpb $0x0,-0x1d(%ebp) 10f63d: 74 1a je 10f659 <_Heap_Free+0xe1> uintptr_t const size = block_size + prev_size + next_block_size; 10f63f: 8b 45 e8 mov -0x18(%ebp),%eax 10f642: 8d 04 06 lea (%esi,%eax,1),%eax 10f645: 03 45 f0 add -0x10(%ebp),%eax return _Heap_Free_list_tail(heap)->prev; } RTEMS_INLINE_ROUTINE void _Heap_Free_list_remove( Heap_Block *block ) { Heap_Block *next = block->next; 10f648: 8b 7a 08 mov 0x8(%edx),%edi Heap_Block *prev = block->prev; 10f64b: 8b 52 0c mov 0xc(%edx),%edx prev->next = next; 10f64e: 89 7a 08 mov %edi,0x8(%edx) next->prev = prev; 10f651: 89 57 0c mov %edx,0xc(%edi) _Heap_Free_list_remove( next_block ); stats->free_blocks -= 1; 10f654: ff 49 38 decl 0x38(%ecx) 10f657: eb 33 jmp 10f68c <_Heap_Free+0x114> prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; next_block = _Heap_Block_at( prev_block, size ); _HAssert(!_Heap_Is_prev_used( next_block)); next_block->prev_size = size; } else { /* coalesce prev */ uintptr_t const size = block_size + prev_size; 10f659: 8b 45 f0 mov -0x10(%ebp),%eax 10f65c: 8d 04 06 lea (%esi,%eax,1),%eax prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 10f65f: 89 c7 mov %eax,%edi 10f661: 83 cf 01 or $0x1,%edi 10f664: 89 7b 04 mov %edi,0x4(%ebx) next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 10f667: 83 62 04 fe andl $0xfffffffe,0x4(%edx) next_block->prev_size = size; 10f66b: 89 02 mov %eax,(%edx) 10f66d: eb 56 jmp 10f6c5 <_Heap_Free+0x14d> } } else if ( next_is_free ) { /* coalesce next */ 10f66f: 80 7d e3 00 cmpb $0x0,-0x1d(%ebp) 10f673: 74 24 je 10f699 <_Heap_Free+0x121> uintptr_t const size = block_size + next_block_size; 10f675: 8b 45 e8 mov -0x18(%ebp),%eax 10f678: 01 f0 add %esi,%eax RTEMS_INLINE_ROUTINE void _Heap_Free_list_replace( Heap_Block *old_block, Heap_Block *new_block ) { Heap_Block *next = old_block->next; 10f67a: 8b 7a 08 mov 0x8(%edx),%edi Heap_Block *prev = old_block->prev; 10f67d: 8b 52 0c mov 0xc(%edx),%edx new_block->next = next; 10f680: 89 7b 08 mov %edi,0x8(%ebx) new_block->prev = prev; 10f683: 89 53 0c mov %edx,0xc(%ebx) next->prev = new_block; 10f686: 89 5f 0c mov %ebx,0xc(%edi) prev->next = new_block; 10f689: 89 5a 08 mov %ebx,0x8(%edx) _Heap_Free_list_replace( next_block, block ); block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 10f68c: 89 c2 mov %eax,%edx 10f68e: 83 ca 01 or $0x1,%edx 10f691: 89 53 04 mov %edx,0x4(%ebx) next_block = _Heap_Block_at( block, size ); next_block->prev_size = size; 10f694: 89 04 03 mov %eax,(%ebx,%eax,1) 10f697: eb 2c jmp 10f6c5 <_Heap_Free+0x14d> RTEMS_INLINE_ROUTINE void _Heap_Free_list_insert_after( Heap_Block *block_before, Heap_Block *new_block ) { Heap_Block *next = block_before->next; 10f699: 8b 41 08 mov 0x8(%ecx),%eax new_block->next = next; 10f69c: 89 43 08 mov %eax,0x8(%ebx) new_block->prev = block_before; 10f69f: 89 4b 0c mov %ecx,0xc(%ebx) block_before->next = new_block; 10f6a2: 89 59 08 mov %ebx,0x8(%ecx) next->prev = new_block; 10f6a5: 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; 10f6a8: 89 f0 mov %esi,%eax 10f6aa: 83 c8 01 or $0x1,%eax 10f6ad: 89 43 04 mov %eax,0x4(%ebx) next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 10f6b0: 83 62 04 fe andl $0xfffffffe,0x4(%edx) next_block->prev_size = block_size; 10f6b4: 89 32 mov %esi,(%edx) /* Statistics */ ++stats->free_blocks; 10f6b6: 8b 41 38 mov 0x38(%ecx),%eax 10f6b9: 40 inc %eax 10f6ba: 89 41 38 mov %eax,0x38(%ecx) if ( stats->max_free_blocks < stats->free_blocks ) { 10f6bd: 39 41 3c cmp %eax,0x3c(%ecx) 10f6c0: 73 03 jae 10f6c5 <_Heap_Free+0x14d> stats->max_free_blocks = stats->free_blocks; 10f6c2: 89 41 3c mov %eax,0x3c(%ecx) } } /* Statistics */ --stats->used_blocks; 10f6c5: ff 49 40 decl 0x40(%ecx) ++stats->frees; 10f6c8: ff 41 50 incl 0x50(%ecx) stats->free_size += block_size; 10f6cb: 01 71 30 add %esi,0x30(%ecx) return( true ); 10f6ce: b0 01 mov $0x1,%al } 10f6d0: 83 c4 14 add $0x14,%esp 10f6d3: 5b pop %ebx 10f6d4: 5e pop %esi 10f6d5: 5f pop %edi 10f6d6: c9 leave 10f6d7: c3 ret =============================================================================== 0011ce4c <_Heap_Size_of_alloc_area>: bool _Heap_Size_of_alloc_area( Heap_Control *heap, void *alloc_begin_ptr, uintptr_t *alloc_size ) { 11ce4c: 55 push %ebp 11ce4d: 89 e5 mov %esp,%ebp 11ce4f: 57 push %edi 11ce50: 56 push %esi 11ce51: 53 push %ebx 11ce52: 8b 5d 08 mov 0x8(%ebp),%ebx 11ce55: 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); 11ce58: 8d 4e f8 lea -0x8(%esi),%ecx 11ce5b: 89 f0 mov %esi,%eax 11ce5d: 31 d2 xor %edx,%edx 11ce5f: 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); 11ce62: 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 11ce64: 8b 53 20 mov 0x20(%ebx),%edx && (uintptr_t) block <= (uintptr_t) heap->last_block; 11ce67: 31 ff xor %edi,%edi 11ce69: 39 d1 cmp %edx,%ecx 11ce6b: 72 0a jb 11ce77 <_Heap_Size_of_alloc_area+0x2b> 11ce6d: 31 c0 xor %eax,%eax 11ce6f: 39 4b 24 cmp %ecx,0x24(%ebx) 11ce72: 0f 93 c0 setae %al 11ce75: 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; 11ce77: 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 ) ) { 11ce79: 85 ff test %edi,%edi 11ce7b: 74 30 je 11cead <_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; 11ce7d: 8b 41 04 mov 0x4(%ecx),%eax 11ce80: 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); 11ce83: 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; 11ce85: 31 ff xor %edi,%edi 11ce87: 39 d1 cmp %edx,%ecx 11ce89: 72 0a jb 11ce95 <_Heap_Size_of_alloc_area+0x49><== NEVER TAKEN 11ce8b: 31 c0 xor %eax,%eax 11ce8d: 39 4b 24 cmp %ecx,0x24(%ebx) 11ce90: 0f 93 c0 setae %al 11ce93: 89 c7 mov %eax,%edi if ( !_Heap_Is_block_in_heap( heap, next_block ) || !_Heap_Is_prev_used( next_block ) ) { return false; 11ce95: 31 c0 xor %eax,%eax } block_size = _Heap_Block_size( block ); next_block = _Heap_Block_at( block, block_size ); if ( 11ce97: 85 ff test %edi,%edi 11ce99: 74 12 je 11cead <_Heap_Size_of_alloc_area+0x61><== NEVER TAKEN !_Heap_Is_block_in_heap( heap, next_block ) || !_Heap_Is_prev_used( next_block ) 11ce9b: f6 41 04 01 testb $0x1,0x4(%ecx) 11ce9f: 74 0c je 11cead <_Heap_Size_of_alloc_area+0x61><== NEVER TAKEN ) { return false; } *alloc_size = (uintptr_t) next_block + HEAP_BLOCK_SIZE_OFFSET - alloc_begin; 11cea1: 29 f1 sub %esi,%ecx 11cea3: 8d 51 04 lea 0x4(%ecx),%edx 11cea6: 8b 45 10 mov 0x10(%ebp),%eax 11cea9: 89 10 mov %edx,(%eax) return true; 11ceab: b0 01 mov $0x1,%al } 11cead: 5b pop %ebx 11ceae: 5e pop %esi 11ceaf: 5f pop %edi 11ceb0: c9 leave 11ceb1: c3 ret =============================================================================== 0010bc6e <_Heap_Walk>: bool _Heap_Walk( Heap_Control *heap, int source, bool dump ) { 10bc6e: 55 push %ebp 10bc6f: 89 e5 mov %esp,%ebp 10bc71: 57 push %edi 10bc72: 56 push %esi 10bc73: 53 push %ebx 10bc74: 83 ec 4c sub $0x4c,%esp 10bc77: 8b 75 08 mov 0x8(%ebp),%esi 10bc7a: 8b 5d 0c mov 0xc(%ebp),%ebx uintptr_t const page_size = heap->page_size; 10bc7d: 8b 46 10 mov 0x10(%esi),%eax 10bc80: 89 45 d8 mov %eax,-0x28(%ebp) uintptr_t const min_block_size = heap->min_block_size; 10bc83: 8b 4e 14 mov 0x14(%esi),%ecx 10bc86: 89 4d d4 mov %ecx,-0x2c(%ebp) Heap_Block *const first_block = heap->first_block; 10bc89: 8b 46 20 mov 0x20(%esi),%eax 10bc8c: 89 45 d0 mov %eax,-0x30(%ebp) Heap_Block *const last_block = heap->last_block; 10bc8f: 8b 4e 24 mov 0x24(%esi),%ecx 10bc92: 89 4d c8 mov %ecx,-0x38(%ebp) Heap_Block *block = first_block; Heap_Walk_printer printer = dump ? _Heap_Walk_print : _Heap_Walk_print_nothing; 10bc95: c7 45 e4 30 bc 10 00 movl $0x10bc30,-0x1c(%ebp) 10bc9c: 80 7d 10 00 cmpb $0x0,0x10(%ebp) 10bca0: 74 07 je 10bca9 <_Heap_Walk+0x3b> 10bca2: c7 45 e4 35 bc 10 00 movl $0x10bc35,-0x1c(%ebp) if ( !_System_state_Is_up( _System_state_Get() ) ) { return true; 10bca9: b0 01 mov $0x1,%al Heap_Block *const last_block = heap->last_block; Heap_Block *block = first_block; Heap_Walk_printer printer = dump ? _Heap_Walk_print : _Heap_Walk_print_nothing; if ( !_System_state_Is_up( _System_state_Get() ) ) { 10bcab: 83 3d ec 73 12 00 03 cmpl $0x3,0x1273ec 10bcb2: 0f 85 e8 02 00 00 jne 10bfa0 <_Heap_Walk+0x332> 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)( 10bcb8: 52 push %edx 10bcb9: ff 76 0c pushl 0xc(%esi) 10bcbc: ff 76 08 pushl 0x8(%esi) 10bcbf: ff 75 c8 pushl -0x38(%ebp) 10bcc2: ff 75 d0 pushl -0x30(%ebp) 10bcc5: ff 76 1c pushl 0x1c(%esi) 10bcc8: ff 76 18 pushl 0x18(%esi) 10bccb: ff 75 d4 pushl -0x2c(%ebp) 10bcce: ff 75 d8 pushl -0x28(%ebp) 10bcd1: 68 11 f9 11 00 push $0x11f911 10bcd6: 6a 00 push $0x0 10bcd8: 53 push %ebx 10bcd9: ff 55 e4 call *-0x1c(%ebp) heap->area_begin, heap->area_end, first_block, last_block, first_free_block, last_free_block ); if ( page_size == 0 ) { 10bcdc: 83 c4 30 add $0x30,%esp 10bcdf: 83 7d d8 00 cmpl $0x0,-0x28(%ebp) 10bce3: 75 0b jne 10bcf0 <_Heap_Walk+0x82> (*printer)( source, true, "page size is zero\n" ); 10bce5: 50 push %eax 10bce6: 68 a2 f9 11 00 push $0x11f9a2 10bceb: e9 6b 02 00 00 jmp 10bf5b <_Heap_Walk+0x2ed> return false; } if ( !_Addresses_Is_aligned( (void *) page_size ) ) { 10bcf0: f6 45 d8 03 testb $0x3,-0x28(%ebp) 10bcf4: 74 0d je 10bd03 <_Heap_Walk+0x95> (*printer)( 10bcf6: ff 75 d8 pushl -0x28(%ebp) 10bcf9: 68 b5 f9 11 00 push $0x11f9b5 10bcfe: e9 58 02 00 00 jmp 10bf5b <_Heap_Walk+0x2ed> RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 10bd03: 8b 45 d4 mov -0x2c(%ebp),%eax 10bd06: 31 d2 xor %edx,%edx 10bd08: f7 75 d8 divl -0x28(%ebp) ); return false; } if ( !_Heap_Is_aligned( min_block_size, page_size ) ) { 10bd0b: 85 d2 test %edx,%edx 10bd0d: 74 0d je 10bd1c <_Heap_Walk+0xae> (*printer)( 10bd0f: ff 75 d4 pushl -0x2c(%ebp) 10bd12: 68 d3 f9 11 00 push $0x11f9d3 10bd17: e9 3f 02 00 00 jmp 10bf5b <_Heap_Walk+0x2ed> RTEMS_INLINE_ROUTINE uintptr_t _Heap_Alloc_area_of_block( const Heap_Block *block ) { return (uintptr_t) block + HEAP_BLOCK_HEADER_SIZE; 10bd1c: 8b 45 d0 mov -0x30(%ebp),%eax 10bd1f: 83 c0 08 add $0x8,%eax RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 10bd22: 31 d2 xor %edx,%edx 10bd24: f7 75 d8 divl -0x28(%ebp) ); return false; } if ( 10bd27: 85 d2 test %edx,%edx 10bd29: 74 0d je 10bd38 <_Heap_Walk+0xca> !_Heap_Is_aligned( _Heap_Alloc_area_of_block( first_block ), page_size ) ) { (*printer)( 10bd2b: ff 75 d0 pushl -0x30(%ebp) 10bd2e: 68 f7 f9 11 00 push $0x11f9f7 10bd33: e9 23 02 00 00 jmp 10bf5b <_Heap_Walk+0x2ed> ); return false; } if ( !_Heap_Is_prev_used( first_block ) ) { 10bd38: 8b 45 d0 mov -0x30(%ebp),%eax 10bd3b: f6 40 04 01 testb $0x1,0x4(%eax) 10bd3f: 75 0b jne 10bd4c <_Heap_Walk+0xde> (*printer)( 10bd41: 57 push %edi 10bd42: 68 28 fa 11 00 push $0x11fa28 10bd47: e9 0f 02 00 00 jmp 10bf5b <_Heap_Walk+0x2ed> - 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; 10bd4c: 8b 4d c8 mov -0x38(%ebp),%ecx 10bd4f: 8b 79 04 mov 0x4(%ecx),%edi 10bd52: 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); 10bd55: 01 cf add %ecx,%edi ); return false; } if ( _Heap_Is_free( last_block ) ) { 10bd57: f6 47 04 01 testb $0x1,0x4(%edi) 10bd5b: 75 0b jne 10bd68 <_Heap_Walk+0xfa> (*printer)( 10bd5d: 56 push %esi 10bd5e: 68 56 fa 11 00 push $0x11fa56 10bd63: e9 f3 01 00 00 jmp 10bf5b <_Heap_Walk+0x2ed> ); return false; } if ( 10bd68: 3b 7d d0 cmp -0x30(%ebp),%edi 10bd6b: 74 0b je 10bd78 <_Heap_Walk+0x10a> <== ALWAYS TAKEN _Heap_Block_at( last_block, _Heap_Block_size( last_block ) ) != first_block ) { (*printer)( 10bd6d: 51 push %ecx <== NOT EXECUTED 10bd6e: 68 6b fa 11 00 push $0x11fa6b <== NOT EXECUTED 10bd73: e9 e3 01 00 00 jmp 10bf5b <_Heap_Walk+0x2ed> <== NOT EXECUTED int source, Heap_Walk_printer printer, Heap_Control *heap ) { uintptr_t const page_size = heap->page_size; 10bd78: 8b 46 10 mov 0x10(%esi),%eax 10bd7b: 89 45 e0 mov %eax,-0x20(%ebp) block = next_block; } while ( block != first_block ); return true; } 10bd7e: 8b 4e 08 mov 0x8(%esi),%ecx Heap_Walk_printer printer, Heap_Control *heap ) { uintptr_t const page_size = heap->page_size; const Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); 10bd81: 89 75 dc mov %esi,-0x24(%ebp) 10bd84: eb 75 jmp 10bdfb <_Heap_Walk+0x18d> 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; 10bd86: 31 c0 xor %eax,%eax 10bd88: 39 4e 20 cmp %ecx,0x20(%esi) 10bd8b: 77 08 ja 10bd95 <_Heap_Walk+0x127> 10bd8d: 31 c0 xor %eax,%eax 10bd8f: 39 4e 24 cmp %ecx,0x24(%esi) 10bd92: 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 ) ) { 10bd95: 85 c0 test %eax,%eax 10bd97: 75 0b jne 10bda4 <_Heap_Walk+0x136> (*printer)( 10bd99: 51 push %ecx 10bd9a: 68 9a fa 11 00 push $0x11fa9a 10bd9f: e9 b7 01 00 00 jmp 10bf5b <_Heap_Walk+0x2ed> RTEMS_INLINE_ROUTINE uintptr_t _Heap_Alloc_area_of_block( const Heap_Block *block ) { return (uintptr_t) block + HEAP_BLOCK_HEADER_SIZE; 10bda4: 8d 41 08 lea 0x8(%ecx),%eax RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 10bda7: 31 d2 xor %edx,%edx 10bda9: f7 75 e0 divl -0x20(%ebp) ); return false; } if ( 10bdac: 85 d2 test %edx,%edx 10bdae: 74 0b je 10bdbb <_Heap_Walk+0x14d> !_Heap_Is_aligned( _Heap_Alloc_area_of_block( free_block ), page_size ) ) { (*printer)( 10bdb0: 51 push %ecx 10bdb1: 68 ba fa 11 00 push $0x11faba 10bdb6: e9 a0 01 00 00 jmp 10bf5b <_Heap_Walk+0x2ed> - 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; 10bdbb: 8b 41 04 mov 0x4(%ecx),%eax 10bdbe: 83 e0 fe and $0xfffffffe,%eax ); return false; } if ( _Heap_Is_used( free_block ) ) { 10bdc1: f6 44 01 04 01 testb $0x1,0x4(%ecx,%eax,1) 10bdc6: 74 0b je 10bdd3 <_Heap_Walk+0x165> (*printer)( 10bdc8: 51 push %ecx 10bdc9: 68 ea fa 11 00 push $0x11faea 10bdce: e9 88 01 00 00 jmp 10bf5b <_Heap_Walk+0x2ed> ); return false; } if ( free_block->prev != prev_block ) { 10bdd3: 8b 41 0c mov 0xc(%ecx),%eax 10bdd6: 3b 45 dc cmp -0x24(%ebp),%eax 10bdd9: 74 1a je 10bdf5 <_Heap_Walk+0x187> (*printer)( 10bddb: 83 ec 0c sub $0xc,%esp 10bdde: 50 push %eax 10bddf: 51 push %ecx 10bde0: 68 06 fb 11 00 push $0x11fb06 10bde5: 6a 01 push $0x1 10bde7: 53 push %ebx 10bde8: ff 55 e4 call *-0x1c(%ebp) 10bdeb: 83 c4 20 add $0x20,%esp if ( !_System_state_Is_up( _System_state_Get() ) ) { return true; } if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; 10bdee: 31 c0 xor %eax,%eax 10bdf0: e9 ab 01 00 00 jmp 10bfa0 <_Heap_Walk+0x332> return false; } prev_block = free_block; free_block = free_block->next; 10bdf5: 89 4d dc mov %ecx,-0x24(%ebp) 10bdf8: 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 ) { 10bdfb: 39 f1 cmp %esi,%ecx 10bdfd: 75 87 jne 10bd86 <_Heap_Walk+0x118> 10bdff: 89 5d dc mov %ebx,-0x24(%ebp) 10be02: eb 02 jmp 10be06 <_Heap_Walk+0x198> block->prev_size ); } block = next_block; } while ( block != first_block ); 10be04: 89 df mov %ebx,%edi return true; } 10be06: 8b 4f 04 mov 0x4(%edi),%ecx 10be09: 89 4d cc mov %ecx,-0x34(%ebp) 10be0c: 83 e1 fe and $0xfffffffe,%ecx 10be0f: 89 4d e0 mov %ecx,-0x20(%ebp) RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 10be12: 8d 1c 0f lea (%edi,%ecx,1),%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; 10be15: 31 c0 xor %eax,%eax 10be17: 39 5e 20 cmp %ebx,0x20(%esi) 10be1a: 77 08 ja 10be24 <_Heap_Walk+0x1b6> <== NEVER TAKEN 10be1c: 31 c0 xor %eax,%eax 10be1e: 39 5e 24 cmp %ebx,0x24(%esi) 10be21: 0f 93 c0 setae %al bool const prev_used = _Heap_Is_prev_used( block ); Heap_Block *const next_block = _Heap_Block_at( block, block_size ); uintptr_t const next_block_begin = (uintptr_t) next_block; bool const is_not_last_block = block != last_block; if ( !_Heap_Is_block_in_heap( heap, next_block ) ) { 10be24: 85 c0 test %eax,%eax 10be26: 75 11 jne 10be39 <_Heap_Walk+0x1cb> 10be28: 89 d9 mov %ebx,%ecx 10be2a: 8b 5d dc mov -0x24(%ebp),%ebx (*printer)( 10be2d: 83 ec 0c sub $0xc,%esp 10be30: 51 push %ecx 10be31: 57 push %edi 10be32: 68 38 fb 11 00 push $0x11fb38 10be37: eb ac jmp 10bde5 <_Heap_Walk+0x177> 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; 10be39: 3b 7d c8 cmp -0x38(%ebp),%edi 10be3c: 0f 95 c1 setne %cl RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 10be3f: 8b 45 e0 mov -0x20(%ebp),%eax 10be42: 31 d2 xor %edx,%edx 10be44: f7 75 d8 divl -0x28(%ebp) ); return false; } if ( !_Heap_Is_aligned( block_size, page_size ) && is_not_last_block ) { 10be47: 85 d2 test %edx,%edx 10be49: 74 15 je 10be60 <_Heap_Walk+0x1f2> 10be4b: 84 c9 test %cl,%cl 10be4d: 74 11 je 10be60 <_Heap_Walk+0x1f2> 10be4f: 8b 5d dc mov -0x24(%ebp),%ebx (*printer)( 10be52: 83 ec 0c sub $0xc,%esp 10be55: ff 75 e0 pushl -0x20(%ebp) 10be58: 57 push %edi 10be59: 68 65 fb 11 00 push $0x11fb65 10be5e: eb 85 jmp 10bde5 <_Heap_Walk+0x177> ); return false; } if ( block_size < min_block_size && is_not_last_block ) { 10be60: 8b 45 d4 mov -0x2c(%ebp),%eax 10be63: 39 45 e0 cmp %eax,-0x20(%ebp) 10be66: 73 18 jae 10be80 <_Heap_Walk+0x212> 10be68: 84 c9 test %cl,%cl 10be6a: 74 14 je 10be80 <_Heap_Walk+0x212> <== NEVER TAKEN 10be6c: 8b 5d dc mov -0x24(%ebp),%ebx (*printer)( 10be6f: 52 push %edx 10be70: 52 push %edx 10be71: 50 push %eax 10be72: ff 75 e0 pushl -0x20(%ebp) 10be75: 57 push %edi 10be76: 68 93 fb 11 00 push $0x11fb93 10be7b: e9 65 ff ff ff jmp 10bde5 <_Heap_Walk+0x177> ); return false; } if ( next_block_begin <= block_begin && is_not_last_block ) { 10be80: 39 fb cmp %edi,%ebx 10be82: 77 18 ja 10be9c <_Heap_Walk+0x22e> 10be84: 84 c9 test %cl,%cl 10be86: 74 14 je 10be9c <_Heap_Walk+0x22e> 10be88: 89 d9 mov %ebx,%ecx 10be8a: 8b 5d dc mov -0x24(%ebp),%ebx (*printer)( 10be8d: 83 ec 0c sub $0xc,%esp 10be90: 51 push %ecx 10be91: 57 push %edi 10be92: 68 be fb 11 00 push $0x11fbbe 10be97: e9 49 ff ff ff jmp 10bde5 <_Heap_Walk+0x177> 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; 10be9c: 8b 4d cc mov -0x34(%ebp),%ecx 10be9f: 83 e1 01 and $0x1,%ecx 10bea2: 89 4d c4 mov %ecx,-0x3c(%ebp) ); return false; } if ( !_Heap_Is_prev_used( next_block ) ) { 10bea5: f6 43 04 01 testb $0x1,0x4(%ebx) 10bea9: 0f 85 ba 00 00 00 jne 10bf69 <_Heap_Walk+0x2fb> block = next_block; } while ( block != first_block ); return true; } 10beaf: 8b 46 08 mov 0x8(%esi),%eax 10beb2: 89 45 c0 mov %eax,-0x40(%ebp) block->prev, block->prev == first_free_block ? " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), block->next, block->next == last_free_block ? 10beb5: 8b 4f 08 mov 0x8(%edi),%ecx 10beb8: 89 4d b4 mov %ecx,-0x4c(%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)( 10bebb: ba de f8 11 00 mov $0x11f8de,%edx 10bec0: 3b 4e 0c cmp 0xc(%esi),%ecx 10bec3: 74 0e je 10bed3 <_Heap_Walk+0x265> " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), block->next, block->next == last_free_block ? " (= last free)" : (block->next == free_list_tail ? " (= tail)" : "") 10bec5: ba 15 f8 11 00 mov $0x11f815,%edx 10beca: 39 f1 cmp %esi,%ecx 10becc: 75 05 jne 10bed3 <_Heap_Walk+0x265> 10bece: ba ed f8 11 00 mov $0x11f8ed,%edx 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 ? 10bed3: 8b 47 0c mov 0xc(%edi),%eax 10bed6: 89 45 cc mov %eax,-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)( 10bed9: b8 f7 f8 11 00 mov $0x11f8f7,%eax 10bede: 8b 4d c0 mov -0x40(%ebp),%ecx 10bee1: 39 4d cc cmp %ecx,-0x34(%ebp) 10bee4: 74 0f je 10bef5 <_Heap_Walk+0x287> block, block_size, block->prev, block->prev == first_free_block ? " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), 10bee6: b8 15 f8 11 00 mov $0x11f815,%eax 10beeb: 39 75 cc cmp %esi,-0x34(%ebp) 10beee: 75 05 jne 10bef5 <_Heap_Walk+0x287> 10bef0: b8 07 f9 11 00 mov $0x11f907,%eax Heap_Block *const last_free_block = _Heap_Free_list_last( heap ); bool const prev_used = _Heap_Is_prev_used( block ); uintptr_t const block_size = _Heap_Block_size( block ); Heap_Block *const next_block = _Heap_Block_at( block, block_size ); (*printer)( 10bef5: 83 ec 0c sub $0xc,%esp 10bef8: 52 push %edx 10bef9: ff 75 b4 pushl -0x4c(%ebp) 10befc: 50 push %eax 10befd: ff 75 cc pushl -0x34(%ebp) 10bf00: ff 75 e0 pushl -0x20(%ebp) 10bf03: 57 push %edi 10bf04: 68 f2 fb 11 00 push $0x11fbf2 10bf09: 6a 00 push $0x0 10bf0b: ff 75 dc pushl -0x24(%ebp) 10bf0e: ff 55 e4 call *-0x1c(%ebp) block->next == last_free_block ? " (= last free)" : (block->next == free_list_tail ? " (= tail)" : "") ); if ( block_size != next_block->prev_size ) { 10bf11: 8b 03 mov (%ebx),%eax 10bf13: 83 c4 30 add $0x30,%esp 10bf16: 39 45 e0 cmp %eax,-0x20(%ebp) 10bf19: 74 16 je 10bf31 <_Heap_Walk+0x2c3> 10bf1b: 89 d9 mov %ebx,%ecx 10bf1d: 8b 5d dc mov -0x24(%ebp),%ebx (*printer)( 10bf20: 56 push %esi 10bf21: 51 push %ecx 10bf22: 50 push %eax 10bf23: ff 75 e0 pushl -0x20(%ebp) 10bf26: 57 push %edi 10bf27: 68 27 fc 11 00 push $0x11fc27 10bf2c: e9 b4 fe ff ff jmp 10bde5 <_Heap_Walk+0x177> ); return false; } if ( !prev_used ) { 10bf31: 83 7d c4 00 cmpl $0x0,-0x3c(%ebp) 10bf35: 75 0b jne 10bf42 <_Heap_Walk+0x2d4> 10bf37: 8b 5d dc mov -0x24(%ebp),%ebx (*printer)( 10bf3a: 57 push %edi 10bf3b: 68 60 fc 11 00 push $0x11fc60 10bf40: eb 19 jmp 10bf5b <_Heap_Walk+0x2ed> block = next_block; } while ( block != first_block ); return true; } 10bf42: 8b 46 08 mov 0x8(%esi),%eax 10bf45: eb 07 jmp 10bf4e <_Heap_Walk+0x2e0> { 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 ) { 10bf47: 39 f8 cmp %edi,%eax 10bf49: 74 4a je 10bf95 <_Heap_Walk+0x327> return true; } free_block = free_block->next; 10bf4b: 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 ) { 10bf4e: 39 f0 cmp %esi,%eax 10bf50: 75 f5 jne 10bf47 <_Heap_Walk+0x2d9> 10bf52: 8b 5d dc mov -0x24(%ebp),%ebx return false; } if ( !_Heap_Walk_is_in_free_list( heap, block ) ) { (*printer)( 10bf55: 57 push %edi 10bf56: 68 cb fc 11 00 push $0x11fccb 10bf5b: 6a 01 push $0x1 10bf5d: 53 push %ebx 10bf5e: ff 55 e4 call *-0x1c(%ebp) 10bf61: 83 c4 10 add $0x10,%esp 10bf64: e9 85 fe ff ff jmp 10bdee <_Heap_Walk+0x180> if ( !_Heap_Is_prev_used( next_block ) ) { if ( !_Heap_Walk_check_free_block( source, printer, heap, block ) ) { return false; } } else if (prev_used) { 10bf69: 83 7d c4 00 cmpl $0x0,-0x3c(%ebp) 10bf6d: 74 0e je 10bf7d <_Heap_Walk+0x30f> (*printer)( 10bf6f: 83 ec 0c sub $0xc,%esp 10bf72: ff 75 e0 pushl -0x20(%ebp) 10bf75: 57 push %edi 10bf76: 68 8f fc 11 00 push $0x11fc8f 10bf7b: eb 0d jmp 10bf8a <_Heap_Walk+0x31c> "block 0x%08x: size %u\n", block, block_size ); } else { (*printer)( 10bf7d: 51 push %ecx 10bf7e: 51 push %ecx 10bf7f: ff 37 pushl (%edi) 10bf81: ff 75 e0 pushl -0x20(%ebp) 10bf84: 57 push %edi 10bf85: 68 a6 fc 11 00 push $0x11fca6 10bf8a: 6a 00 push $0x0 10bf8c: ff 75 dc pushl -0x24(%ebp) 10bf8f: ff 55 e4 call *-0x1c(%ebp) 10bf92: 83 c4 20 add $0x20,%esp block->prev_size ); } block = next_block; } while ( block != first_block ); 10bf95: 3b 5d d0 cmp -0x30(%ebp),%ebx 10bf98: 0f 85 66 fe ff ff jne 10be04 <_Heap_Walk+0x196> return true; 10bf9e: b0 01 mov $0x1,%al } 10bfa0: 8d 65 f4 lea -0xc(%ebp),%esp 10bfa3: 5b pop %ebx 10bfa4: 5e pop %esi 10bfa5: 5f pop %edi 10bfa6: c9 leave 10bfa7: c3 ret =============================================================================== 0010b2a0 <_Internal_error_Occurred>: void _Internal_error_Occurred( Internal_errors_Source the_source, bool is_internal, Internal_errors_t the_error ) { 10b2a0: 55 push %ebp 10b2a1: 89 e5 mov %esp,%ebp 10b2a3: 53 push %ebx 10b2a4: 83 ec 08 sub $0x8,%esp 10b2a7: 8b 45 08 mov 0x8(%ebp),%eax 10b2aa: 8b 55 0c mov 0xc(%ebp),%edx 10b2ad: 8b 5d 10 mov 0x10(%ebp),%ebx _Internal_errors_What_happened.the_source = the_source; 10b2b0: a3 7c 42 12 00 mov %eax,0x12427c _Internal_errors_What_happened.is_internal = is_internal; 10b2b5: 88 15 80 42 12 00 mov %dl,0x124280 _Internal_errors_What_happened.the_error = the_error; 10b2bb: 89 1d 84 42 12 00 mov %ebx,0x124284 _User_extensions_Fatal( the_source, is_internal, the_error ); 10b2c1: 53 push %ebx 10b2c2: 0f b6 d2 movzbl %dl,%edx 10b2c5: 52 push %edx 10b2c6: 50 push %eax 10b2c7: e8 1f 19 00 00 call 10cbeb <_User_extensions_Fatal> RTEMS_INLINE_ROUTINE void _System_state_Set ( System_state_Codes state ) { _System_state_Current = state; 10b2cc: c7 05 64 43 12 00 05 movl $0x5,0x124364 <== NOT EXECUTED 10b2d3: 00 00 00 _System_state_Set( SYSTEM_STATE_FAILED ); _CPU_Fatal_halt( the_error ); 10b2d6: fa cli <== NOT EXECUTED 10b2d7: 89 d8 mov %ebx,%eax <== NOT EXECUTED 10b2d9: f4 hlt <== NOT EXECUTED 10b2da: 83 c4 10 add $0x10,%esp <== NOT EXECUTED 10b2dd: eb fe jmp 10b2dd <_Internal_error_Occurred+0x3d><== NOT EXECUTED =============================================================================== 0010b330 <_Objects_Allocate>: */ Objects_Control *_Objects_Allocate( Objects_Information *information ) { 10b330: 55 push %ebp 10b331: 89 e5 mov %esp,%ebp 10b333: 56 push %esi 10b334: 53 push %ebx 10b335: 8b 5d 08 mov 0x8(%ebp),%ebx * 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 ) return NULL; 10b338: 31 c9 xor %ecx,%ecx * 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 ) 10b33a: 83 7b 18 00 cmpl $0x0,0x18(%ebx) 10b33e: 74 53 je 10b393 <_Objects_Allocate+0x63><== NEVER TAKEN /* * OK. The manager should be initialized and configured to have objects. * With any luck, it is safe to attempt to allocate an object. */ the_object = (Objects_Control *) _Chain_Get( &information->Inactive ); 10b340: 8d 73 20 lea 0x20(%ebx),%esi 10b343: 83 ec 0c sub $0xc,%esp 10b346: 56 push %esi 10b347: e8 24 f7 ff ff call 10aa70 <_Chain_Get> 10b34c: 89 c1 mov %eax,%ecx if ( information->auto_extend ) { 10b34e: 83 c4 10 add $0x10,%esp 10b351: 80 7b 12 00 cmpb $0x0,0x12(%ebx) 10b355: 74 3c je 10b393 <_Objects_Allocate+0x63> /* * If the list is empty then we are out of objects and need to * extend information base. */ if ( !the_object ) { 10b357: 85 c0 test %eax,%eax 10b359: 75 1a jne 10b375 <_Objects_Allocate+0x45> _Objects_Extend_information( information ); 10b35b: 83 ec 0c sub $0xc,%esp 10b35e: 53 push %ebx 10b35f: e8 60 00 00 00 call 10b3c4 <_Objects_Extend_information> the_object = (Objects_Control *) _Chain_Get( &information->Inactive ); 10b364: 89 34 24 mov %esi,(%esp) 10b367: e8 04 f7 ff ff call 10aa70 <_Chain_Get> 10b36c: 89 c1 mov %eax,%ecx } if ( the_object ) { 10b36e: 83 c4 10 add $0x10,%esp 10b371: 85 c0 test %eax,%eax 10b373: 74 1e je 10b393 <_Objects_Allocate+0x63> uint32_t block; block = (uint32_t) _Objects_Get_index( the_object->id ) - 10b375: 0f b7 41 08 movzwl 0x8(%ecx),%eax 10b379: 0f b7 53 08 movzwl 0x8(%ebx),%edx 10b37d: 29 d0 sub %edx,%eax _Objects_Get_index( information->minimum_id ); block /= information->allocation_size; 10b37f: 0f b7 73 14 movzwl 0x14(%ebx),%esi 10b383: 31 d2 xor %edx,%edx 10b385: f7 f6 div %esi information->inactive_per_block[ block ]--; 10b387: c1 e0 02 shl $0x2,%eax 10b38a: 03 43 30 add 0x30(%ebx),%eax 10b38d: ff 08 decl (%eax) information->inactive--; 10b38f: 66 ff 4b 2c decw 0x2c(%ebx) ); } #endif return the_object; } 10b393: 89 c8 mov %ecx,%eax 10b395: 8d 65 f8 lea -0x8(%ebp),%esp 10b398: 5b pop %ebx 10b399: 5e pop %esi 10b39a: c9 leave 10b39b: c3 ret =============================================================================== 0010b3c4 <_Objects_Extend_information>: */ void _Objects_Extend_information( Objects_Information *information ) { 10b3c4: 55 push %ebp 10b3c5: 89 e5 mov %esp,%ebp 10b3c7: 57 push %edi 10b3c8: 56 push %esi 10b3c9: 53 push %ebx 10b3ca: 83 ec 4c sub $0x4c,%esp 10b3cd: 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 ); 10b3d0: 0f b7 43 08 movzwl 0x8(%ebx),%eax 10b3d4: 89 45 d0 mov %eax,-0x30(%ebp) index_base = minimum_index; block = 0; /* if ( information->maximum < minimum_index ) */ if ( information->object_blocks == NULL ) 10b3d7: 8b 4b 34 mov 0x34(%ebx),%ecx 10b3da: 85 c9 test %ecx,%ecx 10b3dc: 74 38 je 10b416 <_Objects_Extend_information+0x52> block_count = 0; else { block_count = information->maximum / information->allocation_size; 10b3de: 0f b7 73 14 movzwl 0x14(%ebx),%esi 10b3e2: 8b 43 10 mov 0x10(%ebx),%eax 10b3e5: 31 d2 xor %edx,%edx 10b3e7: 66 f7 f6 div %si 10b3ea: 0f b7 d0 movzwl %ax,%edx /* * 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 ); 10b3ed: 8b 45 d0 mov -0x30(%ebp),%eax 10b3f0: 89 45 cc mov %eax,-0x34(%ebp) index_base = minimum_index; block = 0; 10b3f3: c7 45 d4 00 00 00 00 movl $0x0,-0x2c(%ebp) 10b3fa: 31 c0 xor %eax,%eax if ( information->object_blocks == NULL ) block_count = 0; else { block_count = information->maximum / information->allocation_size; for ( ; block < block_count; block++ ) { 10b3fc: eb 0a jmp 10b408 <_Objects_Extend_information+0x44> if ( information->object_blocks[ block ] == NULL ) { 10b3fe: 83 3c 81 00 cmpl $0x0,(%ecx,%eax,4) 10b402: 74 28 je 10b42c <_Objects_Extend_information+0x68> 10b404: 01 75 cc add %esi,-0x34(%ebp) if ( information->object_blocks == NULL ) block_count = 0; else { block_count = information->maximum / information->allocation_size; for ( ; block < block_count; block++ ) { 10b407: 40 inc %eax 10b408: 39 d0 cmp %edx,%eax 10b40a: 72 f2 jb 10b3fe <_Objects_Extend_information+0x3a> 10b40c: 89 45 d4 mov %eax,-0x2c(%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; 10b40f: be 01 00 00 00 mov $0x1,%esi 10b414: eb 1b jmp 10b431 <_Objects_Extend_information+0x6d> minimum_index = _Objects_Get_index( information->minimum_id ); 10b416: 8b 55 d0 mov -0x30(%ebp),%edx 10b419: 89 55 cc mov %edx,-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; 10b41c: be 01 00 00 00 mov $0x1,%esi minimum_index = _Objects_Get_index( information->minimum_id ); index_base = minimum_index; block = 0; 10b421: c7 45 d4 00 00 00 00 movl $0x0,-0x2c(%ebp) /* if ( information->maximum < minimum_index ) */ if ( information->object_blocks == NULL ) block_count = 0; 10b428: 31 d2 xor %edx,%edx 10b42a: eb 05 jmp 10b431 <_Objects_Extend_information+0x6d> 10b42c: 89 45 d4 mov %eax,-0x2c(%ebp) else { block_count = information->maximum / information->allocation_size; for ( ; block < block_count; block++ ) { if ( information->object_blocks[ block ] == NULL ) { do_extend = false; 10b42f: 31 f6 xor %esi,%esi } else index_base += information->allocation_size; } } maximum = (uint32_t) information->maximum + information->allocation_size; 10b431: 0f b7 43 14 movzwl 0x14(%ebx),%eax 10b435: 0f b7 4b 10 movzwl 0x10(%ebx),%ecx 10b439: 8d 0c 08 lea (%eax,%ecx,1),%ecx 10b43c: 89 4d bc mov %ecx,-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 ) { 10b43f: 81 f9 ff ff 00 00 cmp $0xffff,%ecx 10b445: 0f 87 d4 01 00 00 ja 10b61f <_Objects_Extend_information+0x25b> /* * 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; 10b44b: 0f af 43 18 imul 0x18(%ebx),%eax if ( information->auto_extend ) { 10b44f: 80 7b 12 00 cmpb $0x0,0x12(%ebx) 10b453: 74 1e je 10b473 <_Objects_Extend_information+0xaf> new_object_block = _Workspace_Allocate( block_size ); 10b455: 83 ec 0c sub $0xc,%esp 10b458: 50 push %eax 10b459: 89 55 b4 mov %edx,-0x4c(%ebp) 10b45c: e8 dd 1a 00 00 call 10cf3e <_Workspace_Allocate> 10b461: 89 45 c4 mov %eax,-0x3c(%ebp) if ( !new_object_block ) 10b464: 83 c4 10 add $0x10,%esp 10b467: 85 c0 test %eax,%eax 10b469: 8b 55 b4 mov -0x4c(%ebp),%edx 10b46c: 75 1a jne 10b488 <_Objects_Extend_information+0xc4> 10b46e: e9 ac 01 00 00 jmp 10b61f <_Objects_Extend_information+0x25b> return; } else { new_object_block = _Workspace_Allocate_or_fatal_error( block_size ); 10b473: 83 ec 0c sub $0xc,%esp 10b476: 50 push %eax 10b477: 89 55 b4 mov %edx,-0x4c(%ebp) 10b47a: e8 ed 1a 00 00 call 10cf6c <_Workspace_Allocate_or_fatal_error> 10b47f: 89 45 c4 mov %eax,-0x3c(%ebp) 10b482: 83 c4 10 add $0x10,%esp 10b485: 8b 55 b4 mov -0x4c(%ebp),%edx } /* * Do we need to grow the tables? */ if ( do_extend ) { 10b488: 89 f1 mov %esi,%ecx 10b48a: 84 c9 test %cl,%cl 10b48c: 0f 84 0d 01 00 00 je 10b59f <_Objects_Extend_information+0x1db><== NEVER TAKEN */ /* * Up the block count and maximum */ block_count++; 10b492: 8d 72 01 lea 0x1(%edx),%esi * Allocate the tables and break it up. */ block_size = block_count * (sizeof(void *) + sizeof(uint32_t) + sizeof(Objects_Name *)) + ((maximum + minimum_index) * sizeof(Objects_Control *)); object_blocks = (void**) _Workspace_Allocate( block_size ); 10b495: 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 *)); 10b498: 8b 4d bc mov -0x44(%ebp),%ecx 10b49b: 03 4d d0 add -0x30(%ebp),%ecx /* * Allocate the tables and break it up. */ block_size = block_count * (sizeof(void *) + sizeof(uint32_t) + sizeof(Objects_Name *)) + 10b49e: 8d 04 76 lea (%esi,%esi,2),%eax 10b4a1: 8d 04 01 lea (%ecx,%eax,1),%eax block_count++; /* * Allocate the tables and break it up. */ block_size = block_count * 10b4a4: 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 ); 10b4a7: 50 push %eax 10b4a8: 89 55 b4 mov %edx,-0x4c(%ebp) 10b4ab: e8 8e 1a 00 00 call 10cf3e <_Workspace_Allocate> if ( !object_blocks ) { 10b4b0: 83 c4 10 add $0x10,%esp 10b4b3: 85 c0 test %eax,%eax 10b4b5: 8b 55 b4 mov -0x4c(%ebp),%edx 10b4b8: 75 13 jne 10b4cd <_Objects_Extend_information+0x109> _Workspace_Free( new_object_block ); 10b4ba: 83 ec 0c sub $0xc,%esp 10b4bd: ff 75 c4 pushl -0x3c(%ebp) 10b4c0: e8 92 1a 00 00 call 10cf57 <_Workspace_Free> return; 10b4c5: 83 c4 10 add $0x10,%esp 10b4c8: e9 52 01 00 00 jmp 10b61f <_Objects_Extend_information+0x25b> 10b4cd: 8d 0c b0 lea (%eax,%esi,4),%ecx 10b4d0: 89 4d b8 mov %ecx,-0x48(%ebp) 10b4d3: 8d 34 f0 lea (%eax,%esi,8),%esi 10b4d6: 89 75 c0 mov %esi,-0x40(%ebp) * Take the block count down. Saves all the (block_count - 1) * in the copies. */ block_count--; if ( information->maximum > minimum_index ) { 10b4d9: 0f b7 4b 10 movzwl 0x10(%ebx),%ecx 10b4dd: 3b 4d d0 cmp -0x30(%ebp),%ecx 10b4e0: 77 04 ja 10b4e6 <_Objects_Extend_information+0x122> 10b4e2: 31 c9 xor %ecx,%ecx 10b4e4: eb 3e jmp 10b524 <_Objects_Extend_information+0x160> /* * 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, 10b4e6: 8d 34 95 00 00 00 00 lea 0x0(,%edx,4),%esi 10b4ed: 89 75 c8 mov %esi,-0x38(%ebp) 10b4f0: 8b 73 34 mov 0x34(%ebx),%esi 10b4f3: 89 c7 mov %eax,%edi 10b4f5: 8b 4d c8 mov -0x38(%ebp),%ecx 10b4f8: f3 a4 rep movsb %ds:(%esi),%es:(%edi) information->object_blocks, block_count * sizeof(void*) ); memcpy( inactive_per_block, 10b4fa: 8b 73 30 mov 0x30(%ebx),%esi 10b4fd: 8b 7d b8 mov -0x48(%ebp),%edi 10b500: 8b 4d c8 mov -0x38(%ebp),%ecx 10b503: 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 *) ); 10b505: 0f b7 4b 10 movzwl 0x10(%ebx),%ecx 10b509: 03 4d d0 add -0x30(%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, 10b50c: c1 e1 02 shl $0x2,%ecx 10b50f: 8b 73 1c mov 0x1c(%ebx),%esi 10b512: 8b 7d c0 mov -0x40(%ebp),%edi 10b515: f3 a4 rep movsb %ds:(%esi),%es:(%edi) 10b517: eb 10 jmp 10b529 <_Objects_Extend_information+0x165> /* * Deal with the special case of the 0 to minimum_index */ for ( index = 0; index < minimum_index; index++ ) { local_table[ index ] = NULL; 10b519: 8b 75 c0 mov -0x40(%ebp),%esi 10b51c: c7 04 8e 00 00 00 00 movl $0x0,(%esi,%ecx,4) } else { /* * Deal with the special case of the 0 to minimum_index */ for ( index = 0; index < minimum_index; index++ ) { 10b523: 41 inc %ecx 10b524: 3b 4d d0 cmp -0x30(%ebp),%ecx 10b527: 72 f0 jb 10b519 <_Objects_Extend_information+0x155> } /* * Initialise the new entries in the table. */ object_blocks[block_count] = NULL; 10b529: c7 04 90 00 00 00 00 movl $0x0,(%eax,%edx,4) inactive_per_block[block_count] = 0; 10b530: 8b 4d b8 mov -0x48(%ebp),%ecx 10b533: c7 04 91 00 00 00 00 movl $0x0,(%ecx,%edx,4) for ( index=index_base ; index < ( information->allocation_size + index_base ); 10b53a: 0f b7 4b 14 movzwl 0x14(%ebx),%ecx 10b53e: 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 ; 10b541: 8b 55 cc mov -0x34(%ebp),%edx 10b544: eb 0b jmp 10b551 <_Objects_Extend_information+0x18d> index < ( information->allocation_size + index_base ); index++ ) { local_table[ index ] = NULL; 10b546: 8b 75 c0 mov -0x40(%ebp),%esi 10b549: c7 04 96 00 00 00 00 movl $0x0,(%esi,%edx,4) object_blocks[block_count] = NULL; inactive_per_block[block_count] = 0; for ( index=index_base ; index < ( information->allocation_size + index_base ); index++ ) { 10b550: 42 inc %edx * Initialise the new entries in the table. */ object_blocks[block_count] = NULL; inactive_per_block[block_count] = 0; for ( index=index_base ; 10b551: 39 ca cmp %ecx,%edx 10b553: 72 f1 jb 10b546 <_Objects_Extend_information+0x182> index < ( information->allocation_size + index_base ); index++ ) { local_table[ index ] = NULL; } _ISR_Disable( level ); 10b555: 9c pushf 10b556: fa cli 10b557: 5e pop %esi old_tables = information->object_blocks; 10b558: 8b 53 34 mov 0x34(%ebx),%edx information->object_blocks = object_blocks; 10b55b: 89 43 34 mov %eax,0x34(%ebx) information->inactive_per_block = inactive_per_block; 10b55e: 8b 45 b8 mov -0x48(%ebp),%eax 10b561: 89 43 30 mov %eax,0x30(%ebx) information->local_table = local_table; 10b564: 8b 4d c0 mov -0x40(%ebp),%ecx 10b567: 89 4b 1c mov %ecx,0x1c(%ebx) information->maximum = (Objects_Maximum) maximum; 10b56a: 8b 45 bc mov -0x44(%ebp),%eax 10b56d: 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) | 10b571: 8b 03 mov (%ebx),%eax 10b573: c1 e0 18 shl $0x18,%eax 10b576: 0d 00 00 01 00 or $0x10000,%eax information->maximum_id = _Objects_Build_id( 10b57b: 0f b7 4b 04 movzwl 0x4(%ebx),%ecx (( (Objects_Id) the_class ) << OBJECTS_CLASS_START_BIT) | 10b57f: c1 e1 1b shl $0x1b,%ecx 10b582: 09 c8 or %ecx,%eax 10b584: 0f b7 4d bc movzwl -0x44(%ebp),%ecx uint32_t the_class, uint32_t node, uint32_t index ) { return (( (Objects_Id) the_api ) << OBJECTS_API_START_BIT) | 10b588: 09 c8 or %ecx,%eax 10b58a: 89 43 0c mov %eax,0xc(%ebx) information->the_class, _Objects_Local_node, information->maximum ); _ISR_Enable( level ); 10b58d: 56 push %esi 10b58e: 9d popf if ( old_tables ) 10b58f: 85 d2 test %edx,%edx 10b591: 74 0c je 10b59f <_Objects_Extend_information+0x1db> _Workspace_Free( old_tables ); 10b593: 83 ec 0c sub $0xc,%esp 10b596: 52 push %edx 10b597: e8 bb 19 00 00 call 10cf57 <_Workspace_Free> 10b59c: 83 c4 10 add $0x10,%esp } /* * Assign the new object block to the object block table. */ information->object_blocks[ block ] = new_object_block; 10b59f: 8b 55 d4 mov -0x2c(%ebp),%edx 10b5a2: c1 e2 02 shl $0x2,%edx 10b5a5: 89 55 d0 mov %edx,-0x30(%ebp) 10b5a8: 8b 43 34 mov 0x34(%ebx),%eax 10b5ab: 8b 75 c4 mov -0x3c(%ebp),%esi 10b5ae: 8b 4d d4 mov -0x2c(%ebp),%ecx 10b5b1: 89 34 88 mov %esi,(%eax,%ecx,4) /* * Initialize objects .. add to a local chain first. */ _Chain_Initialize( 10b5b4: ff 73 18 pushl 0x18(%ebx) 10b5b7: 0f b7 43 14 movzwl 0x14(%ebx),%eax 10b5bb: 50 push %eax 10b5bc: 56 push %esi 10b5bd: 8d 7d dc lea -0x24(%ebp),%edi 10b5c0: 57 push %edi 10b5c1: e8 4e 3c 00 00 call 10f214 <_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 ) { 10b5c6: 83 c4 10 add $0x10,%esp ); /* * Move from the local chain, initialise, then append to the inactive chain */ index = index_base; 10b5c9: 8b 75 cc mov -0x34(%ebp),%esi information->the_class, _Objects_Local_node, index ); _Chain_Append( &information->Inactive, &the_object->Node ); 10b5cc: 8d 43 20 lea 0x20(%ebx),%eax 10b5cf: 89 45 d4 mov %eax,-0x2c(%ebp) /* * Move from the local chain, initialise, then append to the inactive chain */ index = index_base; while ((the_object = (Objects_Control *) _Chain_Get( &Inactive )) != NULL ) { 10b5d2: eb 28 jmp 10b5fc <_Objects_Extend_information+0x238> 10b5d4: 8b 13 mov (%ebx),%edx 10b5d6: c1 e2 18 shl $0x18,%edx 10b5d9: 81 ca 00 00 01 00 or $0x10000,%edx the_object->id = _Objects_Build_id( 10b5df: 0f b7 4b 04 movzwl 0x4(%ebx),%ecx (( (Objects_Id) the_class ) << OBJECTS_CLASS_START_BIT) | 10b5e3: c1 e1 1b shl $0x1b,%ecx 10b5e6: 09 ca or %ecx,%edx uint32_t the_class, uint32_t node, uint32_t index ) { return (( (Objects_Id) the_api ) << OBJECTS_API_START_BIT) | 10b5e8: 09 f2 or %esi,%edx 10b5ea: 89 50 08 mov %edx,0x8(%eax) information->the_class, _Objects_Local_node, index ); _Chain_Append( &information->Inactive, &the_object->Node ); 10b5ed: 52 push %edx 10b5ee: 52 push %edx 10b5ef: 50 push %eax 10b5f0: ff 75 d4 pushl -0x2c(%ebp) 10b5f3: e8 3c f4 ff ff call 10aa34 <_Chain_Append> index++; 10b5f8: 46 inc %esi 10b5f9: 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 ) { 10b5fc: 83 ec 0c sub $0xc,%esp 10b5ff: 57 push %edi 10b600: e8 6b f4 ff ff call 10aa70 <_Chain_Get> 10b605: 83 c4 10 add $0x10,%esp 10b608: 85 c0 test %eax,%eax 10b60a: 75 c8 jne 10b5d4 <_Objects_Extend_information+0x210> _Chain_Append( &information->Inactive, &the_object->Node ); index++; } information->inactive_per_block[ block ] = information->allocation_size; 10b60c: 8b 43 14 mov 0x14(%ebx),%eax 10b60f: 8b 53 30 mov 0x30(%ebx),%edx 10b612: 0f b7 c8 movzwl %ax,%ecx 10b615: 8b 75 d0 mov -0x30(%ebp),%esi 10b618: 89 0c 32 mov %ecx,(%edx,%esi,1) information->inactive = (Objects_Maximum)(information->inactive + information->allocation_size); 10b61b: 66 01 43 2c add %ax,0x2c(%ebx) } 10b61f: 8d 65 f4 lea -0xc(%ebp),%esp 10b622: 5b pop %ebx 10b623: 5e pop %esi 10b624: 5f pop %edi 10b625: c9 leave 10b626: c3 ret =============================================================================== 0010b6b8 <_Objects_Get_information>: Objects_Information *_Objects_Get_information( Objects_APIs the_api, uint32_t the_class ) { 10b6b8: 55 push %ebp 10b6b9: 89 e5 mov %esp,%ebp 10b6bb: 57 push %edi 10b6bc: 56 push %esi 10b6bd: 53 push %ebx 10b6be: 83 ec 0c sub $0xc,%esp 10b6c1: 8b 7d 08 mov 0x8(%ebp),%edi 10b6c4: 8b 75 0c mov 0xc(%ebp),%esi Objects_Information *info; int the_class_api_maximum; if ( !the_class ) return NULL; 10b6c7: 31 db xor %ebx,%ebx ) { Objects_Information *info; int the_class_api_maximum; if ( !the_class ) 10b6c9: 85 f6 test %esi,%esi 10b6cb: 74 34 je 10b701 <_Objects_Get_information+0x49> /* * 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 ); 10b6cd: 83 ec 0c sub $0xc,%esp 10b6d0: 57 push %edi 10b6d1: e8 02 40 00 00 call 10f6d8 <_Objects_API_maximum_class> if ( the_class_api_maximum == 0 ) 10b6d6: 83 c4 10 add $0x10,%esp 10b6d9: 85 c0 test %eax,%eax 10b6db: 74 24 je 10b701 <_Objects_Get_information+0x49> return NULL; if ( the_class > (uint32_t) the_class_api_maximum ) 10b6dd: 39 c6 cmp %eax,%esi 10b6df: 77 20 ja 10b701 <_Objects_Get_information+0x49> return NULL; if ( !_Objects_Information_table[ the_api ] ) 10b6e1: 8b 04 bd bc 41 12 00 mov 0x1241bc(,%edi,4),%eax 10b6e8: 85 c0 test %eax,%eax 10b6ea: 74 15 je 10b701 <_Objects_Get_information+0x49><== NEVER TAKEN return NULL; info = _Objects_Information_table[ the_api ][ the_class ]; 10b6ec: 8b 1c b0 mov (%eax,%esi,4),%ebx if ( !info ) 10b6ef: 85 db test %ebx,%ebx 10b6f1: 74 0e je 10b701 <_Objects_Get_information+0x49><== NEVER TAKEN * Thus we may have 0 local instances and still have a valid object * pointer. */ #if !defined(RTEMS_MULTIPROCESSING) if ( info->maximum == 0 ) return NULL; 10b6f3: 31 c0 xor %eax,%eax 10b6f5: 66 83 7b 10 00 cmpw $0x0,0x10(%ebx) 10b6fa: 0f 95 c0 setne %al 10b6fd: f7 d8 neg %eax 10b6ff: 21 c3 and %eax,%ebx #endif return info; } 10b701: 89 d8 mov %ebx,%eax 10b703: 8d 65 f4 lea -0xc(%ebp),%esp 10b706: 5b pop %ebx 10b707: 5e pop %esi 10b708: 5f pop %edi 10b709: c9 leave 10b70a: c3 ret =============================================================================== 00118ba8 <_Objects_Get_no_protection>: Objects_Control *_Objects_Get_no_protection( Objects_Information *information, Objects_Id id, Objects_Locations *location ) { 118ba8: 55 push %ebp 118ba9: 89 e5 mov %esp,%ebp 118bab: 53 push %ebx 118bac: 8b 55 08 mov 0x8(%ebp),%edx 118baf: 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; 118bb2: b8 01 00 00 00 mov $0x1,%eax 118bb7: 2b 42 08 sub 0x8(%edx),%eax 118bba: 03 45 0c add 0xc(%ebp),%eax if ( information->maximum >= index ) { 118bbd: 0f b7 5a 10 movzwl 0x10(%edx),%ebx 118bc1: 39 c3 cmp %eax,%ebx 118bc3: 72 12 jb 118bd7 <_Objects_Get_no_protection+0x2f> if ( (the_object = information->local_table[ index ]) != NULL ) { 118bc5: 8b 52 1c mov 0x1c(%edx),%edx 118bc8: 8b 04 82 mov (%edx,%eax,4),%eax 118bcb: 85 c0 test %eax,%eax 118bcd: 74 08 je 118bd7 <_Objects_Get_no_protection+0x2f><== NEVER TAKEN *location = OBJECTS_LOCAL; 118bcf: c7 01 00 00 00 00 movl $0x0,(%ecx) return the_object; 118bd5: eb 08 jmp 118bdf <_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; 118bd7: c7 01 01 00 00 00 movl $0x1,(%ecx) return NULL; 118bdd: 31 c0 xor %eax,%eax } 118bdf: 5b pop %ebx 118be0: c9 leave 118be1: c3 ret =============================================================================== 0010c8c8 <_Objects_Id_to_name>: */ Objects_Name_or_id_lookup_errors _Objects_Id_to_name ( Objects_Id id, Objects_Name *name ) { 10c8c8: 55 push %ebp 10c8c9: 89 e5 mov %esp,%ebp 10c8cb: 53 push %ebx 10c8cc: 83 ec 14 sub $0x14,%esp /* * Caller is trusted for name != NULL. */ tmpId = (id == OBJECTS_ID_OF_SELF) ? _Thread_Executing->Object.id : id; 10c8cf: 8b 45 08 mov 0x8(%ebp),%eax 10c8d2: 85 c0 test %eax,%eax 10c8d4: 75 08 jne 10c8de <_Objects_Id_to_name+0x16> 10c8d6: a1 80 77 12 00 mov 0x127780,%eax 10c8db: 8b 40 08 mov 0x8(%eax),%eax 10c8de: 89 c2 mov %eax,%edx 10c8e0: c1 ea 18 shr $0x18,%edx 10c8e3: 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 ) 10c8e6: 8d 4a ff lea -0x1(%edx),%ecx the_api = _Objects_Get_API( tmpId ); if ( !_Objects_Is_api_valid( the_api ) ) return OBJECTS_INVALID_ID; 10c8e9: bb 03 00 00 00 mov $0x3,%ebx 10c8ee: 83 f9 02 cmp $0x2,%ecx 10c8f1: 77 36 ja 10c929 <_Objects_Id_to_name+0x61> 10c8f3: eb 3b jmp 10c930 <_Objects_Id_to_name+0x68> */ RTEMS_INLINE_ROUTINE uint32_t _Objects_Get_class( Objects_Id id ) { return (uint32_t) 10c8f5: 89 c1 mov %eax,%ecx 10c8f7: 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 ]; 10c8fa: 8b 14 8a mov (%edx,%ecx,4),%edx if ( !information ) 10c8fd: 85 d2 test %edx,%edx 10c8ff: 74 28 je 10c929 <_Objects_Id_to_name+0x61><== NEVER TAKEN return OBJECTS_INVALID_ID; #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES) if ( information->is_string ) 10c901: 80 7a 38 00 cmpb $0x0,0x38(%edx) 10c905: 75 22 jne 10c929 <_Objects_Id_to_name+0x61><== NEVER TAKEN return OBJECTS_INVALID_ID; #endif the_object = _Objects_Get( information, tmpId, &ignored_location ); 10c907: 51 push %ecx 10c908: 8d 4d f4 lea -0xc(%ebp),%ecx 10c90b: 51 push %ecx 10c90c: 50 push %eax 10c90d: 52 push %edx 10c90e: e8 5d ff ff ff call 10c870 <_Objects_Get> if ( !the_object ) 10c913: 83 c4 10 add $0x10,%esp 10c916: 85 c0 test %eax,%eax 10c918: 74 0f je 10c929 <_Objects_Id_to_name+0x61> return OBJECTS_INVALID_ID; *name = the_object->name; 10c91a: 8b 50 0c mov 0xc(%eax),%edx 10c91d: 8b 45 0c mov 0xc(%ebp),%eax 10c920: 89 10 mov %edx,(%eax) _Thread_Enable_dispatch(); 10c922: e8 9b 07 00 00 call 10d0c2 <_Thread_Enable_dispatch> return OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL; 10c927: 31 db xor %ebx,%ebx } 10c929: 89 d8 mov %ebx,%eax 10c92b: 8b 5d fc mov -0x4(%ebp),%ebx 10c92e: c9 leave 10c92f: c3 ret the_api = _Objects_Get_API( tmpId ); if ( !_Objects_Is_api_valid( the_api ) ) return OBJECTS_INVALID_ID; if ( !_Objects_Information_table[ the_api ] ) 10c930: 8b 14 95 08 72 12 00 mov 0x127208(,%edx,4),%edx 10c937: 85 d2 test %edx,%edx 10c939: 75 ba jne 10c8f5 <_Objects_Id_to_name+0x2d><== ALWAYS TAKEN 10c93b: eb ec jmp 10c929 <_Objects_Id_to_name+0x61><== NOT EXECUTED =============================================================================== 0010bf48 <_Objects_Set_name>: bool _Objects_Set_name( Objects_Information *information, Objects_Control *the_object, const char *name ) { 10bf48: 55 push %ebp 10bf49: 89 e5 mov %esp,%ebp 10bf4b: 57 push %edi 10bf4c: 56 push %esi 10bf4d: 53 push %ebx 10bf4e: 83 ec 24 sub $0x24,%esp 10bf51: 8b 55 08 mov 0x8(%ebp),%edx 10bf54: 8b 7d 0c mov 0xc(%ebp),%edi 10bf57: 8b 5d 10 mov 0x10(%ebp),%ebx size_t length; const char *s; s = name; length = strnlen( name, information->name_length ); 10bf5a: 0f b7 42 3a movzwl 0x3a(%edx),%eax 10bf5e: 50 push %eax 10bf5f: 53 push %ebx 10bf60: 89 55 e4 mov %edx,-0x1c(%ebp) 10bf63: e8 b0 6e 00 00 call 112e18 10bf68: 89 c6 mov %eax,%esi #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES) if ( information->is_string ) { 10bf6a: 83 c4 10 add $0x10,%esp 10bf6d: 8b 55 e4 mov -0x1c(%ebp),%edx 10bf70: 80 7a 38 00 cmpb $0x0,0x38(%edx) 10bf74: 74 52 je 10bfc8 <_Objects_Set_name+0x80> char *d; d = _Workspace_Allocate( length + 1 ); 10bf76: 83 ec 0c sub $0xc,%esp 10bf79: 8d 40 01 lea 0x1(%eax),%eax 10bf7c: 50 push %eax 10bf7d: e8 9c 16 00 00 call 10d61e <_Workspace_Allocate> 10bf82: 89 c2 mov %eax,%edx if ( !d ) 10bf84: 83 c4 10 add $0x10,%esp return false; 10bf87: 31 c0 xor %eax,%eax #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES) if ( information->is_string ) { char *d; d = _Workspace_Allocate( length + 1 ); if ( !d ) 10bf89: 85 d2 test %edx,%edx 10bf8b: 74 7c je 10c009 <_Objects_Set_name+0xc1><== NEVER TAKEN return false; if ( the_object->name.name_p ) { 10bf8d: 8b 47 0c mov 0xc(%edi),%eax 10bf90: 85 c0 test %eax,%eax 10bf92: 74 19 je 10bfad <_Objects_Set_name+0x65> _Workspace_Free( (void *)the_object->name.name_p ); 10bf94: 83 ec 0c sub $0xc,%esp 10bf97: 50 push %eax 10bf98: 89 55 e4 mov %edx,-0x1c(%ebp) 10bf9b: e8 97 16 00 00 call 10d637 <_Workspace_Free> the_object->name.name_p = NULL; 10bfa0: c7 47 0c 00 00 00 00 movl $0x0,0xc(%edi) 10bfa7: 83 c4 10 add $0x10,%esp 10bfaa: 8b 55 e4 mov -0x1c(%ebp),%edx } strncpy( d, name, length ); 10bfad: 50 push %eax 10bfae: 56 push %esi 10bfaf: 53 push %ebx 10bfb0: 52 push %edx 10bfb1: 89 55 e4 mov %edx,-0x1c(%ebp) 10bfb4: e8 e3 6d 00 00 call 112d9c d[length] = '\0'; 10bfb9: 8b 55 e4 mov -0x1c(%ebp),%edx 10bfbc: c6 04 32 00 movb $0x0,(%edx,%esi,1) the_object->name.name_p = d; 10bfc0: 89 57 0c mov %edx,0xc(%edi) 10bfc3: 83 c4 10 add $0x10,%esp 10bfc6: eb 3f jmp 10c007 <_Objects_Set_name+0xbf> } else #endif { the_object->name.name_u32 = _Objects_Build_name( 10bfc8: 0f be 13 movsbl (%ebx),%edx 10bfcb: c1 e2 18 shl $0x18,%edx 10bfce: b8 00 00 20 00 mov $0x200000,%eax 10bfd3: 83 fe 01 cmp $0x1,%esi 10bfd6: 76 07 jbe 10bfdf <_Objects_Set_name+0x97> 10bfd8: 0f be 43 01 movsbl 0x1(%ebx),%eax 10bfdc: c1 e0 10 shl $0x10,%eax 10bfdf: 09 c2 or %eax,%edx 10bfe1: b8 00 20 00 00 mov $0x2000,%eax 10bfe6: 83 fe 02 cmp $0x2,%esi 10bfe9: 76 07 jbe 10bff2 <_Objects_Set_name+0xaa> 10bfeb: 0f be 43 02 movsbl 0x2(%ebx),%eax 10bfef: c1 e0 08 shl $0x8,%eax 10bff2: 09 d0 or %edx,%eax 10bff4: b9 20 00 00 00 mov $0x20,%ecx 10bff9: 83 fe 03 cmp $0x3,%esi 10bffc: 76 04 jbe 10c002 <_Objects_Set_name+0xba> 10bffe: 0f be 4b 03 movsbl 0x3(%ebx),%ecx 10c002: 09 c1 or %eax,%ecx 10c004: 89 4f 0c mov %ecx,0xc(%edi) ((3 < length) ? s[ 3 ] : ' ') ); } return true; 10c007: b0 01 mov $0x1,%al } 10c009: 8d 65 f4 lea -0xc(%ebp),%esp 10c00c: 5b pop %ebx 10c00d: 5e pop %esi 10c00e: 5f pop %edi 10c00f: c9 leave 10c010: c3 ret =============================================================================== 0010ae00 <_POSIX_Condition_variables_Wait_support>: pthread_cond_t *cond, pthread_mutex_t *mutex, Watchdog_Interval timeout, bool already_timedout ) { 10ae00: 55 push %ebp 10ae01: 89 e5 mov %esp,%ebp 10ae03: 57 push %edi 10ae04: 56 push %esi 10ae05: 53 push %ebx 10ae06: 83 ec 34 sub $0x34,%esp 10ae09: 8b 75 0c mov 0xc(%ebp),%esi 10ae0c: 8a 45 14 mov 0x14(%ebp),%al 10ae0f: 88 45 d7 mov %al,-0x29(%ebp) register POSIX_Condition_variables_Control *the_cond; Objects_Locations location; int status; int mutex_status; if ( !_POSIX_Mutex_Get( mutex, &location ) ) { 10ae12: 8d 7d e4 lea -0x1c(%ebp),%edi 10ae15: 57 push %edi 10ae16: 56 push %esi 10ae17: e8 48 01 00 00 call 10af64 <_POSIX_Mutex_Get> 10ae1c: 83 c4 10 add $0x10,%esp return EINVAL; 10ae1f: bb 16 00 00 00 mov $0x16,%ebx register POSIX_Condition_variables_Control *the_cond; Objects_Locations location; int status; int mutex_status; if ( !_POSIX_Mutex_Get( mutex, &location ) ) { 10ae24: 85 c0 test %eax,%eax 10ae26: 0f 84 bb 00 00 00 je 10aee7 <_POSIX_Condition_variables_Wait_support+0xe7> */ RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void ) { RTEMS_COMPILER_MEMORY_BARRIER(); _Thread_Dispatch_disable_level -= 1; 10ae2c: a1 04 74 12 00 mov 0x127404,%eax 10ae31: 48 dec %eax 10ae32: a3 04 74 12 00 mov %eax,0x127404 return EINVAL; } _Thread_Unnest_dispatch(); the_cond = _POSIX_Condition_variables_Get( cond, &location ); 10ae37: 52 push %edx 10ae38: 52 push %edx 10ae39: 57 push %edi 10ae3a: ff 75 08 pushl 0x8(%ebp) 10ae3d: e8 16 fe ff ff call 10ac58 <_POSIX_Condition_variables_Get> 10ae42: 89 c7 mov %eax,%edi switch ( location ) { 10ae44: 83 c4 10 add $0x10,%esp 10ae47: 83 7d e4 00 cmpl $0x0,-0x1c(%ebp) 10ae4b: 0f 85 96 00 00 00 jne 10aee7 <_POSIX_Condition_variables_Wait_support+0xe7> case OBJECTS_LOCAL: if ( the_cond->Mutex && ( the_cond->Mutex != *mutex ) ) { 10ae51: 8b 40 14 mov 0x14(%eax),%eax 10ae54: 85 c0 test %eax,%eax 10ae56: 74 0e je 10ae66 <_POSIX_Condition_variables_Wait_support+0x66> 10ae58: 3b 06 cmp (%esi),%eax 10ae5a: 74 0a je 10ae66 <_POSIX_Condition_variables_Wait_support+0x66> _Thread_Enable_dispatch(); 10ae5c: e8 79 2d 00 00 call 10dbda <_Thread_Enable_dispatch> return EINVAL; 10ae61: e9 81 00 00 00 jmp 10aee7 <_POSIX_Condition_variables_Wait_support+0xe7> } (void) pthread_mutex_unlock( mutex ); 10ae66: 83 ec 0c sub $0xc,%esp 10ae69: 56 push %esi 10ae6a: e8 25 03 00 00 call 10b194 _Thread_Enable_dispatch(); return EINVAL; } */ if ( !already_timedout ) { 10ae6f: 83 c4 10 add $0x10,%esp 10ae72: 80 7d d7 00 cmpb $0x0,-0x29(%ebp) 10ae76: 75 50 jne 10aec8 <_POSIX_Condition_variables_Wait_support+0xc8> the_cond->Mutex = *mutex; 10ae78: 8b 06 mov (%esi),%eax 10ae7a: 89 47 14 mov %eax,0x14(%edi) 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; 10ae7d: c7 47 48 01 00 00 00 movl $0x1,0x48(%edi) _Thread_queue_Enter_critical_section( &the_cond->Wait_queue ); _Thread_Executing->Wait.return_code = 0; 10ae84: a1 54 79 12 00 mov 0x127954,%eax 10ae89: c7 40 34 00 00 00 00 movl $0x0,0x34(%eax) _Thread_Executing->Wait.queue = &the_cond->Wait_queue; 10ae90: 83 c7 18 add $0x18,%edi 10ae93: 89 78 44 mov %edi,0x44(%eax) _Thread_Executing->Wait.id = *cond; 10ae96: 8b 4d 08 mov 0x8(%ebp),%ecx 10ae99: 8b 11 mov (%ecx),%edx 10ae9b: 89 50 20 mov %edx,0x20(%eax) _Thread_queue_Enqueue( &the_cond->Wait_queue, timeout ); 10ae9e: 50 push %eax 10ae9f: 68 84 e3 10 00 push $0x10e384 10aea4: ff 75 10 pushl 0x10(%ebp) 10aea7: 57 push %edi 10aea8: e8 b7 31 00 00 call 10e064 <_Thread_queue_Enqueue_with_handler> _Thread_Enable_dispatch(); 10aead: e8 28 2d 00 00 call 10dbda <_Thread_Enable_dispatch> /* * Switch ourself out because we blocked as a result of the * _Thread_queue_Enqueue. */ status = _Thread_Executing->Wait.return_code; 10aeb2: a1 54 79 12 00 mov 0x127954,%eax 10aeb7: 8b 58 34 mov 0x34(%eax),%ebx if ( status && status != ETIMEDOUT ) 10aeba: 83 c4 10 add $0x10,%esp 10aebd: 83 fb 74 cmp $0x74,%ebx 10aec0: 74 10 je 10aed2 <_POSIX_Condition_variables_Wait_support+0xd2> 10aec2: 85 db test %ebx,%ebx 10aec4: 74 0c je 10aed2 <_POSIX_Condition_variables_Wait_support+0xd2><== ALWAYS TAKEN 10aec6: eb 1f jmp 10aee7 <_POSIX_Condition_variables_Wait_support+0xe7><== NOT EXECUTED return status; } else { _Thread_Enable_dispatch(); 10aec8: e8 0d 2d 00 00 call 10dbda <_Thread_Enable_dispatch> status = ETIMEDOUT; 10aecd: bb 74 00 00 00 mov $0x74,%ebx /* * When we get here the dispatch disable level is 0. */ mutex_status = pthread_mutex_lock( mutex ); 10aed2: 83 ec 0c sub $0xc,%esp 10aed5: 56 push %esi 10aed6: e8 39 02 00 00 call 10b114 if ( mutex_status ) 10aedb: 83 c4 10 add $0x10,%esp 10aede: 85 c0 test %eax,%eax 10aee0: 74 05 je 10aee7 <_POSIX_Condition_variables_Wait_support+0xe7> return EINVAL; 10aee2: bb 16 00 00 00 mov $0x16,%ebx case OBJECTS_ERROR: break; } return EINVAL; } 10aee7: 89 d8 mov %ebx,%eax 10aee9: 8d 65 f4 lea -0xc(%ebp),%esp 10aeec: 5b pop %ebx 10aeed: 5e pop %esi 10aeee: 5f pop %edi 10aeef: c9 leave 10aef0: c3 ret =============================================================================== 0010e31c <_POSIX_Message_queue_Receive_support>: size_t msg_len, unsigned int *msg_prio, bool wait, Watchdog_Interval timeout ) { 10e31c: 55 push %ebp 10e31d: 89 e5 mov %esp,%ebp 10e31f: 57 push %edi 10e320: 56 push %esi 10e321: 53 push %ebx 10e322: 83 ec 30 sub $0x30,%esp 10e325: 8b 75 08 mov 0x8(%ebp),%esi 10e328: 8b 5d 14 mov 0x14(%ebp),%ebx 10e32b: 8a 55 18 mov 0x18(%ebp),%dl 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 ); 10e32e: 8d 45 e4 lea -0x1c(%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( 10e331: 50 push %eax 10e332: 56 push %esi 10e333: 68 fc cb 12 00 push $0x12cbfc 10e338: 88 55 d4 mov %dl,-0x2c(%ebp) 10e33b: e8 d4 2a 00 00 call 110e14 <_Objects_Get> switch ( location ) { 10e340: 83 c4 10 add $0x10,%esp 10e343: 83 7d e4 00 cmpl $0x0,-0x1c(%ebp) 10e347: 8a 55 d4 mov -0x2c(%ebp),%dl 10e34a: 0f 85 aa 00 00 00 jne 10e3fa <_POSIX_Message_queue_Receive_support+0xde> case OBJECTS_LOCAL: if ( (the_mq_fd->oflag & O_ACCMODE) == O_WRONLY ) { 10e350: 8b 78 14 mov 0x14(%eax),%edi 10e353: 89 f9 mov %edi,%ecx 10e355: 83 e1 03 and $0x3,%ecx 10e358: 49 dec %ecx 10e359: 75 0a jne 10e365 <_POSIX_Message_queue_Receive_support+0x49> _Thread_Enable_dispatch(); 10e35b: e8 02 33 00 00 call 111662 <_Thread_Enable_dispatch> 10e360: e9 95 00 00 00 jmp 10e3fa <_POSIX_Message_queue_Receive_support+0xde> rtems_set_errno_and_return_minus_one( EBADF ); } the_mq = the_mq_fd->Queue; 10e365: 8b 40 10 mov 0x10(%eax),%eax if ( msg_len < the_mq->Message_queue.maximum_message_size ) { 10e368: 8b 48 68 mov 0x68(%eax),%ecx 10e36b: 39 4d 10 cmp %ecx,0x10(%ebp) 10e36e: 73 15 jae 10e385 <_POSIX_Message_queue_Receive_support+0x69> _Thread_Enable_dispatch(); 10e370: e8 ed 32 00 00 call 111662 <_Thread_Enable_dispatch> rtems_set_errno_and_return_minus_one( EMSGSIZE ); 10e375: e8 d2 8a 00 00 call 116e4c <__errno> 10e37a: c7 00 7a 00 00 00 movl $0x7a,(%eax) 10e380: e9 80 00 00 00 jmp 10e405 <_POSIX_Message_queue_Receive_support+0xe9> /* * Now if something goes wrong, we return a "length" of -1 * to indicate an error. */ length_out = -1; 10e385: c7 45 e0 ff ff ff ff movl $0xffffffff,-0x20(%ebp) /* * A timed receive with a bad time will do a poll regardless. */ if ( wait ) 10e38c: 31 c9 xor %ecx,%ecx 10e38e: 84 d2 test %dl,%dl 10e390: 74 09 je 10e39b <_POSIX_Message_queue_Receive_support+0x7f><== NEVER TAKEN do_wait = (the_mq_fd->oflag & O_NONBLOCK) ? false : true; 10e392: 81 e7 00 40 00 00 and $0x4000,%edi 10e398: 0f 94 c1 sete %cl do_wait = wait; /* * Now perform the actual message receive */ _CORE_message_queue_Seize( 10e39b: 52 push %edx 10e39c: 52 push %edx 10e39d: ff 75 1c pushl 0x1c(%ebp) 10e3a0: 0f b6 c9 movzbl %cl,%ecx 10e3a3: 51 push %ecx 10e3a4: 8d 55 e0 lea -0x20(%ebp),%edx 10e3a7: 52 push %edx 10e3a8: ff 75 0c pushl 0xc(%ebp) 10e3ab: 56 push %esi 10e3ac: 83 c0 1c add $0x1c,%eax 10e3af: 50 push %eax 10e3b0: e8 4f 1c 00 00 call 110004 <_CORE_message_queue_Seize> &length_out, do_wait, timeout ); _Thread_Enable_dispatch(); 10e3b5: 83 c4 20 add $0x20,%esp 10e3b8: e8 a5 32 00 00 call 111662 <_Thread_Enable_dispatch> *msg_prio = _POSIX_Message_queue_Priority_from_core(_Thread_Executing->Wait.count); 10e3bd: a1 74 cc 12 00 mov 0x12cc74,%eax RTEMS_INLINE_ROUTINE unsigned int _POSIX_Message_queue_Priority_from_core( CORE_message_queue_Submit_types priority ) { /* absolute value without a library dependency */ return ((priority >= 0) ? priority : -priority); 10e3c2: 8b 50 24 mov 0x24(%eax),%edx 10e3c5: c1 fa 1f sar $0x1f,%edx 10e3c8: 8b 48 24 mov 0x24(%eax),%ecx 10e3cb: 31 d1 xor %edx,%ecx 10e3cd: 89 0b mov %ecx,(%ebx) 10e3cf: 29 13 sub %edx,(%ebx) if ( !_Thread_Executing->Wait.return_code ) 10e3d1: 83 78 34 00 cmpl $0x0,0x34(%eax) 10e3d5: 75 05 jne 10e3dc <_POSIX_Message_queue_Receive_support+0xc0> return length_out; 10e3d7: 8b 45 e0 mov -0x20(%ebp),%eax 10e3da: eb 2c jmp 10e408 <_POSIX_Message_queue_Receive_support+0xec> rtems_set_errno_and_return_minus_one( 10e3dc: e8 6b 8a 00 00 call 116e4c <__errno> 10e3e1: 89 c3 mov %eax,%ebx 10e3e3: 83 ec 0c sub $0xc,%esp 10e3e6: a1 74 cc 12 00 mov 0x12cc74,%eax 10e3eb: ff 70 34 pushl 0x34(%eax) 10e3ee: e8 ed 01 00 00 call 10e5e0 <_POSIX_Message_queue_Translate_core_message_queue_return_code> 10e3f3: 89 03 mov %eax,(%ebx) 10e3f5: 83 c4 10 add $0x10,%esp 10e3f8: eb 0b jmp 10e405 <_POSIX_Message_queue_Receive_support+0xe9> #endif case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( EBADF ); 10e3fa: e8 4d 8a 00 00 call 116e4c <__errno> 10e3ff: c7 00 09 00 00 00 movl $0x9,(%eax) 10e405: 83 c8 ff or $0xffffffff,%eax } 10e408: 8d 65 f4 lea -0xc(%ebp),%esp 10e40b: 5b pop %ebx 10e40c: 5e pop %esi 10e40d: 5f pop %edi 10e40e: c9 leave 10e40f: c3 ret =============================================================================== 0010e85c <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch>: #include void _POSIX_Thread_Evaluate_cancellation_and_enable_dispatch( Thread_Control *the_thread ) { 10e85c: 55 push %ebp 10e85d: 89 e5 mov %esp,%ebp 10e85f: 83 ec 08 sub $0x8,%esp 10e862: 8b 55 08 mov 0x8(%ebp),%edx POSIX_API_Control *thread_support; thread_support = the_thread->API_Extensions[ THREAD_API_POSIX ]; 10e865: 8b 82 f8 00 00 00 mov 0xf8(%edx),%eax if ( thread_support->cancelability_state == PTHREAD_CANCEL_ENABLE && 10e86b: 83 b8 d4 00 00 00 00 cmpl $0x0,0xd4(%eax) 10e872: 75 2c jne 10e8a0 <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch+0x44><== NEVER TAKEN 10e874: 83 b8 d8 00 00 00 01 cmpl $0x1,0xd8(%eax) 10e87b: 75 23 jne 10e8a0 <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch+0x44> thread_support->cancelability_type == PTHREAD_CANCEL_ASYNCHRONOUS && 10e87d: 83 b8 dc 00 00 00 00 cmpl $0x0,0xdc(%eax) 10e884: 74 1a je 10e8a0 <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch+0x44> */ RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void ) { RTEMS_COMPILER_MEMORY_BARRIER(); _Thread_Dispatch_disable_level -= 1; 10e886: a1 d4 51 12 00 mov 0x1251d4,%eax 10e88b: 48 dec %eax 10e88c: a3 d4 51 12 00 mov %eax,0x1251d4 thread_support->cancelation_requested ) { _Thread_Unnest_dispatch(); _POSIX_Thread_Exit( the_thread, PTHREAD_CANCELED ); 10e891: 50 push %eax 10e892: 50 push %eax 10e893: 6a ff push $0xffffffff 10e895: 52 push %edx 10e896: e8 4d 08 00 00 call 10f0e8 <_POSIX_Thread_Exit> 10e89b: 83 c4 10 add $0x10,%esp } else _Thread_Enable_dispatch(); } 10e89e: c9 leave 10e89f: c3 ret 10e8a0: 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(); 10e8a1: e9 38 da ff ff jmp 10c2de <_Thread_Enable_dispatch> =============================================================================== 0010fb18 <_POSIX_Thread_Translate_sched_param>: int policy, struct sched_param *param, Thread_CPU_budget_algorithms *budget_algorithm, Thread_CPU_budget_algorithm_callout *budget_callout ) { 10fb18: 55 push %ebp 10fb19: 89 e5 mov %esp,%ebp 10fb1b: 57 push %edi 10fb1c: 56 push %esi 10fb1d: 53 push %ebx 10fb1e: 83 ec 28 sub $0x28,%esp 10fb21: 8b 55 08 mov 0x8(%ebp),%edx 10fb24: 8b 5d 0c mov 0xc(%ebp),%ebx 10fb27: 8b 7d 10 mov 0x10(%ebp),%edi if ( !_POSIX_Priority_Is_valid( param->sched_priority ) ) 10fb2a: ff 33 pushl (%ebx) 10fb2c: 89 55 e0 mov %edx,-0x20(%ebp) 10fb2f: e8 c4 ff ff ff call 10faf8 <_POSIX_Priority_Is_valid> 10fb34: 83 c4 10 add $0x10,%esp return EINVAL; 10fb37: be 16 00 00 00 mov $0x16,%esi struct sched_param *param, Thread_CPU_budget_algorithms *budget_algorithm, Thread_CPU_budget_algorithm_callout *budget_callout ) { if ( !_POSIX_Priority_Is_valid( param->sched_priority ) ) 10fb3c: 84 c0 test %al,%al 10fb3e: 8b 55 e0 mov -0x20(%ebp),%edx 10fb41: 0f 84 a4 00 00 00 je 10fbeb <_POSIX_Thread_Translate_sched_param+0xd3><== NEVER TAKEN return EINVAL; *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE; 10fb47: c7 07 00 00 00 00 movl $0x0,(%edi) *budget_callout = NULL; 10fb4d: 8b 45 14 mov 0x14(%ebp),%eax 10fb50: c7 00 00 00 00 00 movl $0x0,(%eax) if ( policy == SCHED_OTHER ) { 10fb56: 85 d2 test %edx,%edx 10fb58: 75 0b jne 10fb65 <_POSIX_Thread_Translate_sched_param+0x4d> *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE; 10fb5a: c7 07 01 00 00 00 movl $0x1,(%edi) 10fb60: e9 83 00 00 00 jmp 10fbe8 <_POSIX_Thread_Translate_sched_param+0xd0> return 0; } if ( policy == SCHED_FIFO ) { *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE; return 0; 10fb65: 31 f6 xor %esi,%esi if ( policy == SCHED_OTHER ) { *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE; return 0; } if ( policy == SCHED_FIFO ) { 10fb67: 83 fa 01 cmp $0x1,%edx 10fb6a: 74 7f je 10fbeb <_POSIX_Thread_Translate_sched_param+0xd3> *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE; return 0; } if ( policy == SCHED_RR ) { 10fb6c: 83 fa 02 cmp $0x2,%edx 10fb6f: 75 08 jne 10fb79 <_POSIX_Thread_Translate_sched_param+0x61> *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_EXHAUST_TIMESLICE; 10fb71: c7 07 02 00 00 00 movl $0x2,(%edi) return 0; 10fb77: eb 72 jmp 10fbeb <_POSIX_Thread_Translate_sched_param+0xd3> *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_CALLOUT; *budget_callout = _POSIX_Threads_Sporadic_budget_callout; return 0; } return EINVAL; 10fb79: be 16 00 00 00 mov $0x16,%esi if ( policy == SCHED_RR ) { *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_EXHAUST_TIMESLICE; return 0; } if ( policy == SCHED_SPORADIC ) { 10fb7e: 83 fa 04 cmp $0x4,%edx 10fb81: 75 68 jne 10fbeb <_POSIX_Thread_Translate_sched_param+0xd3> if ( (param->sched_ss_repl_period.tv_sec == 0) && 10fb83: 83 7b 08 00 cmpl $0x0,0x8(%ebx) 10fb87: 75 06 jne 10fb8f <_POSIX_Thread_Translate_sched_param+0x77> 10fb89: 83 7b 0c 00 cmpl $0x0,0xc(%ebx) 10fb8d: 74 5c je 10fbeb <_POSIX_Thread_Translate_sched_param+0xd3> (param->sched_ss_repl_period.tv_nsec == 0) ) return EINVAL; if ( (param->sched_ss_init_budget.tv_sec == 0) && 10fb8f: 83 7b 10 00 cmpl $0x0,0x10(%ebx) 10fb93: 75 0b jne 10fba0 <_POSIX_Thread_Translate_sched_param+0x88> (param->sched_ss_init_budget.tv_nsec == 0) ) return EINVAL; 10fb95: be 16 00 00 00 mov $0x16,%esi if ( policy == SCHED_SPORADIC ) { if ( (param->sched_ss_repl_period.tv_sec == 0) && (param->sched_ss_repl_period.tv_nsec == 0) ) return EINVAL; if ( (param->sched_ss_init_budget.tv_sec == 0) && 10fb9a: 83 7b 14 00 cmpl $0x0,0x14(%ebx) 10fb9e: 74 4b je 10fbeb <_POSIX_Thread_Translate_sched_param+0xd3> (param->sched_ss_init_budget.tv_nsec == 0) ) return EINVAL; if ( _Timespec_To_ticks( ¶m->sched_ss_repl_period ) < 10fba0: 83 ec 0c sub $0xc,%esp 10fba3: 8d 43 08 lea 0x8(%ebx),%eax 10fba6: 50 push %eax 10fba7: e8 58 de ff ff call 10da04 <_Timespec_To_ticks> 10fbac: 89 45 e4 mov %eax,-0x1c(%ebp) _Timespec_To_ticks( ¶m->sched_ss_init_budget ) ) 10fbaf: 8d 43 10 lea 0x10(%ebx),%eax 10fbb2: 89 04 24 mov %eax,(%esp) 10fbb5: e8 4a de ff ff call 10da04 <_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 ) < 10fbba: 83 c4 10 add $0x10,%esp _Timespec_To_ticks( ¶m->sched_ss_init_budget ) ) return EINVAL; 10fbbd: be 16 00 00 00 mov $0x16,%esi 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 ) < 10fbc2: 39 45 e4 cmp %eax,-0x1c(%ebp) 10fbc5: 72 24 jb 10fbeb <_POSIX_Thread_Translate_sched_param+0xd3> _Timespec_To_ticks( ¶m->sched_ss_init_budget ) ) return EINVAL; if ( !_POSIX_Priority_Is_valid( param->sched_ss_low_priority ) ) 10fbc7: 83 ec 0c sub $0xc,%esp 10fbca: ff 73 04 pushl 0x4(%ebx) 10fbcd: e8 26 ff ff ff call 10faf8 <_POSIX_Priority_Is_valid> 10fbd2: 83 c4 10 add $0x10,%esp 10fbd5: 84 c0 test %al,%al 10fbd7: 74 12 je 10fbeb <_POSIX_Thread_Translate_sched_param+0xd3> return EINVAL; *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_CALLOUT; 10fbd9: c7 07 03 00 00 00 movl $0x3,(%edi) *budget_callout = _POSIX_Threads_Sporadic_budget_callout; 10fbdf: 8b 45 14 mov 0x14(%ebp),%eax 10fbe2: c7 00 41 a8 10 00 movl $0x10a841,(%eax) return 0; 10fbe8: 66 31 f6 xor %si,%si } return EINVAL; } 10fbeb: 89 f0 mov %esi,%eax 10fbed: 8d 65 f4 lea -0xc(%ebp),%esp 10fbf0: 5b pop %ebx 10fbf1: 5e pop %esi 10fbf2: 5f pop %edi 10fbf3: c9 leave 10fbf4: c3 ret =============================================================================== 0010a544 <_POSIX_Threads_Initialize_user_threads_body>: * * Output parameters: NONE */ void _POSIX_Threads_Initialize_user_threads_body(void) { 10a544: 55 push %ebp 10a545: 89 e5 mov %esp,%ebp 10a547: 57 push %edi 10a548: 56 push %esi 10a549: 53 push %ebx 10a54a: 83 ec 5c sub $0x5c,%esp uint32_t maximum; posix_initialization_threads_table *user_threads; pthread_t thread_id; pthread_attr_t attr; user_threads = Configuration_POSIX_API.User_initialization_threads_table; 10a54d: 8b 3d 10 12 12 00 mov 0x121210,%edi maximum = Configuration_POSIX_API.number_of_initialization_threads; 10a553: 8b 15 0c 12 12 00 mov 0x12120c,%edx if ( !user_threads || maximum == 0 ) 10a559: 85 d2 test %edx,%edx 10a55b: 74 54 je 10a5b1 <_POSIX_Threads_Initialize_user_threads_body+0x6d><== NEVER TAKEN 10a55d: 85 ff test %edi,%edi 10a55f: 74 50 je 10a5b1 <_POSIX_Threads_Initialize_user_threads_body+0x6d><== NEVER TAKEN 10a561: 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 ); 10a563: 8d 75 a8 lea -0x58(%ebp),%esi 10a566: 83 ec 0c sub $0xc,%esp 10a569: 56 push %esi 10a56a: 89 55 a4 mov %edx,-0x5c(%ebp) 10a56d: e8 86 56 00 00 call 10fbf8 (void) pthread_attr_setinheritsched( &attr, PTHREAD_EXPLICIT_SCHED ); 10a572: 5a pop %edx 10a573: 59 pop %ecx 10a574: 6a 02 push $0x2 10a576: 56 push %esi 10a577: e8 a4 56 00 00 call 10fc20 (void) pthread_attr_setstacksize(&attr, user_threads[ index ].stack_size); 10a57c: 59 pop %ecx 10a57d: 58 pop %eax 10a57e: ff 74 df 04 pushl 0x4(%edi,%ebx,8) 10a582: 56 push %esi 10a583: e8 c4 56 00 00 call 10fc4c status = pthread_create( 10a588: 6a 00 push $0x0 10a58a: ff 34 df pushl (%edi,%ebx,8) 10a58d: 56 push %esi 10a58e: 8d 45 e4 lea -0x1c(%ebp),%eax 10a591: 50 push %eax 10a592: e8 e5 fc ff ff call 10a27c &thread_id, &attr, user_threads[ index ].thread_entry, NULL ); if ( status ) 10a597: 83 c4 20 add $0x20,%esp 10a59a: 85 c0 test %eax,%eax 10a59c: 8b 55 a4 mov -0x5c(%ebp),%edx 10a59f: 74 0b je 10a5ac <_POSIX_Threads_Initialize_user_threads_body+0x68> _Internal_error_Occurred( INTERNAL_ERROR_POSIX_API, true, status ); 10a5a1: 52 push %edx 10a5a2: 50 push %eax 10a5a3: 6a 01 push $0x1 10a5a5: 6a 02 push $0x2 10a5a7: e8 fc 1b 00 00 call 10c1a8 <_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++ ) { 10a5ac: 43 inc %ebx 10a5ad: 39 d3 cmp %edx,%ebx 10a5af: 72 b5 jb 10a566 <_POSIX_Threads_Initialize_user_threads_body+0x22><== NEVER TAKEN NULL ); if ( status ) _Internal_error_Occurred( INTERNAL_ERROR_POSIX_API, true, status ); } } 10a5b1: 8d 65 f4 lea -0xc(%ebp),%esp 10a5b4: 5b pop %ebx 10a5b5: 5e pop %esi 10a5b6: 5f pop %edi 10a5b7: c9 leave 10a5b8: c3 ret =============================================================================== 0010ec4b <_POSIX_Threads_Sporadic_budget_TSR>: */ void _POSIX_Threads_Sporadic_budget_TSR( Objects_Id id __attribute__((unused)), void *argument ) { 10ec4b: 55 push %ebp 10ec4c: 89 e5 mov %esp,%ebp 10ec4e: 56 push %esi 10ec4f: 53 push %ebx 10ec50: 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 ]; 10ec53: 8b b3 f8 00 00 00 mov 0xf8(%ebx),%esi /* ticks is guaranteed to be at least one */ ticks = _Timespec_To_ticks( &api->schedparam.sched_ss_init_budget ); 10ec59: 83 ec 0c sub $0xc,%esp 10ec5c: 8d 86 94 00 00 00 lea 0x94(%esi),%eax 10ec62: 50 push %eax 10ec63: e8 58 0e 00 00 call 10fac0 <_Timespec_To_ticks> the_thread->cpu_time_budget = ticks; 10ec68: 89 43 78 mov %eax,0x78(%ebx) RTEMS_INLINE_ROUTINE Priority_Control _POSIX_Priority_To_core( int priority ) { return (Priority_Control) (POSIX_SCHEDULER_MAXIMUM_PRIORITY - priority + 1); 10ec6b: 0f b6 05 f4 01 12 00 movzbl 0x1201f4,%eax 10ec72: 2b 86 84 00 00 00 sub 0x84(%esi),%eax new_priority = _POSIX_Priority_To_core( api->schedparam.sched_priority ); the_thread->real_priority = new_priority; 10ec78: 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 ) { 10ec7b: 83 c4 10 add $0x10,%esp 10ec7e: 83 7b 1c 00 cmpl $0x0,0x1c(%ebx) 10ec82: 75 12 jne 10ec96 <_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 ) { 10ec84: 39 43 14 cmp %eax,0x14(%ebx) 10ec87: 76 0d jbe 10ec96 <_POSIX_Threads_Sporadic_budget_TSR+0x4b> _Thread_Change_priority( the_thread, new_priority, true ); 10ec89: 52 push %edx 10ec8a: 6a 01 push $0x1 10ec8c: 50 push %eax 10ec8d: 53 push %ebx 10ec8e: e8 11 ce ff ff call 10baa4 <_Thread_Change_priority> 10ec93: 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 ); 10ec96: 83 ec 0c sub $0xc,%esp 10ec99: 8d 86 8c 00 00 00 lea 0x8c(%esi),%eax 10ec9f: 50 push %eax 10eca0: e8 1b 0e 00 00 call 10fac0 <_Timespec_To_ticks> Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 10eca5: 89 86 b0 00 00 00 mov %eax,0xb0(%esi) _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 10ecab: 83 c4 10 add $0x10,%esp _Watchdog_Insert_ticks( &api->Sporadic_timer, ticks ); 10ecae: 81 c6 a4 00 00 00 add $0xa4,%esi 10ecb4: 89 75 0c mov %esi,0xc(%ebp) 10ecb7: c7 45 08 ac 42 12 00 movl $0x1242ac,0x8(%ebp) } 10ecbe: 8d 65 f8 lea -0x8(%ebp),%esp 10ecc1: 5b pop %ebx 10ecc2: 5e pop %esi 10ecc3: c9 leave 10ecc4: e9 43 e0 ff ff jmp 10cd0c <_Watchdog_Insert> =============================================================================== 0010ecc9 <_POSIX_Threads_Sporadic_budget_callout>: * _POSIX_Threads_Sporadic_budget_callout */ void _POSIX_Threads_Sporadic_budget_callout( Thread_Control *the_thread ) { 10ecc9: 55 push %ebp 10ecca: 89 e5 mov %esp,%ebp 10eccc: 83 ec 08 sub $0x8,%esp 10eccf: 8b 45 08 mov 0x8(%ebp),%eax POSIX_API_Control *api; uint32_t new_priority; api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 10ecd2: 8b 88 f8 00 00 00 mov 0xf8(%eax),%ecx /* * This will prevent the thread from consuming its entire "budget" * while at low priority. */ the_thread->cpu_time_budget = 0xFFFFFFFF; /* XXX should be based on MAX_U32 */ 10ecd8: c7 40 78 ff ff ff ff movl $0xffffffff,0x78(%eax) 10ecdf: 0f b6 15 f4 01 12 00 movzbl 0x1201f4,%edx 10ece6: 2b 91 88 00 00 00 sub 0x88(%ecx),%edx new_priority = _POSIX_Priority_To_core(api->schedparam.sched_ss_low_priority); the_thread->real_priority = new_priority; 10ecec: 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 ) { 10ecef: 83 78 1c 00 cmpl $0x0,0x1c(%eax) 10ecf3: 75 12 jne 10ed07 <_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 ) { 10ecf5: 39 50 14 cmp %edx,0x14(%eax) 10ecf8: 73 0d jae 10ed07 <_POSIX_Threads_Sporadic_budget_callout+0x3e><== NEVER TAKEN _Thread_Change_priority( the_thread, new_priority, true ); 10ecfa: 51 push %ecx 10ecfb: 6a 01 push $0x1 10ecfd: 52 push %edx 10ecfe: 50 push %eax 10ecff: e8 a0 cd ff ff call 10baa4 <_Thread_Change_priority> 10ed04: 83 c4 10 add $0x10,%esp #if 0 printk( "lower priority\n" ); #endif } } } 10ed07: c9 leave 10ed08: c3 ret =============================================================================== 0010a314 <_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) { 10a314: 55 push %ebp 10a315: 89 e5 mov %esp,%ebp 10a317: 53 push %ebx 10a318: 83 ec 04 sub $0x4,%esp 10a31b: 8b 5d 0c mov 0xc(%ebp),%ebx bool activated; ptimer = (POSIX_Timer_Control *)data; /* Increment the number of expirations. */ ptimer->overrun = ptimer->overrun + 1; 10a31e: ff 43 68 incl 0x68(%ebx) /* The timer must be reprogrammed */ if ( ( ptimer->timer_data.it_interval.tv_sec != 0 ) || 10a321: 83 7b 54 00 cmpl $0x0,0x54(%ebx) 10a325: 75 06 jne 10a32d <_POSIX_Timer_TSR+0x19> 10a327: 83 7b 58 00 cmpl $0x0,0x58(%ebx) 10a32b: 74 34 je 10a361 <_POSIX_Timer_TSR+0x4d> <== NEVER TAKEN ( ptimer->timer_data.it_interval.tv_nsec != 0 ) ) { activated = _POSIX_Timer_Insert_helper( 10a32d: 83 ec 0c sub $0xc,%esp 10a330: 53 push %ebx 10a331: 68 14 a3 10 00 push $0x10a314 10a336: ff 73 08 pushl 0x8(%ebx) 10a339: ff 73 64 pushl 0x64(%ebx) 10a33c: 8d 43 10 lea 0x10(%ebx),%eax 10a33f: 50 push %eax 10a340: e8 57 55 00 00 call 10f89c <_POSIX_Timer_Insert_helper> ptimer->ticks, ptimer->Object.id, _POSIX_Timer_TSR, ptimer ); if ( !activated ) 10a345: 83 c4 20 add $0x20,%esp 10a348: 84 c0 test %al,%al 10a34a: 74 30 je 10a37c <_POSIX_Timer_TSR+0x68> <== NEVER TAKEN return; /* Store the time when the timer was started again */ _TOD_Get( &ptimer->time ); 10a34c: 83 ec 0c sub $0xc,%esp 10a34f: 8d 43 6c lea 0x6c(%ebx),%eax 10a352: 50 push %eax 10a353: e8 44 14 00 00 call 10b79c <_TOD_Get> /* The state really did not change but just to be safe */ ptimer->state = POSIX_TIMER_STATE_CREATE_RUN; 10a358: c6 43 3c 03 movb $0x3,0x3c(%ebx) 10a35c: 83 c4 10 add $0x10,%esp 10a35f: eb 04 jmp 10a365 <_POSIX_Timer_TSR+0x51> } else { /* Indicates that the timer is stopped */ ptimer->state = POSIX_TIMER_STATE_CREATE_STOP; 10a361: 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 ) ) { 10a365: 50 push %eax 10a366: 50 push %eax 10a367: ff 73 44 pushl 0x44(%ebx) 10a36a: ff 73 38 pushl 0x38(%ebx) 10a36d: e8 fe 50 00 00 call 10f470 } /* After the signal handler returns, the count of expirations of the * timer must be set to 0. */ ptimer->overrun = 0; 10a372: c7 43 68 00 00 00 00 movl $0x0,0x68(%ebx) 10a379: 83 c4 10 add $0x10,%esp } 10a37c: 8b 5d fc mov -0x4(%ebp),%ebx 10a37f: c9 leave 10a380: c3 ret =============================================================================== 00110b94 <_POSIX_signals_Check_signal>: bool _POSIX_signals_Check_signal( POSIX_API_Control *api, int signo, bool is_global ) { 110b94: 55 push %ebp 110b95: 89 e5 mov %esp,%ebp 110b97: 57 push %edi 110b98: 56 push %esi 110b99: 53 push %ebx 110b9a: 83 ec 38 sub $0x38,%esp 110b9d: 8b 5d 08 mov 0x8(%ebp),%ebx 110ba0: 8b 75 0c mov 0xc(%ebp),%esi siginfo_t siginfo_struct; sigset_t saved_signals_blocked; if ( ! _POSIX_signals_Clear_signals( api, signo, &siginfo_struct, 110ba3: 6a 01 push $0x1 110ba5: 0f b6 45 10 movzbl 0x10(%ebp),%eax 110ba9: 50 push %eax 110baa: 8d 7d dc lea -0x24(%ebp),%edi 110bad: 57 push %edi 110bae: 56 push %esi 110baf: 53 push %ebx 110bb0: e8 5b 00 00 00 call 110c10 <_POSIX_signals_Clear_signals> 110bb5: 88 c2 mov %al,%dl 110bb7: 83 c4 20 add $0x20,%esp is_global, true ) ) return false; 110bba: 31 c0 xor %eax,%eax ) { siginfo_t siginfo_struct; sigset_t saved_signals_blocked; if ( ! _POSIX_signals_Clear_signals( api, signo, &siginfo_struct, 110bbc: 84 d2 test %dl,%dl 110bbe: 74 46 je 110c06 <_POSIX_signals_Check_signal+0x72> #endif /* * Just to prevent sending a signal which is currently being ignored. */ if ( _POSIX_signals_Vectors[ signo ].sa_handler == SIG_IGN ) 110bc0: 6b ce 0c imul $0xc,%esi,%ecx 110bc3: 8b 91 4c 47 12 00 mov 0x12474c(%ecx),%edx 110bc9: 83 fa 01 cmp $0x1,%edx 110bcc: 74 38 je 110c06 <_POSIX_signals_Check_signal+0x72><== NEVER TAKEN return false; /* * Block the signals requested in sa_mask */ saved_signals_blocked = api->signals_blocked; 110bce: 8b 83 cc 00 00 00 mov 0xcc(%ebx),%eax 110bd4: 89 45 d4 mov %eax,-0x2c(%ebp) api->signals_blocked |= _POSIX_signals_Vectors[ signo ].sa_mask; 110bd7: 0b 81 48 47 12 00 or 0x124748(%ecx),%eax 110bdd: 89 83 cc 00 00 00 mov %eax,0xcc(%ebx) /* * Here, the signal handler function executes */ switch ( _POSIX_signals_Vectors[ signo ].sa_flags ) { 110be3: 83 b9 44 47 12 00 02 cmpl $0x2,0x124744(%ecx) 110bea: 75 06 jne 110bf2 <_POSIX_signals_Check_signal+0x5e> case SA_SIGINFO: (*_POSIX_signals_Vectors[ signo ].sa_sigaction)( 110bec: 50 push %eax 110bed: 6a 00 push $0x0 110bef: 57 push %edi 110bf0: eb 03 jmp 110bf5 <_POSIX_signals_Check_signal+0x61> &siginfo_struct, NULL /* context is undefined per 1003.1b-1993, p. 66 */ ); break; default: (*_POSIX_signals_Vectors[ signo ].sa_handler)( signo ); 110bf2: 83 ec 0c sub $0xc,%esp 110bf5: 56 push %esi 110bf6: ff d2 call *%edx break; 110bf8: 83 c4 10 add $0x10,%esp } /* * Restore the previous set of blocked signals */ api->signals_blocked = saved_signals_blocked; 110bfb: 8b 45 d4 mov -0x2c(%ebp),%eax 110bfe: 89 83 cc 00 00 00 mov %eax,0xcc(%ebx) return true; 110c04: b0 01 mov $0x1,%al } 110c06: 8d 65 f4 lea -0xc(%ebp),%esp 110c09: 5b pop %ebx 110c0a: 5e pop %esi 110c0b: 5f pop %edi 110c0c: c9 leave 110c0d: c3 ret =============================================================================== 00111104 <_POSIX_signals_Clear_process_signals>: */ void _POSIX_signals_Clear_process_signals( int signo ) { 111104: 55 push %ebp 111105: 89 e5 mov %esp,%ebp 111107: 53 push %ebx 111108: 8b 4d 08 mov 0x8(%ebp),%ecx clear_signal = true; mask = signo_to_mask( signo ); ISR_Level level; _ISR_Disable( level ); 11110b: 9c pushf 11110c: fa cli 11110d: 5a pop %edx if ( _POSIX_signals_Vectors[ signo ].sa_flags == SA_SIGINFO ) { 11110e: 6b c1 0c imul $0xc,%ecx,%eax 111111: 83 b8 44 47 12 00 02 cmpl $0x2,0x124744(%eax) 111118: 75 0e jne 111128 <_POSIX_signals_Clear_process_signals+0x24> */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 11111a: 8d 98 40 49 12 00 lea 0x124940(%eax),%ebx if ( !_Chain_Is_empty( &_POSIX_signals_Siginfo[ signo ] ) ) 111120: 39 98 3c 49 12 00 cmp %ebx,0x12493c(%eax) 111126: 75 0e jne 111136 <_POSIX_signals_Clear_process_signals+0x32><== NEVER TAKEN 111128: 49 dec %ecx 111129: b8 fe ff ff ff mov $0xfffffffe,%eax clear_signal = false; } if ( clear_signal ) { _POSIX_signals_Pending &= ~mask; 11112e: d3 c0 rol %cl,%eax 111130: 21 05 38 49 12 00 and %eax,0x124938 } _ISR_Enable( level ); 111136: 52 push %edx 111137: 9d popf } 111138: 5b pop %ebx 111139: c9 leave 11113a: c3 ret =============================================================================== 0010abb8 <_POSIX_signals_Get_highest>: #include int _POSIX_signals_Get_highest( sigset_t set ) { 10abb8: 55 push %ebp 10abb9: 89 e5 mov %esp,%ebp 10abbb: 56 push %esi 10abbc: 53 push %ebx 10abbd: 8b 55 08 mov 0x8(%ebp),%edx int signo; for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) { 10abc0: b8 1b 00 00 00 mov $0x1b,%eax 10abc5: bb 01 00 00 00 mov $0x1,%ebx #include #include #include #include int _POSIX_signals_Get_highest( 10abca: 8d 48 ff lea -0x1(%eax),%ecx 10abcd: 89 de mov %ebx,%esi 10abcf: d3 e6 shl %cl,%esi ) { int signo; for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) { if ( set & signo_to_mask( signo ) ) { 10abd1: 85 d6 test %edx,%esi 10abd3: 75 1e jne 10abf3 <_POSIX_signals_Get_highest+0x3b><== NEVER TAKEN sigset_t set ) { int signo; for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) { 10abd5: 40 inc %eax 10abd6: 83 f8 20 cmp $0x20,%eax 10abd9: 75 ef jne 10abca <_POSIX_signals_Get_highest+0x12> 10abdb: b0 01 mov $0x1,%al 10abdd: bb 01 00 00 00 mov $0x1,%ebx #include #include #include #include int _POSIX_signals_Get_highest( 10abe2: 8d 48 ff lea -0x1(%eax),%ecx 10abe5: 89 de mov %ebx,%esi 10abe7: 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 ) ) { 10abe9: 85 d6 test %edx,%esi 10abeb: 75 06 jne 10abf3 <_POSIX_signals_Get_highest+0x3b> */ #if (SIGHUP != 1) #error "Assumption that SIGHUP==1 violated!!" #endif for ( signo = SIGHUP ; signo <= __SIGLASTNOTRT ; signo++ ) { 10abed: 40 inc %eax 10abee: 83 f8 1b cmp $0x1b,%eax 10abf1: 75 ef jne 10abe2 <_POSIX_signals_Get_highest+0x2a><== ALWAYS TAKEN * a return 0. This routine will NOT be called unless a signal * is pending in the set passed in. */ found_it: return signo; } 10abf3: 5b pop %ebx 10abf4: 5e pop %esi 10abf5: c9 leave 10abf6: c3 ret =============================================================================== 00121b18 <_POSIX_signals_Unblock_thread>: bool _POSIX_signals_Unblock_thread( Thread_Control *the_thread, int signo, siginfo_t *info ) { 121b18: 55 push %ebp 121b19: 89 e5 mov %esp,%ebp 121b1b: 57 push %edi 121b1c: 56 push %esi 121b1d: 53 push %ebx 121b1e: 83 ec 0c sub $0xc,%esp 121b21: 8b 5d 08 mov 0x8(%ebp),%ebx 121b24: 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 ]; 121b27: 8b 83 f8 00 00 00 mov 0xf8(%ebx),%eax 121b2d: 8d 4e ff lea -0x1(%esi),%ecx 121b30: ba 01 00 00 00 mov $0x1,%edx 121b35: d3 e2 shl %cl,%edx /* * Is the thread is specifically waiting for a signal? */ if ( _States_Is_interruptible_signal( the_thread->current_state ) ) { 121b37: 8b 4b 10 mov 0x10(%ebx),%ecx 121b3a: 89 cf mov %ecx,%edi 121b3c: 81 e7 00 80 00 10 and $0x10008000,%edi 121b42: 81 ff 00 80 00 10 cmp $0x10008000,%edi 121b48: 75 55 jne 121b9f <_POSIX_signals_Unblock_thread+0x87> if ( (the_thread->Wait.option & mask) || (~api->signals_blocked & mask) ) { 121b4a: 85 53 30 test %edx,0x30(%ebx) 121b4d: 75 12 jne 121b61 <_POSIX_signals_Unblock_thread+0x49> 121b4f: 8b 88 cc 00 00 00 mov 0xcc(%eax),%ecx 121b55: f7 d1 not %ecx /* * This should only be reached via pthread_kill(). */ return false; 121b57: 31 c0 xor %eax,%eax * Is the thread is specifically waiting for a signal? */ if ( _States_Is_interruptible_signal( the_thread->current_state ) ) { if ( (the_thread->Wait.option & mask) || (~api->signals_blocked & mask) ) { 121b59: 85 ca test %ecx,%edx 121b5b: 0f 84 a5 00 00 00 je 121c06 <_POSIX_signals_Unblock_thread+0xee> the_thread->Wait.return_code = EINTR; 121b61: c7 43 34 04 00 00 00 movl $0x4,0x34(%ebx) the_info = (siginfo_t *) the_thread->Wait.return_argument; 121b68: 8b 43 28 mov 0x28(%ebx),%eax if ( !info ) { 121b6b: 83 7d 10 00 cmpl $0x0,0x10(%ebp) 121b6f: 75 12 jne 121b83 <_POSIX_signals_Unblock_thread+0x6b> the_info->si_signo = signo; 121b71: 89 30 mov %esi,(%eax) the_info->si_code = SI_USER; 121b73: c7 40 04 01 00 00 00 movl $0x1,0x4(%eax) the_info->si_value.sival_int = 0; 121b7a: c7 40 08 00 00 00 00 movl $0x0,0x8(%eax) 121b81: eb 0c jmp 121b8f <_POSIX_signals_Unblock_thread+0x77> } else { *the_info = *info; 121b83: b9 03 00 00 00 mov $0x3,%ecx 121b88: 89 c7 mov %eax,%edi 121b8a: 8b 75 10 mov 0x10(%ebp),%esi 121b8d: f3 a5 rep movsl %ds:(%esi),%es:(%edi) } _Thread_queue_Extract_with_proxy( the_thread ); 121b8f: 83 ec 0c sub $0xc,%esp 121b92: 53 push %ebx 121b93: e8 cc f1 fe ff call 110d64 <_Thread_queue_Extract_with_proxy> return true; 121b98: 83 c4 10 add $0x10,%esp 121b9b: b0 01 mov $0x1,%al 121b9d: eb 67 jmp 121c06 <_POSIX_signals_Unblock_thread+0xee> } /* * Thread is not waiting due to a sigwait. */ if ( ~api->signals_blocked & mask ) { 121b9f: 8b b0 cc 00 00 00 mov 0xcc(%eax),%esi 121ba5: f7 d6 not %esi } else if ( the_thread->current_state == STATES_READY ) { if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) _Context_Switch_necessary = true; } } return false; 121ba7: 31 c0 xor %eax,%eax } /* * Thread is not waiting due to a sigwait. */ if ( ~api->signals_blocked & mask ) { 121ba9: 85 f2 test %esi,%edx 121bab: 74 59 je 121c06 <_POSIX_signals_Unblock_thread+0xee> * it is not blocked, THEN * we need to dispatch at the end of this ISR. * + Any other combination, do nothing. */ if ( the_thread->current_state & STATES_INTERRUPTIBLE_BY_SIGNAL ) { 121bad: f7 c1 00 00 00 10 test $0x10000000,%ecx 121bb3: 74 35 je 121bea <_POSIX_signals_Unblock_thread+0xd2> the_thread->Wait.return_code = EINTR; 121bb5: c7 43 34 04 00 00 00 movl $0x4,0x34(%ebx) #if 0 if ( _States_Is_waiting_on_thread_queue(the_thread->current_state) ) _Thread_queue_Extract_with_proxy( the_thread ); else #endif if ( _States_Is_delaying(the_thread->current_state) ){ 121bbc: 80 e1 08 and $0x8,%cl 121bbf: 74 45 je 121c06 <_POSIX_signals_Unblock_thread+0xee><== NEVER TAKEN if ( _Watchdog_Is_active( &the_thread->Timer ) ) 121bc1: 83 7b 50 02 cmpl $0x2,0x50(%ebx) 121bc5: 75 0f jne 121bd6 <_POSIX_signals_Unblock_thread+0xbe><== NEVER TAKEN (void) _Watchdog_Remove( &the_thread->Timer ); 121bc7: 83 ec 0c sub $0xc,%esp 121bca: 8d 43 48 lea 0x48(%ebx),%eax 121bcd: 50 push %eax 121bce: e8 1d fa fe ff call 1115f0 <_Watchdog_Remove> 121bd3: 83 c4 10 add $0x10,%esp RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 121bd6: 50 push %eax 121bd7: 50 push %eax 121bd8: 68 f8 ff 03 10 push $0x1003fff8 121bdd: 53 push %ebx 121bde: e8 ad e7 fe ff call 110390 <_Thread_Clear_state> 121be3: 83 c4 10 add $0x10,%esp } else if ( the_thread->current_state == STATES_READY ) { if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) _Context_Switch_necessary = true; } } return false; 121be6: 31 c0 xor %eax,%eax 121be8: eb 1c jmp 121c06 <_POSIX_signals_Unblock_thread+0xee> if ( _States_Is_delaying(the_thread->current_state) ){ if ( _Watchdog_Is_active( &the_thread->Timer ) ) (void) _Watchdog_Remove( &the_thread->Timer ); _Thread_Unblock( the_thread ); } } else if ( the_thread->current_state == STATES_READY ) { 121bea: 85 c9 test %ecx,%ecx 121bec: 75 18 jne 121c06 <_POSIX_signals_Unblock_thread+0xee><== NEVER TAKEN if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) 121bee: 83 3d a4 a8 12 00 00 cmpl $0x0,0x12a8a4 121bf5: 74 0f je 121c06 <_POSIX_signals_Unblock_thread+0xee> 121bf7: 3b 1d a8 a8 12 00 cmp 0x12a8a8,%ebx 121bfd: 75 07 jne 121c06 <_POSIX_signals_Unblock_thread+0xee><== NEVER TAKEN _Context_Switch_necessary = true; 121bff: c6 05 b4 a8 12 00 01 movb $0x1,0x12a8b4 } } return false; } 121c06: 8d 65 f4 lea -0xc(%ebp),%esp 121c09: 5b pop %ebx 121c0a: 5e pop %esi 121c0b: 5f pop %edi 121c0c: c9 leave 121c0d: c3 ret =============================================================================== 0010f164 <_RTEMS_Tasks_Invoke_task_variable_dtor>: void _RTEMS_Tasks_Invoke_task_variable_dtor( Thread_Control *the_thread, rtems_task_variable_t *tvp ) { 10f164: 55 push %ebp 10f165: 89 e5 mov %esp,%ebp 10f167: 56 push %esi 10f168: 53 push %ebx 10f169: 8b 5d 0c mov 0xc(%ebp),%ebx void (*dtor)(void *); void *value; dtor = tvp->dtor; 10f16c: 8b 43 10 mov 0x10(%ebx),%eax if (_Thread_Is_executing(the_thread)) { 10f16f: 8b 15 34 47 12 00 mov 0x124734,%edx 10f175: 39 55 08 cmp %edx,0x8(%ebp) 10f178: 75 0c jne 10f186 <_RTEMS_Tasks_Invoke_task_variable_dtor+0x22><== NEVER TAKEN value = *tvp->ptr; 10f17a: 8b 4b 04 mov 0x4(%ebx),%ecx 10f17d: 8b 11 mov (%ecx),%edx *tvp->ptr = tvp->gval; 10f17f: 8b 73 08 mov 0x8(%ebx),%esi 10f182: 89 31 mov %esi,(%ecx) 10f184: eb 03 jmp 10f189 <_RTEMS_Tasks_Invoke_task_variable_dtor+0x25> } else { value = tvp->tval; 10f186: 8b 53 0c mov 0xc(%ebx),%edx } if ( dtor ) 10f189: 85 c0 test %eax,%eax 10f18b: 74 09 je 10f196 <_RTEMS_Tasks_Invoke_task_variable_dtor+0x32> (*dtor)(value); 10f18d: 83 ec 0c sub $0xc,%esp 10f190: 52 push %edx 10f191: ff d0 call *%eax 10f193: 83 c4 10 add $0x10,%esp _Workspace_Free(tvp); 10f196: 89 5d 08 mov %ebx,0x8(%ebp) } 10f199: 8d 65 f8 lea -0x8(%ebp),%esp 10f19c: 5b pop %ebx 10f19d: 5e pop %esi 10f19e: c9 leave } if ( dtor ) (*dtor)(value); _Workspace_Free(tvp); 10f19f: e9 b3 dd ff ff jmp 10cf57 <_Workspace_Free> =============================================================================== 0010ef91 <_RTEMS_tasks_Post_switch_extension>: */ void _RTEMS_tasks_Post_switch_extension( Thread_Control *executing ) { 10ef91: 55 push %ebp 10ef92: 89 e5 mov %esp,%ebp 10ef94: 57 push %edi 10ef95: 56 push %esi 10ef96: 53 push %ebx 10ef97: 83 ec 1c sub $0x1c,%esp RTEMS_API_Control *api; ASR_Information *asr; rtems_signal_set signal_set; Modes_Control prev_mode; api = executing->API_Extensions[ THREAD_API_RTEMS ]; 10ef9a: 8b 45 08 mov 0x8(%ebp),%eax 10ef9d: 8b 98 f4 00 00 00 mov 0xf4(%eax),%ebx if ( !api ) 10efa3: 85 db test %ebx,%ebx 10efa5: 74 45 je 10efec <_RTEMS_tasks_Post_switch_extension+0x5b><== NEVER TAKEN * Signal Processing */ asr = &api->Signal; _ISR_Disable( level ); 10efa7: 9c pushf 10efa8: fa cli 10efa9: 58 pop %eax signal_set = asr->signals_posted; 10efaa: 8b 7b 14 mov 0x14(%ebx),%edi asr->signals_posted = 0; 10efad: c7 43 14 00 00 00 00 movl $0x0,0x14(%ebx) _ISR_Enable( level ); 10efb4: 50 push %eax 10efb5: 9d popf if ( !signal_set ) /* similar to _ASR_Are_signals_pending( asr ) */ 10efb6: 85 ff test %edi,%edi 10efb8: 74 32 je 10efec <_RTEMS_tasks_Post_switch_extension+0x5b> return; asr->nest_level += 1; 10efba: ff 43 1c incl 0x1c(%ebx) rtems_task_mode( asr->mode_set, RTEMS_ALL_MODE_MASKS, &prev_mode ); 10efbd: 50 push %eax 10efbe: 8d 75 e4 lea -0x1c(%ebp),%esi 10efc1: 56 push %esi 10efc2: 68 ff ff 00 00 push $0xffff 10efc7: ff 73 10 pushl 0x10(%ebx) 10efca: e8 a9 1d 00 00 call 110d78 (*asr->handler)( signal_set ); 10efcf: 89 3c 24 mov %edi,(%esp) 10efd2: ff 53 0c call *0xc(%ebx) asr->nest_level -= 1; 10efd5: ff 4b 1c decl 0x1c(%ebx) rtems_task_mode( prev_mode, RTEMS_ALL_MODE_MASKS, &prev_mode ); 10efd8: 83 c4 0c add $0xc,%esp 10efdb: 56 push %esi 10efdc: 68 ff ff 00 00 push $0xffff 10efe1: ff 75 e4 pushl -0x1c(%ebp) 10efe4: e8 8f 1d 00 00 call 110d78 10efe9: 83 c4 10 add $0x10,%esp } 10efec: 8d 65 f4 lea -0xc(%ebp),%esp 10efef: 5b pop %ebx 10eff0: 5e pop %esi 10eff1: 5f pop %edi 10eff2: c9 leave 10eff3: c3 ret =============================================================================== 0010b410 <_Rate_monotonic_Timeout>: void _Rate_monotonic_Timeout( Objects_Id id, void *ignored ) { 10b410: 55 push %ebp 10b411: 89 e5 mov %esp,%ebp 10b413: 53 push %ebx 10b414: 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 ); 10b417: 8d 45 f4 lea -0xc(%ebp),%eax 10b41a: 50 push %eax 10b41b: ff 75 08 pushl 0x8(%ebp) 10b41e: 68 14 72 12 00 push $0x127214 10b423: e8 d4 1a 00 00 call 10cefc <_Objects_Get> 10b428: 89 c3 mov %eax,%ebx switch ( location ) { 10b42a: 83 c4 10 add $0x10,%esp 10b42d: 83 7d f4 00 cmpl $0x0,-0xc(%ebp) 10b431: 75 64 jne 10b497 <_Rate_monotonic_Timeout+0x87><== NEVER TAKEN case OBJECTS_LOCAL: the_thread = the_period->owner; 10b433: 8b 40 40 mov 0x40(%eax),%eax if ( _States_Is_waiting_for_period( the_thread->current_state ) && 10b436: f6 40 11 40 testb $0x40,0x11(%eax) 10b43a: 74 18 je 10b454 <_Rate_monotonic_Timeout+0x44> 10b43c: 8b 53 08 mov 0x8(%ebx),%edx 10b43f: 39 50 20 cmp %edx,0x20(%eax) 10b442: 75 10 jne 10b454 <_Rate_monotonic_Timeout+0x44> RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 10b444: 52 push %edx 10b445: 52 push %edx 10b446: 68 f8 ff 03 10 push $0x1003fff8 10b44b: 50 push %eax 10b44c: e8 13 1f 00 00 call 10d364 <_Thread_Clear_state> the_thread->Wait.id == the_period->Object.id ) { _Thread_Unblock( the_thread ); _Rate_monotonic_Initiate_statistics( the_period ); 10b451: 59 pop %ecx 10b452: eb 10 jmp 10b464 <_Rate_monotonic_Timeout+0x54> _Watchdog_Insert_ticks( &the_period->Timer, the_period->next_length ); } else if ( the_period->state == RATE_MONOTONIC_OWNER_IS_BLOCKING ) { 10b454: 83 7b 38 01 cmpl $0x1,0x38(%ebx) 10b458: 75 2b jne 10b485 <_Rate_monotonic_Timeout+0x75> the_period->state = RATE_MONOTONIC_EXPIRED_WHILE_BLOCKING; 10b45a: c7 43 38 03 00 00 00 movl $0x3,0x38(%ebx) _Rate_monotonic_Initiate_statistics( the_period ); 10b461: 83 ec 0c sub $0xc,%esp 10b464: 53 push %ebx 10b465: e8 e8 fa ff ff call 10af52 <_Rate_monotonic_Initiate_statistics> Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 10b46a: 8b 43 3c mov 0x3c(%ebx),%eax 10b46d: 89 43 1c mov %eax,0x1c(%ebx) _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 10b470: 58 pop %eax 10b471: 5a pop %edx _Watchdog_Insert_ticks( &the_period->Timer, the_period->next_length ); 10b472: 83 c3 10 add $0x10,%ebx 10b475: 53 push %ebx 10b476: 68 d0 73 12 00 push $0x1273d0 10b47b: e8 c0 31 00 00 call 10e640 <_Watchdog_Insert> 10b480: 83 c4 10 add $0x10,%esp 10b483: eb 07 jmp 10b48c <_Rate_monotonic_Timeout+0x7c> } else the_period->state = RATE_MONOTONIC_EXPIRED; 10b485: c7 43 38 04 00 00 00 movl $0x4,0x38(%ebx) */ RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void ) { RTEMS_COMPILER_MEMORY_BARRIER(); _Thread_Dispatch_disable_level -= 1; 10b48c: a1 08 73 12 00 mov 0x127308,%eax 10b491: 48 dec %eax 10b492: a3 08 73 12 00 mov %eax,0x127308 case OBJECTS_REMOTE: /* impossible */ #endif case OBJECTS_ERROR: break; } } 10b497: 8b 5d fc mov -0x4(%ebp),%ebx 10b49a: c9 leave 10b49b: c3 ret =============================================================================== 0010ad18 <_TOD_Validate>: */ bool _TOD_Validate( const rtems_time_of_day *the_tod ) { 10ad18: 55 push %ebp 10ad19: 89 e5 mov %esp,%ebp 10ad1b: 56 push %esi 10ad1c: 53 push %ebx 10ad1d: 8b 4d 08 mov 0x8(%ebp),%ecx uint32_t days_in_month; uint32_t ticks_per_second; ticks_per_second = TOD_MICROSECONDS_PER_SECOND / rtems_configuration_get_microseconds_per_tick(); 10ad20: 8b 35 84 44 12 00 mov 0x124484,%esi (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; 10ad26: 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) || 10ad28: 85 c9 test %ecx,%ecx 10ad2a: 74 57 je 10ad83 <_TOD_Validate+0x6b> <== NEVER TAKEN ) { uint32_t days_in_month; uint32_t ticks_per_second; ticks_per_second = TOD_MICROSECONDS_PER_SECOND / 10ad2c: b8 40 42 0f 00 mov $0xf4240,%eax 10ad31: 31 d2 xor %edx,%edx 10ad33: f7 f6 div %esi rtems_configuration_get_microseconds_per_tick(); if ((!the_tod) || 10ad35: 39 41 18 cmp %eax,0x18(%ecx) 10ad38: 73 49 jae 10ad83 <_TOD_Validate+0x6b> <== NEVER TAKEN (the_tod->ticks >= ticks_per_second) || 10ad3a: 83 79 14 3b cmpl $0x3b,0x14(%ecx) 10ad3e: 77 43 ja 10ad83 <_TOD_Validate+0x6b> <== NEVER TAKEN (the_tod->second >= TOD_SECONDS_PER_MINUTE) || 10ad40: 83 79 10 3b cmpl $0x3b,0x10(%ecx) 10ad44: 77 3d ja 10ad83 <_TOD_Validate+0x6b> (the_tod->minute >= TOD_MINUTES_PER_HOUR) || 10ad46: 83 79 0c 17 cmpl $0x17,0xc(%ecx) 10ad4a: 77 37 ja 10ad83 <_TOD_Validate+0x6b> (the_tod->hour >= TOD_HOURS_PER_DAY) || (the_tod->month == 0) || 10ad4c: 8b 41 04 mov 0x4(%ecx),%eax 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) || 10ad4f: 85 c0 test %eax,%eax 10ad51: 74 30 je 10ad83 <_TOD_Validate+0x6b> <== NEVER TAKEN (the_tod->month == 0) || 10ad53: 83 f8 0c cmp $0xc,%eax 10ad56: 77 2b ja 10ad83 <_TOD_Validate+0x6b> (the_tod->month > TOD_MONTHS_PER_YEAR) || (the_tod->year < TOD_BASE_YEAR) || 10ad58: 8b 31 mov (%ecx),%esi (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) || 10ad5a: 81 fe c3 07 00 00 cmp $0x7c3,%esi 10ad60: 76 21 jbe 10ad83 <_TOD_Validate+0x6b> (the_tod->year < TOD_BASE_YEAR) || (the_tod->day == 0) ) 10ad62: 8b 51 08 mov 0x8(%ecx),%edx (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) || 10ad65: 85 d2 test %edx,%edx 10ad67: 74 1a je 10ad83 <_TOD_Validate+0x6b> <== NEVER TAKEN (the_tod->day == 0) ) return false; if ( (the_tod->year % 4) == 0 ) 10ad69: 83 e6 03 and $0x3,%esi 10ad6c: 75 09 jne 10ad77 <_TOD_Validate+0x5f> days_in_month = _TOD_Days_per_month[ 1 ][ the_tod->month ]; 10ad6e: 8b 04 85 48 16 12 00 mov 0x121648(,%eax,4),%eax 10ad75: eb 07 jmp 10ad7e <_TOD_Validate+0x66> else days_in_month = _TOD_Days_per_month[ 0 ][ the_tod->month ]; 10ad77: 8b 04 85 14 16 12 00 mov 0x121614(,%eax,4),%eax * false - if the the_tod is invalid * * NOTE: This routine only works for leap-years through 2099. */ bool _TOD_Validate( 10ad7e: 39 c2 cmp %eax,%edx 10ad80: 0f 96 c3 setbe %bl if ( the_tod->day > days_in_month ) return false; return true; } 10ad83: 88 d8 mov %bl,%al 10ad85: 5b pop %ebx 10ad86: 5e pop %esi 10ad87: c9 leave 10ad88: c3 ret =============================================================================== 0010baa4 <_Thread_Change_priority>: void _Thread_Change_priority( Thread_Control *the_thread, Priority_Control new_priority, bool prepend_it ) { 10baa4: 55 push %ebp 10baa5: 89 e5 mov %esp,%ebp 10baa7: 57 push %edi 10baa8: 56 push %esi 10baa9: 53 push %ebx 10baaa: 83 ec 28 sub $0x28,%esp 10baad: 8b 5d 08 mov 0x8(%ebp),%ebx 10bab0: 8b 7d 0c mov 0xc(%ebp),%edi 10bab3: 8a 45 10 mov 0x10(%ebp),%al 10bab6: 88 45 e7 mov %al,-0x19(%ebp) */ /* * Save original state */ original_state = the_thread->current_state; 10bab9: 8b 73 10 mov 0x10(%ebx),%esi /* * Set a transient state for the thread so it is pulled off the Ready chains. * This will prevent it from being scheduled no matter what happens in an * ISR. */ _Thread_Set_transient( the_thread ); 10babc: 53 push %ebx 10babd: e8 42 0d 00 00 call 10c804 <_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 ) 10bac2: 83 c4 10 add $0x10,%esp 10bac5: 39 7b 14 cmp %edi,0x14(%ebx) 10bac8: 74 0c je 10bad6 <_Thread_Change_priority+0x32> _Thread_Set_priority( the_thread, new_priority ); 10baca: 50 push %eax 10bacb: 50 push %eax 10bacc: 57 push %edi 10bacd: 53 push %ebx 10bace: e8 f9 0b 00 00 call 10c6cc <_Thread_Set_priority> 10bad3: 83 c4 10 add $0x10,%esp _ISR_Disable( level ); 10bad6: 9c pushf 10bad7: fa cli 10bad8: 59 pop %ecx /* * If the thread has more than STATES_TRANSIENT set, then it is blocked, * If it is blocked on a thread queue, then we need to requeue it. */ state = the_thread->current_state; 10bad9: 8b 43 10 mov 0x10(%ebx),%eax if ( state != STATES_TRANSIENT ) { 10badc: 83 f8 04 cmp $0x4,%eax 10badf: 74 2f je 10bb10 <_Thread_Change_priority+0x6c> /* Only clear the transient state if it wasn't set already */ if ( ! _States_Is_transient( original_state ) ) 10bae1: 83 e6 04 and $0x4,%esi 10bae4: 75 08 jne 10baee <_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); 10bae6: 89 c2 mov %eax,%edx 10bae8: 83 e2 fb and $0xfffffffb,%edx 10baeb: 89 53 10 mov %edx,0x10(%ebx) the_thread->current_state = _States_Clear( STATES_TRANSIENT, state ); _ISR_Enable( level ); 10baee: 51 push %ecx 10baef: 9d popf if ( _States_Is_waiting_on_thread_queue( state ) ) { 10baf0: a9 e0 be 03 00 test $0x3bee0,%eax 10baf5: 0f 84 c0 00 00 00 je 10bbbb <_Thread_Change_priority+0x117> _Thread_queue_Requeue( the_thread->Wait.queue, the_thread ); 10bafb: 89 5d 0c mov %ebx,0xc(%ebp) 10bafe: 8b 43 44 mov 0x44(%ebx),%eax 10bb01: 89 45 08 mov %eax,0x8(%ebp) if ( !_Thread_Is_executing_also_the_heir() && _Thread_Executing->is_preemptible ) _Context_Switch_necessary = true; _ISR_Enable( level ); } 10bb04: 8d 65 f4 lea -0xc(%ebp),%esp 10bb07: 5b pop %ebx 10bb08: 5e pop %esi 10bb09: 5f pop %edi 10bb0a: c9 leave /* Only clear the transient state if it wasn't set already */ if ( ! _States_Is_transient( original_state ) ) the_thread->current_state = _States_Clear( STATES_TRANSIENT, state ); _ISR_Enable( level ); if ( _States_Is_waiting_on_thread_queue( state ) ) { _Thread_queue_Requeue( the_thread->Wait.queue, the_thread ); 10bb0b: e9 34 0b 00 00 jmp 10c644 <_Thread_queue_Requeue> } return; } /* Only clear the transient state if it wasn't set already */ if ( ! _States_Is_transient( original_state ) ) { 10bb10: 83 e6 04 and $0x4,%esi 10bb13: 75 53 jne 10bb68 <_Thread_Change_priority+0xc4><== NEVER TAKEN * Interrupts are STILL disabled. * We now know the thread will be in the READY state when we remove * the TRANSIENT state. So we have to place it on the appropriate * Ready Queue with interrupts off. */ the_thread->current_state = _States_Clear( STATES_TRANSIENT, state ); 10bb15: c7 43 10 00 00 00 00 movl $0x0,0x10(%ebx) RTEMS_INLINE_ROUTINE void _Priority_Add_to_bit_map ( Priority_Information *the_priority_map ) { *the_priority_map->minor |= the_priority_map->ready_minor; 10bb1c: 8b 83 90 00 00 00 mov 0x90(%ebx),%eax 10bb22: 66 8b 93 96 00 00 00 mov 0x96(%ebx),%dx 10bb29: 66 09 10 or %dx,(%eax) _Priority_Major_bit_map |= the_priority_map->ready_major; 10bb2c: 66 a1 88 42 12 00 mov 0x124288,%ax 10bb32: 0b 83 94 00 00 00 or 0x94(%ebx),%eax 10bb38: 66 a3 88 42 12 00 mov %ax,0x124288 _Priority_Add_to_bit_map( &the_thread->Priority_map ); if ( prepend_it ) 10bb3e: 80 7d e7 00 cmpb $0x0,-0x19(%ebp) 10bb42: 8b 83 8c 00 00 00 mov 0x8c(%ebx),%eax 10bb48: 74 0e je 10bb58 <_Thread_Change_priority+0xb4> Chain_Node *the_node ) { Chain_Node *before_node; the_node->previous = after_node; 10bb4a: 89 43 04 mov %eax,0x4(%ebx) before_node = after_node->next; 10bb4d: 8b 10 mov (%eax),%edx after_node->next = the_node; 10bb4f: 89 18 mov %ebx,(%eax) the_node->next = before_node; 10bb51: 89 13 mov %edx,(%ebx) before_node->previous = the_node; 10bb53: 89 5a 04 mov %ebx,0x4(%edx) 10bb56: eb 10 jmp 10bb68 <_Thread_Change_priority+0xc4> */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 10bb58: 8d 50 04 lea 0x4(%eax),%edx 10bb5b: 89 13 mov %edx,(%ebx) ) { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); old_last_node = the_chain->last; 10bb5d: 8b 50 08 mov 0x8(%eax),%edx the_chain->last = the_node; 10bb60: 89 58 08 mov %ebx,0x8(%eax) old_last_node->next = the_node; 10bb63: 89 1a mov %ebx,(%edx) the_node->previous = old_last_node; 10bb65: 89 53 04 mov %edx,0x4(%ebx) _Chain_Prepend_unprotected( the_thread->ready, &the_thread->Object.Node ); else _Chain_Append_unprotected( the_thread->ready, &the_thread->Object.Node ); } _ISR_Flash( level ); 10bb68: 51 push %ecx 10bb69: 9d popf 10bb6a: fa cli RTEMS_INLINE_ROUTINE Priority_Control _Priority_Get_highest( void ) { Priority_Bit_map_control minor; Priority_Bit_map_control major; _Bitfield_Find_first_bit( _Priority_Major_bit_map, major ); 10bb6b: 66 8b 1d 88 42 12 00 mov 0x124288,%bx 10bb72: 31 c0 xor %eax,%eax 10bb74: 89 c2 mov %eax,%edx 10bb76: 66 0f bc d3 bsf %bx,%dx _Bitfield_Find_first_bit( _Priority_Bit_map[major], minor ); 10bb7a: 0f b7 d2 movzwl %dx,%edx 10bb7d: 66 8b 9c 12 f8 42 12 mov 0x1242f8(%edx,%edx,1),%bx 10bb84: 00 10bb85: 66 0f bc c3 bsf %bx,%ax return (_Priority_Bits_index( major ) << 4) + 10bb89: c1 e2 04 shl $0x4,%edx 10bb8c: 0f b7 c0 movzwl %ax,%eax */ RTEMS_INLINE_ROUTINE void _Thread_Calculate_heir( void ) { _Thread_Heir = (Thread_Control *) _Thread_Ready_chain[ _Priority_Get_highest() ].first; 10bb8f: 8d 04 02 lea (%edx,%eax,1),%eax 10bb92: 6b c0 0c imul $0xc,%eax,%eax 10bb95: 03 05 b0 41 12 00 add 0x1241b0,%eax * ready thread. */ RTEMS_INLINE_ROUTINE void _Thread_Calculate_heir( void ) { _Thread_Heir = (Thread_Control *) 10bb9b: 8b 10 mov (%eax),%edx 10bb9d: 89 15 38 47 12 00 mov %edx,0x124738 * is also the heir thread, and false otherwise. */ RTEMS_INLINE_ROUTINE bool _Thread_Is_executing_also_the_heir( void ) { return ( _Thread_Executing == _Thread_Heir ); 10bba3: a1 34 47 12 00 mov 0x124734,%eax * We altered the set of thread priorities. So let's figure out * who is the heir and if we need to switch to them. */ _Thread_Calculate_heir(); if ( !_Thread_Is_executing_also_the_heir() && 10bba8: 39 d0 cmp %edx,%eax 10bbaa: 74 0d je 10bbb9 <_Thread_Change_priority+0x115> 10bbac: 80 78 74 00 cmpb $0x0,0x74(%eax) 10bbb0: 74 07 je 10bbb9 <_Thread_Change_priority+0x115> _Thread_Executing->is_preemptible ) _Context_Switch_necessary = true; 10bbb2: c6 05 40 47 12 00 01 movb $0x1,0x124740 _ISR_Enable( level ); 10bbb9: 51 push %ecx 10bbba: 9d popf } 10bbbb: 8d 65 f4 lea -0xc(%ebp),%esp 10bbbe: 5b pop %ebx 10bbbf: 5e pop %esi 10bbc0: 5f pop %edi 10bbc1: c9 leave 10bbc2: c3 ret =============================================================================== 0010bbc4 <_Thread_Clear_state>: void _Thread_Clear_state( Thread_Control *the_thread, States_Control state ) { 10bbc4: 55 push %ebp 10bbc5: 89 e5 mov %esp,%ebp 10bbc7: 53 push %ebx 10bbc8: 8b 45 08 mov 0x8(%ebp),%eax 10bbcb: 8b 55 0c mov 0xc(%ebp),%edx ISR_Level level; States_Control current_state; _ISR_Disable( level ); 10bbce: 9c pushf 10bbcf: fa cli 10bbd0: 59 pop %ecx current_state = the_thread->current_state; 10bbd1: 8b 58 10 mov 0x10(%eax),%ebx if ( current_state & state ) { 10bbd4: 85 da test %ebx,%edx 10bbd6: 74 71 je 10bc49 <_Thread_Clear_state+0x85> 10bbd8: f7 d2 not %edx 10bbda: 21 da and %ebx,%edx current_state = the_thread->current_state = _States_Clear( state, current_state ); 10bbdc: 89 50 10 mov %edx,0x10(%eax) if ( _States_Is_ready( current_state ) ) { 10bbdf: 85 d2 test %edx,%edx 10bbe1: 75 66 jne 10bc49 <_Thread_Clear_state+0x85> RTEMS_INLINE_ROUTINE void _Priority_Add_to_bit_map ( Priority_Information *the_priority_map ) { *the_priority_map->minor |= the_priority_map->ready_minor; 10bbe3: 8b 90 90 00 00 00 mov 0x90(%eax),%edx 10bbe9: 66 8b 98 96 00 00 00 mov 0x96(%eax),%bx 10bbf0: 66 09 1a or %bx,(%edx) _Priority_Major_bit_map |= the_priority_map->ready_major; 10bbf3: 66 8b 15 88 42 12 00 mov 0x124288,%dx 10bbfa: 0b 90 94 00 00 00 or 0x94(%eax),%edx 10bc00: 66 89 15 88 42 12 00 mov %dx,0x124288 _Priority_Add_to_bit_map( &the_thread->Priority_map ); _Chain_Append_unprotected(the_thread->ready, &the_thread->Object.Node); 10bc07: 8b 90 8c 00 00 00 mov 0x8c(%eax),%edx */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 10bc0d: 8d 5a 04 lea 0x4(%edx),%ebx 10bc10: 89 18 mov %ebx,(%eax) ) { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); old_last_node = the_chain->last; 10bc12: 8b 5a 08 mov 0x8(%edx),%ebx the_chain->last = the_node; 10bc15: 89 42 08 mov %eax,0x8(%edx) old_last_node->next = the_node; 10bc18: 89 03 mov %eax,(%ebx) the_node->previous = old_last_node; 10bc1a: 89 58 04 mov %ebx,0x4(%eax) _ISR_Flash( level ); 10bc1d: 51 push %ecx 10bc1e: 9d popf 10bc1f: fa cli * a context switch. * Pseudo-ISR case: * Even if the thread isn't preemptible, if the new heir is * a pseudo-ISR system task, we need to do a context switch. */ if ( the_thread->current_priority < _Thread_Heir->current_priority ) { 10bc20: 8b 50 14 mov 0x14(%eax),%edx 10bc23: 8b 1d 38 47 12 00 mov 0x124738,%ebx 10bc29: 3b 53 14 cmp 0x14(%ebx),%edx 10bc2c: 73 1b jae 10bc49 <_Thread_Clear_state+0x85> _Thread_Heir = the_thread; 10bc2e: a3 38 47 12 00 mov %eax,0x124738 if ( _Thread_Executing->is_preemptible || 10bc33: a1 34 47 12 00 mov 0x124734,%eax 10bc38: 80 78 74 00 cmpb $0x0,0x74(%eax) 10bc3c: 75 04 jne 10bc42 <_Thread_Clear_state+0x7e> 10bc3e: 85 d2 test %edx,%edx 10bc40: 75 07 jne 10bc49 <_Thread_Clear_state+0x85><== ALWAYS TAKEN the_thread->current_priority == 0 ) _Context_Switch_necessary = true; 10bc42: c6 05 40 47 12 00 01 movb $0x1,0x124740 } } } _ISR_Enable( level ); 10bc49: 51 push %ecx 10bc4a: 9d popf } 10bc4b: 5b pop %ebx 10bc4c: c9 leave 10bc4d: c3 ret =============================================================================== 0010bdc4 <_Thread_Delay_ended>: void _Thread_Delay_ended( Objects_Id id, void *ignored __attribute__((unused)) ) { 10bdc4: 55 push %ebp 10bdc5: 89 e5 mov %esp,%ebp 10bdc7: 83 ec 20 sub $0x20,%esp Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); 10bdca: 8d 45 f4 lea -0xc(%ebp),%eax 10bdcd: 50 push %eax 10bdce: ff 75 08 pushl 0x8(%ebp) 10bdd1: e8 82 01 00 00 call 10bf58 <_Thread_Get> switch ( location ) { 10bdd6: 83 c4 10 add $0x10,%esp 10bdd9: 83 7d f4 00 cmpl $0x0,-0xc(%ebp) 10bddd: 75 1b jne 10bdfa <_Thread_Delay_ended+0x36><== NEVER TAKEN #if defined(RTEMS_MULTIPROCESSING) case OBJECTS_REMOTE: /* impossible */ #endif break; case OBJECTS_LOCAL: _Thread_Clear_state( 10bddf: 52 push %edx 10bde0: 52 push %edx 10bde1: 68 18 00 00 10 push $0x10000018 10bde6: 50 push %eax 10bde7: e8 d8 fd ff ff call 10bbc4 <_Thread_Clear_state> 10bdec: a1 e4 41 12 00 mov 0x1241e4,%eax 10bdf1: 48 dec %eax 10bdf2: a3 e4 41 12 00 mov %eax,0x1241e4 10bdf7: 83 c4 10 add $0x10,%esp | STATES_INTERRUPTIBLE_BY_SIGNAL ); _Thread_Unnest_dispatch(); break; } } 10bdfa: c9 leave 10bdfb: c3 ret =============================================================================== 0010bdfc <_Thread_Dispatch>: * dispatch thread * no dispatch thread */ void _Thread_Dispatch( void ) { 10bdfc: 55 push %ebp 10bdfd: 89 e5 mov %esp,%ebp 10bdff: 57 push %edi 10be00: 56 push %esi 10be01: 53 push %ebx 10be02: 83 ec 1c sub $0x1c,%esp Thread_Control *executing; Thread_Control *heir; ISR_Level level; executing = _Thread_Executing; 10be05: 8b 1d 34 47 12 00 mov 0x124734,%ebx _ISR_Disable( level ); 10be0b: 9c pushf 10be0c: fa cli 10be0d: 58 pop %eax #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ { Timestamp_Control uptime, ran; _TOD_Get_uptime( &uptime ); _Timestamp_Subtract( 10be0e: 8d 7d d8 lea -0x28(%ebp),%edi Thread_Control *heir; ISR_Level level; executing = _Thread_Executing; _ISR_Disable( level ); while ( _Context_Switch_necessary == true ) { 10be11: e9 f9 00 00 00 jmp 10bf0f <_Thread_Dispatch+0x113> heir = _Thread_Heir; 10be16: 8b 35 38 47 12 00 mov 0x124738,%esi _Thread_Dispatch_disable_level = 1; 10be1c: c7 05 e4 41 12 00 01 movl $0x1,0x1241e4 10be23: 00 00 00 _Context_Switch_necessary = false; 10be26: c6 05 40 47 12 00 00 movb $0x0,0x124740 _Thread_Executing = heir; 10be2d: 89 35 34 47 12 00 mov %esi,0x124734 /* * 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 ) 10be33: 39 de cmp %ebx,%esi 10be35: 0f 84 e2 00 00 00 je 10bf1d <_Thread_Dispatch+0x121> */ #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 ) 10be3b: 83 7e 7c 01 cmpl $0x1,0x7c(%esi) 10be3f: 75 09 jne 10be4a <_Thread_Dispatch+0x4e> heir->cpu_time_budget = _Thread_Ticks_per_timeslice; 10be41: 8b 15 b4 41 12 00 mov 0x1241b4,%edx 10be47: 89 56 78 mov %edx,0x78(%esi) _ISR_Enable( level ); 10be4a: 50 push %eax 10be4b: 9d popf #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ { Timestamp_Control uptime, ran; _TOD_Get_uptime( &uptime ); 10be4c: 83 ec 0c sub $0xc,%esp 10be4f: 8d 45 e0 lea -0x20(%ebp),%eax 10be52: 50 push %eax 10be53: e8 70 35 00 00 call 10f3c8 <_TOD_Get_uptime> _Timestamp_Subtract( 10be58: 83 c4 0c add $0xc,%esp 10be5b: 57 push %edi 10be5c: 8d 45 e0 lea -0x20(%ebp),%eax 10be5f: 50 push %eax 10be60: 68 98 42 12 00 push $0x124298 10be65: e8 36 0c 00 00 call 10caa0 <_Timespec_Subtract> &_Thread_Time_of_last_context_switch, &uptime, &ran ); _Timestamp_Add_to( &executing->cpu_time_used, &ran ); 10be6a: 58 pop %eax 10be6b: 5a pop %edx 10be6c: 57 push %edi 10be6d: 8d 83 84 00 00 00 lea 0x84(%ebx),%eax 10be73: 50 push %eax 10be74: e8 f7 0b 00 00 call 10ca70 <_Timespec_Add_to> _Thread_Time_of_last_context_switch = uptime; 10be79: 8b 45 e0 mov -0x20(%ebp),%eax 10be7c: 8b 55 e4 mov -0x1c(%ebp),%edx 10be7f: a3 98 42 12 00 mov %eax,0x124298 10be84: 89 15 9c 42 12 00 mov %edx,0x12429c #endif /* * Switch libc's task specific data. */ if ( _Thread_libc_reent ) { 10be8a: a1 6c 42 12 00 mov 0x12426c,%eax 10be8f: 83 c4 10 add $0x10,%esp 10be92: 85 c0 test %eax,%eax 10be94: 74 10 je 10bea6 <_Thread_Dispatch+0xaa> <== NEVER TAKEN executing->libc_reent = *_Thread_libc_reent; 10be96: 8b 10 mov (%eax),%edx 10be98: 89 93 f0 00 00 00 mov %edx,0xf0(%ebx) *_Thread_libc_reent = heir->libc_reent; 10be9e: 8b 96 f0 00 00 00 mov 0xf0(%esi),%edx 10bea4: 89 10 mov %edx,(%eax) } _User_extensions_Thread_switch( executing, heir ); 10bea6: 51 push %ecx 10bea7: 51 push %ecx 10bea8: 56 push %esi 10bea9: 53 push %ebx 10beaa: e8 29 0e 00 00 call 10ccd8 <_User_extensions_Thread_switch> if ( executing->fp_context != NULL ) _Context_Save_fp( &executing->fp_context ); #endif #endif _Context_Switch( &executing->Registers, &heir->Registers ); 10beaf: 58 pop %eax 10beb0: 5a pop %edx 10beb1: 81 c6 d4 00 00 00 add $0xd4,%esi 10beb7: 56 push %esi 10beb8: 8d 83 d4 00 00 00 lea 0xd4(%ebx),%eax 10bebe: 50 push %eax 10bebf: e8 dc 10 00 00 call 10cfa0 <_CPU_Context_switch> #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) #if ( CPU_USE_DEFERRED_FP_SWITCH == TRUE ) if ( (executing->fp_context != NULL) && 10bec4: 83 c4 10 add $0x10,%esp 10bec7: 83 bb ec 00 00 00 00 cmpl $0x0,0xec(%ebx) 10bece: 74 36 je 10bf06 <_Thread_Dispatch+0x10a> #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 ); 10bed0: a1 68 42 12 00 mov 0x124268,%eax 10bed5: 39 c3 cmp %eax,%ebx 10bed7: 74 2d je 10bf06 <_Thread_Dispatch+0x10a> !_Thread_Is_allocated_fp( executing ) ) { if ( _Thread_Allocated_fp != NULL ) 10bed9: 85 c0 test %eax,%eax 10bedb: 74 11 je 10beee <_Thread_Dispatch+0xf2> _Context_Save_fp( &_Thread_Allocated_fp->fp_context ); 10bedd: 83 ec 0c sub $0xc,%esp 10bee0: 05 ec 00 00 00 add $0xec,%eax 10bee5: 50 push %eax 10bee6: e8 e9 10 00 00 call 10cfd4 <_CPU_Context_save_fp> 10beeb: 83 c4 10 add $0x10,%esp _Context_Restore_fp( &executing->fp_context ); 10beee: 83 ec 0c sub $0xc,%esp 10bef1: 8d 83 ec 00 00 00 lea 0xec(%ebx),%eax 10bef7: 50 push %eax 10bef8: e8 e1 10 00 00 call 10cfde <_CPU_Context_restore_fp> _Thread_Allocated_fp = executing; 10befd: 89 1d 68 42 12 00 mov %ebx,0x124268 10bf03: 83 c4 10 add $0x10,%esp if ( executing->fp_context != NULL ) _Context_Restore_fp( &executing->fp_context ); #endif #endif executing = _Thread_Executing; 10bf06: 8b 1d 34 47 12 00 mov 0x124734,%ebx _ISR_Disable( level ); 10bf0c: 9c pushf 10bf0d: fa cli 10bf0e: 58 pop %eax Thread_Control *heir; ISR_Level level; executing = _Thread_Executing; _ISR_Disable( level ); while ( _Context_Switch_necessary == true ) { 10bf0f: 8a 15 40 47 12 00 mov 0x124740,%dl 10bf15: 84 d2 test %dl,%dl 10bf17: 0f 85 f9 fe ff ff jne 10be16 <_Thread_Dispatch+0x1a> _ISR_Disable( level ); } post_switch: _Thread_Dispatch_disable_level = 0; 10bf1d: c7 05 e4 41 12 00 00 movl $0x0,0x1241e4 10bf24: 00 00 00 _ISR_Enable( level ); 10bf27: 50 push %eax 10bf28: 9d popf _API_extensions_Run_postswitch(); 10bf29: e8 09 ea ff ff call 10a937 <_API_extensions_Run_postswitch> } 10bf2e: 8d 65 f4 lea -0xc(%ebp),%esp 10bf31: 5b pop %ebx 10bf32: 5e pop %esi 10bf33: 5f pop %edi 10bf34: c9 leave 10bf35: c3 ret =============================================================================== 0010bf58 <_Thread_Get>: Thread_Control *_Thread_Get ( Objects_Id id, Objects_Locations *location ) { 10bf58: 55 push %ebp 10bf59: 89 e5 mov %esp,%ebp 10bf5b: 53 push %ebx 10bf5c: 83 ec 04 sub $0x4,%esp 10bf5f: 8b 55 08 mov 0x8(%ebp),%edx 10bf62: 8b 45 0c mov 0xc(%ebp),%eax uint32_t the_class; Objects_Information **api_information; Objects_Information *information; Thread_Control *tp = (Thread_Control *) 0; if ( _Objects_Are_ids_equal( id, OBJECTS_ID_OF_SELF ) ) { 10bf65: 85 d2 test %edx,%edx 10bf67: 75 1a jne 10bf83 <_Thread_Get+0x2b> rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 10bf69: 8b 15 e4 41 12 00 mov 0x1241e4,%edx 10bf6f: 42 inc %edx 10bf70: 89 15 e4 41 12 00 mov %edx,0x1241e4 _Thread_Disable_dispatch(); *location = OBJECTS_LOCAL; 10bf76: c7 00 00 00 00 00 movl $0x0,(%eax) tp = _Thread_Executing; 10bf7c: a1 34 47 12 00 mov 0x124734,%eax goto done; 10bf81: eb 3a jmp 10bfbd <_Thread_Get+0x65> */ RTEMS_INLINE_ROUTINE Objects_APIs _Objects_Get_API( Objects_Id id ) { return (Objects_APIs) ((id >> OBJECTS_API_START_BIT) & OBJECTS_API_VALID_BITS); 10bf83: 89 d1 mov %edx,%ecx 10bf85: c1 e9 18 shr $0x18,%ecx 10bf88: 83 e1 07 and $0x7,%ecx */ RTEMS_INLINE_ROUTINE bool _Objects_Is_api_valid( uint32_t the_api ) { if ( !the_api || the_api > OBJECTS_APIS_LAST ) 10bf8b: 8d 59 ff lea -0x1(%ecx),%ebx 10bf8e: 83 fb 02 cmp $0x2,%ebx 10bf91: 76 2f jbe 10bfc2 <_Thread_Get+0x6a> 10bf93: eb 12 jmp 10bfa7 <_Thread_Get+0x4f> if ( the_class != 1 ) { /* threads are always first class :) */ *location = OBJECTS_ERROR; goto done; } api_information = _Objects_Information_table[ the_api ]; 10bf95: 8b 0c 8d bc 41 12 00 mov 0x1241bc(,%ecx,4),%ecx if ( !api_information ) { 10bf9c: 85 c9 test %ecx,%ecx 10bf9e: 74 07 je 10bfa7 <_Thread_Get+0x4f> <== NEVER TAKEN *location = OBJECTS_ERROR; goto done; } information = api_information[ the_class ]; 10bfa0: 8b 49 04 mov 0x4(%ecx),%ecx if ( !information ) { 10bfa3: 85 c9 test %ecx,%ecx 10bfa5: 75 0a jne 10bfb1 <_Thread_Get+0x59> *location = OBJECTS_ERROR; 10bfa7: c7 00 01 00 00 00 movl $0x1,(%eax) { uint32_t the_api; uint32_t the_class; Objects_Information **api_information; Objects_Information *information; Thread_Control *tp = (Thread_Control *) 0; 10bfad: 31 c0 xor %eax,%eax } information = api_information[ the_class ]; if ( !information ) { *location = OBJECTS_ERROR; goto done; 10bfaf: eb 0c jmp 10bfbd <_Thread_Get+0x65> } tp = (Thread_Control *) _Objects_Get( information, id, location ); 10bfb1: 53 push %ebx 10bfb2: 50 push %eax 10bfb3: 52 push %edx 10bfb4: 51 push %ecx 10bfb5: e8 a2 f7 ff ff call 10b75c <_Objects_Get> 10bfba: 83 c4 10 add $0x10,%esp done: return tp; } 10bfbd: 8b 5d fc mov -0x4(%ebp),%ebx 10bfc0: c9 leave 10bfc1: c3 ret */ RTEMS_INLINE_ROUTINE uint32_t _Objects_Get_class( Objects_Id id ) { return (uint32_t) 10bfc2: 89 d3 mov %edx,%ebx 10bfc4: c1 eb 1b shr $0x1b,%ebx *location = OBJECTS_ERROR; goto done; } the_class = _Objects_Get_class( id ); if ( the_class != 1 ) { /* threads are always first class :) */ 10bfc7: 4b dec %ebx 10bfc8: 74 cb je 10bf95 <_Thread_Get+0x3d> 10bfca: eb db jmp 10bfa7 <_Thread_Get+0x4f> =============================================================================== 00110fb8 <_Thread_Handler>: * * Output parameters: NONE */ void _Thread_Handler( void ) { 110fb8: 55 push %ebp 110fb9: 89 e5 mov %esp,%ebp 110fbb: 53 push %ebx 110fbc: 83 ec 14 sub $0x14,%esp #if defined(EXECUTE_GLOBAL_CONSTRUCTORS) static char doneConstructors; char doneCons; #endif executing = _Thread_Executing; 110fbf: 8b 1d 34 47 12 00 mov 0x124734,%ebx /* * have to put level into a register for those cpu's that use * inline asm here */ level = executing->Start.isr_level; 110fc5: 8b 83 b8 00 00 00 mov 0xb8(%ebx),%eax _ISR_Set_level(level); 110fcb: 85 c0 test %eax,%eax 110fcd: 74 03 je 110fd2 <_Thread_Handler+0x1a> 110fcf: fa cli 110fd0: eb 01 jmp 110fd3 <_Thread_Handler+0x1b> 110fd2: fb sti #if defined(EXECUTE_GLOBAL_CONSTRUCTORS) doneCons = doneConstructors; 110fd3: a0 a0 3e 12 00 mov 0x123ea0,%al 110fd8: 88 45 f7 mov %al,-0x9(%ebp) doneConstructors = 1; 110fdb: c6 05 a0 3e 12 00 01 movb $0x1,0x123ea0 #endif #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) #if ( CPU_USE_DEFERRED_FP_SWITCH == TRUE ) if ( (executing->fp_context != NULL) && 110fe2: 83 bb ec 00 00 00 00 cmpl $0x0,0xec(%ebx) 110fe9: 74 24 je 11100f <_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 ); 110feb: a1 68 42 12 00 mov 0x124268,%eax 110ff0: 39 c3 cmp %eax,%ebx 110ff2: 74 1b je 11100f <_Thread_Handler+0x57> !_Thread_Is_allocated_fp( executing ) ) { if ( _Thread_Allocated_fp != NULL ) 110ff4: 85 c0 test %eax,%eax 110ff6: 74 11 je 111009 <_Thread_Handler+0x51> _Context_Save_fp( &_Thread_Allocated_fp->fp_context ); 110ff8: 83 ec 0c sub $0xc,%esp 110ffb: 05 ec 00 00 00 add $0xec,%eax 111000: 50 push %eax 111001: e8 ce bf ff ff call 10cfd4 <_CPU_Context_save_fp> 111006: 83 c4 10 add $0x10,%esp _Thread_Allocated_fp = executing; 111009: 89 1d 68 42 12 00 mov %ebx,0x124268 /* * 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 ); 11100f: 83 ec 0c sub $0xc,%esp 111012: 53 push %ebx 111013: e8 70 bb ff ff call 10cb88 <_User_extensions_Thread_begin> /* * At this point, the dispatch disable level BETTER be 1. */ _Thread_Enable_dispatch(); 111018: e8 19 af ff ff call 10bf36 <_Thread_Enable_dispatch> /* * _init could be a weak symbol and we SHOULD test it but it isn't * in any configuration I know of and it generates a warning on every * RTEMS target configuration. --joel (12 May 2007) */ if (!doneCons) /* && (volatile void *)_init) */ { 11101d: 83 c4 10 add $0x10,%esp 111020: 80 7d f7 00 cmpb $0x0,-0x9(%ebp) 111024: 75 05 jne 11102b <_Thread_Handler+0x73> INIT_NAME (); 111026: e8 85 c0 00 00 call 11d0b0 <__start_set_sysctl_set> } #endif if ( executing->Start.prototype == THREAD_START_NUMERIC ) { 11102b: 8b 83 a0 00 00 00 mov 0xa0(%ebx),%eax 111031: 85 c0 test %eax,%eax 111033: 75 0b jne 111040 <_Thread_Handler+0x88> executing->Wait.return_argument = (*(Thread_Entry_numeric) executing->Start.entry_point)( 111035: 83 ec 0c sub $0xc,%esp 111038: ff b3 a8 00 00 00 pushl 0xa8(%ebx) 11103e: eb 0c jmp 11104c <_Thread_Handler+0x94> executing->Start.numeric_argument ); } #if defined(RTEMS_POSIX_API) else if ( executing->Start.prototype == THREAD_START_POINTER ) { 111040: 48 dec %eax 111041: 75 15 jne 111058 <_Thread_Handler+0xa0> <== NEVER TAKEN executing->Wait.return_argument = (*(Thread_Entry_pointer) executing->Start.entry_point)( 111043: 83 ec 0c sub $0xc,%esp 111046: ff b3 a4 00 00 00 pushl 0xa4(%ebx) 11104c: ff 93 9c 00 00 00 call *0x9c(%ebx) executing->Start.numeric_argument ); } #if defined(RTEMS_POSIX_API) else if ( executing->Start.prototype == THREAD_START_POINTER ) { executing->Wait.return_argument = 111052: 89 43 28 mov %eax,0x28(%ebx) 111055: 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 ); 111058: 83 ec 0c sub $0xc,%esp 11105b: 53 push %ebx 11105c: e8 58 bb ff ff call 10cbb9 <_User_extensions_Thread_exitted> _Internal_error_Occurred( 111061: 83 c4 0c add $0xc,%esp 111064: 6a 05 push $0x5 111066: 6a 01 push $0x1 111068: 6a 00 push $0x0 11106a: e8 31 a2 ff ff call 10b2a0 <_Internal_error_Occurred> =============================================================================== 0010bfcc <_Thread_Initialize>: Thread_CPU_budget_algorithms budget_algorithm, Thread_CPU_budget_algorithm_callout budget_callout, uint32_t isr_level, Objects_Name name ) { 10bfcc: 55 push %ebp 10bfcd: 89 e5 mov %esp,%ebp 10bfcf: 57 push %edi 10bfd0: 56 push %esi 10bfd1: 53 push %ebx 10bfd2: 83 ec 1c sub $0x1c,%esp 10bfd5: 8b 5d 0c mov 0xc(%ebp),%ebx 10bfd8: 8b 4d 10 mov 0x10(%ebp),%ecx 10bfdb: 8b 75 14 mov 0x14(%ebp),%esi 10bfde: 8a 55 18 mov 0x18(%ebp),%dl 10bfe1: 8a 45 20 mov 0x20(%ebp),%al 10bfe4: 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; 10bfe7: c7 83 f4 00 00 00 00 movl $0x0,0xf4(%ebx) 10bfee: 00 00 00 10bff1: c7 83 f8 00 00 00 00 movl $0x0,0xf8(%ebx) 10bff8: 00 00 00 extensions_area = NULL; the_thread->libc_reent = NULL; 10bffb: c7 83 f0 00 00 00 00 movl $0x0,0xf0(%ebx) 10c002: 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 ) { 10c005: 85 c9 test %ecx,%ecx 10c007: 75 31 jne 10c03a <_Thread_Initialize+0x6e> actual_stack_size = _Thread_Stack_Allocate( the_thread, stack_size ); 10c009: 51 push %ecx 10c00a: 51 push %ecx 10c00b: 56 push %esi 10c00c: 53 push %ebx 10c00d: 88 55 e0 mov %dl,-0x20(%ebp) 10c010: e8 63 08 00 00 call 10c878 <_Thread_Stack_Allocate> if ( !actual_stack_size || actual_stack_size < stack_size ) 10c015: 83 c4 10 add $0x10,%esp 10c018: 39 f0 cmp %esi,%eax 10c01a: 8a 55 e0 mov -0x20(%ebp),%dl 10c01d: 0f 82 c1 01 00 00 jb 10c1e4 <_Thread_Initialize+0x218> 10c023: 85 c0 test %eax,%eax 10c025: 0f 84 b9 01 00 00 je 10c1e4 <_Thread_Initialize+0x218><== NEVER TAKEN return false; /* stack allocation failed */ stack = the_thread->Start.stack; 10c02b: 8b 8b d0 00 00 00 mov 0xd0(%ebx),%ecx the_thread->Start.core_allocated_stack = true; 10c031: c6 83 c0 00 00 00 01 movb $0x1,0xc0(%ebx) 10c038: eb 09 jmp 10c043 <_Thread_Initialize+0x77> } else { stack = stack_area; actual_stack_size = stack_size; the_thread->Start.core_allocated_stack = false; 10c03a: c6 83 c0 00 00 00 00 movb $0x0,0xc0(%ebx) 10c041: 89 f0 mov %esi,%eax Stack_Control *the_stack, void *starting_address, size_t size ) { the_stack->area = starting_address; 10c043: 89 8b c8 00 00 00 mov %ecx,0xc8(%ebx) the_stack->size = size; 10c049: 89 83 c4 00 00 00 mov %eax,0xc4(%ebx) extensions_area = NULL; the_thread->libc_reent = NULL; #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) fp_area = NULL; 10c04f: 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 ) { 10c051: 84 d2 test %dl,%dl 10c053: 74 17 je 10c06c <_Thread_Initialize+0xa0> fp_area = _Workspace_Allocate( CONTEXT_FP_SIZE ); 10c055: 83 ec 0c sub $0xc,%esp 10c058: 6a 6c push $0x6c 10c05a: e8 df 0e 00 00 call 10cf3e <_Workspace_Allocate> 10c05f: 89 c7 mov %eax,%edi if ( !fp_area ) 10c061: 83 c4 10 add $0x10,%esp 10c064: 85 c0 test %eax,%eax 10c066: 0f 84 08 01 00 00 je 10c174 <_Thread_Initialize+0x1a8> goto failed; fp_area = _Context_Fp_start( fp_area, 0 ); } the_thread->fp_context = fp_area; 10c06c: 89 bb ec 00 00 00 mov %edi,0xec(%ebx) the_thread->Start.fp_context = fp_area; 10c072: 89 bb cc 00 00 00 mov %edi,0xcc(%ebx) Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 10c078: c7 43 50 00 00 00 00 movl $0x0,0x50(%ebx) the_watchdog->routine = routine; 10c07f: c7 43 64 00 00 00 00 movl $0x0,0x64(%ebx) the_watchdog->id = id; 10c086: c7 43 68 00 00 00 00 movl $0x0,0x68(%ebx) the_watchdog->user_data = user_data; 10c08d: c7 43 6c 00 00 00 00 movl $0x0,0x6c(%ebx) #endif /* * Allocate the extensions area for this thread */ if ( _Thread_Maximum_extensions ) { 10c094: a1 78 42 12 00 mov 0x124278,%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; 10c099: 31 f6 xor %esi,%esi #endif /* * Allocate the extensions area for this thread */ if ( _Thread_Maximum_extensions ) { 10c09b: 85 c0 test %eax,%eax 10c09d: 74 1d je 10c0bc <_Thread_Initialize+0xf0> extensions_area = _Workspace_Allocate( 10c09f: 83 ec 0c sub $0xc,%esp 10c0a2: 8d 04 85 04 00 00 00 lea 0x4(,%eax,4),%eax 10c0a9: 50 push %eax 10c0aa: e8 8f 0e 00 00 call 10cf3e <_Workspace_Allocate> 10c0af: 89 c6 mov %eax,%esi (_Thread_Maximum_extensions + 1) * sizeof( void * ) ); if ( !extensions_area ) 10c0b1: 83 c4 10 add $0x10,%esp 10c0b4: 85 c0 test %eax,%eax 10c0b6: 0f 84 ba 00 00 00 je 10c176 <_Thread_Initialize+0x1aa> goto failed; } the_thread->extensions = (void **) extensions_area; 10c0bc: 89 b3 fc 00 00 00 mov %esi,0xfc(%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 ) { 10c0c2: 85 f6 test %esi,%esi 10c0c4: 74 16 je 10c0dc <_Thread_Initialize+0x110> for ( i = 0; i <= _Thread_Maximum_extensions ; i++ ) 10c0c6: 8b 15 78 42 12 00 mov 0x124278,%edx 10c0cc: 31 c0 xor %eax,%eax 10c0ce: eb 08 jmp 10c0d8 <_Thread_Initialize+0x10c> the_thread->extensions[i] = NULL; 10c0d0: c7 04 86 00 00 00 00 movl $0x0,(%esi,%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++ ) 10c0d7: 40 inc %eax 10c0d8: 39 d0 cmp %edx,%eax 10c0da: 76 f4 jbe 10c0d0 <_Thread_Initialize+0x104> /* * General initialization */ the_thread->Start.is_preemptible = is_preemptible; 10c0dc: 8a 45 e7 mov -0x19(%ebp),%al 10c0df: 88 83 ac 00 00 00 mov %al,0xac(%ebx) the_thread->Start.budget_algorithm = budget_algorithm; 10c0e5: 8b 45 24 mov 0x24(%ebp),%eax 10c0e8: 89 83 b0 00 00 00 mov %eax,0xb0(%ebx) the_thread->Start.budget_callout = budget_callout; 10c0ee: 8b 45 28 mov 0x28(%ebp),%eax 10c0f1: 89 83 b4 00 00 00 mov %eax,0xb4(%ebx) switch ( budget_algorithm ) { 10c0f7: 83 7d 24 02 cmpl $0x2,0x24(%ebp) 10c0fb: 75 08 jne 10c105 <_Thread_Initialize+0x139> 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; 10c0fd: a1 b4 41 12 00 mov 0x1241b4,%eax 10c102: 89 43 78 mov %eax,0x78(%ebx) case THREAD_CPU_BUDGET_ALGORITHM_CALLOUT: break; #endif } the_thread->Start.isr_level = isr_level; 10c105: 8b 45 2c mov 0x2c(%ebp),%eax 10c108: 89 83 b8 00 00 00 mov %eax,0xb8(%ebx) the_thread->current_state = STATES_DORMANT; 10c10e: c7 43 10 01 00 00 00 movl $0x1,0x10(%ebx) the_thread->Wait.queue = NULL; 10c115: c7 43 44 00 00 00 00 movl $0x0,0x44(%ebx) the_thread->resource_count = 0; 10c11c: c7 43 1c 00 00 00 00 movl $0x0,0x1c(%ebx) the_thread->real_priority = priority; 10c123: 8b 45 1c mov 0x1c(%ebp),%eax 10c126: 89 43 18 mov %eax,0x18(%ebx) the_thread->Start.initial_priority = priority; 10c129: 89 83 bc 00 00 00 mov %eax,0xbc(%ebx) _Thread_Set_priority( the_thread, priority ); 10c12f: 52 push %edx 10c130: 52 push %edx 10c131: 50 push %eax 10c132: 53 push %ebx 10c133: e8 94 05 00 00 call 10c6cc <_Thread_Set_priority> /* * Initialize the CPU usage statistics */ #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ _Timestamp_Set_to_zero( &the_thread->cpu_time_used ); 10c138: c7 83 84 00 00 00 00 movl $0x0,0x84(%ebx) 10c13f: 00 00 00 10c142: c7 83 88 00 00 00 00 movl $0x0,0x88(%ebx) 10c149: 00 00 00 _Thread_Stack_Free( the_thread ); return false; } 10c14c: 8b 45 08 mov 0x8(%ebp),%eax 10c14f: 8b 40 1c mov 0x1c(%eax),%eax Objects_Information *information, Objects_Control *the_object, Objects_Name name ) { _Objects_Set_local_object( 10c152: 0f b7 53 08 movzwl 0x8(%ebx),%edx #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 10c156: 89 1c 90 mov %ebx,(%eax,%edx,4) information, _Objects_Get_index( the_object->id ), the_object ); the_object->name = name; 10c159: 8b 45 30 mov 0x30(%ebp),%eax 10c15c: 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 ); 10c15f: 89 1c 24 mov %ebx,(%esp) 10c162: e8 c1 0a 00 00 call 10cc28 <_User_extensions_Thread_create> 10c167: 88 c2 mov %al,%dl if ( extension_status ) 10c169: 83 c4 10 add $0x10,%esp return true; 10c16c: b0 01 mov $0x1,%al * 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 ) 10c16e: 84 d2 test %dl,%dl 10c170: 74 04 je 10c176 <_Thread_Initialize+0x1aa> 10c172: eb 72 jmp 10c1e6 <_Thread_Initialize+0x21a> * Zero out all the allocated memory fields */ for ( i=0 ; i <= THREAD_API_LAST ; i++ ) the_thread->API_Extensions[i] = NULL; extensions_area = NULL; 10c174: 31 f6 xor %esi,%esi extension_status = _User_extensions_Thread_create( the_thread ); if ( extension_status ) return true; failed: if ( the_thread->libc_reent ) 10c176: 8b 83 f0 00 00 00 mov 0xf0(%ebx),%eax 10c17c: 85 c0 test %eax,%eax 10c17e: 74 0c je 10c18c <_Thread_Initialize+0x1c0> _Workspace_Free( the_thread->libc_reent ); 10c180: 83 ec 0c sub $0xc,%esp 10c183: 50 push %eax 10c184: e8 ce 0d 00 00 call 10cf57 <_Workspace_Free> 10c189: 83 c4 10 add $0x10,%esp for ( i=0 ; i <= THREAD_API_LAST ; i++ ) if ( the_thread->API_Extensions[i] ) 10c18c: 8b 83 f4 00 00 00 mov 0xf4(%ebx),%eax 10c192: 85 c0 test %eax,%eax 10c194: 74 0c je 10c1a2 <_Thread_Initialize+0x1d6> _Workspace_Free( the_thread->API_Extensions[i] ); 10c196: 83 ec 0c sub $0xc,%esp 10c199: 50 push %eax 10c19a: e8 b8 0d 00 00 call 10cf57 <_Workspace_Free> 10c19f: 83 c4 10 add $0x10,%esp failed: if ( the_thread->libc_reent ) _Workspace_Free( the_thread->libc_reent ); for ( i=0 ; i <= THREAD_API_LAST ; i++ ) if ( the_thread->API_Extensions[i] ) 10c1a2: 8b 83 f8 00 00 00 mov 0xf8(%ebx),%eax 10c1a8: 85 c0 test %eax,%eax 10c1aa: 74 0c je 10c1b8 <_Thread_Initialize+0x1ec> _Workspace_Free( the_thread->API_Extensions[i] ); 10c1ac: 83 ec 0c sub $0xc,%esp 10c1af: 50 push %eax 10c1b0: e8 a2 0d 00 00 call 10cf57 <_Workspace_Free> 10c1b5: 83 c4 10 add $0x10,%esp if ( extensions_area ) 10c1b8: 85 f6 test %esi,%esi 10c1ba: 74 0c je 10c1c8 <_Thread_Initialize+0x1fc> (void) _Workspace_Free( extensions_area ); 10c1bc: 83 ec 0c sub $0xc,%esp 10c1bf: 56 push %esi 10c1c0: e8 92 0d 00 00 call 10cf57 <_Workspace_Free> 10c1c5: 83 c4 10 add $0x10,%esp #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) if ( fp_area ) 10c1c8: 85 ff test %edi,%edi 10c1ca: 74 0c je 10c1d8 <_Thread_Initialize+0x20c> (void) _Workspace_Free( fp_area ); 10c1cc: 83 ec 0c sub $0xc,%esp 10c1cf: 57 push %edi 10c1d0: e8 82 0d 00 00 call 10cf57 <_Workspace_Free> 10c1d5: 83 c4 10 add $0x10,%esp #endif _Thread_Stack_Free( the_thread ); 10c1d8: 83 ec 0c sub $0xc,%esp 10c1db: 53 push %ebx 10c1dc: e8 e7 06 00 00 call 10c8c8 <_Thread_Stack_Free> return false; 10c1e1: 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 */ 10c1e4: 31 c0 xor %eax,%eax _Thread_Stack_Free( the_thread ); return false; } 10c1e6: 8d 65 f4 lea -0xc(%ebp),%esp 10c1e9: 5b pop %ebx 10c1ea: 5e pop %esi 10c1eb: 5f pop %edi 10c1ec: c9 leave 10c1ed: c3 ret =============================================================================== 0010f468 <_Thread_Resume>: void _Thread_Resume( Thread_Control *the_thread, bool force ) { 10f468: 55 push %ebp 10f469: 89 e5 mov %esp,%ebp 10f46b: 53 push %ebx 10f46c: 8b 45 08 mov 0x8(%ebp),%eax ISR_Level level; States_Control current_state; _ISR_Disable( level ); 10f46f: 9c pushf 10f470: fa cli 10f471: 59 pop %ecx current_state = the_thread->current_state; 10f472: 8b 50 10 mov 0x10(%eax),%edx if ( current_state & STATES_SUSPENDED ) { 10f475: f6 c2 02 test $0x2,%dl 10f478: 74 70 je 10f4ea <_Thread_Resume+0x82> <== NEVER TAKEN 10f47a: 83 e2 fd and $0xfffffffd,%edx current_state = the_thread->current_state = _States_Clear(STATES_SUSPENDED, current_state); 10f47d: 89 50 10 mov %edx,0x10(%eax) if ( _States_Is_ready( current_state ) ) { 10f480: 85 d2 test %edx,%edx 10f482: 75 66 jne 10f4ea <_Thread_Resume+0x82> RTEMS_INLINE_ROUTINE void _Priority_Add_to_bit_map ( Priority_Information *the_priority_map ) { *the_priority_map->minor |= the_priority_map->ready_minor; 10f484: 8b 90 90 00 00 00 mov 0x90(%eax),%edx 10f48a: 66 8b 98 96 00 00 00 mov 0x96(%eax),%bx 10f491: 66 09 1a or %bx,(%edx) _Priority_Major_bit_map |= the_priority_map->ready_major; 10f494: 66 8b 15 50 73 12 00 mov 0x127350,%dx 10f49b: 0b 90 94 00 00 00 or 0x94(%eax),%edx 10f4a1: 66 89 15 50 73 12 00 mov %dx,0x127350 _Priority_Add_to_bit_map( &the_thread->Priority_map ); _Chain_Append_unprotected(the_thread->ready, &the_thread->Object.Node); 10f4a8: 8b 90 8c 00 00 00 mov 0x8c(%eax),%edx */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 10f4ae: 8d 5a 04 lea 0x4(%edx),%ebx 10f4b1: 89 18 mov %ebx,(%eax) ) { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); old_last_node = the_chain->last; 10f4b3: 8b 5a 08 mov 0x8(%edx),%ebx the_chain->last = the_node; 10f4b6: 89 42 08 mov %eax,0x8(%edx) old_last_node->next = the_node; 10f4b9: 89 03 mov %eax,(%ebx) the_node->previous = old_last_node; 10f4bb: 89 58 04 mov %ebx,0x4(%eax) _ISR_Flash( level ); 10f4be: 51 push %ecx 10f4bf: 9d popf 10f4c0: fa cli if ( the_thread->current_priority < _Thread_Heir->current_priority ) { 10f4c1: 8b 50 14 mov 0x14(%eax),%edx 10f4c4: 8b 1d 00 78 12 00 mov 0x127800,%ebx 10f4ca: 3b 53 14 cmp 0x14(%ebx),%edx 10f4cd: 73 1b jae 10f4ea <_Thread_Resume+0x82> _Thread_Heir = the_thread; 10f4cf: a3 00 78 12 00 mov %eax,0x127800 if ( _Thread_Executing->is_preemptible || 10f4d4: a1 fc 77 12 00 mov 0x1277fc,%eax 10f4d9: 80 78 74 00 cmpb $0x0,0x74(%eax) 10f4dd: 75 04 jne 10f4e3 <_Thread_Resume+0x7b> 10f4df: 85 d2 test %edx,%edx 10f4e1: 75 07 jne 10f4ea <_Thread_Resume+0x82> <== ALWAYS TAKEN the_thread->current_priority == 0 ) _Context_Switch_necessary = true; 10f4e3: c6 05 08 78 12 00 01 movb $0x1,0x127808 } } } _ISR_Enable( level ); 10f4ea: 51 push %ecx 10f4eb: 9d popf } 10f4ec: 5b pop %ebx 10f4ed: c9 leave 10f4ee: c3 ret =============================================================================== 0010c9b0 <_Thread_Tickle_timeslice>: * * Output parameters: NONE */ void _Thread_Tickle_timeslice( void ) { 10c9b0: 55 push %ebp 10c9b1: 89 e5 mov %esp,%ebp 10c9b3: 53 push %ebx 10c9b4: 83 ec 04 sub $0x4,%esp Thread_Control *executing; executing = _Thread_Executing; 10c9b7: 8b 1d 34 47 12 00 mov 0x124734,%ebx /* * If the thread is not preemptible or is not ready, then * just return. */ if ( !executing->is_preemptible ) 10c9bd: 80 7b 74 00 cmpb $0x0,0x74(%ebx) 10c9c1: 74 4c je 10ca0f <_Thread_Tickle_timeslice+0x5f> return; if ( !_States_Is_ready( executing->current_state ) ) 10c9c3: 83 7b 10 00 cmpl $0x0,0x10(%ebx) 10c9c7: 75 46 jne 10ca0f <_Thread_Tickle_timeslice+0x5f> /* * The cpu budget algorithm determines what happens next. */ switch ( executing->budget_algorithm ) { 10c9c9: 8b 43 7c mov 0x7c(%ebx),%eax 10c9cc: 83 f8 01 cmp $0x1,%eax 10c9cf: 72 3e jb 10ca0f <_Thread_Tickle_timeslice+0x5f> 10c9d1: 83 f8 02 cmp $0x2,%eax 10c9d4: 76 07 jbe 10c9dd <_Thread_Tickle_timeslice+0x2d> 10c9d6: 83 f8 03 cmp $0x3,%eax 10c9d9: 75 34 jne 10ca0f <_Thread_Tickle_timeslice+0x5f><== NEVER TAKEN 10c9db: eb 1a jmp 10c9f7 <_Thread_Tickle_timeslice+0x47> case THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE: #if defined(RTEMS_SCORE_THREAD_ENABLE_EXHAUST_TIMESLICE) case THREAD_CPU_BUDGET_ALGORITHM_EXHAUST_TIMESLICE: #endif if ( (int)(--executing->cpu_time_budget) <= 0 ) { 10c9dd: 8b 43 78 mov 0x78(%ebx),%eax 10c9e0: 48 dec %eax 10c9e1: 89 43 78 mov %eax,0x78(%ebx) 10c9e4: 85 c0 test %eax,%eax 10c9e6: 7f 27 jg 10ca0f <_Thread_Tickle_timeslice+0x5f> * at the priority of the currently executing thread, then the * 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. */ _Thread_Yield_processor(); 10c9e8: e8 27 00 00 00 call 10ca14 <_Thread_Yield_processor> executing->cpu_time_budget = _Thread_Ticks_per_timeslice; 10c9ed: a1 b4 41 12 00 mov 0x1241b4,%eax 10c9f2: 89 43 78 mov %eax,0x78(%ebx) 10c9f5: eb 18 jmp 10ca0f <_Thread_Tickle_timeslice+0x5f> } break; #if defined(RTEMS_SCORE_THREAD_ENABLE_SCHEDULER_CALLOUT) case THREAD_CPU_BUDGET_ALGORITHM_CALLOUT: if ( --executing->cpu_time_budget == 0 ) 10c9f7: 8b 43 78 mov 0x78(%ebx),%eax 10c9fa: 48 dec %eax 10c9fb: 89 43 78 mov %eax,0x78(%ebx) 10c9fe: 85 c0 test %eax,%eax 10ca00: 75 0d jne 10ca0f <_Thread_Tickle_timeslice+0x5f> (*executing->budget_callout)( executing ); 10ca02: 83 ec 0c sub $0xc,%esp 10ca05: 53 push %ebx 10ca06: ff 93 80 00 00 00 call *0x80(%ebx) 10ca0c: 83 c4 10 add $0x10,%esp break; #endif } } 10ca0f: 8b 5d fc mov -0x4(%ebp),%ebx 10ca12: c9 leave 10ca13: c3 ret =============================================================================== 0010f850 <_Thread_queue_Extract_priority_helper>: void _Thread_queue_Extract_priority_helper( Thread_queue_Control *the_thread_queue __attribute__((unused)), Thread_Control *the_thread, bool requeuing ) { 10f850: 55 push %ebp 10f851: 89 e5 mov %esp,%ebp 10f853: 57 push %edi 10f854: 56 push %esi 10f855: 53 push %ebx 10f856: 83 ec 1c sub $0x1c,%esp 10f859: 8b 5d 0c mov 0xc(%ebp),%ebx 10f85c: 8a 45 10 mov 0x10(%ebp),%al 10f85f: 88 45 e3 mov %al,-0x1d(%ebp) Chain_Node *new_first_node; Chain_Node *new_second_node; Chain_Node *last_node; the_node = (Chain_Node *) the_thread; _ISR_Disable( level ); 10f862: 9c pushf 10f863: fa cli 10f864: 8f 45 e4 popl -0x1c(%ebp) if ( !_States_Is_waiting_on_thread_queue( the_thread->current_state ) ) { 10f867: f7 43 10 e0 be 03 00 testl $0x3bee0,0x10(%ebx) 10f86e: 75 09 jne 10f879 <_Thread_queue_Extract_priority_helper+0x29> _ISR_Enable( level ); 10f870: ff 75 e4 pushl -0x1c(%ebp) 10f873: 9d popf return; 10f874: e9 82 00 00 00 jmp 10f8fb <_Thread_queue_Extract_priority_helper+0xab> /* * The thread was actually waiting on a thread queue so let's remove it. */ next_node = the_node->next; 10f879: 8b 13 mov (%ebx),%edx previous_node = the_node->previous; 10f87b: 8b 4b 04 mov 0x4(%ebx),%ecx */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 10f87e: 8b 43 38 mov 0x38(%ebx),%eax */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 10f881: 8d 73 3c lea 0x3c(%ebx),%esi if ( !_Chain_Is_empty( &the_thread->Wait.Block2n ) ) { 10f884: 39 f0 cmp %esi,%eax 10f886: 74 26 je 10f8ae <_Thread_queue_Extract_priority_helper+0x5e> new_first_node = the_thread->Wait.Block2n.first; new_first_thread = (Thread_Control *) new_first_node; last_node = the_thread->Wait.Block2n.last; 10f888: 8b 73 40 mov 0x40(%ebx),%esi new_second_node = new_first_node->next; 10f88b: 8b 38 mov (%eax),%edi previous_node->next = new_first_node; 10f88d: 89 01 mov %eax,(%ecx) next_node->previous = new_first_node; 10f88f: 89 42 04 mov %eax,0x4(%edx) new_first_node->next = next_node; 10f892: 89 10 mov %edx,(%eax) new_first_node->previous = previous_node; 10f894: 89 48 04 mov %ecx,0x4(%eax) if ( !_Chain_Has_only_one_node( &the_thread->Wait.Block2n ) ) { 10f897: 39 f0 cmp %esi,%eax 10f899: 74 18 je 10f8b3 <_Thread_queue_Extract_priority_helper+0x63> /* > two threads on 2-n */ new_second_node->previous = _Chain_Head( &new_first_thread->Wait.Block2n ); 10f89b: 8d 50 38 lea 0x38(%eax),%edx 10f89e: 89 57 04 mov %edx,0x4(%edi) new_first_thread->Wait.Block2n.first = new_second_node; 10f8a1: 89 78 38 mov %edi,0x38(%eax) new_first_thread->Wait.Block2n.last = last_node; 10f8a4: 89 70 40 mov %esi,0x40(%eax) 10f8a7: 83 c0 3c add $0x3c,%eax 10f8aa: 89 06 mov %eax,(%esi) 10f8ac: eb 05 jmp 10f8b3 <_Thread_queue_Extract_priority_helper+0x63> last_node->next = _Chain_Tail( &new_first_thread->Wait.Block2n ); } } else { previous_node->next = next_node; 10f8ae: 89 11 mov %edx,(%ecx) next_node->previous = previous_node; 10f8b0: 89 4a 04 mov %ecx,0x4(%edx) /* * If we are not supposed to touch timers or the thread's state, return. */ if ( requeuing ) { 10f8b3: 80 7d e3 00 cmpb $0x0,-0x1d(%ebp) 10f8b7: 74 06 je 10f8bf <_Thread_queue_Extract_priority_helper+0x6f> _ISR_Enable( level ); 10f8b9: ff 75 e4 pushl -0x1c(%ebp) 10f8bc: 9d popf 10f8bd: eb 3c jmp 10f8fb <_Thread_queue_Extract_priority_helper+0xab> return; } if ( !_Watchdog_Is_active( &the_thread->Timer ) ) { 10f8bf: 83 7b 50 02 cmpl $0x2,0x50(%ebx) 10f8c3: 74 06 je 10f8cb <_Thread_queue_Extract_priority_helper+0x7b><== NEVER TAKEN _ISR_Enable( level ); 10f8c5: ff 75 e4 pushl -0x1c(%ebp) 10f8c8: 9d popf 10f8c9: eb 1a jmp 10f8e5 <_Thread_queue_Extract_priority_helper+0x95> 10f8cb: c7 43 50 03 00 00 00 movl $0x3,0x50(%ebx) <== NOT EXECUTED } else { _Watchdog_Deactivate( &the_thread->Timer ); _ISR_Enable( level ); 10f8d2: ff 75 e4 pushl -0x1c(%ebp) <== NOT EXECUTED 10f8d5: 9d popf <== NOT EXECUTED (void) _Watchdog_Remove( &the_thread->Timer ); 10f8d6: 83 ec 0c sub $0xc,%esp <== NOT EXECUTED 10f8d9: 8d 43 48 lea 0x48(%ebx),%eax <== NOT EXECUTED 10f8dc: 50 push %eax <== NOT EXECUTED 10f8dd: e8 42 d5 ff ff call 10ce24 <_Watchdog_Remove> <== NOT EXECUTED 10f8e2: 83 c4 10 add $0x10,%esp <== NOT EXECUTED 10f8e5: c7 45 0c f8 ff 03 10 movl $0x1003fff8,0xc(%ebp) 10f8ec: 89 5d 08 mov %ebx,0x8(%ebp) #if defined(RTEMS_MULTIPROCESSING) if ( !_Objects_Is_local_id( the_thread->Object.id ) ) _Thread_MP_Free_proxy( the_thread ); #endif } 10f8ef: 8d 65 f4 lea -0xc(%ebp),%esp 10f8f2: 5b pop %ebx 10f8f3: 5e pop %esi 10f8f4: 5f pop %edi 10f8f5: c9 leave 10f8f6: e9 c9 c2 ff ff jmp 10bbc4 <_Thread_Clear_state> 10f8fb: 8d 65 f4 lea -0xc(%ebp),%esp 10f8fe: 5b pop %ebx 10f8ff: 5e pop %esi 10f900: 5f pop %edi 10f901: c9 leave 10f902: c3 ret =============================================================================== 0010c644 <_Thread_queue_Requeue>: void _Thread_queue_Requeue( Thread_queue_Control *the_thread_queue, Thread_Control *the_thread ) { 10c644: 55 push %ebp 10c645: 89 e5 mov %esp,%ebp 10c647: 57 push %edi 10c648: 56 push %esi 10c649: 53 push %ebx 10c64a: 83 ec 1c sub $0x1c,%esp 10c64d: 8b 75 08 mov 0x8(%ebp),%esi 10c650: 8b 7d 0c mov 0xc(%ebp),%edi /* * Just in case the thread really wasn't blocked on a thread queue * when we get here. */ if ( !the_thread_queue ) 10c653: 85 f6 test %esi,%esi 10c655: 74 36 je 10c68d <_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 ) { 10c657: 83 7e 34 01 cmpl $0x1,0x34(%esi) 10c65b: 75 30 jne 10c68d <_Thread_queue_Requeue+0x49><== NEVER TAKEN Thread_queue_Control *tq = the_thread_queue; ISR_Level level; ISR_Level level_ignored; _ISR_Disable( level ); 10c65d: 9c pushf 10c65e: fa cli 10c65f: 5b pop %ebx if ( _States_Is_waiting_on_thread_queue( the_thread->current_state ) ) { 10c660: f7 47 10 e0 be 03 00 testl $0x3bee0,0x10(%edi) 10c667: 74 22 je 10c68b <_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; 10c669: c7 46 30 01 00 00 00 movl $0x1,0x30(%esi) _Thread_queue_Enter_critical_section( tq ); _Thread_queue_Extract_priority_helper( tq, the_thread, true ); 10c670: 50 push %eax 10c671: 6a 01 push $0x1 10c673: 57 push %edi 10c674: 56 push %esi 10c675: e8 d6 31 00 00 call 10f850 <_Thread_queue_Extract_priority_helper> (void) _Thread_queue_Enqueue_priority( tq, the_thread, &level_ignored ); 10c67a: 83 c4 0c add $0xc,%esp 10c67d: 8d 45 e4 lea -0x1c(%ebp),%eax 10c680: 50 push %eax 10c681: 57 push %edi 10c682: 56 push %esi 10c683: e8 c4 fd ff ff call 10c44c <_Thread_queue_Enqueue_priority> 10c688: 83 c4 10 add $0x10,%esp } _ISR_Enable( level ); 10c68b: 53 push %ebx 10c68c: 9d popf } } 10c68d: 8d 65 f4 lea -0xc(%ebp),%esp 10c690: 5b pop %ebx 10c691: 5e pop %esi 10c692: 5f pop %edi 10c693: c9 leave 10c694: c3 ret =============================================================================== 0010c698 <_Thread_queue_Timeout>: void _Thread_queue_Timeout( Objects_Id id, void *ignored __attribute__((unused)) ) { 10c698: 55 push %ebp 10c699: 89 e5 mov %esp,%ebp 10c69b: 83 ec 20 sub $0x20,%esp Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); 10c69e: 8d 45 f4 lea -0xc(%ebp),%eax 10c6a1: 50 push %eax 10c6a2: ff 75 08 pushl 0x8(%ebp) 10c6a5: e8 ae f8 ff ff call 10bf58 <_Thread_Get> switch ( location ) { 10c6aa: 83 c4 10 add $0x10,%esp 10c6ad: 83 7d f4 00 cmpl $0x0,-0xc(%ebp) 10c6b1: 75 17 jne 10c6ca <_Thread_queue_Timeout+0x32><== NEVER TAKEN #if defined(RTEMS_MULTIPROCESSING) case OBJECTS_REMOTE: /* impossible */ #endif break; case OBJECTS_LOCAL: _Thread_queue_Process_timeout( the_thread ); 10c6b3: 83 ec 0c sub $0xc,%esp 10c6b6: 50 push %eax 10c6b7: e8 48 32 00 00 call 10f904 <_Thread_queue_Process_timeout> */ RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void ) { RTEMS_COMPILER_MEMORY_BARRIER(); _Thread_Dispatch_disable_level -= 1; 10c6bc: a1 e4 41 12 00 mov 0x1241e4,%eax 10c6c1: 48 dec %eax 10c6c2: a3 e4 41 12 00 mov %eax,0x1241e4 10c6c7: 83 c4 10 add $0x10,%esp _Thread_Unnest_dispatch(); break; } } 10c6ca: c9 leave 10c6cb: c3 ret =============================================================================== 00116a70 <_Timer_server_Body>: * @a arg points to the corresponding timer server control block. */ static rtems_task _Timer_server_Body( rtems_task_argument arg ) { 116a70: 55 push %ebp 116a71: 89 e5 mov %esp,%ebp 116a73: 57 push %edi 116a74: 56 push %esi 116a75: 53 push %ebx 116a76: 83 ec 4c sub $0x4c,%esp 116a79: 8b 5d 08 mov 0x8(%ebp),%ebx 116a7c: 8d 45 dc lea -0x24(%ebp),%eax 116a7f: 8d 55 e0 lea -0x20(%ebp),%edx 116a82: 89 55 b4 mov %edx,-0x4c(%ebp) */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 116a85: 89 55 dc mov %edx,-0x24(%ebp) the_chain->permanent_null = NULL; 116a88: c7 45 e0 00 00 00 00 movl $0x0,-0x20(%ebp) Timer_server_Control *ts = (Timer_server_Control *) arg; Chain_Control insert_chain; Chain_Control fire_chain; _Chain_Initialize_empty( &insert_chain ); 116a8f: 89 45 e4 mov %eax,-0x1c(%ebp) */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 116a92: 8d 7d d0 lea -0x30(%ebp),%edi 116a95: 8d 55 d4 lea -0x2c(%ebp),%edx 116a98: 89 55 b0 mov %edx,-0x50(%ebp) */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 116a9b: 89 55 d0 mov %edx,-0x30(%ebp) the_chain->permanent_null = NULL; 116a9e: c7 45 d4 00 00 00 00 movl $0x0,-0x2c(%ebp) the_chain->last = _Chain_Head(the_chain); 116aa5: 89 7d d8 mov %edi,-0x28(%ebp) */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; watchdogs->last_snapshot = snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 116aa8: 8d 43 30 lea 0x30(%ebx),%eax 116aab: 89 45 c0 mov %eax,-0x40(%ebp) /* * 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 ); 116aae: 8d 73 68 lea 0x68(%ebx),%esi static void _Timer_server_Stop_interval_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog ); 116ab1: 8d 53 08 lea 0x8(%ebx),%edx 116ab4: 89 55 bc mov %edx,-0x44(%ebp) { /* * Afterwards all timer inserts are directed to this chain and the interval * and TOD chains will be no more modified by other parties. */ ts->insert_chain = insert_chain; 116ab7: 8d 4d dc lea -0x24(%ebp),%ecx 116aba: 89 4b 78 mov %ecx,0x78(%ebx) static void _Timer_server_Process_interval_watchdogs( Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = _Watchdog_Ticks_since_boot; 116abd: a1 f0 e6 13 00 mov 0x13e6f0,%eax /* * We assume adequate unsigned arithmetic here. */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; 116ac2: 8b 53 3c mov 0x3c(%ebx),%edx watchdogs->last_snapshot = snapshot; 116ac5: 89 43 3c mov %eax,0x3c(%ebx) _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 116ac8: 51 push %ecx 116ac9: 8d 4d d0 lea -0x30(%ebp),%ecx 116acc: 51 push %ecx Watchdog_Interval snapshot = _Watchdog_Ticks_since_boot; /* * We assume adequate unsigned arithmetic here. */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; 116acd: 29 d0 sub %edx,%eax watchdogs->last_snapshot = snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 116acf: 50 push %eax 116ad0: ff 75 c0 pushl -0x40(%ebp) 116ad3: e8 88 39 00 00 call 11a460 <_Watchdog_Adjust_to_chain> static void _Timer_server_Process_tod_watchdogs( Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); 116ad8: a1 44 e6 13 00 mov 0x13e644,%eax 116add: 89 45 c4 mov %eax,-0x3c(%ebp) Watchdog_Interval last_snapshot = watchdogs->last_snapshot; 116ae0: 8b 43 74 mov 0x74(%ebx),%eax /* * Process the seconds chain. Start by checking that the Time * of Day (TOD) has not been set backwards. If it has then * we want to adjust the watchdogs->Chain to indicate this. */ if ( snapshot > last_snapshot ) { 116ae3: 83 c4 10 add $0x10,%esp 116ae6: 39 45 c4 cmp %eax,-0x3c(%ebp) 116ae9: 76 13 jbe 116afe <_Timer_server_Body+0x8e> /* * 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 ); 116aeb: 52 push %edx 116aec: 8d 55 d0 lea -0x30(%ebp),%edx 116aef: 52 push %edx if ( snapshot > last_snapshot ) { /* * This path is for normal forward movement and cases where the * TOD has been set forward. */ delta = snapshot - last_snapshot; 116af0: 8b 4d c4 mov -0x3c(%ebp),%ecx 116af3: 29 c1 sub %eax,%ecx _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 116af5: 51 push %ecx 116af6: 56 push %esi 116af7: e8 64 39 00 00 call 11a460 <_Watchdog_Adjust_to_chain> 116afc: eb 0f jmp 116b0d <_Timer_server_Body+0x9d> } else if ( snapshot < last_snapshot ) { 116afe: 73 10 jae 116b10 <_Timer_server_Body+0xa0> /* * 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 ); 116b00: 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; 116b01: 2b 45 c4 sub -0x3c(%ebp),%eax _Watchdog_Adjust( &watchdogs->Chain, WATCHDOG_BACKWARD, delta ); 116b04: 50 push %eax 116b05: 6a 01 push $0x1 116b07: 56 push %esi 116b08: e8 e7 38 00 00 call 11a3f4 <_Watchdog_Adjust> 116b0d: 83 c4 10 add $0x10,%esp } watchdogs->last_snapshot = snapshot; 116b10: 8b 45 c4 mov -0x3c(%ebp),%eax 116b13: 89 43 74 mov %eax,0x74(%ebx) } static void _Timer_server_Process_insertions( Timer_server_Control *ts ) { while ( true ) { Timer_Control *timer = (Timer_Control *) _Chain_Get( ts->insert_chain ); 116b16: 8b 43 78 mov 0x78(%ebx),%eax 116b19: 83 ec 0c sub $0xc,%esp 116b1c: 50 push %eax 116b1d: e8 da 08 00 00 call 1173fc <_Chain_Get> if ( timer == NULL ) { 116b22: 83 c4 10 add $0x10,%esp 116b25: 85 c0 test %eax,%eax 116b27: 74 29 je 116b52 <_Timer_server_Body+0xe2><== ALWAYS TAKEN static void _Timer_server_Insert_timer( Timer_server_Control *ts, Timer_Control *timer ) { if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { 116b29: 8b 50 38 mov 0x38(%eax),%edx <== NOT EXECUTED 116b2c: 83 fa 01 cmp $0x1,%edx <== NOT EXECUTED 116b2f: 75 0b jne 116b3c <_Timer_server_Body+0xcc><== NOT EXECUTED _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); 116b31: 52 push %edx <== NOT EXECUTED 116b32: 52 push %edx <== NOT EXECUTED 116b33: 83 c0 10 add $0x10,%eax <== NOT EXECUTED 116b36: 50 push %eax <== NOT EXECUTED 116b37: ff 75 c0 pushl -0x40(%ebp) <== NOT EXECUTED 116b3a: eb 0c jmp 116b48 <_Timer_server_Body+0xd8><== NOT EXECUTED } else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) { 116b3c: 83 fa 03 cmp $0x3,%edx <== NOT EXECUTED 116b3f: 75 d5 jne 116b16 <_Timer_server_Body+0xa6><== NOT EXECUTED _Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker ); 116b41: 51 push %ecx <== NOT EXECUTED 116b42: 51 push %ecx <== NOT EXECUTED 116b43: 83 c0 10 add $0x10,%eax <== NOT EXECUTED 116b46: 50 push %eax <== NOT EXECUTED 116b47: 56 push %esi <== NOT EXECUTED 116b48: e8 9b 39 00 00 call 11a4e8 <_Watchdog_Insert> <== NOT EXECUTED 116b4d: 83 c4 10 add $0x10,%esp <== NOT EXECUTED 116b50: eb c4 jmp 116b16 <_Timer_server_Body+0xa6><== 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 ); 116b52: 9c pushf 116b53: fa cli 116b54: 58 pop %eax if ( _Chain_Is_empty( insert_chain ) ) { 116b55: 8b 55 b4 mov -0x4c(%ebp),%edx 116b58: 39 55 dc cmp %edx,-0x24(%ebp) 116b5b: 75 13 jne 116b70 <_Timer_server_Body+0x100><== NEVER TAKEN ts->insert_chain = NULL; 116b5d: c7 43 78 00 00 00 00 movl $0x0,0x78(%ebx) _ISR_Enable( level ); 116b64: 50 push %eax 116b65: 9d popf _Chain_Initialize_empty( &fire_chain ); while ( true ) { _Timer_server_Get_watchdogs_that_fire_now( ts, &insert_chain, &fire_chain ); if ( !_Chain_Is_empty( &fire_chain ) ) { 116b66: 8b 4d b0 mov -0x50(%ebp),%ecx 116b69: 39 4d d0 cmp %ecx,-0x30(%ebp) 116b6c: 75 09 jne 116b77 <_Timer_server_Body+0x107> 116b6e: eb 3e jmp 116bae <_Timer_server_Body+0x13e> ts->insert_chain = NULL; _ISR_Enable( level ); break; } else { _ISR_Enable( level ); 116b70: 50 push %eax <== NOT EXECUTED 116b71: 9d popf <== NOT EXECUTED 116b72: e9 46 ff ff ff jmp 116abd <_Timer_server_Body+0x4d><== 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 ); 116b77: 9c pushf 116b78: fa cli 116b79: 5a pop %edx */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 116b7a: 8b 45 d0 mov -0x30(%ebp),%eax */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected( Chain_Control *the_chain ) { if ( !_Chain_Is_empty(the_chain)) 116b7d: 3b 45 b0 cmp -0x50(%ebp),%eax 116b80: 74 25 je 116ba7 <_Timer_server_Body+0x137> { Chain_Node *return_node; Chain_Node *new_first; return_node = the_chain->first; new_first = return_node->next; 116b82: 8b 08 mov (%eax),%ecx the_chain->first = new_first; 116b84: 89 4d d0 mov %ecx,-0x30(%ebp) new_first->previous = _Chain_Head(the_chain); 116b87: 89 79 04 mov %edi,0x4(%ecx) watchdog = (Watchdog_Control *) _Chain_Get_unprotected( &fire_chain ); if ( watchdog != NULL ) { 116b8a: 85 c0 test %eax,%eax 116b8c: 74 19 je 116ba7 <_Timer_server_Body+0x137><== NEVER TAKEN watchdog->state = WATCHDOG_INACTIVE; 116b8e: c7 40 08 00 00 00 00 movl $0x0,0x8(%eax) _ISR_Enable( level ); 116b95: 52 push %edx 116b96: 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 ); 116b97: 52 push %edx 116b98: 52 push %edx 116b99: ff 70 24 pushl 0x24(%eax) 116b9c: ff 70 20 pushl 0x20(%eax) 116b9f: ff 50 1c call *0x1c(%eax) } 116ba2: 83 c4 10 add $0x10,%esp 116ba5: eb d0 jmp 116b77 <_Timer_server_Body+0x107> watchdog = (Watchdog_Control *) _Chain_Get_unprotected( &fire_chain ); if ( watchdog != NULL ) { watchdog->state = WATCHDOG_INACTIVE; _ISR_Enable( level ); } else { _ISR_Enable( level ); 116ba7: 52 push %edx 116ba8: 9d popf 116ba9: e9 09 ff ff ff jmp 116ab7 <_Timer_server_Body+0x47> * the active flag of the timer server is true. */ (*watchdog->routine)( watchdog->id, watchdog->user_data ); } } else { ts->active = false; 116bae: c6 43 7c 00 movb $0x0,0x7c(%ebx) /* * Block until there is something to do. */ _Thread_Disable_dispatch(); 116bb2: e8 1d fe ff ff call 1169d4 <_Thread_Disable_dispatch> _Thread_Set_state( ts->thread, STATES_DELAYING ); 116bb7: 50 push %eax 116bb8: 50 push %eax 116bb9: 6a 08 push $0x8 116bbb: ff 33 pushl (%ebx) 116bbd: e8 06 31 00 00 call 119cc8 <_Thread_Set_state> _Timer_server_Reset_interval_system_watchdog( ts ); 116bc2: 89 d8 mov %ebx,%eax 116bc4: e8 1b fe ff ff call 1169e4 <_Timer_server_Reset_interval_system_watchdog> _Timer_server_Reset_tod_system_watchdog( ts ); 116bc9: 89 d8 mov %ebx,%eax 116bcb: e8 5a fe ff ff call 116a2a <_Timer_server_Reset_tod_system_watchdog> _Thread_Enable_dispatch(); 116bd0: e8 e9 27 00 00 call 1193be <_Thread_Enable_dispatch> ts->active = true; 116bd5: 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 ); 116bd9: 59 pop %ecx 116bda: ff 75 bc pushl -0x44(%ebp) 116bdd: e8 1e 3a 00 00 call 11a600 <_Watchdog_Remove> static void _Timer_server_Stop_tod_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->TOD_watchdogs.System_watchdog ); 116be2: 8d 43 40 lea 0x40(%ebx),%eax 116be5: 89 04 24 mov %eax,(%esp) 116be8: e8 13 3a 00 00 call 11a600 <_Watchdog_Remove> 116bed: 83 c4 10 add $0x10,%esp 116bf0: e9 c2 fe ff ff jmp 116ab7 <_Timer_server_Body+0x47> =============================================================================== 00116bf5 <_Timer_server_Schedule_operation_method>: static void _Timer_server_Schedule_operation_method( Timer_server_Control *ts, Timer_Control *timer ) { 116bf5: 55 push %ebp 116bf6: 89 e5 mov %esp,%ebp 116bf8: 57 push %edi 116bf9: 56 push %esi 116bfa: 53 push %ebx 116bfb: 83 ec 2c sub $0x2c,%esp 116bfe: 8b 5d 08 mov 0x8(%ebp),%ebx 116c01: 8b 75 0c mov 0xc(%ebp),%esi if ( ts->insert_chain == NULL ) { 116c04: 8b 43 78 mov 0x78(%ebx),%eax 116c07: 85 c0 test %eax,%eax 116c09: 0f 85 de 00 00 00 jne 116ced <_Timer_server_Schedule_operation_method+0xf8><== NEVER TAKEN * is the reference point for the delta chain. Thus if we do not update the * reference point we have to add DT to the initial delta of the watchdog * being inserted. This could result in an integer overflow. */ _Thread_Disable_dispatch(); 116c0f: e8 c0 fd ff ff call 1169d4 <_Thread_Disable_dispatch> if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { 116c14: 8b 46 38 mov 0x38(%esi),%eax 116c17: 83 f8 01 cmp $0x1,%eax 116c1a: 75 5a jne 116c76 <_Timer_server_Schedule_operation_method+0x81> /* * We have to advance the last known ticks value of the server and update * the watchdog chain accordingly. */ _ISR_Disable( level ); 116c1c: 9c pushf 116c1d: fa cli 116c1e: 8f 45 e0 popl -0x20(%ebp) snapshot = _Watchdog_Ticks_since_boot; 116c21: 8b 15 f0 e6 13 00 mov 0x13e6f0,%edx last_snapshot = ts->Interval_watchdogs.last_snapshot; 116c27: 8b 4b 3c mov 0x3c(%ebx),%ecx */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 116c2a: 8b 43 30 mov 0x30(%ebx),%eax */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 116c2d: 8d 7b 34 lea 0x34(%ebx),%edi if ( !_Chain_Is_empty( &ts->Interval_watchdogs.Chain ) ) { 116c30: 39 f8 cmp %edi,%eax 116c32: 74 19 je 116c4d <_Timer_server_Schedule_operation_method+0x58> first_watchdog = _Watchdog_First( &ts->Interval_watchdogs.Chain ); /* * We assume adequate unsigned arithmetic here. */ delta = snapshot - last_snapshot; 116c34: 89 d7 mov %edx,%edi 116c36: 29 cf sub %ecx,%edi 116c38: 89 7d e4 mov %edi,-0x1c(%ebp) delta_interval = first_watchdog->delta_interval; 116c3b: 8b 78 10 mov 0x10(%eax),%edi if (delta_interval > delta) { delta_interval -= delta; } else { delta_interval = 0; 116c3e: 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) { 116c40: 3b 7d e4 cmp -0x1c(%ebp),%edi 116c43: 76 05 jbe 116c4a <_Timer_server_Schedule_operation_method+0x55> delta_interval -= delta; 116c45: 89 f9 mov %edi,%ecx 116c47: 2b 4d e4 sub -0x1c(%ebp),%ecx } else { delta_interval = 0; } first_watchdog->delta_interval = delta_interval; 116c4a: 89 48 10 mov %ecx,0x10(%eax) } ts->Interval_watchdogs.last_snapshot = snapshot; 116c4d: 89 53 3c mov %edx,0x3c(%ebx) _ISR_Enable( level ); 116c50: ff 75 e0 pushl -0x20(%ebp) 116c53: 9d popf _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); 116c54: 50 push %eax 116c55: 50 push %eax 116c56: 83 c6 10 add $0x10,%esi 116c59: 56 push %esi 116c5a: 8d 43 30 lea 0x30(%ebx),%eax 116c5d: 50 push %eax 116c5e: e8 85 38 00 00 call 11a4e8 <_Watchdog_Insert> if ( !ts->active ) { 116c63: 8a 43 7c mov 0x7c(%ebx),%al 116c66: 83 c4 10 add $0x10,%esp 116c69: 84 c0 test %al,%al 116c6b: 75 74 jne 116ce1 <_Timer_server_Schedule_operation_method+0xec> _Timer_server_Reset_interval_system_watchdog( ts ); 116c6d: 89 d8 mov %ebx,%eax 116c6f: e8 70 fd ff ff call 1169e4 <_Timer_server_Reset_interval_system_watchdog> 116c74: eb 6b jmp 116ce1 <_Timer_server_Schedule_operation_method+0xec> } } else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) { 116c76: 83 f8 03 cmp $0x3,%eax 116c79: 75 66 jne 116ce1 <_Timer_server_Schedule_operation_method+0xec> /* * We have to advance the last known seconds value of the server and update * the watchdog chain accordingly. */ _ISR_Disable( level ); 116c7b: 9c pushf 116c7c: fa cli 116c7d: 8f 45 e0 popl -0x20(%ebp) snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); 116c80: 8b 15 44 e6 13 00 mov 0x13e644,%edx last_snapshot = ts->TOD_watchdogs.last_snapshot; 116c86: 8b 43 74 mov 0x74(%ebx),%eax */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 116c89: 8b 4b 68 mov 0x68(%ebx),%ecx */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 116c8c: 8d 7b 6c lea 0x6c(%ebx),%edi if ( !_Chain_Is_empty( &ts->TOD_watchdogs.Chain ) ) { 116c8f: 39 f9 cmp %edi,%ecx 116c91: 74 27 je 116cba <_Timer_server_Schedule_operation_method+0xc5> first_watchdog = _Watchdog_First( &ts->TOD_watchdogs.Chain ); delta_interval = first_watchdog->delta_interval; 116c93: 8b 79 10 mov 0x10(%ecx),%edi 116c96: 89 7d d4 mov %edi,-0x2c(%ebp) if ( snapshot > last_snapshot ) { 116c99: 39 c2 cmp %eax,%edx 116c9b: 76 15 jbe 116cb2 <_Timer_server_Schedule_operation_method+0xbd> /* * We advanced in time. */ delta = snapshot - last_snapshot; 116c9d: 89 d7 mov %edx,%edi 116c9f: 29 c7 sub %eax,%edi 116ca1: 89 7d e4 mov %edi,-0x1c(%ebp) if (delta_interval > delta) { delta_interval -= delta; } else { delta_interval = 0; 116ca4: 31 c0 xor %eax,%eax if ( snapshot > last_snapshot ) { /* * We advanced in time. */ delta = snapshot - last_snapshot; if (delta_interval > delta) { 116ca6: 39 7d d4 cmp %edi,-0x2c(%ebp) 116ca9: 76 0c jbe 116cb7 <_Timer_server_Schedule_operation_method+0xc2><== NEVER TAKEN delta_interval -= delta; 116cab: 8b 45 d4 mov -0x2c(%ebp),%eax 116cae: 29 f8 sub %edi,%eax 116cb0: eb 05 jmp 116cb7 <_Timer_server_Schedule_operation_method+0xc2> } } else { /* * Someone put us in the past. */ delta = last_snapshot - snapshot; 116cb2: 03 45 d4 add -0x2c(%ebp),%eax delta_interval += delta; 116cb5: 29 d0 sub %edx,%eax } first_watchdog->delta_interval = delta_interval; 116cb7: 89 41 10 mov %eax,0x10(%ecx) } ts->TOD_watchdogs.last_snapshot = snapshot; 116cba: 89 53 74 mov %edx,0x74(%ebx) _ISR_Enable( level ); 116cbd: ff 75 e0 pushl -0x20(%ebp) 116cc0: 9d popf _Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker ); 116cc1: 57 push %edi 116cc2: 57 push %edi 116cc3: 83 c6 10 add $0x10,%esi 116cc6: 56 push %esi 116cc7: 8d 43 68 lea 0x68(%ebx),%eax 116cca: 50 push %eax 116ccb: e8 18 38 00 00 call 11a4e8 <_Watchdog_Insert> if ( !ts->active ) { 116cd0: 8a 43 7c mov 0x7c(%ebx),%al 116cd3: 83 c4 10 add $0x10,%esp 116cd6: 84 c0 test %al,%al 116cd8: 75 07 jne 116ce1 <_Timer_server_Schedule_operation_method+0xec> _Timer_server_Reset_tod_system_watchdog( ts ); 116cda: 89 d8 mov %ebx,%eax 116cdc: e8 49 fd ff ff call 116a2a <_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 ); } } 116ce1: 8d 65 f4 lea -0xc(%ebp),%esp 116ce4: 5b pop %ebx 116ce5: 5e pop %esi 116ce6: 5f pop %edi 116ce7: c9 leave if ( !ts->active ) { _Timer_server_Reset_tod_system_watchdog( ts ); } } _Thread_Enable_dispatch(); 116ce8: e9 d1 26 00 00 jmp 1193be <_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 ); 116ced: 8b 43 78 mov 0x78(%ebx),%eax <== NOT EXECUTED 116cf0: 89 75 0c mov %esi,0xc(%ebp) <== NOT EXECUTED 116cf3: 89 45 08 mov %eax,0x8(%ebp) <== NOT EXECUTED } } 116cf6: 8d 65 f4 lea -0xc(%ebp),%esp <== NOT EXECUTED 116cf9: 5b pop %ebx <== NOT EXECUTED 116cfa: 5e pop %esi <== NOT EXECUTED 116cfb: 5f pop %edi <== NOT EXECUTED 116cfc: c9 leave <== NOT EXECUTED * server is not preemptible, so we must be in interrupt context here. No * thread dispatch will happen until the timer server finishes its * critical section. We have to use the protected chain methods because * we may be interrupted by a higher priority interrupt. */ _Chain_Append( ts->insert_chain, &timer->Object.Node ); 116cfd: e9 be 06 00 00 jmp 1173c0 <_Chain_Append> <== NOT EXECUTED =============================================================================== 0010cbeb <_User_extensions_Fatal>: void _User_extensions_Fatal ( Internal_errors_Source the_source, bool is_internal, Internal_errors_t the_error ) { 10cbeb: 55 push %ebp 10cbec: 89 e5 mov %esp,%ebp 10cbee: 57 push %edi 10cbef: 56 push %esi 10cbf0: 53 push %ebx 10cbf1: 83 ec 0c sub $0xc,%esp 10cbf4: 8b 7d 10 mov 0x10(%ebp),%edi Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _User_extensions_List.last ; 10cbf7: 8b 1d e0 43 12 00 mov 0x1243e0,%ebx the_node = the_node->previous ) { the_extension = (User_extensions_Control *) the_node; if ( the_extension->Callouts.fatal != NULL ) (*the_extension->Callouts.fatal)( the_source, is_internal, the_error ); 10cbfd: 0f b6 75 0c movzbl 0xc(%ebp),%esi ) { Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _User_extensions_List.last ; 10cc01: eb 15 jmp 10cc18 <_User_extensions_Fatal+0x2d> !_Chain_Is_head( &_User_extensions_List, the_node ) ; the_node = the_node->previous ) { the_extension = (User_extensions_Control *) the_node; if ( the_extension->Callouts.fatal != NULL ) 10cc03: 8b 43 30 mov 0x30(%ebx),%eax 10cc06: 85 c0 test %eax,%eax 10cc08: 74 0b je 10cc15 <_User_extensions_Fatal+0x2a> (*the_extension->Callouts.fatal)( the_source, is_internal, the_error ); 10cc0a: 52 push %edx 10cc0b: 57 push %edi 10cc0c: 56 push %esi 10cc0d: ff 75 08 pushl 0x8(%ebp) 10cc10: ff d0 call *%eax 10cc12: 83 c4 10 add $0x10,%esp <== NOT EXECUTED Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _User_extensions_List.last ; !_Chain_Is_head( &_User_extensions_List, the_node ) ; the_node = the_node->previous ) { 10cc15: 8b 5b 04 mov 0x4(%ebx),%ebx ) { Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _User_extensions_List.last ; 10cc18: 81 fb d8 43 12 00 cmp $0x1243d8,%ebx 10cc1e: 75 e3 jne 10cc03 <_User_extensions_Fatal+0x18> the_extension = (User_extensions_Control *) the_node; if ( the_extension->Callouts.fatal != NULL ) (*the_extension->Callouts.fatal)( the_source, is_internal, the_error ); } } 10cc20: 8d 65 f4 lea -0xc(%ebp),%esp 10cc23: 5b pop %ebx 10cc24: 5e pop %esi 10cc25: 5f pop %edi 10cc26: c9 leave 10cc27: c3 ret =============================================================================== 0010cad4 <_User_extensions_Handler_initialization>: #include #include #include void _User_extensions_Handler_initialization(void) { 10cad4: 55 push %ebp 10cad5: 89 e5 mov %esp,%ebp 10cad7: 57 push %edi 10cad8: 56 push %esi 10cad9: 53 push %ebx 10cada: 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; 10cadd: a1 30 02 12 00 mov 0x120230,%eax 10cae2: 89 45 e4 mov %eax,-0x1c(%ebp) initial_extensions = Configuration.User_extension_table; 10cae5: 8b 35 34 02 12 00 mov 0x120234,%esi */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 10caeb: c7 05 d8 43 12 00 dc movl $0x1243dc,0x1243d8 10caf2: 43 12 00 the_chain->permanent_null = NULL; 10caf5: c7 05 dc 43 12 00 00 movl $0x0,0x1243dc 10cafc: 00 00 00 the_chain->last = _Chain_Head(the_chain); 10caff: c7 05 e0 43 12 00 d8 movl $0x1243d8,0x1243e0 10cb06: 43 12 00 */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 10cb09: c7 05 e8 41 12 00 ec movl $0x1241ec,0x1241e8 10cb10: 41 12 00 the_chain->permanent_null = NULL; 10cb13: c7 05 ec 41 12 00 00 movl $0x0,0x1241ec 10cb1a: 00 00 00 the_chain->last = _Chain_Head(the_chain); 10cb1d: c7 05 f0 41 12 00 e8 movl $0x1241e8,0x1241f0 10cb24: 41 12 00 _Chain_Initialize_empty( &_User_extensions_List ); _Chain_Initialize_empty( &_User_extensions_Switches_list ); if ( initial_extensions ) { 10cb27: 85 f6 test %esi,%esi 10cb29: 74 53 je 10cb7e <_User_extensions_Handler_initialization+0xaa><== NEVER TAKEN extension = (User_extensions_Control *) _Workspace_Allocate_or_fatal_error( 10cb2b: 6b c8 34 imul $0x34,%eax,%ecx 10cb2e: 83 ec 0c sub $0xc,%esp 10cb31: 51 push %ecx 10cb32: 89 4d e0 mov %ecx,-0x20(%ebp) 10cb35: e8 32 04 00 00 call 10cf6c <_Workspace_Allocate_or_fatal_error> 10cb3a: 89 c3 mov %eax,%ebx number_of_extensions * sizeof( User_extensions_Control ) ); memset ( 10cb3c: 31 c0 xor %eax,%eax 10cb3e: 8b 4d e0 mov -0x20(%ebp),%ecx 10cb41: 89 df mov %ebx,%edi 10cb43: f3 aa rep stos %al,%es:(%edi) 10cb45: 89 f0 mov %esi,%eax extension, 0, number_of_extensions * sizeof( User_extensions_Control ) ); for ( i = 0 ; i < number_of_extensions ; i++ ) { 10cb47: 83 c4 10 add $0x10,%esp 10cb4a: 31 d2 xor %edx,%edx 10cb4c: eb 2b jmp 10cb79 <_User_extensions_Handler_initialization+0xa5> RTEMS_INLINE_ROUTINE void _User_extensions_Add_set_with_table( User_extensions_Control *extension, const User_extensions_Table *extension_table ) { extension->Callouts = *extension_table; 10cb4e: 8d 7b 14 lea 0x14(%ebx),%edi 10cb51: 89 c6 mov %eax,%esi 10cb53: b9 08 00 00 00 mov $0x8,%ecx 10cb58: f3 a5 rep movsl %ds:(%esi),%es:(%edi) _User_extensions_Add_set( extension ); 10cb5a: 83 ec 0c sub $0xc,%esp 10cb5d: 53 push %ebx 10cb5e: 89 45 dc mov %eax,-0x24(%ebp) 10cb61: 89 55 e0 mov %edx,-0x20(%ebp) 10cb64: e8 97 2f 00 00 call 10fb00 <_User_extensions_Add_set> _User_extensions_Add_set_with_table (extension, &initial_extensions[i]); extension++; 10cb69: 83 c3 34 add $0x34,%ebx extension, 0, number_of_extensions * sizeof( User_extensions_Control ) ); for ( i = 0 ; i < number_of_extensions ; i++ ) { 10cb6c: 8b 55 e0 mov -0x20(%ebp),%edx 10cb6f: 42 inc %edx 10cb70: 8b 45 dc mov -0x24(%ebp),%eax 10cb73: 83 c0 20 add $0x20,%eax 10cb76: 83 c4 10 add $0x10,%esp 10cb79: 3b 55 e4 cmp -0x1c(%ebp),%edx 10cb7c: 72 d0 jb 10cb4e <_User_extensions_Handler_initialization+0x7a> _User_extensions_Add_set_with_table (extension, &initial_extensions[i]); extension++; } } } 10cb7e: 8d 65 f4 lea -0xc(%ebp),%esp 10cb81: 5b pop %ebx 10cb82: 5e pop %esi 10cb83: 5f pop %edi 10cb84: c9 leave 10cb85: c3 ret =============================================================================== 0010e520 <_Watchdog_Adjust>: void _Watchdog_Adjust( Chain_Control *header, Watchdog_Adjust_directions direction, Watchdog_Interval units ) { 10e520: 55 push %ebp 10e521: 89 e5 mov %esp,%ebp 10e523: 57 push %edi 10e524: 56 push %esi 10e525: 53 push %ebx 10e526: 83 ec 1c sub $0x1c,%esp 10e529: 8b 75 08 mov 0x8(%ebp),%esi 10e52c: 8b 7d 0c mov 0xc(%ebp),%edi 10e52f: 8b 5d 10 mov 0x10(%ebp),%ebx ISR_Level level; _ISR_Disable( level ); 10e532: 9c pushf 10e533: fa cli 10e534: 58 pop %eax */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 10e535: 8b 16 mov (%esi),%edx */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 10e537: 8d 4e 04 lea 0x4(%esi),%ecx * hence the compiler must not assume *header to remain * unmodified across that call. * * Till Straumann, 7/2003 */ if ( !_Chain_Is_empty( header ) ) { 10e53a: 39 ca cmp %ecx,%edx 10e53c: 74 44 je 10e582 <_Watchdog_Adjust+0x62> switch ( direction ) { 10e53e: 85 ff test %edi,%edi 10e540: 74 3c je 10e57e <_Watchdog_Adjust+0x5e> 10e542: 4f dec %edi 10e543: 75 3d jne 10e582 <_Watchdog_Adjust+0x62> <== NEVER TAKEN case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; 10e545: 01 5a 10 add %ebx,0x10(%edx) break; 10e548: eb 38 jmp 10e582 <_Watchdog_Adjust+0x62> RTEMS_INLINE_ROUTINE Watchdog_Control *_Watchdog_First( Chain_Control *header ) { return ( (Watchdog_Control *) header->first ); 10e54a: 8b 16 mov (%esi),%edx case WATCHDOG_FORWARD: while ( units ) { if ( units < _Watchdog_First( header )->delta_interval ) { 10e54c: 8b 7a 10 mov 0x10(%edx),%edi 10e54f: 39 fb cmp %edi,%ebx 10e551: 73 07 jae 10e55a <_Watchdog_Adjust+0x3a> _Watchdog_First( header )->delta_interval -= units; 10e553: 29 df sub %ebx,%edi 10e555: 89 7a 10 mov %edi,0x10(%edx) break; 10e558: eb 28 jmp 10e582 <_Watchdog_Adjust+0x62> } else { units -= _Watchdog_First( header )->delta_interval; _Watchdog_First( header )->delta_interval = 1; 10e55a: c7 42 10 01 00 00 00 movl $0x1,0x10(%edx) _ISR_Enable( level ); 10e561: 50 push %eax 10e562: 9d popf _Watchdog_Tickle( header ); 10e563: 83 ec 0c sub $0xc,%esp 10e566: 56 push %esi 10e567: 89 4d e4 mov %ecx,-0x1c(%ebp) 10e56a: e8 9d 01 00 00 call 10e70c <_Watchdog_Tickle> _ISR_Disable( level ); 10e56f: 9c pushf 10e570: fa cli 10e571: 58 pop %eax if ( _Chain_Is_empty( header ) ) 10e572: 83 c4 10 add $0x10,%esp 10e575: 8b 4d e4 mov -0x1c(%ebp),%ecx 10e578: 39 0e cmp %ecx,(%esi) 10e57a: 74 06 je 10e582 <_Watchdog_Adjust+0x62> while ( units ) { if ( units < _Watchdog_First( header )->delta_interval ) { _Watchdog_First( header )->delta_interval -= units; break; } else { units -= _Watchdog_First( header )->delta_interval; 10e57c: 29 fb sub %edi,%ebx switch ( direction ) { case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; break; case WATCHDOG_FORWARD: while ( units ) { 10e57e: 85 db test %ebx,%ebx 10e580: 75 c8 jne 10e54a <_Watchdog_Adjust+0x2a> <== ALWAYS TAKEN } break; } } _ISR_Enable( level ); 10e582: 50 push %eax 10e583: 9d popf } 10e584: 8d 65 f4 lea -0xc(%ebp),%esp 10e587: 5b pop %ebx 10e588: 5e pop %esi 10e589: 5f pop %edi 10e58a: c9 leave 10e58b: c3 ret =============================================================================== 0010ce24 <_Watchdog_Remove>: */ Watchdog_States _Watchdog_Remove( Watchdog_Control *the_watchdog ) { 10ce24: 55 push %ebp 10ce25: 89 e5 mov %esp,%ebp 10ce27: 56 push %esi 10ce28: 53 push %ebx 10ce29: 8b 55 08 mov 0x8(%ebp),%edx ISR_Level level; Watchdog_States previous_state; Watchdog_Control *next_watchdog; _ISR_Disable( level ); 10ce2c: 9c pushf 10ce2d: fa cli 10ce2e: 5e pop %esi previous_state = the_watchdog->state; 10ce2f: 8b 42 08 mov 0x8(%edx),%eax switch ( previous_state ) { 10ce32: 83 f8 01 cmp $0x1,%eax 10ce35: 74 09 je 10ce40 <_Watchdog_Remove+0x1c> 10ce37: 72 42 jb 10ce7b <_Watchdog_Remove+0x57> 10ce39: 83 f8 03 cmp $0x3,%eax 10ce3c: 77 3d ja 10ce7b <_Watchdog_Remove+0x57> <== NEVER TAKEN 10ce3e: eb 09 jmp 10ce49 <_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; 10ce40: c7 42 08 00 00 00 00 movl $0x0,0x8(%edx) break; 10ce47: eb 32 jmp 10ce7b <_Watchdog_Remove+0x57> case WATCHDOG_ACTIVE: case WATCHDOG_REMOVE_IT: the_watchdog->state = WATCHDOG_INACTIVE; 10ce49: 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 ); } 10ce50: 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) ) 10ce52: 83 39 00 cmpl $0x0,(%ecx) 10ce55: 74 06 je 10ce5d <_Watchdog_Remove+0x39> next_watchdog->delta_interval += the_watchdog->delta_interval; 10ce57: 8b 5a 10 mov 0x10(%edx),%ebx 10ce5a: 01 59 10 add %ebx,0x10(%ecx) if ( _Watchdog_Sync_count ) 10ce5d: 8b 1d 18 43 12 00 mov 0x124318,%ebx 10ce63: 85 db test %ebx,%ebx 10ce65: 74 0c je 10ce73 <_Watchdog_Remove+0x4f> _Watchdog_Sync_level = _ISR_Nest_level; 10ce67: 8b 1d 30 47 12 00 mov 0x124730,%ebx 10ce6d: 89 1d 90 42 12 00 mov %ebx,0x124290 { Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; 10ce73: 8b 5a 04 mov 0x4(%edx),%ebx next->previous = previous; 10ce76: 89 59 04 mov %ebx,0x4(%ecx) previous->next = next; 10ce79: 89 0b mov %ecx,(%ebx) _Chain_Extract_unprotected( &the_watchdog->Node ); break; } the_watchdog->stop_time = _Watchdog_Ticks_since_boot; 10ce7b: 8b 0d 1c 43 12 00 mov 0x12431c,%ecx 10ce81: 89 4a 18 mov %ecx,0x18(%edx) _ISR_Enable( level ); 10ce84: 56 push %esi 10ce85: 9d popf return( previous_state ); } 10ce86: 5b pop %ebx 10ce87: 5e pop %esi 10ce88: c9 leave 10ce89: c3 ret =============================================================================== 0010e094 <_Watchdog_Report_chain>: void _Watchdog_Report_chain( const char *name, Chain_Control *header ) { 10e094: 55 push %ebp 10e095: 89 e5 mov %esp,%ebp 10e097: 57 push %edi 10e098: 56 push %esi 10e099: 53 push %ebx 10e09a: 83 ec 20 sub $0x20,%esp 10e09d: 8b 7d 08 mov 0x8(%ebp),%edi 10e0a0: 8b 75 0c mov 0xc(%ebp),%esi ISR_Level level; Chain_Node *node; _ISR_Disable( level ); 10e0a3: 9c pushf 10e0a4: fa cli 10e0a5: 8f 45 e4 popl -0x1c(%ebp) printk( "Watchdog Chain: %s %p\n", name, header ); 10e0a8: 56 push %esi 10e0a9: 57 push %edi 10e0aa: 68 84 11 12 00 push $0x121184 10e0af: e8 d8 a9 ff ff call 108a8c */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 10e0b4: 8b 1e mov (%esi),%ebx */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 10e0b6: 83 c6 04 add $0x4,%esi if ( !_Chain_Is_empty( header ) ) { 10e0b9: 83 c4 10 add $0x10,%esp 10e0bc: 39 f3 cmp %esi,%ebx 10e0be: 74 1d je 10e0dd <_Watchdog_Report_chain+0x49> node != _Chain_Tail(header) ; node = node->next ) { Watchdog_Control *watch = (Watchdog_Control *) node; _Watchdog_Report( NULL, watch ); 10e0c0: 52 push %edx 10e0c1: 52 push %edx 10e0c2: 53 push %ebx 10e0c3: 6a 00 push $0x0 10e0c5: e8 32 00 00 00 call 10e0fc <_Watchdog_Report> _ISR_Disable( level ); printk( "Watchdog Chain: %s %p\n", name, header ); if ( !_Chain_Is_empty( header ) ) { for ( node = header->first ; node != _Chain_Tail(header) ; node = node->next ) 10e0ca: 8b 1b mov (%ebx),%ebx Chain_Node *node; _ISR_Disable( level ); printk( "Watchdog Chain: %s %p\n", name, header ); if ( !_Chain_Is_empty( header ) ) { for ( node = header->first ; 10e0cc: 83 c4 10 add $0x10,%esp 10e0cf: 39 f3 cmp %esi,%ebx 10e0d1: 75 ed jne 10e0c0 <_Watchdog_Report_chain+0x2c><== NEVER TAKEN { Watchdog_Control *watch = (Watchdog_Control *) node; _Watchdog_Report( NULL, watch ); } printk( "== end of %s \n", name ); 10e0d3: 50 push %eax 10e0d4: 50 push %eax 10e0d5: 57 push %edi 10e0d6: 68 9b 11 12 00 push $0x12119b 10e0db: eb 08 jmp 10e0e5 <_Watchdog_Report_chain+0x51> } else { printk( "Chain is empty\n" ); 10e0dd: 83 ec 0c sub $0xc,%esp 10e0e0: 68 aa 11 12 00 push $0x1211aa 10e0e5: e8 a2 a9 ff ff call 108a8c 10e0ea: 83 c4 10 add $0x10,%esp } _ISR_Enable( level ); 10e0ed: ff 75 e4 pushl -0x1c(%ebp) 10e0f0: 9d popf } 10e0f1: 8d 65 f4 lea -0xc(%ebp),%esp 10e0f4: 5b pop %ebx 10e0f5: 5e pop %esi 10e0f6: 5f pop %edi 10e0f7: c9 leave 10e0f8: c3 ret =============================================================================== 0010ce8c <_Watchdog_Tickle>: */ void _Watchdog_Tickle( Chain_Control *header ) { 10ce8c: 55 push %ebp 10ce8d: 89 e5 mov %esp,%ebp 10ce8f: 57 push %edi 10ce90: 56 push %esi 10ce91: 53 push %ebx 10ce92: 83 ec 1c sub $0x1c,%esp 10ce95: 8b 7d 08 mov 0x8(%ebp),%edi * See the comment in watchdoginsert.c and watchdogadjust.c * about why it's safe not to declare header a pointer to * volatile data - till, 2003/7 */ _ISR_Disable( level ); 10ce98: 9c pushf 10ce99: fa cli 10ce9a: 5e pop %esi */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 10ce9b: 8b 1f mov (%edi),%ebx */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 10ce9d: 8d 47 04 lea 0x4(%edi),%eax 10cea0: 89 45 e4 mov %eax,-0x1c(%ebp) if ( _Chain_Is_empty( header ) ) 10cea3: 39 c3 cmp %eax,%ebx 10cea5: 74 40 je 10cee7 <_Watchdog_Tickle+0x5b> * to be inserted has already had its delta_interval adjusted to 0, and * so is added to the head of the chain with a delta_interval of 0. * * Steven Johnson - 12/2005 (gcc-3.2.3 -O3 on powerpc) */ if (the_watchdog->delta_interval != 0) { 10cea7: 8b 43 10 mov 0x10(%ebx),%eax 10ceaa: 85 c0 test %eax,%eax 10ceac: 74 08 je 10ceb6 <_Watchdog_Tickle+0x2a> the_watchdog->delta_interval--; 10ceae: 48 dec %eax 10ceaf: 89 43 10 mov %eax,0x10(%ebx) if ( the_watchdog->delta_interval != 0 ) 10ceb2: 85 c0 test %eax,%eax 10ceb4: 75 31 jne 10cee7 <_Watchdog_Tickle+0x5b> goto leave; } do { watchdog_state = _Watchdog_Remove( the_watchdog ); 10ceb6: 83 ec 0c sub $0xc,%esp 10ceb9: 53 push %ebx 10ceba: e8 65 ff ff ff call 10ce24 <_Watchdog_Remove> _ISR_Enable( level ); 10cebf: 56 push %esi 10cec0: 9d popf switch( watchdog_state ) { 10cec1: 83 c4 10 add $0x10,%esp 10cec4: 83 f8 02 cmp $0x2,%eax 10cec7: 75 0e jne 10ced7 <_Watchdog_Tickle+0x4b> <== NEVER TAKEN case WATCHDOG_ACTIVE: (*the_watchdog->routine)( 10cec9: 50 push %eax 10ceca: 50 push %eax 10cecb: ff 73 24 pushl 0x24(%ebx) 10cece: ff 73 20 pushl 0x20(%ebx) 10ced1: ff 53 1c call *0x1c(%ebx) the_watchdog->id, the_watchdog->user_data ); break; 10ced4: 83 c4 10 add $0x10,%esp case WATCHDOG_REMOVE_IT: break; } _ISR_Disable( level ); 10ced7: 9c pushf 10ced8: fa cli 10ced9: 5e pop %esi } while ( !_Chain_Is_empty( header ) && (the_watchdog->delta_interval == 0) ); leave: _ISR_Enable(level); } 10ceda: 8b 1f mov (%edi),%ebx _ISR_Disable( level ); the_watchdog = _Watchdog_First( header ); } while ( !_Chain_Is_empty( header ) && (the_watchdog->delta_interval == 0) ); 10cedc: 3b 5d e4 cmp -0x1c(%ebp),%ebx 10cedf: 74 06 je 10cee7 <_Watchdog_Tickle+0x5b> } _ISR_Disable( level ); the_watchdog = _Watchdog_First( header ); } while ( !_Chain_Is_empty( header ) && 10cee1: 83 7b 10 00 cmpl $0x0,0x10(%ebx) 10cee5: eb cd jmp 10ceb4 <_Watchdog_Tickle+0x28> (the_watchdog->delta_interval == 0) ); leave: _ISR_Enable(level); 10cee7: 56 push %esi 10cee8: 9d popf } 10cee9: 8d 65 f4 lea -0xc(%ebp),%esp 10ceec: 5b pop %ebx 10ceed: 5e pop %esi 10ceee: 5f pop %edi 10ceef: c9 leave 10cef0: c3 ret =============================================================================== 00109ff8 : int clock_gettime( clockid_t clock_id, struct timespec *tp ) { 109ff8: 55 push %ebp 109ff9: 89 e5 mov %esp,%ebp 109ffb: 83 ec 08 sub $0x8,%esp 109ffe: 8b 45 08 mov 0x8(%ebp),%eax 10a001: 8b 55 0c mov 0xc(%ebp),%edx if ( !tp ) 10a004: 85 d2 test %edx,%edx 10a006: 74 3c je 10a044 rtems_set_errno_and_return_minus_one( EINVAL ); if ( clock_id == CLOCK_REALTIME ) { 10a008: 83 f8 01 cmp $0x1,%eax 10a00b: 75 0b jne 10a018 _TOD_Get(tp); 10a00d: 83 ec 0c sub $0xc,%esp 10a010: 52 push %edx 10a011: e8 9e 1b 00 00 call 10bbb4 <_TOD_Get> 10a016: eb 13 jmp 10a02b return 0; } #ifdef CLOCK_MONOTONIC if ( clock_id == CLOCK_MONOTONIC ) { 10a018: 83 f8 04 cmp $0x4,%eax 10a01b: 74 05 je 10a022 <== NEVER TAKEN return 0; } #endif #ifdef _POSIX_CPUTIME if ( clock_id == CLOCK_PROCESS_CPUTIME ) { 10a01d: 83 f8 02 cmp $0x2,%eax 10a020: 75 10 jne 10a032 _TOD_Get_uptime_as_timespec( tp ); 10a022: 83 ec 0c sub $0xc,%esp 10a025: 52 push %edx 10a026: e8 e5 1b 00 00 call 10bc10 <_TOD_Get_uptime_as_timespec> return 0; 10a02b: 83 c4 10 add $0x10,%esp 10a02e: 31 c0 xor %eax,%eax 10a030: eb 20 jmp 10a052 } #endif #ifdef _POSIX_THREAD_CPUTIME if ( clock_id == CLOCK_THREAD_CPUTIME ) 10a032: 83 f8 03 cmp $0x3,%eax 10a035: 75 0d jne 10a044 rtems_set_errno_and_return_minus_one( ENOSYS ); 10a037: e8 a0 7f 00 00 call 111fdc <__errno> 10a03c: c7 00 58 00 00 00 movl $0x58,(%eax) 10a042: eb 0b jmp 10a04f #endif rtems_set_errno_and_return_minus_one( EINVAL ); 10a044: e8 93 7f 00 00 call 111fdc <__errno> 10a049: c7 00 16 00 00 00 movl $0x16,(%eax) 10a04f: 83 c8 ff or $0xffffffff,%eax return 0; } 10a052: c9 leave 10a053: c3 ret =============================================================================== 0010a054 : int clock_settime( clockid_t clock_id, const struct timespec *tp ) { 10a054: 55 push %ebp 10a055: 89 e5 mov %esp,%ebp 10a057: 83 ec 08 sub $0x8,%esp 10a05a: 8b 45 08 mov 0x8(%ebp),%eax 10a05d: 8b 55 0c mov 0xc(%ebp),%edx if ( !tp ) 10a060: 85 d2 test %edx,%edx 10a062: 74 44 je 10a0a8 <== NEVER TAKEN rtems_set_errno_and_return_minus_one( EINVAL ); if ( clock_id == CLOCK_REALTIME ) { 10a064: 83 f8 01 cmp $0x1,%eax 10a067: 75 28 jne 10a091 if ( tp->tv_sec < TOD_SECONDS_1970_THROUGH_1988 ) 10a069: 81 3a ff e4 da 21 cmpl $0x21dae4ff,(%edx) 10a06f: 76 37 jbe 10a0a8 rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 10a071: a1 24 62 12 00 mov 0x126224,%eax 10a076: 40 inc %eax 10a077: a3 24 62 12 00 mov %eax,0x126224 rtems_set_errno_and_return_minus_one( EINVAL ); _Thread_Disable_dispatch(); _TOD_Set( tp ); 10a07c: 83 ec 0c sub $0xc,%esp 10a07f: 52 push %edx 10a080: e8 e3 1b 00 00 call 10bc68 <_TOD_Set> _Thread_Enable_dispatch(); 10a085: e8 6c 2c 00 00 call 10ccf6 <_Thread_Enable_dispatch> rtems_set_errno_and_return_minus_one( ENOSYS ); #endif else rtems_set_errno_and_return_minus_one( EINVAL ); return 0; 10a08a: 83 c4 10 add $0x10,%esp 10a08d: 31 c0 xor %eax,%eax 10a08f: eb 25 jmp 10a0b6 _Thread_Disable_dispatch(); _TOD_Set( tp ); _Thread_Enable_dispatch(); } #ifdef _POSIX_CPUTIME else if ( clock_id == CLOCK_PROCESS_CPUTIME ) 10a091: 83 f8 02 cmp $0x2,%eax 10a094: 74 05 je 10a09b rtems_set_errno_and_return_minus_one( ENOSYS ); #endif #ifdef _POSIX_THREAD_CPUTIME else if ( clock_id == CLOCK_THREAD_CPUTIME ) 10a096: 83 f8 03 cmp $0x3,%eax 10a099: 75 0d jne 10a0a8 rtems_set_errno_and_return_minus_one( ENOSYS ); 10a09b: e8 3c 7f 00 00 call 111fdc <__errno> 10a0a0: c7 00 58 00 00 00 movl $0x58,(%eax) 10a0a6: eb 0b jmp 10a0b3 #endif else rtems_set_errno_and_return_minus_one( EINVAL ); 10a0a8: e8 2f 7f 00 00 call 111fdc <__errno> 10a0ad: c7 00 16 00 00 00 movl $0x16,(%eax) 10a0b3: 83 c8 ff or $0xffffffff,%eax return 0; } 10a0b6: c9 leave 10a0b7: c3 ret =============================================================================== 001218d4 : int killinfo( pid_t pid, int sig, const union sigval *value ) { 1218d4: 55 push %ebp 1218d5: 89 e5 mov %esp,%ebp 1218d7: 57 push %edi 1218d8: 56 push %esi 1218d9: 53 push %ebx 1218da: 83 ec 4c sub $0x4c,%esp 1218dd: 8b 5d 0c mov 0xc(%ebp),%ebx 1218e0: 8b 7d 10 mov 0x10(%ebp),%edi POSIX_signals_Siginfo_node *psiginfo; /* * Only supported for the "calling process" (i.e. this node). */ if ( pid != getpid() ) 1218e3: e8 64 fd ff ff call 12164c 1218e8: 39 45 08 cmp %eax,0x8(%ebp) 1218eb: 74 0d je 1218fa rtems_set_errno_and_return_minus_one( ESRCH ); 1218ed: e8 fe 40 ff ff call 1159f0 <__errno> 1218f2: c7 00 03 00 00 00 movl $0x3,(%eax) 1218f8: eb 0f jmp 121909 /* * Validate the signal passed. */ if ( !sig ) 1218fa: 85 db test %ebx,%ebx 1218fc: 75 13 jne 121911 rtems_set_errno_and_return_minus_one( EINVAL ); 1218fe: e8 ed 40 ff ff call 1159f0 <__errno> 121903: c7 00 16 00 00 00 movl $0x16,(%eax) 121909: 83 c8 ff or $0xffffffff,%eax 12190c: e9 ea 01 00 00 jmp 121afb static inline bool is_valid_signo( int signo ) { return ((signo) >= 1 && (signo) <= 32 ); 121911: 8d 4b ff lea -0x1(%ebx),%ecx if ( !is_valid_signo(sig) ) 121914: 83 f9 1f cmp $0x1f,%ecx 121917: 77 e5 ja 1218fe rtems_set_errno_and_return_minus_one( EINVAL ); /* * If the signal is being ignored, then we are out of here. */ if ( _POSIX_signals_Vectors[ sig ].sa_handler == SIG_IGN ) 121919: 6b d3 0c imul $0xc,%ebx,%edx return 0; 12191c: 31 c0 xor %eax,%eax rtems_set_errno_and_return_minus_one( EINVAL ); /* * If the signal is being ignored, then we are out of here. */ if ( _POSIX_signals_Vectors[ sig ].sa_handler == SIG_IGN ) 12191e: 83 ba c0 a8 12 00 01 cmpl $0x1,0x12a8c0(%edx) 121925: 0f 84 d0 01 00 00 je 121afb /* * 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 ) ) 12192b: 83 fb 04 cmp $0x4,%ebx 12192e: 74 0a je 12193a 121930: 83 fb 08 cmp $0x8,%ebx 121933: 74 05 je 12193a 121935: 83 fb 0b cmp $0xb,%ebx 121938: 75 16 jne 121950 return pthread_kill( pthread_self(), sig ); 12193a: e8 79 03 00 00 call 121cb8 12193f: 56 push %esi 121940: 56 push %esi 121941: 53 push %ebx 121942: 50 push %eax 121943: e8 c8 02 00 00 call 121c10 121948: 83 c4 10 add $0x10,%esp 12194b: e9 ab 01 00 00 jmp 121afb static inline sigset_t signo_to_mask( uint32_t sig ) { return 1u << (sig - 1); 121950: be 01 00 00 00 mov $0x1,%esi 121955: d3 e6 shl %cl,%esi /* * Build up a siginfo structure */ siginfo = &siginfo_struct; siginfo->si_signo = sig; 121957: 89 5d dc mov %ebx,-0x24(%ebp) siginfo->si_code = SI_USER; 12195a: c7 45 e0 01 00 00 00 movl $0x1,-0x20(%ebp) if ( !value ) { 121961: 85 ff test %edi,%edi 121963: 75 09 jne 12196e siginfo->si_value.sival_int = 0; 121965: c7 45 e4 00 00 00 00 movl $0x0,-0x1c(%ebp) 12196c: eb 05 jmp 121973 } else { siginfo->si_value = *value; 12196e: 8b 07 mov (%edi),%eax 121970: 89 45 e4 mov %eax,-0x1c(%ebp) 121973: a1 58 a3 12 00 mov 0x12a358,%eax 121978: 40 inc %eax 121979: a3 58 a3 12 00 mov %eax,0x12a358 /* * 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; 12197e: 8b 15 a8 a8 12 00 mov 0x12a8a8,%edx api = the_thread->API_Extensions[ THREAD_API_POSIX ]; if ( _POSIX_signals_Is_interested( api, mask ) ) { 121984: 8b 82 f8 00 00 00 mov 0xf8(%edx),%eax 12198a: 8b 80 cc 00 00 00 mov 0xcc(%eax),%eax 121990: f7 d0 not %eax 121992: 85 c6 test %eax,%esi 121994: 0f 85 e7 00 00 00 jne 121a81 /* XXX violation of visibility -- need to define thread queue support */ the_chain = &_POSIX_signals_Wait_queue.Queues.Fifo; for ( the_node = the_chain->first ; 12199a: a1 44 aa 12 00 mov 0x12aa44,%eax 12199f: eb 23 jmp 1219c4 !_Chain_Is_tail( the_chain, the_node ) ; the_node = the_node->next ) { the_thread = (Thread_Control *)the_node; 1219a1: 89 c2 mov %eax,%edx api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 1219a3: 8b 88 f8 00 00 00 mov 0xf8(%eax),%ecx #endif /* * Is this thread is actually blocked waiting for the signal? */ if (the_thread->Wait.option & mask) 1219a9: 85 70 30 test %esi,0x30(%eax) 1219ac: 0f 85 cf 00 00 00 jne 121a81 /* * Is this thread is blocked waiting for another signal but has * not blocked this one? */ if (~api->signals_blocked & mask) 1219b2: 8b 89 cc 00 00 00 mov 0xcc(%ecx),%ecx 1219b8: f7 d1 not %ecx 1219ba: 85 ce test %ecx,%esi 1219bc: 0f 85 bf 00 00 00 jne 121a81 the_chain = &_POSIX_signals_Wait_queue.Queues.Fifo; for ( the_node = the_chain->first ; !_Chain_Is_tail( the_chain, the_node ) ; the_node = the_node->next ) { 1219c2: 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 = the_chain->first ; 1219c4: 3d 48 aa 12 00 cmp $0x12aa48,%eax 1219c9: 75 d6 jne 1219a1 * NOTES: * * + rtems internal threads do not receive signals. */ interested = NULL; interested_priority = PRIORITY_MAXIMUM + 1; 1219cb: 0f b6 0d f4 61 12 00 movzbl 0x1261f4,%ecx 1219d2: 41 inc %ecx * * NOTES: * * + rtems internal threads do not receive signals. */ interested = NULL; 1219d3: 31 d2 xor %edx,%edx interested_priority = PRIORITY_MAXIMUM + 1; for (the_api = OBJECTS_CLASSIC_API; the_api <= OBJECTS_APIS_LAST; the_api++) { 1219d5: 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 ] ) 1219dc: 8b 7d cc mov -0x34(%ebp),%edi 1219df: 8b 04 bd 30 a3 12 00 mov 0x12a330(,%edi,4),%eax 1219e6: 85 c0 test %eax,%eax 1219e8: 0f 84 82 00 00 00 je 121a70 <== NEVER TAKEN continue; the_info = _Objects_Information_table[ the_api ][ 1 ]; 1219ee: 8b 40 04 mov 0x4(%eax),%eax */ if ( !the_info ) continue; #endif maximum = the_info->maximum; 1219f1: 0f b7 78 10 movzwl 0x10(%eax),%edi 1219f5: 89 7d c4 mov %edi,-0x3c(%ebp) object_table = the_info->local_table; 1219f8: 8b 40 1c mov 0x1c(%eax),%eax 1219fb: 89 45 c0 mov %eax,-0x40(%ebp) for ( index = 1 ; index <= maximum ; index++ ) { 1219fe: c7 45 d0 01 00 00 00 movl $0x1,-0x30(%ebp) 121a05: 89 5d b4 mov %ebx,-0x4c(%ebp) 121a08: eb 5b jmp 121a65 the_thread = (Thread_Control *) object_table[ index ]; 121a0a: 8b 5d d0 mov -0x30(%ebp),%ebx 121a0d: 8b 7d c0 mov -0x40(%ebp),%edi 121a10: 8b 04 9f mov (%edi,%ebx,4),%eax if ( !the_thread ) 121a13: 85 c0 test %eax,%eax 121a15: 74 4b je 121a62 /* * If this thread is of lower priority than the interested thread, * go on to the next thread. */ if ( the_thread->current_priority > interested_priority ) 121a17: 8b 58 14 mov 0x14(%eax),%ebx 121a1a: 89 5d d4 mov %ebx,-0x2c(%ebp) 121a1d: 39 cb cmp %ecx,%ebx 121a1f: 77 41 ja 121a62 #if defined(RTEMS_DEBUG) if ( !api ) continue; #endif if ( !_POSIX_signals_Is_interested( api, mask ) ) 121a21: 8b b8 f8 00 00 00 mov 0xf8(%eax),%edi 121a27: 8b bf cc 00 00 00 mov 0xcc(%edi),%edi 121a2d: f7 d7 not %edi 121a2f: 85 fe test %edi,%esi 121a31: 74 2f je 121a62 * * 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 ) { 121a33: 39 cb cmp %ecx,%ebx 121a35: 72 26 jb 121a5d * and blocking interruptibutable by signal. * * If the interested thread is ready, don't think about changing. */ if ( !_States_Is_ready( interested->current_state ) ) { 121a37: 8b 7a 10 mov 0x10(%edx),%edi 121a3a: 89 7d c8 mov %edi,-0x38(%ebp) 121a3d: 85 ff test %edi,%edi 121a3f: 74 21 je 121a62 <== NEVER TAKEN /* preferred ready over blocked */ DEBUG_STEP("5"); if ( _States_Is_ready( the_thread->current_state ) ) { 121a41: 8b 78 10 mov 0x10(%eax),%edi 121a44: 85 ff test %edi,%edi 121a46: 74 15 je 121a5d continue; } DEBUG_STEP("6"); /* prefer blocked/interruptible over blocked/not interruptible */ if ( !_States_Is_interruptible_by_signal(interested->current_state) ) { 121a48: f7 45 c8 00 00 00 10 testl $0x10000000,-0x38(%ebp) 121a4f: 75 11 jne 121a62 DEBUG_STEP("7"); if ( _States_Is_interruptible_by_signal(the_thread->current_state) ) { 121a51: 81 e7 00 00 00 10 and $0x10000000,%edi 121a57: 74 09 je 121a62 121a59: 89 d9 mov %ebx,%ecx 121a5b: eb 03 jmp 121a60 */ if ( !_States_Is_ready( interested->current_state ) ) { /* preferred ready over blocked */ DEBUG_STEP("5"); if ( _States_Is_ready( the_thread->current_state ) ) { 121a5d: 8b 4d d4 mov -0x2c(%ebp),%ecx 121a60: 89 c2 mov %eax,%edx #endif maximum = the_info->maximum; object_table = the_info->local_table; for ( index = 1 ; index <= maximum ; index++ ) { 121a62: ff 45 d0 incl -0x30(%ebp) 121a65: 8b 45 c4 mov -0x3c(%ebp),%eax 121a68: 39 45 d0 cmp %eax,-0x30(%ebp) 121a6b: 76 9d jbe 121a0a 121a6d: 8b 5d b4 mov -0x4c(%ebp),%ebx * + 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++) { 121a70: ff 45 cc incl -0x34(%ebp) 121a73: 83 7d cc 04 cmpl $0x4,-0x34(%ebp) 121a77: 0f 85 5f ff ff ff jne 1219dc } } } } if ( interested ) { 121a7d: 85 d2 test %edx,%edx 121a7f: 74 13 je 121a94 /* * 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 ) ) { 121a81: 51 push %ecx mask = signo_to_mask( sig ); /* * Build up a siginfo structure */ siginfo = &siginfo_struct; 121a82: 8d 45 dc lea -0x24(%ebp),%eax /* * 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 ) ) { 121a85: 50 push %eax 121a86: 53 push %ebx 121a87: 52 push %edx 121a88: e8 8b 00 00 00 call 121b18 <_POSIX_signals_Unblock_thread> 121a8d: 83 c4 10 add $0x10,%esp 121a90: 84 c0 test %al,%al 121a92: 75 60 jne 121af4 /* * 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 ); 121a94: 83 ec 0c sub $0xc,%esp 121a97: 56 push %esi 121a98: e8 67 00 00 00 call 121b04 <_POSIX_signals_Set_process_signals> if ( _POSIX_signals_Vectors[ sig ].sa_flags == SA_SIGINFO ) { 121a9d: 6b db 0c imul $0xc,%ebx,%ebx 121aa0: 83 c4 10 add $0x10,%esp 121aa3: 83 bb b8 a8 12 00 02 cmpl $0x2,0x12a8b8(%ebx) 121aaa: 75 48 jne 121af4 psiginfo = (POSIX_signals_Siginfo_node *) _Chain_Get( &_POSIX_signals_Inactive_siginfo ); 121aac: 83 ec 0c sub $0xc,%esp 121aaf: 68 38 aa 12 00 push $0x12aa38 121ab4: e8 e3 d6 fe ff call 10f19c <_Chain_Get> if ( !psiginfo ) { 121ab9: 83 c4 10 add $0x10,%esp 121abc: 85 c0 test %eax,%eax 121abe: 75 15 jne 121ad5 _Thread_Enable_dispatch(); 121ac0: e8 3d ec fe ff call 110702 <_Thread_Enable_dispatch> rtems_set_errno_and_return_minus_one( EAGAIN ); 121ac5: e8 26 3f ff ff call 1159f0 <__errno> 121aca: c7 00 0b 00 00 00 movl $0xb,(%eax) 121ad0: e9 34 fe ff ff jmp 121909 } psiginfo->Info = *siginfo; 121ad5: 8d 78 08 lea 0x8(%eax),%edi 121ad8: 8d 75 dc lea -0x24(%ebp),%esi 121adb: b9 03 00 00 00 mov $0x3,%ecx 121ae0: f3 a5 rep movsl %ds:(%esi),%es:(%edi) _Chain_Append( &_POSIX_signals_Siginfo[ sig ], &psiginfo->Node ); 121ae2: 52 push %edx 121ae3: 52 push %edx 121ae4: 50 push %eax 121ae5: 81 c3 b0 aa 12 00 add $0x12aab0,%ebx 121aeb: 53 push %ebx 121aec: e8 6f d6 fe ff call 10f160 <_Chain_Append> 121af1: 83 c4 10 add $0x10,%esp } DEBUG_STEP("\n"); _Thread_Enable_dispatch(); 121af4: e8 09 ec fe ff call 110702 <_Thread_Enable_dispatch> return 0; 121af9: 31 c0 xor %eax,%eax } 121afb: 8d 65 f4 lea -0xc(%ebp),%esp 121afe: 5b pop %ebx 121aff: 5e pop %esi 121b00: 5f pop %edi 121b01: c9 leave 121b02: c3 ret =============================================================================== 0010e704 : int pthread_attr_setschedpolicy( pthread_attr_t *attr, int policy ) { 10e704: 55 push %ebp 10e705: 89 e5 mov %esp,%ebp 10e707: 8b 55 08 mov 0x8(%ebp),%edx 10e70a: 8b 4d 0c mov 0xc(%ebp),%ecx if ( !attr || !attr->is_initialized ) return EINVAL; 10e70d: b8 16 00 00 00 mov $0x16,%eax int pthread_attr_setschedpolicy( pthread_attr_t *attr, int policy ) { if ( !attr || !attr->is_initialized ) 10e712: 85 d2 test %edx,%edx 10e714: 74 1e je 10e734 10e716: 83 3a 00 cmpl $0x0,(%edx) 10e719: 74 19 je 10e734 return EINVAL; switch ( policy ) { 10e71b: 83 f9 04 cmp $0x4,%ecx 10e71e: 77 0f ja 10e72f 10e720: b0 01 mov $0x1,%al 10e722: d3 e0 shl %cl,%eax 10e724: a8 17 test $0x17,%al 10e726: 74 07 je 10e72f <== NEVER TAKEN case SCHED_OTHER: case SCHED_FIFO: case SCHED_RR: case SCHED_SPORADIC: attr->schedpolicy = policy; 10e728: 89 4a 14 mov %ecx,0x14(%edx) return 0; 10e72b: 31 c0 xor %eax,%eax 10e72d: eb 05 jmp 10e734 default: return ENOTSUP; 10e72f: b8 86 00 00 00 mov $0x86,%eax } } 10e734: c9 leave 10e735: c3 ret =============================================================================== 0010a578 : int pthread_barrier_init( pthread_barrier_t *barrier, const pthread_barrierattr_t *attr, unsigned int count ) { 10a578: 55 push %ebp 10a579: 89 e5 mov %esp,%ebp 10a57b: 57 push %edi 10a57c: 56 push %esi 10a57d: 53 push %ebx 10a57e: 83 ec 1c sub $0x1c,%esp 10a581: 8b 5d 08 mov 0x8(%ebp),%ebx 10a584: 8b 75 10 mov 0x10(%ebp),%esi /* * Error check parameters */ if ( !barrier ) return EINVAL; 10a587: b8 16 00 00 00 mov $0x16,%eax const pthread_barrierattr_t *the_attr; /* * Error check parameters */ if ( !barrier ) 10a58c: 85 db test %ebx,%ebx 10a58e: 0f 84 96 00 00 00 je 10a62a return EINVAL; if ( count == 0 ) 10a594: 85 f6 test %esi,%esi 10a596: 0f 84 8e 00 00 00 je 10a62a return EINVAL; /* * If the user passed in NULL, use the default attributes */ if ( attr ) { 10a59c: 8b 7d 0c mov 0xc(%ebp),%edi 10a59f: 85 ff test %edi,%edi 10a5a1: 75 0f jne 10a5b2 the_attr = attr; } else { (void) pthread_barrierattr_init( &my_attr ); 10a5a3: 83 ec 0c sub $0xc,%esp 10a5a6: 8d 7d d8 lea -0x28(%ebp),%edi 10a5a9: 57 push %edi 10a5aa: e8 19 ff ff ff call 10a4c8 10a5af: 83 c4 10 add $0x10,%esp /* * Now start error checking the attributes that we are going to use */ if ( !the_attr->is_initialized ) return EINVAL; 10a5b2: b8 16 00 00 00 mov $0x16,%eax } /* * Now start error checking the attributes that we are going to use */ if ( !the_attr->is_initialized ) 10a5b7: 83 3f 00 cmpl $0x0,(%edi) 10a5ba: 74 6e je 10a62a return EINVAL; switch ( the_attr->process_shared ) { 10a5bc: 83 7f 04 00 cmpl $0x0,0x4(%edi) 10a5c0: 75 68 jne 10a62a <== NEVER TAKEN } /* * Convert from POSIX attributes to Core Barrier attributes */ the_attributes.discipline = CORE_BARRIER_AUTOMATIC_RELEASE; 10a5c2: c7 45 e0 00 00 00 00 movl $0x0,-0x20(%ebp) the_attributes.maximum_count = count; 10a5c9: 89 75 e4 mov %esi,-0x1c(%ebp) rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 10a5cc: a1 f4 61 12 00 mov 0x1261f4,%eax 10a5d1: 40 inc %eax 10a5d2: a3 f4 61 12 00 mov %eax,0x1261f4 * the inactive chain of free barrier control blocks. */ RTEMS_INLINE_ROUTINE POSIX_Barrier_Control *_POSIX_Barrier_Allocate( void ) { return (POSIX_Barrier_Control *) _Objects_Allocate( &_POSIX_Barrier_Information ); 10a5d7: 83 ec 0c sub $0xc,%esp 10a5da: 68 c0 65 12 00 push $0x1265c0 10a5df: e8 14 1e 00 00 call 10c3f8 <_Objects_Allocate> 10a5e4: 89 c6 mov %eax,%esi */ _Thread_Disable_dispatch(); /* prevents deletion */ the_barrier = _POSIX_Barrier_Allocate(); if ( !the_barrier ) { 10a5e6: 83 c4 10 add $0x10,%esp 10a5e9: 85 c0 test %eax,%eax 10a5eb: 75 0c jne 10a5f9 _Thread_Enable_dispatch(); 10a5ed: e8 0c 2a 00 00 call 10cffe <_Thread_Enable_dispatch> return EAGAIN; 10a5f2: b8 0b 00 00 00 mov $0xb,%eax 10a5f7: eb 31 jmp 10a62a } _CORE_barrier_Initialize( &the_barrier->Barrier, &the_attributes ); 10a5f9: 50 push %eax 10a5fa: 50 push %eax 10a5fb: 8d 45 e0 lea -0x20(%ebp),%eax 10a5fe: 50 push %eax 10a5ff: 8d 46 10 lea 0x10(%esi),%eax 10a602: 50 push %eax 10a603: e8 9c 14 00 00 call 10baa4 <_CORE_barrier_Initialize> uint32_t name ) { _Objects_Set_local_object( information, _Objects_Get_index( the_object->id ), 10a608: 8b 46 08 mov 0x8(%esi),%eax Objects_Information *information, Objects_Control *the_object, uint32_t name ) { _Objects_Set_local_object( 10a60b: 0f b7 c8 movzwl %ax,%ecx #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 10a60e: 8b 15 dc 65 12 00 mov 0x1265dc,%edx 10a614: 89 34 8a mov %esi,(%edx,%ecx,4) _Objects_Get_index( the_object->id ), the_object ); /* ASSERT: information->is_string == false */ the_object->name.name_u32 = name; 10a617: c7 46 0c 00 00 00 00 movl $0x0,0xc(%esi) ); /* * Exit the critical section and return the user an operational barrier */ *barrier = the_barrier->Object.id; 10a61e: 89 03 mov %eax,(%ebx) _Thread_Enable_dispatch(); 10a620: e8 d9 29 00 00 call 10cffe <_Thread_Enable_dispatch> return 0; 10a625: 83 c4 10 add $0x10,%esp 10a628: 31 c0 xor %eax,%eax } 10a62a: 8d 65 f4 lea -0xc(%ebp),%esp 10a62d: 5b pop %ebx 10a62e: 5e pop %esi 10a62f: 5f pop %edi 10a630: c9 leave 10a631: c3 ret =============================================================================== 00109f30 : void pthread_cleanup_push( void (*routine)( void * ), void *arg ) { 109f30: 55 push %ebp 109f31: 89 e5 mov %esp,%ebp 109f33: 56 push %esi 109f34: 53 push %ebx 109f35: 8b 5d 08 mov 0x8(%ebp),%ebx 109f38: 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 ) 109f3b: 85 db test %ebx,%ebx 109f3d: 74 4b je 109f8a rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 109f3f: a1 cc 61 12 00 mov 0x1261cc,%eax 109f44: 40 inc %eax 109f45: a3 cc 61 12 00 mov %eax,0x1261cc return; _Thread_Disable_dispatch(); handler = _Workspace_Allocate( sizeof( POSIX_Cancel_Handler_control ) ); 109f4a: 83 ec 0c sub $0xc,%esp 109f4d: 6a 10 push $0x10 109f4f: e8 2a 3b 00 00 call 10da7e <_Workspace_Allocate> if ( handler ) { 109f54: 83 c4 10 add $0x10,%esp 109f57: 85 c0 test %eax,%eax 109f59: 74 24 je 109f7f <== NEVER TAKEN thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; 109f5b: 8b 15 1c 67 12 00 mov 0x12671c,%edx handler_stack = &thread_support->Cancellation_Handlers; 109f61: 8b 92 f8 00 00 00 mov 0xf8(%edx),%edx 109f67: 81 c2 e0 00 00 00 add $0xe0,%edx handler->routine = routine; 109f6d: 89 58 08 mov %ebx,0x8(%eax) handler->arg = arg; 109f70: 89 70 0c mov %esi,0xc(%eax) _Chain_Append( handler_stack, &handler->Node ); 109f73: 51 push %ecx 109f74: 51 push %ecx 109f75: 50 push %eax 109f76: 52 push %edx 109f77: e8 7c 15 00 00 call 10b4f8 <_Chain_Append> 109f7c: 83 c4 10 add $0x10,%esp } _Thread_Enable_dispatch(); } 109f7f: 8d 65 f8 lea -0x8(%ebp),%esp 109f82: 5b pop %ebx 109f83: 5e pop %esi 109f84: c9 leave handler->routine = routine; handler->arg = arg; _Chain_Append( handler_stack, &handler->Node ); } _Thread_Enable_dispatch(); 109f85: e9 70 2a 00 00 jmp 10c9fa <_Thread_Enable_dispatch> } 109f8a: 8d 65 f8 lea -0x8(%ebp),%esp 109f8d: 5b pop %ebx 109f8e: 5e pop %esi 109f8f: c9 leave 109f90: c3 ret =============================================================================== 0010aca0 : int pthread_cond_init( pthread_cond_t *cond, const pthread_condattr_t *attr ) { 10aca0: 55 push %ebp 10aca1: 89 e5 mov %esp,%ebp 10aca3: 56 push %esi 10aca4: 53 push %ebx POSIX_Condition_variables_Control *the_cond; const pthread_condattr_t *the_attr; if ( attr ) the_attr = attr; 10aca5: 8b 5d 0c mov 0xc(%ebp),%ebx 10aca8: 85 db test %ebx,%ebx 10acaa: 75 05 jne 10acb1 else the_attr = &_POSIX_Condition_variables_Default_attributes; 10acac: bb 4c 0e 12 00 mov $0x120e4c,%ebx /* * Be careful about attributes when global!!! */ if ( the_attr->process_shared == PTHREAD_PROCESS_SHARED ) return EINVAL; 10acb1: b8 16 00 00 00 mov $0x16,%eax /* * Be careful about attributes when global!!! */ if ( the_attr->process_shared == PTHREAD_PROCESS_SHARED ) 10acb6: 83 7b 04 01 cmpl $0x1,0x4(%ebx) 10acba: 74 76 je 10ad32 <== NEVER TAKEN return EINVAL; if ( !the_attr->is_initialized ) 10acbc: 83 3b 00 cmpl $0x0,(%ebx) 10acbf: 74 71 je 10ad32 rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 10acc1: a1 04 74 12 00 mov 0x127404,%eax 10acc6: 40 inc %eax 10acc7: a3 04 74 12 00 mov %eax,0x127404 RTEMS_INLINE_ROUTINE POSIX_Condition_variables_Control *_POSIX_Condition_variables_Allocate( void ) { return (POSIX_Condition_variables_Control *) _Objects_Allocate( &_POSIX_Condition_variables_Information ); 10accc: 83 ec 0c sub $0xc,%esp 10accf: 68 68 78 12 00 push $0x127868 10acd4: e8 fb 22 00 00 call 10cfd4 <_Objects_Allocate> 10acd9: 89 c6 mov %eax,%esi _Thread_Disable_dispatch(); the_cond = _POSIX_Condition_variables_Allocate(); if ( !the_cond ) { 10acdb: 83 c4 10 add $0x10,%esp 10acde: 85 c0 test %eax,%eax 10ace0: 75 0c jne 10acee _Thread_Enable_dispatch(); 10ace2: e8 f3 2e 00 00 call 10dbda <_Thread_Enable_dispatch> return ENOMEM; 10ace7: b8 0c 00 00 00 mov $0xc,%eax 10acec: eb 44 jmp 10ad32 } the_cond->process_shared = the_attr->process_shared; 10acee: 8b 43 04 mov 0x4(%ebx),%eax 10acf1: 89 46 10 mov %eax,0x10(%esi) the_cond->Mutex = POSIX_CONDITION_VARIABLES_NO_MUTEX; 10acf4: c7 46 14 00 00 00 00 movl $0x0,0x14(%esi) /* XXX some more initialization might need to go here */ _Thread_queue_Initialize( 10acfb: 6a 74 push $0x74 10acfd: 68 00 08 00 00 push $0x800 10ad02: 6a 00 push $0x0 10ad04: 8d 46 18 lea 0x18(%esi),%eax 10ad07: 50 push %eax 10ad08: e8 c7 35 00 00 call 10e2d4 <_Thread_queue_Initialize> uint32_t name ) { _Objects_Set_local_object( information, _Objects_Get_index( the_object->id ), 10ad0d: 8b 46 08 mov 0x8(%esi),%eax Objects_Information *information, Objects_Control *the_object, uint32_t name ) { _Objects_Set_local_object( 10ad10: 0f b7 c8 movzwl %ax,%ecx #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 10ad13: 8b 15 84 78 12 00 mov 0x127884,%edx 10ad19: 89 34 8a mov %esi,(%edx,%ecx,4) _Objects_Get_index( the_object->id ), the_object ); /* ASSERT: information->is_string == false */ the_object->name.name_u32 = name; 10ad1c: c7 46 0c 00 00 00 00 movl $0x0,0xc(%esi) &_POSIX_Condition_variables_Information, &the_cond->Object, 0 ); *cond = the_cond->Object.id; 10ad23: 8b 55 08 mov 0x8(%ebp),%edx 10ad26: 89 02 mov %eax,(%edx) _Thread_Enable_dispatch(); 10ad28: e8 ad 2e 00 00 call 10dbda <_Thread_Enable_dispatch> return 0; 10ad2d: 83 c4 10 add $0x10,%esp 10ad30: 31 c0 xor %eax,%eax } 10ad32: 8d 65 f8 lea -0x8(%ebp),%esp 10ad35: 5b pop %ebx 10ad36: 5e pop %esi 10ad37: c9 leave 10ad38: c3 ret =============================================================================== 0010ab54 : */ int pthread_condattr_destroy( pthread_condattr_t *attr ) { 10ab54: 55 push %ebp 10ab55: 89 e5 mov %esp,%ebp 10ab57: 8b 55 08 mov 0x8(%ebp),%edx if ( !attr || attr->is_initialized == false ) return EINVAL; 10ab5a: b8 16 00 00 00 mov $0x16,%eax int pthread_condattr_destroy( pthread_condattr_t *attr ) { if ( !attr || attr->is_initialized == false ) 10ab5f: 85 d2 test %edx,%edx 10ab61: 74 0d je 10ab70 10ab63: 83 3a 00 cmpl $0x0,(%edx) 10ab66: 74 08 je 10ab70 <== NEVER TAKEN return EINVAL; attr->is_initialized = false; 10ab68: c7 02 00 00 00 00 movl $0x0,(%edx) return 0; 10ab6e: 30 c0 xor %al,%al } 10ab70: c9 leave 10ab71: c3 ret =============================================================================== 0010a27c : pthread_t *thread, const pthread_attr_t *attr, void *(*start_routine)( void * ), void *arg ) { 10a27c: 55 push %ebp 10a27d: 89 e5 mov %esp,%ebp 10a27f: 57 push %edi 10a280: 56 push %esi 10a281: 53 push %ebx 10a282: 83 ec 5c sub $0x5c,%esp struct sched_param schedparam; Objects_Name name; int rc; if ( !start_routine ) return EFAULT; 10a285: c7 45 b4 0e 00 00 00 movl $0xe,-0x4c(%ebp) int schedpolicy = SCHED_RR; struct sched_param schedparam; Objects_Name name; int rc; if ( !start_routine ) 10a28c: 83 7d 10 00 cmpl $0x0,0x10(%ebp) 10a290: 0f 84 0f 02 00 00 je 10a4a5 return EFAULT; the_attr = (attr) ? attr : &_POSIX_Threads_Default_attributes; 10a296: 8b 5d 0c mov 0xc(%ebp),%ebx 10a299: 85 db test %ebx,%ebx 10a29b: 75 05 jne 10a2a2 10a29d: bb bc f9 11 00 mov $0x11f9bc,%ebx if ( !the_attr->is_initialized ) return EINVAL; 10a2a2: c7 45 b4 16 00 00 00 movl $0x16,-0x4c(%ebp) if ( !start_routine ) return EFAULT; the_attr = (attr) ? attr : &_POSIX_Threads_Default_attributes; if ( !the_attr->is_initialized ) 10a2a9: 83 3b 00 cmpl $0x0,(%ebx) 10a2ac: 0f 84 f3 01 00 00 je 10a4a5 * 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) ) 10a2b2: 83 7b 04 00 cmpl $0x0,0x4(%ebx) 10a2b6: 74 0e je 10a2c6 10a2b8: a1 14 12 12 00 mov 0x121214,%eax 10a2bd: 39 43 08 cmp %eax,0x8(%ebx) 10a2c0: 0f 82 df 01 00 00 jb 10a4a5 * 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 ) { 10a2c6: 8b 43 10 mov 0x10(%ebx),%eax 10a2c9: 83 f8 01 cmp $0x1,%eax 10a2cc: 74 0b je 10a2d9 10a2ce: 83 f8 02 cmp $0x2,%eax 10a2d1: 0f 85 c7 01 00 00 jne 10a49e 10a2d7: eb 1f jmp 10a2f8 case PTHREAD_INHERIT_SCHED: api = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; 10a2d9: a1 24 57 12 00 mov 0x125724,%eax 10a2de: 8b b0 f8 00 00 00 mov 0xf8(%eax),%esi schedpolicy = api->schedpolicy; 10a2e4: 8b 86 80 00 00 00 mov 0x80(%esi),%eax 10a2ea: 89 45 ac mov %eax,-0x54(%ebp) schedparam = api->schedparam; 10a2ed: 8d 7d c4 lea -0x3c(%ebp),%edi 10a2f0: 81 c6 84 00 00 00 add $0x84,%esi 10a2f6: eb 0c jmp 10a304 break; case PTHREAD_EXPLICIT_SCHED: schedpolicy = the_attr->schedpolicy; 10a2f8: 8b 43 14 mov 0x14(%ebx),%eax 10a2fb: 89 45 ac mov %eax,-0x54(%ebp) schedparam = the_attr->schedparam; 10a2fe: 8d 7d c4 lea -0x3c(%ebp),%edi 10a301: 8d 73 18 lea 0x18(%ebx),%esi 10a304: b9 07 00 00 00 mov $0x7,%ecx 10a309: 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; 10a30b: 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 ) 10a312: 83 7b 0c 00 cmpl $0x0,0xc(%ebx) 10a316: 0f 85 89 01 00 00 jne 10a4a5 return ENOTSUP; /* * Interpret the scheduling parameters. */ if ( !_POSIX_Priority_Is_valid( schedparam.sched_priority ) ) 10a31c: 83 ec 0c sub $0xc,%esp 10a31f: ff 75 c4 pushl -0x3c(%ebp) 10a322: e8 d1 57 00 00 call 10faf8 <_POSIX_Priority_Is_valid> 10a327: 83 c4 10 add $0x10,%esp return EINVAL; 10a32a: c7 45 b4 16 00 00 00 movl $0x16,-0x4c(%ebp) return ENOTSUP; /* * Interpret the scheduling parameters. */ if ( !_POSIX_Priority_Is_valid( schedparam.sched_priority ) ) 10a331: 84 c0 test %al,%al 10a333: 0f 84 6c 01 00 00 je 10a4a5 <== NEVER TAKEN return EINVAL; core_priority = _POSIX_Priority_To_core( schedparam.sched_priority ); 10a339: 8b 45 c4 mov -0x3c(%ebp),%eax 10a33c: 89 45 a8 mov %eax,-0x58(%ebp) RTEMS_INLINE_ROUTINE Priority_Control _POSIX_Priority_To_core( int priority ) { return (Priority_Control) (POSIX_SCHEDULER_MAXIMUM_PRIORITY - priority + 1); 10a33f: 0f b6 3d 18 12 12 00 movzbl 0x121218,%edi /* * Set the core scheduling policy information. */ rc = _POSIX_Thread_Translate_sched_param( 10a346: 8d 45 e0 lea -0x20(%ebp),%eax 10a349: 50 push %eax 10a34a: 8d 45 e4 lea -0x1c(%ebp),%eax 10a34d: 50 push %eax 10a34e: 8d 45 c4 lea -0x3c(%ebp),%eax 10a351: 50 push %eax 10a352: ff 75 ac pushl -0x54(%ebp) 10a355: e8 be 57 00 00 call 10fb18 <_POSIX_Thread_Translate_sched_param> 10a35a: 89 45 b4 mov %eax,-0x4c(%ebp) schedpolicy, &schedparam, &budget_algorithm, &budget_callout ); if ( rc ) 10a35d: 83 c4 10 add $0x10,%esp 10a360: 85 c0 test %eax,%eax 10a362: 0f 85 3d 01 00 00 jne 10a4a5 #endif /* * Lock the allocator mutex for protection */ _RTEMS_Lock_allocator(); 10a368: 83 ec 0c sub $0xc,%esp 10a36b: ff 35 7c 52 12 00 pushl 0x12527c 10a371: e8 4e 15 00 00 call 10b8c4 <_API_Mutex_Lock> * _POSIX_Threads_Allocate */ RTEMS_INLINE_ROUTINE Thread_Control *_POSIX_Threads_Allocate( void ) { return (Thread_Control *) _Objects_Allocate( &_POSIX_Threads_Information ); 10a376: c7 04 24 20 54 12 00 movl $0x125420,(%esp) 10a37d: e8 b6 1e 00 00 call 10c238 <_Objects_Allocate> 10a382: 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 ) { 10a385: 83 c4 10 add $0x10,%esp 10a388: 85 c0 test %eax,%eax 10a38a: 75 05 jne 10a391 _RTEMS_Unlock_allocator(); 10a38c: 83 ec 0c sub $0xc,%esp 10a38f: eb 53 jmp 10a3e4 /* * Initialize the core thread for this task. */ name.name_p = NULL; /* posix threads don't have a name by default */ status = _Thread_Initialize( 10a391: 8b 4d e0 mov -0x20(%ebp),%ecx 10a394: 8b 75 e4 mov -0x1c(%ebp),%esi 10a397: 8b 53 08 mov 0x8(%ebx),%edx 10a39a: a1 14 12 12 00 mov 0x121214,%eax 10a39f: d1 e0 shl %eax 10a3a1: 39 d0 cmp %edx,%eax 10a3a3: 73 02 jae 10a3a7 10a3a5: 89 d0 mov %edx,%eax 10a3a7: 52 push %edx 10a3a8: 6a 00 push $0x0 10a3aa: 6a 00 push $0x0 10a3ac: 51 push %ecx 10a3ad: 56 push %esi 10a3ae: 6a 01 push $0x1 10a3b0: 81 e7 ff 00 00 00 and $0xff,%edi 10a3b6: 2b 7d a8 sub -0x58(%ebp),%edi 10a3b9: 57 push %edi 10a3ba: 6a 01 push $0x1 10a3bc: 50 push %eax 10a3bd: ff 73 04 pushl 0x4(%ebx) 10a3c0: ff 75 b0 pushl -0x50(%ebp) 10a3c3: 68 20 54 12 00 push $0x125420 10a3c8: e8 07 2b 00 00 call 10ced4 <_Thread_Initialize> budget_callout, 0, /* isr level */ name /* posix threads don't have a name */ ); if ( !status ) { 10a3cd: 83 c4 30 add $0x30,%esp 10a3d0: 84 c0 test %al,%al 10a3d2: 75 2a jne 10a3fe RTEMS_INLINE_ROUTINE void _POSIX_Threads_Free ( Thread_Control *the_pthread ) { _Objects_Free( &_POSIX_Threads_Information, &the_pthread->Object ); 10a3d4: 56 push %esi 10a3d5: 56 push %esi 10a3d6: ff 75 b0 pushl -0x50(%ebp) 10a3d9: 68 20 54 12 00 push $0x125420 10a3de: e8 4d 21 00 00 call 10c530 <_Objects_Free> _POSIX_Threads_Free( the_thread ); _RTEMS_Unlock_allocator(); 10a3e3: 5b pop %ebx 10a3e4: ff 35 7c 52 12 00 pushl 0x12527c 10a3ea: e8 1d 15 00 00 call 10b90c <_API_Mutex_Unlock> return EAGAIN; 10a3ef: 83 c4 10 add $0x10,%esp 10a3f2: c7 45 b4 0b 00 00 00 movl $0xb,-0x4c(%ebp) 10a3f9: e9 a7 00 00 00 jmp 10a4a5 } /* * finish initializing the per API structure */ api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 10a3fe: 8b 45 b0 mov -0x50(%ebp),%eax 10a401: 8b 90 f8 00 00 00 mov 0xf8(%eax),%edx api->Attributes = *the_attr; 10a407: b9 0f 00 00 00 mov $0xf,%ecx 10a40c: 89 d7 mov %edx,%edi 10a40e: 89 de mov %ebx,%esi 10a410: f3 a5 rep movsl %ds:(%esi),%es:(%edi) api->detachstate = the_attr->detachstate; 10a412: 8b 43 38 mov 0x38(%ebx),%eax 10a415: 89 42 3c mov %eax,0x3c(%edx) api->schedpolicy = schedpolicy; 10a418: 8b 45 ac mov -0x54(%ebp),%eax 10a41b: 89 82 80 00 00 00 mov %eax,0x80(%edx) api->schedparam = schedparam; 10a421: 8d ba 84 00 00 00 lea 0x84(%edx),%edi 10a427: 8d 75 c4 lea -0x3c(%ebp),%esi 10a42a: b1 07 mov $0x7,%cl 10a42c: f3 a5 rep movsl %ds:(%esi),%es:(%edi) /* * POSIX threads are allocated and started in one operation. */ status = _Thread_Start( 10a42e: 83 ec 0c sub $0xc,%esp 10a431: 6a 00 push $0x0 10a433: ff 75 14 pushl 0x14(%ebp) 10a436: ff 75 10 pushl 0x10(%ebp) 10a439: 6a 01 push $0x1 10a43b: ff 75 b0 pushl -0x50(%ebp) 10a43e: 89 55 a4 mov %edx,-0x5c(%ebp) 10a441: e8 16 34 00 00 call 10d85c <_Thread_Start> _RTEMS_Unlock_allocator(); return EINVAL; } #endif if ( schedpolicy == SCHED_SPORADIC ) { 10a446: 83 c4 20 add $0x20,%esp 10a449: 83 7d ac 04 cmpl $0x4,-0x54(%ebp) 10a44d: 8b 55 a4 mov -0x5c(%ebp),%edx 10a450: 75 2e jne 10a480 _Watchdog_Insert_ticks( 10a452: 83 ec 0c sub $0xc,%esp &api->Sporadic_timer, _Timespec_To_ticks( &api->schedparam.sched_ss_repl_period ) 10a455: 8d 82 8c 00 00 00 lea 0x8c(%edx),%eax return EINVAL; } #endif if ( schedpolicy == SCHED_SPORADIC ) { _Watchdog_Insert_ticks( 10a45b: 50 push %eax 10a45c: e8 a3 35 00 00 call 10da04 <_Timespec_To_ticks> Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 10a461: 8b 55 a4 mov -0x5c(%ebp),%edx 10a464: 89 82 b0 00 00 00 mov %eax,0xb0(%edx) _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 10a46a: 58 pop %eax 10a46b: 59 pop %ecx 10a46c: 81 c2 a4 00 00 00 add $0xa4,%edx 10a472: 52 push %edx 10a473: 68 9c 52 12 00 push $0x12529c 10a478: e8 3b 38 00 00 call 10dcb8 <_Watchdog_Insert> 10a47d: 83 c4 10 add $0x10,%esp } /* * Return the id and indicate we successfully created the thread */ *thread = the_thread->Object.id; 10a480: 8b 45 b0 mov -0x50(%ebp),%eax 10a483: 8b 50 08 mov 0x8(%eax),%edx 10a486: 8b 45 08 mov 0x8(%ebp),%eax 10a489: 89 10 mov %edx,(%eax) _RTEMS_Unlock_allocator(); 10a48b: 83 ec 0c sub $0xc,%esp 10a48e: ff 35 7c 52 12 00 pushl 0x12527c 10a494: e8 73 14 00 00 call 10b90c <_API_Mutex_Unlock> return 0; 10a499: 83 c4 10 add $0x10,%esp 10a49c: eb 07 jmp 10a4a5 schedpolicy = the_attr->schedpolicy; schedparam = the_attr->schedparam; break; default: return EINVAL; 10a49e: c7 45 b4 16 00 00 00 movl $0x16,-0x4c(%ebp) */ *thread = the_thread->Object.id; _RTEMS_Unlock_allocator(); return 0; } 10a4a5: 8b 45 b4 mov -0x4c(%ebp),%eax 10a4a8: 8d 65 f4 lea -0xc(%ebp),%esp 10a4ab: 5b pop %ebx 10a4ac: 5e pop %esi 10a4ad: 5f pop %edi 10a4ae: c9 leave 10a4af: c3 ret =============================================================================== 00110d5c : } void pthread_exit( void *value_ptr ) { 110d5c: 55 push %ebp 110d5d: 89 e5 mov %esp,%ebp 110d5f: 83 ec 10 sub $0x10,%esp _POSIX_Thread_Exit( _Thread_Executing, value_ptr ); 110d62: ff 75 08 pushl 0x8(%ebp) 110d65: ff 35 34 47 12 00 pushl 0x124734 110d6b: e8 88 ff ff ff call 110cf8 <_POSIX_Thread_Exit> 110d70: 83 c4 10 add $0x10,%esp <== NOT EXECUTED } 110d73: c9 leave <== NOT EXECUTED 110d74: c3 ret <== NOT EXECUTED =============================================================================== 0010a0fc : int pthread_key_create( pthread_key_t *key, void (*destructor)( void * ) ) { 10a0fc: 55 push %ebp 10a0fd: 89 e5 mov %esp,%ebp 10a0ff: 57 push %edi 10a100: 56 push %esi 10a101: 53 push %ebx 10a102: 83 ec 28 sub $0x28,%esp 10a105: a1 34 62 12 00 mov 0x126234,%eax 10a10a: 40 inc %eax 10a10b: a3 34 62 12 00 mov %eax,0x126234 * the inactive chain of free keys control blocks. */ RTEMS_INLINE_ROUTINE POSIX_Keys_Control *_POSIX_Keys_Allocate( void ) { return (POSIX_Keys_Control *) _Objects_Allocate( &_POSIX_Keys_Information ); 10a110: 68 58 66 12 00 push $0x126658 10a115: e8 72 1f 00 00 call 10c08c <_Objects_Allocate> 10a11a: 89 c3 mov %eax,%ebx _Thread_Disable_dispatch(); the_key = _POSIX_Keys_Allocate(); if ( !the_key ) { 10a11c: 83 c4 10 add $0x10,%esp 10a11f: 85 c0 test %eax,%eax 10a121: 75 0f jne 10a132 _Thread_Enable_dispatch(); 10a123: e8 6a 2b 00 00 call 10cc92 <_Thread_Enable_dispatch> return EAGAIN; 10a128: b8 0b 00 00 00 mov $0xb,%eax 10a12d: e9 a9 00 00 00 jmp 10a1db } the_key->destructor = destructor; 10a132: 8b 45 0c mov 0xc(%ebp),%eax 10a135: 89 43 10 mov %eax,0x10(%ebx) * APIs are optional. * * NOTE: Currently RTEMS Classic API tasks are always enabled. */ for ( the_api = 1; 10a138: be 01 00 00 00 mov $0x1,%esi the_api <= OBJECTS_APIS_LAST; the_api++ ) { if ( _Objects_Information_table[ the_api ] ) { 10a13d: 8b 04 b5 0c 62 12 00 mov 0x12620c(,%esi,4),%eax 10a144: 85 c0 test %eax,%eax 10a146: 74 63 je 10a1ab <== NEVER TAKEN true, INTERNAL_ERROR_IMPLEMENTATION_KEY_CREATE_INCONSISTENCY ); #endif bytes_to_allocate = sizeof( void * ) * (_Objects_Information_table[ the_api ][ 1 ]->maximum + 1); 10a148: 8b 40 04 mov 0x4(%eax),%eax 10a14b: 0f b7 40 10 movzwl 0x10(%eax),%eax INTERNAL_ERROR_CORE, true, INTERNAL_ERROR_IMPLEMENTATION_KEY_CREATE_INCONSISTENCY ); #endif bytes_to_allocate = sizeof( void * ) * 10a14f: 8d 0c 85 04 00 00 00 lea 0x4(,%eax,4),%ecx (_Objects_Information_table[ the_api ][ 1 ]->maximum + 1); table = _Workspace_Allocate( bytes_to_allocate ); 10a156: 83 ec 0c sub $0xc,%esp 10a159: 51 push %ecx 10a15a: 89 4d e4 mov %ecx,-0x1c(%ebp) 10a15d: e8 20 3c 00 00 call 10dd82 <_Workspace_Allocate> if ( !table ) { 10a162: 83 c4 10 add $0x10,%esp 10a165: 85 c0 test %eax,%eax 10a167: 8b 4d e4 mov -0x1c(%ebp),%ecx 10a16a: 75 33 jne 10a19f for ( --the_api; 10a16c: 4e dec %esi 10a16d: eb 10 jmp 10a17f the_api >= 1; the_api-- ) _Workspace_Free( the_key->Values[ the_api ] ); 10a16f: 83 ec 0c sub $0xc,%esp 10a172: ff 74 b3 14 pushl 0x14(%ebx,%esi,4) 10a176: e8 20 3c 00 00 call 10dd9b <_Workspace_Free> (_Objects_Information_table[ the_api ][ 1 ]->maximum + 1); table = _Workspace_Allocate( bytes_to_allocate ); if ( !table ) { for ( --the_api; the_api >= 1; the_api-- ) 10a17b: 4e dec %esi 10a17c: 83 c4 10 add $0x10,%esp #endif bytes_to_allocate = sizeof( void * ) * (_Objects_Information_table[ the_api ][ 1 ]->maximum + 1); table = _Workspace_Allocate( bytes_to_allocate ); if ( !table ) { for ( --the_api; 10a17f: 85 f6 test %esi,%esi 10a181: 75 ec jne 10a16f */ RTEMS_INLINE_ROUTINE void _POSIX_Keys_Free ( POSIX_Keys_Control *the_key ) { _Objects_Free( &_POSIX_Keys_Information, &the_key->Object ); 10a183: 50 push %eax 10a184: 50 push %eax 10a185: 53 push %ebx 10a186: 68 58 66 12 00 push $0x126658 10a18b: e8 f4 21 00 00 call 10c384 <_Objects_Free> the_api >= 1; the_api-- ) _Workspace_Free( the_key->Values[ the_api ] ); _POSIX_Keys_Free( the_key ); _Thread_Enable_dispatch(); 10a190: e8 fd 2a 00 00 call 10cc92 <_Thread_Enable_dispatch> return ENOMEM; 10a195: 83 c4 10 add $0x10,%esp 10a198: b8 0c 00 00 00 mov $0xc,%eax 10a19d: eb 3c jmp 10a1db } the_key->Values[ the_api ] = table; 10a19f: 89 44 b3 14 mov %eax,0x14(%ebx,%esi,4) memset( table, '\0', bytes_to_allocate ); 10a1a3: 89 c7 mov %eax,%edi 10a1a5: 31 c0 xor %eax,%eax 10a1a7: f3 aa rep stos %al,%es:(%edi) 10a1a9: eb 08 jmp 10a1b3 } else { the_key->Values[ the_api ] = NULL; 10a1ab: c7 44 b3 14 00 00 00 movl $0x0,0x14(%ebx,%esi,4) <== NOT EXECUTED 10a1b2: 00 * NOTE: Currently RTEMS Classic API tasks are always enabled. */ for ( the_api = 1; the_api <= OBJECTS_APIS_LAST; the_api++ ) { 10a1b3: 46 inc %esi * APIs are optional. * * NOTE: Currently RTEMS Classic API tasks are always enabled. */ for ( the_api = 1; 10a1b4: 83 fe 04 cmp $0x4,%esi 10a1b7: 75 84 jne 10a13d uint32_t name ) { _Objects_Set_local_object( information, _Objects_Get_index( the_object->id ), 10a1b9: 8b 43 08 mov 0x8(%ebx),%eax Objects_Information *information, Objects_Control *the_object, uint32_t name ) { _Objects_Set_local_object( 10a1bc: 0f b7 c8 movzwl %ax,%ecx #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 10a1bf: 8b 15 74 66 12 00 mov 0x126674,%edx 10a1c5: 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; 10a1c8: c7 43 0c 00 00 00 00 movl $0x0,0xc(%ebx) } _Objects_Open_u32( &_POSIX_Keys_Information, &the_key->Object, 0 ); *key = the_key->Object.id; 10a1cf: 8b 55 08 mov 0x8(%ebp),%edx 10a1d2: 89 02 mov %eax,(%edx) _Thread_Enable_dispatch(); 10a1d4: e8 b9 2a 00 00 call 10cc92 <_Thread_Enable_dispatch> return 0; 10a1d9: 31 c0 xor %eax,%eax } 10a1db: 8d 65 f4 lea -0xc(%ebp),%esp 10a1de: 5b pop %ebx 10a1df: 5e pop %esi 10a1e0: 5f pop %edi 10a1e1: c9 leave 10a1e2: c3 ret =============================================================================== 0010a1e4 : */ int pthread_key_delete( pthread_key_t key ) { 10a1e4: 55 push %ebp 10a1e5: 89 e5 mov %esp,%ebp 10a1e7: 56 push %esi 10a1e8: 53 push %ebx 10a1e9: 83 ec 14 sub $0x14,%esp register POSIX_Keys_Control *the_key; Objects_Locations location; uint32_t the_api; the_key = _POSIX_Keys_Get( key, &location ); 10a1ec: 8d 45 f4 lea -0xc(%ebp),%eax pthread_key_t id, Objects_Locations *location ) { return (POSIX_Keys_Control *) _Objects_Get( &_POSIX_Keys_Information, (Objects_Id) id, location ); 10a1ef: 50 push %eax 10a1f0: ff 75 08 pushl 0x8(%ebp) 10a1f3: 68 58 66 12 00 push $0x126658 10a1f8: e8 bb 22 00 00 call 10c4b8 <_Objects_Get> 10a1fd: 89 c6 mov %eax,%esi switch ( location ) { 10a1ff: 83 c4 10 add $0x10,%esp #endif case OBJECTS_ERROR: break; } return EINVAL; 10a202: b8 16 00 00 00 mov $0x16,%eax register POSIX_Keys_Control *the_key; Objects_Locations location; uint32_t the_api; the_key = _POSIX_Keys_Get( key, &location ); switch ( location ) { 10a207: 83 7d f4 00 cmpl $0x0,-0xc(%ebp) 10a20b: 75 46 jne 10a253 case OBJECTS_LOCAL: _Objects_Close( &_POSIX_Keys_Information, &the_key->Object ); 10a20d: 52 push %edx 10a20e: 52 push %edx 10a20f: 56 push %esi 10a210: 68 58 66 12 00 push $0x126658 10a215: e8 de 1e 00 00 call 10c0f8 <_Objects_Close> 10a21a: 83 c4 10 add $0x10,%esp for ( the_api = 1; the_api <= OBJECTS_APIS_LAST; the_api++ ) 10a21d: bb 01 00 00 00 mov $0x1,%ebx if ( the_key->Values[ the_api ] ) 10a222: 8b 44 9e 14 mov 0x14(%esi,%ebx,4),%eax 10a226: 85 c0 test %eax,%eax 10a228: 74 0c je 10a236 <== NEVER TAKEN _Workspace_Free( the_key->Values[ the_api ] ); 10a22a: 83 ec 0c sub $0xc,%esp 10a22d: 50 push %eax 10a22e: e8 68 3b 00 00 call 10dd9b <_Workspace_Free> 10a233: 83 c4 10 add $0x10,%esp switch ( location ) { case OBJECTS_LOCAL: _Objects_Close( &_POSIX_Keys_Information, &the_key->Object ); for ( the_api = 1; the_api <= OBJECTS_APIS_LAST; the_api++ ) 10a236: 43 inc %ebx 10a237: 83 fb 04 cmp $0x4,%ebx 10a23a: 75 e6 jne 10a222 */ RTEMS_INLINE_ROUTINE void _POSIX_Keys_Free ( POSIX_Keys_Control *the_key ) { _Objects_Free( &_POSIX_Keys_Information, &the_key->Object ); 10a23c: 50 push %eax 10a23d: 50 push %eax 10a23e: 56 push %esi 10a23f: 68 58 66 12 00 push $0x126658 10a244: e8 3b 21 00 00 call 10c384 <_Objects_Free> * NOTE: The destructor is not called and it is the responsibility * of the application to free the memory. */ _POSIX_Keys_Free( the_key ); _Thread_Enable_dispatch(); 10a249: e8 44 2a 00 00 call 10cc92 <_Thread_Enable_dispatch> return 0; 10a24e: 83 c4 10 add $0x10,%esp 10a251: 31 c0 xor %eax,%eax case OBJECTS_ERROR: break; } return EINVAL; } 10a253: 8d 65 f8 lea -0x8(%ebp),%esp 10a256: 5b pop %ebx 10a257: 5e pop %esi 10a258: c9 leave 10a259: c3 ret =============================================================================== 0010bfd4 : */ int pthread_mutex_unlock( pthread_mutex_t *mutex ) { 10bfd4: 55 push %ebp 10bfd5: 89 e5 mov %esp,%ebp 10bfd7: 53 push %ebx 10bfd8: 83 ec 1c sub $0x1c,%esp register POSIX_Mutex_Control *the_mutex; Objects_Locations location; CORE_mutex_Status status; the_mutex = _POSIX_Mutex_Get( mutex, &location ); 10bfdb: 8d 45 f4 lea -0xc(%ebp),%eax 10bfde: 50 push %eax 10bfdf: ff 75 08 pushl 0x8(%ebp) 10bfe2: e8 a9 fc ff ff call 10bc90 <_POSIX_Mutex_Get> switch ( location ) { 10bfe7: 83 c4 10 add $0x10,%esp 10bfea: 83 7d f4 00 cmpl $0x0,-0xc(%ebp) 10bfee: 75 23 jne 10c013 <== NEVER TAKEN case OBJECTS_LOCAL: status = _CORE_mutex_Surrender( 10bff0: 52 push %edx 10bff1: 6a 00 push $0x0 10bff3: ff 70 08 pushl 0x8(%eax) 10bff6: 83 c0 14 add $0x14,%eax 10bff9: 50 push %eax 10bffa: e8 ad 19 00 00 call 10d9ac <_CORE_mutex_Surrender> 10bfff: 89 c3 mov %eax,%ebx &the_mutex->Mutex, the_mutex->Object.id, NULL ); _Thread_Enable_dispatch(); 10c001: e8 20 2c 00 00 call 10ec26 <_Thread_Enable_dispatch> return _POSIX_Mutex_Translate_core_mutex_return_code( status ); 10c006: 89 1c 24 mov %ebx,(%esp) 10c009: e8 a2 ff ff ff call 10bfb0 <_POSIX_Mutex_Translate_core_mutex_return_code> 10c00e: 83 c4 10 add $0x10,%esp 10c011: eb 05 jmp 10c018 #endif case OBJECTS_ERROR: break; } return EINVAL; 10c013: b8 16 00 00 00 mov $0x16,%eax } 10c018: 8b 5d fc mov -0x4(%ebp),%ebx 10c01b: c9 leave 10c01c: c3 ret =============================================================================== 0010bbfc : int pthread_mutexattr_setpshared( pthread_mutexattr_t *attr, int pshared ) { 10bbfc: 55 push %ebp 10bbfd: 89 e5 mov %esp,%ebp 10bbff: 8b 55 08 mov 0x8(%ebp),%edx 10bc02: 8b 4d 0c mov 0xc(%ebp),%ecx if ( !attr || !attr->is_initialized ) return EINVAL; 10bc05: b8 16 00 00 00 mov $0x16,%eax int pthread_mutexattr_setpshared( pthread_mutexattr_t *attr, int pshared ) { if ( !attr || !attr->is_initialized ) 10bc0a: 85 d2 test %edx,%edx 10bc0c: 74 0f je 10bc1d 10bc0e: 83 3a 00 cmpl $0x0,(%edx) 10bc11: 74 0a je 10bc1d return EINVAL; switch ( pshared ) { 10bc13: 83 f9 01 cmp $0x1,%ecx 10bc16: 77 05 ja 10bc1d <== NEVER TAKEN case PTHREAD_PROCESS_SHARED: case PTHREAD_PROCESS_PRIVATE: attr->process_shared = pshared; 10bc18: 89 4a 04 mov %ecx,0x4(%edx) return 0; 10bc1b: 30 c0 xor %al,%al default: return EINVAL; } } 10bc1d: c9 leave 10bc1e: c3 ret =============================================================================== 00109e24 : #if defined(_UNIX98_THREAD_MUTEX_ATTRIBUTES) int pthread_mutexattr_settype( pthread_mutexattr_t *attr, int type ) { 109e24: 55 push %ebp 109e25: 89 e5 mov %esp,%ebp 109e27: 8b 55 08 mov 0x8(%ebp),%edx 109e2a: 8b 4d 0c mov 0xc(%ebp),%ecx if ( !attr || !attr->is_initialized ) return EINVAL; 109e2d: b8 16 00 00 00 mov $0x16,%eax int pthread_mutexattr_settype( pthread_mutexattr_t *attr, int type ) { if ( !attr || !attr->is_initialized ) 109e32: 85 d2 test %edx,%edx 109e34: 74 0f je 109e45 109e36: 83 3a 00 cmpl $0x0,(%edx) 109e39: 74 0a je 109e45 <== NEVER TAKEN return EINVAL; switch ( type ) { 109e3b: 83 f9 03 cmp $0x3,%ecx 109e3e: 77 05 ja 109e45 case PTHREAD_MUTEX_NORMAL: case PTHREAD_MUTEX_RECURSIVE: case PTHREAD_MUTEX_ERRORCHECK: case PTHREAD_MUTEX_DEFAULT: attr->type = type; 109e40: 89 4a 10 mov %ecx,0x10(%edx) return 0; 109e43: 30 c0 xor %al,%al default: return EINVAL; } } 109e45: c9 leave 109e46: c3 ret =============================================================================== 0010a8c8 : int pthread_once( pthread_once_t *once_control, void (*init_routine)(void) ) { 10a8c8: 55 push %ebp 10a8c9: 89 e5 mov %esp,%ebp 10a8cb: 56 push %esi 10a8cc: 53 push %ebx 10a8cd: 83 ec 10 sub $0x10,%esp 10a8d0: 8b 5d 08 mov 0x8(%ebp),%ebx 10a8d3: 8b 75 0c mov 0xc(%ebp),%esi if ( !once_control || !init_routine ) 10a8d6: 85 f6 test %esi,%esi 10a8d8: 74 51 je 10a92b 10a8da: 85 db test %ebx,%ebx 10a8dc: 74 4d je 10a92b once_control->init_executed = true; (*init_routine)(); } rtems_task_mode(saveMode, RTEMS_PREEMPT_MASK, &saveMode); } return 0; 10a8de: 31 c0 xor %eax,%eax ) { if ( !once_control || !init_routine ) return EINVAL; if ( !once_control->init_executed ) { 10a8e0: 83 7b 04 00 cmpl $0x0,0x4(%ebx) 10a8e4: 75 4a jne 10a930 rtems_mode saveMode; rtems_task_mode(RTEMS_NO_PREEMPT, RTEMS_PREEMPT_MASK, &saveMode); 10a8e6: 52 push %edx 10a8e7: 8d 45 f4 lea -0xc(%ebp),%eax 10a8ea: 50 push %eax 10a8eb: 68 00 01 00 00 push $0x100 10a8f0: 68 00 01 00 00 push $0x100 10a8f5: e8 9e 0a 00 00 call 10b398 if ( !once_control->init_executed ) { 10a8fa: 83 c4 10 add $0x10,%esp 10a8fd: 83 7b 04 00 cmpl $0x0,0x4(%ebx) 10a901: 75 0f jne 10a912 <== NEVER TAKEN once_control->is_initialized = true; 10a903: c7 03 01 00 00 00 movl $0x1,(%ebx) once_control->init_executed = true; 10a909: c7 43 04 01 00 00 00 movl $0x1,0x4(%ebx) (*init_routine)(); 10a910: ff d6 call *%esi } rtems_task_mode(saveMode, RTEMS_PREEMPT_MASK, &saveMode); 10a912: 50 push %eax 10a913: 8d 45 f4 lea -0xc(%ebp),%eax 10a916: 50 push %eax 10a917: 68 00 01 00 00 push $0x100 10a91c: ff 75 f4 pushl -0xc(%ebp) 10a91f: e8 74 0a 00 00 call 10b398 10a924: 83 c4 10 add $0x10,%esp } return 0; 10a927: 31 c0 xor %eax,%eax 10a929: eb 05 jmp 10a930 pthread_once_t *once_control, void (*init_routine)(void) ) { if ( !once_control || !init_routine ) return EINVAL; 10a92b: b8 16 00 00 00 mov $0x16,%eax (*init_routine)(); } rtems_task_mode(saveMode, RTEMS_PREEMPT_MASK, &saveMode); } return 0; } 10a930: 8d 65 f8 lea -0x8(%ebp),%esp 10a933: 5b pop %ebx 10a934: 5e pop %esi 10a935: c9 leave 10a936: c3 ret =============================================================================== 0010af40 : int pthread_rwlock_init( pthread_rwlock_t *rwlock, const pthread_rwlockattr_t *attr ) { 10af40: 55 push %ebp 10af41: 89 e5 mov %esp,%ebp 10af43: 56 push %esi 10af44: 53 push %ebx 10af45: 83 ec 10 sub $0x10,%esp 10af48: 8b 5d 08 mov 0x8(%ebp),%ebx /* * Error check parameters */ if ( !rwlock ) return EINVAL; 10af4b: b8 16 00 00 00 mov $0x16,%eax const pthread_rwlockattr_t *the_attr; /* * Error check parameters */ if ( !rwlock ) 10af50: 85 db test %ebx,%ebx 10af52: 0f 84 84 00 00 00 je 10afdc return EINVAL; /* * If the user passed in NULL, use the default attributes */ if ( attr ) { 10af58: 8b 75 0c mov 0xc(%ebp),%esi 10af5b: 85 f6 test %esi,%esi 10af5d: 75 0f jne 10af6e the_attr = attr; } else { (void) pthread_rwlockattr_init( &default_attr ); 10af5f: 83 ec 0c sub $0xc,%esp 10af62: 8d 75 ec lea -0x14(%ebp),%esi 10af65: 56 push %esi 10af66: e8 55 09 00 00 call 10b8c0 10af6b: 83 c4 10 add $0x10,%esp /* * Now start error checking the attributes that we are going to use */ if ( !the_attr->is_initialized ) return EINVAL; 10af6e: b8 16 00 00 00 mov $0x16,%eax } /* * Now start error checking the attributes that we are going to use */ if ( !the_attr->is_initialized ) 10af73: 83 3e 00 cmpl $0x0,(%esi) 10af76: 74 64 je 10afdc <== NEVER TAKEN return EINVAL; switch ( the_attr->process_shared ) { 10af78: 83 7e 04 00 cmpl $0x0,0x4(%esi) 10af7c: 75 5e jne 10afdc <== NEVER TAKEN rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 10af7e: a1 f4 71 12 00 mov 0x1271f4,%eax 10af83: 40 inc %eax 10af84: a3 f4 71 12 00 mov %eax,0x1271f4 * the inactive chain of free RWLock control blocks. */ RTEMS_INLINE_ROUTINE POSIX_RWLock_Control *_POSIX_RWLock_Allocate( void ) { return (POSIX_RWLock_Control *) _Objects_Allocate( &_POSIX_RWLock_Information ); 10af89: 83 ec 0c sub $0xc,%esp 10af8c: 68 00 74 12 00 push $0x127400 10af91: e8 3a 23 00 00 call 10d2d0 <_Objects_Allocate> 10af96: 89 c6 mov %eax,%esi */ _Thread_Disable_dispatch(); /* prevents deletion */ the_rwlock = _POSIX_RWLock_Allocate(); if ( !the_rwlock ) { 10af98: 83 c4 10 add $0x10,%esp 10af9b: 85 c0 test %eax,%eax 10af9d: 75 0c jne 10afab _Thread_Enable_dispatch(); 10af9f: e8 32 2f 00 00 call 10ded6 <_Thread_Enable_dispatch> return EAGAIN; 10afa4: b8 0b 00 00 00 mov $0xb,%eax 10afa9: eb 31 jmp 10afdc } _CORE_RWLock_Initialize( &the_rwlock->RWLock, &the_attributes ); 10afab: 50 push %eax 10afac: 50 push %eax 10afad: 8d 45 f4 lea -0xc(%ebp),%eax 10afb0: 50 push %eax 10afb1: 8d 46 10 lea 0x10(%esi),%eax 10afb4: 50 push %eax 10afb5: e8 6e 1b 00 00 call 10cb28 <_CORE_RWLock_Initialize> uint32_t name ) { _Objects_Set_local_object( information, _Objects_Get_index( the_object->id ), 10afba: 8b 46 08 mov 0x8(%esi),%eax Objects_Information *information, Objects_Control *the_object, uint32_t name ) { _Objects_Set_local_object( 10afbd: 0f b7 c8 movzwl %ax,%ecx #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 10afc0: 8b 15 1c 74 12 00 mov 0x12741c,%edx 10afc6: 89 34 8a mov %esi,(%edx,%ecx,4) _Objects_Get_index( the_object->id ), the_object ); /* ASSERT: information->is_string == false */ the_object->name.name_u32 = name; 10afc9: c7 46 0c 00 00 00 00 movl $0x0,0xc(%esi) &_POSIX_RWLock_Information, &the_rwlock->Object, 0 ); *rwlock = the_rwlock->Object.id; 10afd0: 89 03 mov %eax,(%ebx) _Thread_Enable_dispatch(); 10afd2: e8 ff 2e 00 00 call 10ded6 <_Thread_Enable_dispatch> return 0; 10afd7: 83 c4 10 add $0x10,%esp 10afda: 31 c0 xor %eax,%eax } 10afdc: 8d 65 f8 lea -0x8(%ebp),%esp 10afdf: 5b pop %ebx 10afe0: 5e pop %esi 10afe1: c9 leave 10afe2: c3 ret =============================================================================== 0010afe4 : */ int pthread_rwlock_rdlock( pthread_rwlock_t *rwlock ) { 10afe4: 55 push %ebp 10afe5: 89 e5 mov %esp,%ebp 10afe7: 56 push %esi 10afe8: 53 push %ebx 10afe9: 83 ec 10 sub $0x10,%esp 10afec: 8b 5d 08 mov 0x8(%ebp),%ebx POSIX_RWLock_Control *the_rwlock; Objects_Locations location; if ( !rwlock ) return EINVAL; 10afef: be 16 00 00 00 mov $0x16,%esi ) { POSIX_RWLock_Control *the_rwlock; Objects_Locations location; if ( !rwlock ) 10aff4: 85 db test %ebx,%ebx 10aff6: 74 4b je 10b043 <== NEVER TAKEN RTEMS_INLINE_ROUTINE POSIX_RWLock_Control *_POSIX_RWLock_Get ( pthread_rwlock_t *RWLock, Objects_Locations *location ) { return (POSIX_RWLock_Control *) _Objects_Get( 10aff8: 50 push %eax return EINVAL; the_rwlock = _POSIX_RWLock_Get( rwlock, &location ); 10aff9: 8d 45 f4 lea -0xc(%ebp),%eax 10affc: 50 push %eax 10affd: ff 33 pushl (%ebx) 10afff: 68 00 74 12 00 push $0x127400 10b004: e8 f3 26 00 00 call 10d6fc <_Objects_Get> switch ( location ) { 10b009: 83 c4 10 add $0x10,%esp 10b00c: 83 7d f4 00 cmpl $0x0,-0xc(%ebp) 10b010: 75 31 jne 10b043 case OBJECTS_LOCAL: _CORE_RWLock_Obtain_for_reading( 10b012: 83 ec 0c sub $0xc,%esp 10b015: 6a 00 push $0x0 10b017: 6a 00 push $0x0 10b019: 6a 01 push $0x1 10b01b: ff 33 pushl (%ebx) 10b01d: 83 c0 10 add $0x10,%eax 10b020: 50 push %eax 10b021: e8 36 1b 00 00 call 10cb5c <_CORE_RWLock_Obtain_for_reading> true, /* we are willing to wait forever */ 0, NULL ); _Thread_Enable_dispatch(); 10b026: 83 c4 20 add $0x20,%esp 10b029: e8 a8 2e 00 00 call 10ded6 <_Thread_Enable_dispatch> return _POSIX_RWLock_Translate_core_RWLock_return_code( 10b02e: 83 ec 0c sub $0xc,%esp (CORE_RWLock_Status) _Thread_Executing->Wait.return_code 10b031: a1 44 77 12 00 mov 0x127744,%eax 0, NULL ); _Thread_Enable_dispatch(); return _POSIX_RWLock_Translate_core_RWLock_return_code( 10b036: ff 70 34 pushl 0x34(%eax) 10b039: e8 66 01 00 00 call 10b1a4 <_POSIX_RWLock_Translate_core_RWLock_return_code> 10b03e: 89 c6 mov %eax,%esi 10b040: 83 c4 10 add $0x10,%esp case OBJECTS_ERROR: break; } return EINVAL; } 10b043: 89 f0 mov %esi,%eax 10b045: 8d 65 f8 lea -0x8(%ebp),%esp 10b048: 5b pop %ebx 10b049: 5e pop %esi 10b04a: c9 leave 10b04b: c3 ret =============================================================================== 0010b04c : int pthread_rwlock_timedrdlock( pthread_rwlock_t *rwlock, const struct timespec *abstime ) { 10b04c: 55 push %ebp 10b04d: 89 e5 mov %esp,%ebp 10b04f: 57 push %edi 10b050: 56 push %esi 10b051: 53 push %ebx 10b052: 83 ec 2c sub $0x2c,%esp 10b055: 8b 7d 08 mov 0x8(%ebp),%edi Watchdog_Interval ticks; bool do_wait = true; POSIX_Absolute_timeout_conversion_results_t status; if ( !rwlock ) return EINVAL; 10b058: bb 16 00 00 00 mov $0x16,%ebx Objects_Locations location; Watchdog_Interval ticks; bool do_wait = true; POSIX_Absolute_timeout_conversion_results_t status; if ( !rwlock ) 10b05d: 85 ff test %edi,%edi 10b05f: 0f 84 89 00 00 00 je 10b0ee * * 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 ); 10b065: 50 push %eax 10b066: 50 push %eax 10b067: 8d 45 e0 lea -0x20(%ebp),%eax 10b06a: 50 push %eax 10b06b: ff 75 0c pushl 0xc(%ebp) 10b06e: e8 09 58 00 00 call 11087c <_POSIX_Absolute_timeout_to_ticks> 10b073: 89 c6 mov %eax,%esi 10b075: 83 c4 0c add $0xc,%esp if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE ) do_wait = false; the_rwlock = _POSIX_RWLock_Get( rwlock, &location ); 10b078: 8d 45 e4 lea -0x1c(%ebp),%eax 10b07b: 50 push %eax 10b07c: ff 37 pushl (%edi) 10b07e: 68 00 74 12 00 push $0x127400 10b083: e8 74 26 00 00 call 10d6fc <_Objects_Get> switch ( location ) { 10b088: 83 c4 10 add $0x10,%esp 10b08b: 83 7d e4 00 cmpl $0x0,-0x1c(%ebp) 10b08f: 75 5d jne 10b0ee int _EXFUN(pthread_rwlock_init, (pthread_rwlock_t *__rwlock, _CONST pthread_rwlockattr_t *__attr)); int _EXFUN(pthread_rwlock_destroy, (pthread_rwlock_t *__rwlock)); int _EXFUN(pthread_rwlock_rdlock,(pthread_rwlock_t *__rwlock)); int _EXFUN(pthread_rwlock_tryrdlock,(pthread_rwlock_t *__rwlock)); int _EXFUN(pthread_rwlock_timedrdlock, 10b091: 83 fe 03 cmp $0x3,%esi 10b094: 0f 94 c2 sete %dl case OBJECTS_LOCAL: _CORE_RWLock_Obtain_for_reading( 10b097: 83 ec 0c sub $0xc,%esp 10b09a: 6a 00 push $0x0 10b09c: ff 75 e0 pushl -0x20(%ebp) 10b09f: 0f b6 ca movzbl %dl,%ecx 10b0a2: 51 push %ecx 10b0a3: ff 37 pushl (%edi) 10b0a5: 83 c0 10 add $0x10,%eax 10b0a8: 50 push %eax 10b0a9: 88 55 d4 mov %dl,-0x2c(%ebp) 10b0ac: e8 ab 1a 00 00 call 10cb5c <_CORE_RWLock_Obtain_for_reading> do_wait, ticks, NULL ); _Thread_Enable_dispatch(); 10b0b1: 83 c4 20 add $0x20,%esp 10b0b4: e8 1d 2e 00 00 call 10ded6 <_Thread_Enable_dispatch> if ( !do_wait ) { 10b0b9: 8a 55 d4 mov -0x2c(%ebp),%dl 10b0bc: 84 d2 test %dl,%dl 10b0be: 75 19 jne 10b0d9 if ( _Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE ) { 10b0c0: a1 44 77 12 00 mov 0x127744,%eax 10b0c5: 83 78 34 02 cmpl $0x2,0x34(%eax) 10b0c9: 75 0e jne 10b0d9 switch (status) { 10b0cb: 85 f6 test %esi,%esi 10b0cd: 74 1f je 10b0ee <== NEVER TAKEN case POSIX_ABSOLUTE_TIMEOUT_INVALID: return EINVAL; case POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST: case POSIX_ABSOLUTE_TIMEOUT_IS_NOW: return ETIMEDOUT; 10b0cf: bb 74 00 00 00 mov $0x74,%ebx ); _Thread_Enable_dispatch(); if ( !do_wait ) { if ( _Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE ) { switch (status) { 10b0d4: 83 fe 02 cmp $0x2,%esi 10b0d7: 76 15 jbe 10b0ee <== ALWAYS TAKEN break; } } } return _POSIX_RWLock_Translate_core_RWLock_return_code( 10b0d9: 83 ec 0c sub $0xc,%esp (CORE_RWLock_Status) _Thread_Executing->Wait.return_code 10b0dc: a1 44 77 12 00 mov 0x127744,%eax break; } } } return _POSIX_RWLock_Translate_core_RWLock_return_code( 10b0e1: ff 70 34 pushl 0x34(%eax) 10b0e4: e8 bb 00 00 00 call 10b1a4 <_POSIX_RWLock_Translate_core_RWLock_return_code> 10b0e9: 89 c3 mov %eax,%ebx 10b0eb: 83 c4 10 add $0x10,%esp case OBJECTS_ERROR: break; } return EINVAL; } 10b0ee: 89 d8 mov %ebx,%eax 10b0f0: 8d 65 f4 lea -0xc(%ebp),%esp 10b0f3: 5b pop %ebx 10b0f4: 5e pop %esi 10b0f5: 5f pop %edi 10b0f6: c9 leave 10b0f7: c3 ret =============================================================================== 0010b0f8 : int pthread_rwlock_timedwrlock( pthread_rwlock_t *rwlock, const struct timespec *abstime ) { 10b0f8: 55 push %ebp 10b0f9: 89 e5 mov %esp,%ebp 10b0fb: 57 push %edi 10b0fc: 56 push %esi 10b0fd: 53 push %ebx 10b0fe: 83 ec 2c sub $0x2c,%esp 10b101: 8b 7d 08 mov 0x8(%ebp),%edi Watchdog_Interval ticks; bool do_wait = true; POSIX_Absolute_timeout_conversion_results_t status; if ( !rwlock ) return EINVAL; 10b104: bb 16 00 00 00 mov $0x16,%ebx Objects_Locations location; Watchdog_Interval ticks; bool do_wait = true; POSIX_Absolute_timeout_conversion_results_t status; if ( !rwlock ) 10b109: 85 ff test %edi,%edi 10b10b: 0f 84 89 00 00 00 je 10b19a * * 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 ); 10b111: 50 push %eax 10b112: 50 push %eax 10b113: 8d 45 e0 lea -0x20(%ebp),%eax 10b116: 50 push %eax 10b117: ff 75 0c pushl 0xc(%ebp) 10b11a: e8 5d 57 00 00 call 11087c <_POSIX_Absolute_timeout_to_ticks> 10b11f: 89 c6 mov %eax,%esi 10b121: 83 c4 0c add $0xc,%esp if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE ) do_wait = false; the_rwlock = _POSIX_RWLock_Get( rwlock, &location ); 10b124: 8d 45 e4 lea -0x1c(%ebp),%eax 10b127: 50 push %eax 10b128: ff 37 pushl (%edi) 10b12a: 68 00 74 12 00 push $0x127400 10b12f: e8 c8 25 00 00 call 10d6fc <_Objects_Get> switch ( location ) { 10b134: 83 c4 10 add $0x10,%esp 10b137: 83 7d e4 00 cmpl $0x0,-0x1c(%ebp) 10b13b: 75 5d jne 10b19a (pthread_rwlock_t *__rwlock, _CONST struct timespec *__abstime)); int _EXFUN(pthread_rwlock_unlock,(pthread_rwlock_t *__rwlock)); int _EXFUN(pthread_rwlock_wrlock,(pthread_rwlock_t *__rwlock)); int _EXFUN(pthread_rwlock_trywrlock,(pthread_rwlock_t *__rwlock)); int _EXFUN(pthread_rwlock_timedwrlock, 10b13d: 83 fe 03 cmp $0x3,%esi 10b140: 0f 94 c2 sete %dl case OBJECTS_LOCAL: _CORE_RWLock_Obtain_for_writing( 10b143: 83 ec 0c sub $0xc,%esp 10b146: 6a 00 push $0x0 10b148: ff 75 e0 pushl -0x20(%ebp) 10b14b: 0f b6 ca movzbl %dl,%ecx 10b14e: 51 push %ecx 10b14f: ff 37 pushl (%edi) 10b151: 83 c0 10 add $0x10,%eax 10b154: 50 push %eax 10b155: 88 55 d4 mov %dl,-0x2c(%ebp) 10b158: e8 b7 1a 00 00 call 10cc14 <_CORE_RWLock_Obtain_for_writing> do_wait, ticks, NULL ); _Thread_Enable_dispatch(); 10b15d: 83 c4 20 add $0x20,%esp 10b160: e8 71 2d 00 00 call 10ded6 <_Thread_Enable_dispatch> if ( !do_wait && 10b165: 8a 55 d4 mov -0x2c(%ebp),%dl 10b168: 84 d2 test %dl,%dl 10b16a: 75 19 jne 10b185 (_Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE) ) { 10b16c: a1 44 77 12 00 mov 0x127744,%eax ticks, NULL ); _Thread_Enable_dispatch(); if ( !do_wait && 10b171: 83 78 34 02 cmpl $0x2,0x34(%eax) 10b175: 75 0e jne 10b185 (_Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE) ) { switch (status) { 10b177: 85 f6 test %esi,%esi 10b179: 74 1f je 10b19a <== NEVER TAKEN case POSIX_ABSOLUTE_TIMEOUT_INVALID: return EINVAL; case POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST: case POSIX_ABSOLUTE_TIMEOUT_IS_NOW: return ETIMEDOUT; 10b17b: bb 74 00 00 00 mov $0x74,%ebx ); _Thread_Enable_dispatch(); if ( !do_wait && (_Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE) ) { switch (status) { 10b180: 83 fe 02 cmp $0x2,%esi 10b183: 76 15 jbe 10b19a <== ALWAYS TAKEN case POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE: break; } } return _POSIX_RWLock_Translate_core_RWLock_return_code( 10b185: 83 ec 0c sub $0xc,%esp (CORE_RWLock_Status) _Thread_Executing->Wait.return_code 10b188: a1 44 77 12 00 mov 0x127744,%eax case POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE: break; } } return _POSIX_RWLock_Translate_core_RWLock_return_code( 10b18d: ff 70 34 pushl 0x34(%eax) 10b190: e8 0f 00 00 00 call 10b1a4 <_POSIX_RWLock_Translate_core_RWLock_return_code> 10b195: 89 c3 mov %eax,%ebx 10b197: 83 c4 10 add $0x10,%esp case OBJECTS_ERROR: break; } return EINVAL; } 10b19a: 89 d8 mov %ebx,%eax 10b19c: 8d 65 f4 lea -0xc(%ebp),%esp 10b19f: 5b pop %ebx 10b1a0: 5e pop %esi 10b1a1: 5f pop %edi 10b1a2: c9 leave 10b1a3: c3 ret =============================================================================== 0010b8e0 : int pthread_rwlockattr_setpshared( pthread_rwlockattr_t *attr, int pshared ) { 10b8e0: 55 push %ebp 10b8e1: 89 e5 mov %esp,%ebp 10b8e3: 8b 55 08 mov 0x8(%ebp),%edx 10b8e6: 8b 4d 0c mov 0xc(%ebp),%ecx if ( !attr ) return EINVAL; 10b8e9: b8 16 00 00 00 mov $0x16,%eax int pthread_rwlockattr_setpshared( pthread_rwlockattr_t *attr, int pshared ) { if ( !attr ) 10b8ee: 85 d2 test %edx,%edx 10b8f0: 74 0f je 10b901 return EINVAL; if ( !attr->is_initialized ) 10b8f2: 83 3a 00 cmpl $0x0,(%edx) 10b8f5: 74 0a je 10b901 return EINVAL; switch ( pshared ) { 10b8f7: 83 f9 01 cmp $0x1,%ecx 10b8fa: 77 05 ja 10b901 <== NEVER TAKEN case PTHREAD_PROCESS_SHARED: case PTHREAD_PROCESS_PRIVATE: attr->process_shared = pshared; 10b8fc: 89 4a 04 mov %ecx,0x4(%edx) return 0; 10b8ff: 30 c0 xor %al,%al default: return EINVAL; } } 10b901: c9 leave 10b902: c3 ret =============================================================================== 0010c778 : int pthread_setschedparam( pthread_t thread, int policy, struct sched_param *param ) { 10c778: 55 push %ebp 10c779: 89 e5 mov %esp,%ebp 10c77b: 57 push %edi 10c77c: 56 push %esi 10c77d: 53 push %ebx 10c77e: 83 ec 2c sub $0x2c,%esp 10c781: 8b 75 10 mov 0x10(%ebp),%esi /* * Check all the parameters */ if ( !param ) return EINVAL; 10c784: c7 45 d4 16 00 00 00 movl $0x16,-0x2c(%ebp) int rc; /* * Check all the parameters */ if ( !param ) 10c78b: 85 f6 test %esi,%esi 10c78d: 0f 84 00 01 00 00 je 10c893 <== NEVER TAKEN return EINVAL; rc = _POSIX_Thread_Translate_sched_param( 10c793: 8d 45 e0 lea -0x20(%ebp),%eax 10c796: 50 push %eax 10c797: 8d 45 e4 lea -0x1c(%ebp),%eax 10c79a: 50 push %eax 10c79b: 56 push %esi 10c79c: ff 75 0c pushl 0xc(%ebp) 10c79f: e8 c4 51 00 00 call 111968 <_POSIX_Thread_Translate_sched_param> 10c7a4: 89 45 d4 mov %eax,-0x2c(%ebp) policy, param, &budget_algorithm, &budget_callout ); if ( rc ) 10c7a7: 83 c4 10 add $0x10,%esp 10c7aa: 85 c0 test %eax,%eax 10c7ac: 0f 85 e1 00 00 00 jne 10c893 <== NEVER TAKEN 10c7b2: 53 push %ebx return rc; /* * Actually change the scheduling policy and parameters */ the_thread = _POSIX_Threads_Get( thread, &location ); 10c7b3: 8d 45 dc lea -0x24(%ebp),%eax 10c7b6: 50 push %eax 10c7b7: ff 75 08 pushl 0x8(%ebp) 10c7ba: 68 80 94 12 00 push $0x129480 10c7bf: e8 88 1c 00 00 call 10e44c <_Objects_Get> 10c7c4: 89 c2 mov %eax,%edx switch ( location ) { 10c7c6: 83 c4 10 add $0x10,%esp 10c7c9: 83 7d dc 00 cmpl $0x0,-0x24(%ebp) 10c7cd: 0f 85 b9 00 00 00 jne 10c88c <== NEVER TAKEN case OBJECTS_LOCAL: api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 10c7d3: 8b 98 f8 00 00 00 mov 0xf8(%eax),%ebx if ( api->schedpolicy == SCHED_SPORADIC ) 10c7d9: 83 bb 80 00 00 00 04 cmpl $0x4,0x80(%ebx) 10c7e0: 75 18 jne 10c7fa (void) _Watchdog_Remove( &api->Sporadic_timer ); 10c7e2: 83 ec 0c sub $0xc,%esp 10c7e5: 8d 83 a4 00 00 00 lea 0xa4(%ebx),%eax 10c7eb: 50 push %eax 10c7ec: 89 55 d0 mov %edx,-0x30(%ebp) 10c7ef: e8 50 34 00 00 call 10fc44 <_Watchdog_Remove> 10c7f4: 83 c4 10 add $0x10,%esp 10c7f7: 8b 55 d0 mov -0x30(%ebp),%edx api->schedpolicy = policy; 10c7fa: 8b 45 0c mov 0xc(%ebp),%eax 10c7fd: 89 83 80 00 00 00 mov %eax,0x80(%ebx) api->schedparam = *param; 10c803: 8d bb 84 00 00 00 lea 0x84(%ebx),%edi 10c809: b9 07 00 00 00 mov $0x7,%ecx 10c80e: f3 a5 rep movsl %ds:(%esi),%es:(%edi) the_thread->budget_algorithm = budget_algorithm; 10c810: 8b 45 e4 mov -0x1c(%ebp),%eax 10c813: 89 42 7c mov %eax,0x7c(%edx) the_thread->budget_callout = budget_callout; 10c816: 8b 45 e0 mov -0x20(%ebp),%eax 10c819: 89 82 80 00 00 00 mov %eax,0x80(%edx) switch ( api->schedpolicy ) { 10c81f: 83 7d 0c 00 cmpl $0x0,0xc(%ebp) 10c823: 78 60 js 10c885 <== NEVER TAKEN 10c825: 83 7d 0c 02 cmpl $0x2,0xc(%ebp) 10c829: 7e 08 jle 10c833 10c82b: 83 7d 0c 04 cmpl $0x4,0xc(%ebp) 10c82f: 75 54 jne 10c885 <== NEVER TAKEN 10c831: eb 24 jmp 10c857 case SCHED_OTHER: case SCHED_FIFO: case SCHED_RR: the_thread->cpu_time_budget = _Thread_Ticks_per_timeslice; 10c833: a1 04 92 12 00 mov 0x129204,%eax 10c838: 89 42 78 mov %eax,0x78(%edx) 10c83b: 0f b6 05 18 52 12 00 movzbl 0x125218,%eax 10c842: 2b 83 84 00 00 00 sub 0x84(%ebx),%eax the_thread->real_priority = 10c848: 89 42 18 mov %eax,0x18(%edx) _POSIX_Priority_To_core( api->schedparam.sched_priority ); _Thread_Change_priority( 10c84b: 51 push %ecx 10c84c: 6a 01 push $0x1 10c84e: 50 push %eax 10c84f: 52 push %edx 10c850: e8 3f 1f 00 00 call 10e794 <_Thread_Change_priority> 10c855: eb 2b jmp 10c882 true ); break; case SCHED_SPORADIC: api->ss_high_priority = api->schedparam.sched_priority; 10c857: 8b 83 84 00 00 00 mov 0x84(%ebx),%eax 10c85d: 89 83 a0 00 00 00 mov %eax,0xa0(%ebx) _Watchdog_Remove( &api->Sporadic_timer ); 10c863: 83 ec 0c sub $0xc,%esp 10c866: 81 c3 a4 00 00 00 add $0xa4,%ebx 10c86c: 53 push %ebx 10c86d: 89 55 d0 mov %edx,-0x30(%ebp) 10c870: e8 cf 33 00 00 call 10fc44 <_Watchdog_Remove> _POSIX_Threads_Sporadic_budget_TSR( 0, the_thread ); 10c875: 58 pop %eax 10c876: 5a pop %edx 10c877: 8b 55 d0 mov -0x30(%ebp),%edx 10c87a: 52 push %edx 10c87b: 6a 00 push $0x0 10c87d: e8 e1 fd ff ff call 10c663 <_POSIX_Threads_Sporadic_budget_TSR> break; 10c882: 83 c4 10 add $0x10,%esp } _Thread_Enable_dispatch(); 10c885: e8 9c 23 00 00 call 10ec26 <_Thread_Enable_dispatch> return 0; 10c88a: eb 07 jmp 10c893 #endif case OBJECTS_ERROR: break; } return ESRCH; 10c88c: c7 45 d4 03 00 00 00 movl $0x3,-0x2c(%ebp) } 10c893: 8b 45 d4 mov -0x2c(%ebp),%eax 10c896: 8d 65 f4 lea -0xc(%ebp),%esp 10c899: 5b pop %ebx 10c89a: 5e pop %esi 10c89b: 5f pop %edi 10c89c: c9 leave 10c89d: c3 ret =============================================================================== 0010a6a4 : * * 18.2.2 Setting Cancelability State, P1003.1c/Draft 10, p. 183 */ void pthread_testcancel( void ) { 10a6a4: 55 push %ebp 10a6a5: 89 e5 mov %esp,%ebp 10a6a7: 53 push %ebx 10a6a8: 83 ec 04 sub $0x4,%esp * Don't even think about deleting a resource from an ISR. * Besides this request is supposed to be for _Thread_Executing * and the ISR context is not a thread. */ if ( _ISR_Is_in_progress() ) 10a6ab: 83 3d 18 67 12 00 00 cmpl $0x0,0x126718 10a6b2: 75 48 jne 10a6fc <== NEVER TAKEN return; thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; 10a6b4: a1 1c 67 12 00 mov 0x12671c,%eax 10a6b9: 8b 80 f8 00 00 00 mov 0xf8(%eax),%eax 10a6bf: 8b 15 cc 61 12 00 mov 0x1261cc,%edx 10a6c5: 42 inc %edx 10a6c6: 89 15 cc 61 12 00 mov %edx,0x1261cc */ void pthread_testcancel( void ) { POSIX_API_Control *thread_support; bool cancel = false; 10a6cc: 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 && 10a6ce: 83 b8 d4 00 00 00 00 cmpl $0x0,0xd4(%eax) 10a6d5: 75 0a jne 10a6e1 <== NEVER TAKEN /* Setting Cancelability State, P1003.1c/Draft 10, p. 183 */ int _EXFUN(pthread_setcancelstate, (int __state, int *__oldstate)); int _EXFUN(pthread_setcanceltype, (int __type, int *__oldtype)); void _EXFUN(pthread_testcancel, (void)); 10a6d7: 83 b8 dc 00 00 00 00 cmpl $0x0,0xdc(%eax) 10a6de: 0f 95 c3 setne %bl thread_support->cancelation_requested ) cancel = true; _Thread_Enable_dispatch(); 10a6e1: e8 14 23 00 00 call 10c9fa <_Thread_Enable_dispatch> if ( cancel ) 10a6e6: 84 db test %bl,%bl 10a6e8: 74 12 je 10a6fc _POSIX_Thread_Exit( _Thread_Executing, PTHREAD_CANCELED ); 10a6ea: 50 push %eax 10a6eb: 50 push %eax 10a6ec: 6a ff push $0xffffffff 10a6ee: ff 35 1c 67 12 00 pushl 0x12671c 10a6f4: e8 5f 51 00 00 call 10f858 <_POSIX_Thread_Exit> 10a6f9: 83 c4 10 add $0x10,%esp <== NOT EXECUTED } 10a6fc: 8b 5d fc mov -0x4(%ebp),%ebx 10a6ff: c9 leave 10a700: c3 ret =============================================================================== 0010c7b4 : #include #include void rtems_iterate_over_all_threads(rtems_per_thread_routine routine) { 10c7b4: 55 push %ebp 10c7b5: 89 e5 mov %esp,%ebp 10c7b7: 57 push %edi 10c7b8: 56 push %esi 10c7b9: 53 push %ebx 10c7ba: 83 ec 0c sub $0xc,%esp uint32_t i; uint32_t api_index; Thread_Control *the_thread; Objects_Information *information; if ( !routine ) 10c7bd: 83 7d 08 00 cmpl $0x0,0x8(%ebp) 10c7c1: 74 41 je 10c804 <== NEVER TAKEN 10c7c3: bb 01 00 00 00 mov $0x1,%ebx return; for ( api_index = 1 ; api_index <= OBJECTS_APIS_LAST ; api_index++ ) { if ( !_Objects_Information_table[ api_index ] ) 10c7c8: 8b 04 9d 20 02 13 00 mov 0x130220(,%ebx,4),%eax 10c7cf: 85 c0 test %eax,%eax 10c7d1: 74 2b je 10c7fe <== NEVER TAKEN continue; information = _Objects_Information_table[ api_index ][ 1 ]; 10c7d3: 8b 78 04 mov 0x4(%eax),%edi if ( !information ) 10c7d6: be 01 00 00 00 mov $0x1,%esi 10c7db: 85 ff test %edi,%edi 10c7dd: 75 17 jne 10c7f6 10c7df: eb 1d jmp 10c7fe continue; for ( i=1 ; i <= information->maximum ; i++ ) { the_thread = (Thread_Control *)information->local_table[ i ]; 10c7e1: 8b 47 1c mov 0x1c(%edi),%eax 10c7e4: 8b 04 b0 mov (%eax,%esi,4),%eax if ( !the_thread ) 10c7e7: 85 c0 test %eax,%eax 10c7e9: 74 0a je 10c7f5 <== NEVER TAKEN continue; (*routine)(the_thread); 10c7eb: 83 ec 0c sub $0xc,%esp 10c7ee: 50 push %eax 10c7ef: ff 55 08 call *0x8(%ebp) 10c7f2: 83 c4 10 add $0x10,%esp information = _Objects_Information_table[ api_index ][ 1 ]; if ( !information ) continue; for ( i=1 ; i <= information->maximum ; i++ ) { 10c7f5: 46 inc %esi 10c7f6: 0f b7 47 10 movzwl 0x10(%edi),%eax 10c7fa: 39 c6 cmp %eax,%esi 10c7fc: 76 e3 jbe 10c7e1 Objects_Information *information; if ( !routine ) return; for ( api_index = 1 ; api_index <= OBJECTS_APIS_LAST ; api_index++ ) { 10c7fe: 43 inc %ebx 10c7ff: 83 fb 04 cmp $0x4,%ebx 10c802: 75 c4 jne 10c7c8 (*routine)(the_thread); } } } 10c804: 8d 65 f4 lea -0xc(%ebp),%esp 10c807: 5b pop %ebx 10c808: 5e pop %esi 10c809: 5f pop %edi 10c80a: c9 leave 10c80b: c3 ret =============================================================================== 001148d0 : uint32_t length, uint32_t buffer_size, rtems_attribute attribute_set, rtems_id *id ) { 1148d0: 55 push %ebp 1148d1: 89 e5 mov %esp,%ebp 1148d3: 57 push %edi 1148d4: 56 push %esi 1148d5: 53 push %ebx 1148d6: 83 ec 1c sub $0x1c,%esp 1148d9: 8b 75 0c mov 0xc(%ebp),%esi 1148dc: 8b 55 10 mov 0x10(%ebp),%edx 1148df: 8b 7d 14 mov 0x14(%ebp),%edi register Partition_Control *the_partition; if ( !rtems_is_name_valid( name ) ) return RTEMS_INVALID_NAME; 1148e2: b8 03 00 00 00 mov $0x3,%eax rtems_id *id ) { register Partition_Control *the_partition; if ( !rtems_is_name_valid( name ) ) 1148e7: 83 7d 08 00 cmpl $0x0,0x8(%ebp) 1148eb: 0f 84 ce 00 00 00 je 1149bf return RTEMS_INVALID_NAME; if ( !starting_address ) return RTEMS_INVALID_ADDRESS; 1148f1: b0 09 mov $0x9,%al register Partition_Control *the_partition; if ( !rtems_is_name_valid( name ) ) return RTEMS_INVALID_NAME; if ( !starting_address ) 1148f3: 85 f6 test %esi,%esi 1148f5: 0f 84 c4 00 00 00 je 1149bf return RTEMS_INVALID_ADDRESS; if ( !id ) 1148fb: 83 7d 1c 00 cmpl $0x0,0x1c(%ebp) 1148ff: 0f 84 ba 00 00 00 je 1149bf <== NEVER TAKEN return RTEMS_INVALID_ADDRESS; if ( length == 0 || buffer_size == 0 || length < buffer_size || 114905: 85 ff test %edi,%edi 114907: 0f 84 ad 00 00 00 je 1149ba 11490d: 85 d2 test %edx,%edx 11490f: 0f 84 a5 00 00 00 je 1149ba !_Partition_Is_buffer_size_aligned( buffer_size ) ) return RTEMS_INVALID_SIZE; 114915: b0 08 mov $0x8,%al return RTEMS_INVALID_ADDRESS; if ( !id ) return RTEMS_INVALID_ADDRESS; if ( length == 0 || buffer_size == 0 || length < buffer_size || 114917: 39 fa cmp %edi,%edx 114919: 0f 82 a0 00 00 00 jb 1149bf 11491f: f7 c7 03 00 00 00 test $0x3,%edi 114925: 0f 85 94 00 00 00 jne 1149bf !_Partition_Is_buffer_size_aligned( buffer_size ) ) return RTEMS_INVALID_SIZE; if ( !_Addresses_Is_aligned( starting_address ) ) return RTEMS_INVALID_ADDRESS; 11492b: 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 ) ) 11492d: f7 c6 03 00 00 00 test $0x3,%esi 114933: 0f 85 86 00 00 00 jne 1149bf 114939: a1 b8 e5 13 00 mov 0x13e5b8,%eax 11493e: 40 inc %eax 11493f: a3 b8 e5 13 00 mov %eax,0x13e5b8 * 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 ); 114944: 83 ec 0c sub $0xc,%esp 114947: 68 44 e4 13 00 push $0x13e444 11494c: 89 55 e4 mov %edx,-0x1c(%ebp) 11494f: e8 28 3e 00 00 call 11877c <_Objects_Allocate> 114954: 89 c3 mov %eax,%ebx _Thread_Disable_dispatch(); /* prevents deletion */ the_partition = _Partition_Allocate(); if ( !the_partition ) { 114956: 83 c4 10 add $0x10,%esp 114959: 85 c0 test %eax,%eax 11495b: 8b 55 e4 mov -0x1c(%ebp),%edx 11495e: 75 0c jne 11496c _Thread_Enable_dispatch(); 114960: e8 59 4a 00 00 call 1193be <_Thread_Enable_dispatch> return RTEMS_TOO_MANY; 114965: b8 05 00 00 00 mov $0x5,%eax 11496a: eb 53 jmp 1149bf _Thread_Enable_dispatch(); return RTEMS_TOO_MANY; } #endif the_partition->starting_address = starting_address; 11496c: 89 70 10 mov %esi,0x10(%eax) the_partition->length = length; 11496f: 89 50 14 mov %edx,0x14(%eax) the_partition->buffer_size = buffer_size; 114972: 89 78 18 mov %edi,0x18(%eax) the_partition->attribute_set = attribute_set; 114975: 8b 45 18 mov 0x18(%ebp),%eax 114978: 89 43 1c mov %eax,0x1c(%ebx) the_partition->number_of_used_blocks = 0; 11497b: c7 43 20 00 00 00 00 movl $0x0,0x20(%ebx) _Chain_Initialize( &the_partition->Memory, starting_address, 114982: 57 push %edi 114983: 89 d0 mov %edx,%eax 114985: 31 d2 xor %edx,%edx 114987: f7 f7 div %edi 114989: 50 push %eax 11498a: 56 push %esi 11498b: 8d 43 24 lea 0x24(%ebx),%eax 11498e: 50 push %eax 11498f: e8 8c 2a 00 00 call 117420 <_Chain_Initialize> Objects_Name name ) { _Objects_Set_local_object( information, _Objects_Get_index( the_object->id ), 114994: 8b 43 08 mov 0x8(%ebx),%eax Objects_Information *information, Objects_Control *the_object, Objects_Name name ) { _Objects_Set_local_object( 114997: 0f b7 c8 movzwl %ax,%ecx #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 11499a: 8b 15 60 e4 13 00 mov 0x13e460,%edx 1149a0: 89 1c 8a mov %ebx,(%edx,%ecx,4) information, _Objects_Get_index( the_object->id ), the_object ); the_object->name = name; 1149a3: 8b 55 08 mov 0x8(%ebp),%edx 1149a6: 89 53 0c mov %edx,0xc(%ebx) &_Partition_Information, &the_partition->Object, (Objects_Name) name ); *id = the_partition->Object.id; 1149a9: 8b 55 1c mov 0x1c(%ebp),%edx 1149ac: 89 02 mov %eax,(%edx) name, 0 /* Not used */ ); #endif _Thread_Enable_dispatch(); 1149ae: e8 0b 4a 00 00 call 1193be <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 1149b3: 83 c4 10 add $0x10,%esp 1149b6: 31 c0 xor %eax,%eax 1149b8: eb 05 jmp 1149bf 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; 1149ba: b8 08 00 00 00 mov $0x8,%eax ); #endif _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } 1149bf: 8d 65 f4 lea -0xc(%ebp),%esp 1149c2: 5b pop %ebx 1149c3: 5e pop %esi 1149c4: 5f pop %edi 1149c5: c9 leave 1149c6: c3 ret =============================================================================== 0010b095 : rtems_status_code rtems_rate_monotonic_period( rtems_id id, rtems_interval length ) { 10b095: 55 push %ebp 10b096: 89 e5 mov %esp,%ebp 10b098: 57 push %edi 10b099: 56 push %esi 10b09a: 53 push %ebx 10b09b: 83 ec 30 sub $0x30,%esp 10b09e: 8b 75 08 mov 0x8(%ebp),%esi 10b0a1: 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 ); 10b0a4: 8d 45 e4 lea -0x1c(%ebp),%eax Objects_Id id, Objects_Locations *location ) { return (Rate_monotonic_Control *) _Objects_Get( &_Rate_monotonic_Information, id, location ); 10b0a7: 50 push %eax 10b0a8: 56 push %esi 10b0a9: 68 14 72 12 00 push $0x127214 10b0ae: e8 49 1e 00 00 call 10cefc <_Objects_Get> 10b0b3: 89 c7 mov %eax,%edi switch ( location ) { 10b0b5: 83 c4 10 add $0x10,%esp 10b0b8: 83 7d e4 00 cmpl $0x0,-0x1c(%ebp) 10b0bc: 0f 85 3d 01 00 00 jne 10b1ff case OBJECTS_LOCAL: if ( !_Thread_Is_executing( the_period->owner ) ) { 10b0c2: a1 58 78 12 00 mov 0x127858,%eax 10b0c7: 39 47 40 cmp %eax,0x40(%edi) 10b0ca: 74 0f je 10b0db _Thread_Enable_dispatch(); 10b0cc: e8 05 26 00 00 call 10d6d6 <_Thread_Enable_dispatch> return RTEMS_NOT_OWNER_OF_RESOURCE; 10b0d1: bb 17 00 00 00 mov $0x17,%ebx 10b0d6: e9 29 01 00 00 jmp 10b204 } if ( length == RTEMS_PERIOD_STATUS ) { 10b0db: 85 db test %ebx,%ebx 10b0dd: 75 19 jne 10b0f8 switch ( the_period->state ) { 10b0df: 8b 47 38 mov 0x38(%edi),%eax 10b0e2: 83 f8 04 cmp $0x4,%eax 10b0e5: 77 07 ja 10b0ee <== NEVER TAKEN 10b0e7: 8b 1c 85 04 0f 12 00 mov 0x120f04(,%eax,4),%ebx case RATE_MONOTONIC_ACTIVE: default: /* unreached -- only to remove warnings */ return_value = RTEMS_SUCCESSFUL; break; } _Thread_Enable_dispatch(); 10b0ee: e8 e3 25 00 00 call 10d6d6 <_Thread_Enable_dispatch> return( return_value ); 10b0f3: e9 0c 01 00 00 jmp 10b204 } _ISR_Disable( level ); 10b0f8: 9c pushf 10b0f9: fa cli 10b0fa: 8f 45 d4 popl -0x2c(%ebp) switch ( the_period->state ) { 10b0fd: 8b 47 38 mov 0x38(%edi),%eax 10b100: 83 f8 02 cmp $0x2,%eax 10b103: 74 5d je 10b162 10b105: 83 f8 04 cmp $0x4,%eax 10b108: 0f 84 b8 00 00 00 je 10b1c6 10b10e: 85 c0 test %eax,%eax 10b110: 0f 85 e9 00 00 00 jne 10b1ff <== NEVER TAKEN case RATE_MONOTONIC_INACTIVE: { _ISR_Enable( level ); 10b116: ff 75 d4 pushl -0x2c(%ebp) 10b119: 9d popf /* * Baseline statistics information for the beginning of a period. */ _Rate_monotonic_Initiate_statistics( the_period ); 10b11a: 83 ec 0c sub $0xc,%esp 10b11d: 57 push %edi 10b11e: e8 2f fe ff ff call 10af52 <_Rate_monotonic_Initiate_statistics> the_period->state = RATE_MONOTONIC_ACTIVE; 10b123: c7 47 38 02 00 00 00 movl $0x2,0x38(%edi) Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 10b12a: c7 47 18 00 00 00 00 movl $0x0,0x18(%edi) the_watchdog->routine = routine; 10b131: c7 47 2c 10 b4 10 00 movl $0x10b410,0x2c(%edi) the_watchdog->id = id; 10b138: 89 77 30 mov %esi,0x30(%edi) the_watchdog->user_data = user_data; 10b13b: c7 47 34 00 00 00 00 movl $0x0,0x34(%edi) _Rate_monotonic_Timeout, id, NULL ); the_period->next_length = length; 10b142: 89 5f 3c mov %ebx,0x3c(%edi) Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 10b145: 89 5f 1c mov %ebx,0x1c(%edi) _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 10b148: 58 pop %eax 10b149: 5a pop %edx _Watchdog_Insert_ticks( &the_period->Timer, length ); 10b14a: 83 c7 10 add $0x10,%edi 10b14d: 57 push %edi 10b14e: 68 d0 73 12 00 push $0x1273d0 10b153: e8 e8 34 00 00 call 10e640 <_Watchdog_Insert> _Thread_Enable_dispatch(); 10b158: e8 79 25 00 00 call 10d6d6 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 10b15d: 83 c4 10 add $0x10,%esp 10b160: eb 60 jmp 10b1c2 case RATE_MONOTONIC_ACTIVE: /* * Update statistics from the concluding period. */ _Rate_monotonic_Update_statistics( the_period ); 10b162: 83 ec 0c sub $0xc,%esp 10b165: 57 push %edi 10b166: e8 4f fe ff ff call 10afba <_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; 10b16b: c7 47 38 01 00 00 00 movl $0x1,0x38(%edi) the_period->next_length = length; 10b172: 89 5f 3c mov %ebx,0x3c(%edi) _ISR_Enable( level ); 10b175: ff 75 d4 pushl -0x2c(%ebp) 10b178: 9d popf _Thread_Executing->Wait.id = the_period->Object.id; 10b179: a1 58 78 12 00 mov 0x127858,%eax 10b17e: 8b 57 08 mov 0x8(%edi),%edx 10b181: 89 50 20 mov %edx,0x20(%eax) _Thread_Set_state( _Thread_Executing, STATES_WAITING_FOR_PERIOD ); 10b184: 5b pop %ebx 10b185: 5e pop %esi 10b186: 68 00 40 00 00 push $0x4000 10b18b: 50 push %eax 10b18c: e8 43 2d 00 00 call 10ded4 <_Thread_Set_state> /* * Did the watchdog timer expire while we were actually blocking * on it? */ _ISR_Disable( level ); 10b191: 9c pushf 10b192: fa cli 10b193: 5a pop %edx local_state = the_period->state; 10b194: 8b 47 38 mov 0x38(%edi),%eax the_period->state = RATE_MONOTONIC_ACTIVE; 10b197: c7 47 38 02 00 00 00 movl $0x2,0x38(%edi) _ISR_Enable( level ); 10b19e: 52 push %edx 10b19f: 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 ) 10b1a0: 83 c4 10 add $0x10,%esp 10b1a3: 83 f8 03 cmp $0x3,%eax 10b1a6: 75 15 jne 10b1bd _Thread_Clear_state( _Thread_Executing, STATES_WAITING_FOR_PERIOD ); 10b1a8: 51 push %ecx 10b1a9: 51 push %ecx 10b1aa: 68 00 40 00 00 push $0x4000 10b1af: ff 35 58 78 12 00 pushl 0x127858 10b1b5: e8 aa 21 00 00 call 10d364 <_Thread_Clear_state> 10b1ba: 83 c4 10 add $0x10,%esp _Thread_Enable_dispatch(); 10b1bd: e8 14 25 00 00 call 10d6d6 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 10b1c2: 31 db xor %ebx,%ebx 10b1c4: eb 3e jmp 10b204 case RATE_MONOTONIC_EXPIRED: /* * Update statistics from the concluding period */ _Rate_monotonic_Update_statistics( the_period ); 10b1c6: 83 ec 0c sub $0xc,%esp 10b1c9: 57 push %edi 10b1ca: e8 eb fd ff ff call 10afba <_Rate_monotonic_Update_statistics> _ISR_Enable( level ); 10b1cf: ff 75 d4 pushl -0x2c(%ebp) 10b1d2: 9d popf the_period->state = RATE_MONOTONIC_ACTIVE; 10b1d3: c7 47 38 02 00 00 00 movl $0x2,0x38(%edi) the_period->next_length = length; 10b1da: 89 5f 3c mov %ebx,0x3c(%edi) Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 10b1dd: 89 5f 1c mov %ebx,0x1c(%edi) _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 10b1e0: 58 pop %eax 10b1e1: 5a pop %edx _Watchdog_Insert_ticks( &the_period->Timer, length ); 10b1e2: 83 c7 10 add $0x10,%edi 10b1e5: 57 push %edi 10b1e6: 68 d0 73 12 00 push $0x1273d0 10b1eb: e8 50 34 00 00 call 10e640 <_Watchdog_Insert> _Thread_Enable_dispatch(); 10b1f0: e8 e1 24 00 00 call 10d6d6 <_Thread_Enable_dispatch> return RTEMS_TIMEOUT; 10b1f5: 83 c4 10 add $0x10,%esp 10b1f8: bb 06 00 00 00 mov $0x6,%ebx 10b1fd: eb 05 jmp 10b204 #endif case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 10b1ff: bb 04 00 00 00 mov $0x4,%ebx } 10b204: 89 d8 mov %ebx,%eax 10b206: 8d 65 f4 lea -0xc(%ebp),%esp 10b209: 5b pop %ebx 10b20a: 5e pop %esi 10b20b: 5f pop %edi 10b20c: c9 leave 10b20d: c3 ret =============================================================================== 0010b210 : */ void rtems_rate_monotonic_report_statistics_with_plugin( void *context, rtems_printk_plugin_t print ) { 10b210: 55 push %ebp 10b211: 89 e5 mov %esp,%ebp 10b213: 57 push %edi 10b214: 56 push %esi 10b215: 53 push %ebx 10b216: 83 ec 7c sub $0x7c,%esp 10b219: 8b 5d 08 mov 0x8(%ebp),%ebx 10b21c: 8b 7d 0c mov 0xc(%ebp),%edi rtems_id id; rtems_rate_monotonic_period_statistics the_stats; rtems_rate_monotonic_period_status the_status; char name[5]; if ( !print ) 10b21f: 85 ff test %edi,%edi 10b221: 0f 84 2b 01 00 00 je 10b352 <== NEVER TAKEN return; (*print)( context, "Period information by period\n" ); 10b227: 52 push %edx 10b228: 52 push %edx 10b229: 68 18 0f 12 00 push $0x120f18 10b22e: 53 push %ebx 10b22f: ff d7 call *%edi #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ (*print)( context, "--- CPU times are in seconds ---\n" ); 10b231: 5e pop %esi 10b232: 58 pop %eax 10b233: 68 36 0f 12 00 push $0x120f36 10b238: 53 push %ebx 10b239: ff d7 call *%edi (*print)( context, "--- Wall times are in seconds ---\n" ); 10b23b: 5a pop %edx 10b23c: 59 pop %ecx 10b23d: 68 58 0f 12 00 push $0x120f58 10b242: 53 push %ebx 10b243: ff d7 call *%edi Be sure to test the various cases. (*print)( context,"\ 1234567890123456789012345678901234567890123456789012345678901234567890123456789\ \n"); */ (*print)( context, " ID OWNER COUNT MISSED " 10b245: 5e pop %esi 10b246: 58 pop %eax 10b247: 68 7b 0f 12 00 push $0x120f7b 10b24c: 53 push %ebx 10b24d: ff d7 call *%edi #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ " " #endif " WALL TIME\n" ); (*print)( context, " " 10b24f: 5a pop %edx 10b250: 59 pop %ecx 10b251: 68 c6 0f 12 00 push $0x120fc6 10b256: 53 push %ebx 10b257: ff d7 call *%edi /* * Cycle through all possible ids and try to report on each one. If it * is a period that is inactive, we just get an error back. No big deal. */ for ( id=_Rate_monotonic_Information.minimum_id ; 10b259: 8b 35 1c 72 12 00 mov 0x12721c,%esi 10b25f: 83 c4 10 add $0x10,%esp 10b262: e9 df 00 00 00 jmp 10b346 id <= _Rate_monotonic_Information.maximum_id ; id++ ) { status = rtems_rate_monotonic_get_statistics( id, &the_stats ); 10b267: 50 push %eax 10b268: 50 push %eax 10b269: 8d 45 88 lea -0x78(%ebp),%eax 10b26c: 50 push %eax 10b26d: 56 push %esi 10b26e: e8 c9 55 00 00 call 11083c if ( status != RTEMS_SUCCESSFUL ) 10b273: 83 c4 10 add $0x10,%esp 10b276: 85 c0 test %eax,%eax 10b278: 0f 85 c7 00 00 00 jne 10b345 continue; /* If the above passed, so should this but check it anyway */ status = rtems_rate_monotonic_get_status( id, &the_status ); 10b27e: 51 push %ecx 10b27f: 51 push %ecx 10b280: 8d 55 c0 lea -0x40(%ebp),%edx 10b283: 52 push %edx 10b284: 56 push %esi 10b285: e8 56 56 00 00 call 1108e0 #if defined(RTEMS_DEBUG) if ( status != RTEMS_SUCCESSFUL ) continue; #endif rtems_object_get_name( the_status.owner, sizeof(name), name ); 10b28a: 83 c4 0c add $0xc,%esp 10b28d: 8d 45 e3 lea -0x1d(%ebp),%eax 10b290: 50 push %eax 10b291: 6a 05 push $0x5 10b293: ff 75 c0 pushl -0x40(%ebp) 10b296: e8 01 02 00 00 call 10b49c /* * Print part of report line that is not dependent on granularity */ (*print)( context, 10b29b: 58 pop %eax 10b29c: 5a pop %edx 10b29d: ff 75 8c pushl -0x74(%ebp) 10b2a0: ff 75 88 pushl -0x78(%ebp) 10b2a3: 8d 55 e3 lea -0x1d(%ebp),%edx 10b2a6: 52 push %edx 10b2a7: 56 push %esi 10b2a8: 68 12 10 12 00 push $0x121012 10b2ad: 53 push %ebx 10b2ae: ff d7 call *%edi ); /* * If the count is zero, don't print statistics */ if (the_stats.count == 0) { 10b2b0: 8b 45 88 mov -0x78(%ebp),%eax 10b2b3: 83 c4 20 add $0x20,%esp 10b2b6: 85 c0 test %eax,%eax 10b2b8: 75 0f jne 10b2c9 (*print)( context, "\n" ); 10b2ba: 51 push %ecx 10b2bb: 51 push %ecx 10b2bc: 68 8c 12 12 00 push $0x12128c 10b2c1: 53 push %ebx 10b2c2: ff d7 call *%edi continue; 10b2c4: 83 c4 10 add $0x10,%esp 10b2c7: eb 7c jmp 10b345 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 ); 10b2c9: 52 push %edx 10b2ca: 8d 55 d8 lea -0x28(%ebp),%edx 10b2cd: 52 push %edx 10b2ce: 50 push %eax 10b2cf: 8d 45 a0 lea -0x60(%ebp),%eax 10b2d2: 50 push %eax 10b2d3: e8 3c 30 00 00 call 10e314 <_Timespec_Divide_by_integer> (*print)( context, 10b2d8: 8b 45 dc mov -0x24(%ebp),%eax 10b2db: b9 e8 03 00 00 mov $0x3e8,%ecx 10b2e0: 99 cltd 10b2e1: f7 f9 idiv %ecx 10b2e3: 50 push %eax 10b2e4: ff 75 d8 pushl -0x28(%ebp) 10b2e7: 8b 45 9c mov -0x64(%ebp),%eax 10b2ea: 99 cltd 10b2eb: f7 f9 idiv %ecx 10b2ed: 50 push %eax 10b2ee: ff 75 98 pushl -0x68(%ebp) 10b2f1: 8b 45 94 mov -0x6c(%ebp),%eax 10b2f4: 99 cltd 10b2f5: f7 f9 idiv %ecx 10b2f7: 50 push %eax 10b2f8: ff 75 90 pushl -0x70(%ebp) 10b2fb: 68 29 10 12 00 push $0x121029 10b300: 53 push %ebx 10b301: 89 4d 84 mov %ecx,-0x7c(%ebp) 10b304: ff d7 call *%edi struct timespec wall_average; struct timespec *min_wall = &the_stats.min_wall_time; struct timespec *max_wall = &the_stats.max_wall_time; struct timespec *total_wall = &the_stats.total_wall_time; _Timespec_Divide_by_integer(total_wall, the_stats.count, &wall_average); 10b306: 83 c4 2c add $0x2c,%esp 10b309: 8d 55 d8 lea -0x28(%ebp),%edx 10b30c: 52 push %edx 10b30d: ff 75 88 pushl -0x78(%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; 10b310: 8d 45 b8 lea -0x48(%ebp),%eax _Timespec_Divide_by_integer(total_wall, the_stats.count, &wall_average); 10b313: 50 push %eax 10b314: e8 fb 2f 00 00 call 10e314 <_Timespec_Divide_by_integer> (*print)( context, 10b319: 8b 45 dc mov -0x24(%ebp),%eax 10b31c: 8b 4d 84 mov -0x7c(%ebp),%ecx 10b31f: 99 cltd 10b320: f7 f9 idiv %ecx 10b322: 50 push %eax 10b323: ff 75 d8 pushl -0x28(%ebp) 10b326: 8b 45 b4 mov -0x4c(%ebp),%eax 10b329: 99 cltd 10b32a: f7 f9 idiv %ecx 10b32c: 50 push %eax 10b32d: ff 75 b0 pushl -0x50(%ebp) 10b330: 8b 45 ac mov -0x54(%ebp),%eax 10b333: 99 cltd 10b334: f7 f9 idiv %ecx 10b336: 50 push %eax 10b337: ff 75 a8 pushl -0x58(%ebp) 10b33a: 68 48 10 12 00 push $0x121048 10b33f: 53 push %ebx 10b340: ff d7 call *%edi 10b342: 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++ ) { 10b345: 46 inc %esi /* * Cycle through all possible ids and try to report on each one. If it * is a period that is inactive, we just get an error back. No big deal. */ for ( id=_Rate_monotonic_Information.minimum_id ; 10b346: 3b 35 20 72 12 00 cmp 0x127220,%esi 10b34c: 0f 86 15 ff ff ff jbe 10b267 the_stats.min_wall_time, the_stats.max_wall_time, ival_wall, fval_wall ); #endif } } } 10b352: 8d 65 f4 lea -0xc(%ebp),%esp 10b355: 5b pop %ebx 10b356: 5e pop %esi 10b357: 5f pop %edi 10b358: c9 leave 10b359: c3 ret =============================================================================== 00115c40 : rtems_status_code rtems_signal_send( rtems_id id, rtems_signal_set signal_set ) { 115c40: 55 push %ebp 115c41: 89 e5 mov %esp,%ebp 115c43: 53 push %ebx 115c44: 83 ec 14 sub $0x14,%esp 115c47: 8b 5d 0c mov 0xc(%ebp),%ebx Objects_Locations location; RTEMS_API_Control *api; ASR_Information *asr; if ( !signal_set ) return RTEMS_INVALID_NUMBER; 115c4a: 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 ) 115c4f: 85 db test %ebx,%ebx 115c51: 74 6d je 115cc0 return RTEMS_INVALID_NUMBER; the_thread = _Thread_Get( id, &location ); 115c53: 50 push %eax 115c54: 50 push %eax 115c55: 8d 45 f4 lea -0xc(%ebp),%eax 115c58: 50 push %eax 115c59: ff 75 08 pushl 0x8(%ebp) 115c5c: e8 7f 37 00 00 call 1193e0 <_Thread_Get> switch ( location ) { 115c61: 83 c4 10 add $0x10,%esp 115c64: 83 7d f4 00 cmpl $0x0,-0xc(%ebp) 115c68: 75 51 jne 115cbb case OBJECTS_LOCAL: api = the_thread->API_Extensions[ THREAD_API_RTEMS ]; 115c6a: 8b 90 f4 00 00 00 mov 0xf4(%eax),%edx asr = &api->Signal; if ( ! _ASR_Is_null_handler( asr->handler ) ) { 115c70: 83 7a 0c 00 cmpl $0x0,0xc(%edx) 115c74: 74 39 je 115caf if ( asr->is_enabled ) { 115c76: 80 7a 08 00 cmpb $0x0,0x8(%edx) 115c7a: 74 22 je 115c9e rtems_signal_set *signal_set ) { ISR_Level _level; _ISR_Disable( _level ); 115c7c: 9c pushf 115c7d: fa cli 115c7e: 59 pop %ecx *signal_set |= signals; 115c7f: 09 5a 14 or %ebx,0x14(%edx) _ISR_Enable( _level ); 115c82: 51 push %ecx 115c83: 9d popf _ASR_Post_signals( signal_set, &asr->signals_posted ); if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) 115c84: 83 3d 0c eb 13 00 00 cmpl $0x0,0x13eb0c 115c8b: 74 19 je 115ca6 115c8d: 3b 05 10 eb 13 00 cmp 0x13eb10,%eax 115c93: 75 11 jne 115ca6 <== NEVER TAKEN _Context_Switch_necessary = true; 115c95: c6 05 1c eb 13 00 01 movb $0x1,0x13eb1c 115c9c: eb 08 jmp 115ca6 rtems_signal_set *signal_set ) { ISR_Level _level; _ISR_Disable( _level ); 115c9e: 9c pushf 115c9f: fa cli 115ca0: 58 pop %eax *signal_set |= signals; 115ca1: 09 5a 18 or %ebx,0x18(%edx) _ISR_Enable( _level ); 115ca4: 50 push %eax 115ca5: 9d popf } else { _ASR_Post_signals( signal_set, &asr->signals_pending ); } _Thread_Enable_dispatch(); 115ca6: e8 13 37 00 00 call 1193be <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 115cab: 31 c0 xor %eax,%eax 115cad: eb 11 jmp 115cc0 } _Thread_Enable_dispatch(); 115caf: e8 0a 37 00 00 call 1193be <_Thread_Enable_dispatch> return RTEMS_NOT_DEFINED; 115cb4: b8 0b 00 00 00 mov $0xb,%eax 115cb9: eb 05 jmp 115cc0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 115cbb: b8 04 00 00 00 mov $0x4,%eax } 115cc0: 8b 5d fc mov -0x4(%ebp),%ebx 115cc3: c9 leave 115cc4: c3 ret =============================================================================== 00110d78 : rtems_status_code rtems_task_mode( rtems_mode mode_set, rtems_mode mask, rtems_mode *previous_mode_set ) { 110d78: 55 push %ebp 110d79: 89 e5 mov %esp,%ebp 110d7b: 57 push %edi 110d7c: 56 push %esi 110d7d: 53 push %ebx 110d7e: 83 ec 1c sub $0x1c,%esp 110d81: 8b 4d 10 mov 0x10(%ebp),%ecx bool is_asr_enabled = false; bool needs_asr_dispatching = false; rtems_mode old_mode; if ( !previous_mode_set ) return RTEMS_INVALID_ADDRESS; 110d84: b8 09 00 00 00 mov $0x9,%eax ASR_Information *asr; bool is_asr_enabled = false; bool needs_asr_dispatching = false; rtems_mode old_mode; if ( !previous_mode_set ) 110d89: 85 c9 test %ecx,%ecx 110d8b: 0f 84 04 01 00 00 je 110e95 return RTEMS_INVALID_ADDRESS; executing = _Thread_Executing; 110d91: 8b 35 34 47 12 00 mov 0x124734,%esi api = executing->API_Extensions[ THREAD_API_RTEMS ]; 110d97: 8b 9e f4 00 00 00 mov 0xf4(%esi),%ebx asr = &api->Signal; old_mode = (executing->is_preemptible) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT; 110d9d: 80 7e 74 01 cmpb $0x1,0x74(%esi) 110da1: 19 ff sbb %edi,%edi 110da3: 81 e7 00 01 00 00 and $0x100,%edi if ( executing->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_NONE ) 110da9: 83 7e 7c 00 cmpl $0x0,0x7c(%esi) 110dad: 74 06 je 110db5 old_mode |= RTEMS_NO_TIMESLICE; else old_mode |= RTEMS_TIMESLICE; 110daf: 81 cf 00 02 00 00 or $0x200,%edi old_mode |= (asr->is_enabled) ? RTEMS_ASR : RTEMS_NO_ASR; 110db5: 80 7b 08 01 cmpb $0x1,0x8(%ebx) 110db9: 19 d2 sbb %edx,%edx 110dbb: 81 e2 00 04 00 00 and $0x400,%edx old_mode |= _ISR_Get_level(); 110dc1: 89 55 e4 mov %edx,-0x1c(%ebp) 110dc4: 89 4d e0 mov %ecx,-0x20(%ebp) 110dc7: e8 39 c5 ff ff call 10d305 <_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; 110dcc: 8b 55 e4 mov -0x1c(%ebp),%edx 110dcf: 09 d0 or %edx,%eax old_mode |= _ISR_Get_level(); 110dd1: 09 f8 or %edi,%eax 110dd3: 8b 4d e0 mov -0x20(%ebp),%ecx 110dd6: 89 01 mov %eax,(%ecx) /* * These are generic thread scheduling characteristics. */ if ( mask & RTEMS_PREEMPT_MASK ) 110dd8: f7 45 0c 00 01 00 00 testl $0x100,0xc(%ebp) 110ddf: 74 0b je 110dec executing->is_preemptible = _Modes_Is_preempt(mode_set) ? true : false; 110de1: f7 45 08 00 01 00 00 testl $0x100,0x8(%ebp) 110de8: 0f 94 46 74 sete 0x74(%esi) if ( mask & RTEMS_TIMESLICE_MASK ) { 110dec: f7 45 0c 00 02 00 00 testl $0x200,0xc(%ebp) 110df3: 74 21 je 110e16 if ( _Modes_Is_timeslice(mode_set) ) { 110df5: f7 45 08 00 02 00 00 testl $0x200,0x8(%ebp) 110dfc: 74 11 je 110e0f executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE; 110dfe: c7 46 7c 01 00 00 00 movl $0x1,0x7c(%esi) executing->cpu_time_budget = _Thread_Ticks_per_timeslice; 110e05: a1 b4 41 12 00 mov 0x1241b4,%eax 110e0a: 89 46 78 mov %eax,0x78(%esi) 110e0d: eb 07 jmp 110e16 } else executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE; 110e0f: c7 46 7c 00 00 00 00 movl $0x0,0x7c(%esi) /* * Set the new interrupt level */ if ( mask & RTEMS_INTERRUPT_MASK ) 110e16: f6 45 0c 01 testb $0x1,0xc(%ebp) 110e1a: 74 0a je 110e26 */ RTEMS_INLINE_ROUTINE void _Modes_Set_interrupt_level ( Modes_Control mode_set ) { _ISR_Set_level( _Modes_Get_interrupt_level( mode_set ) ); 110e1c: f6 45 08 01 testb $0x1,0x8(%ebp) 110e20: 74 03 je 110e25 110e22: fa cli 110e23: eb 01 jmp 110e26 110e25: fb sti /* * This is specific to the RTEMS API */ is_asr_enabled = false; needs_asr_dispatching = false; 110e26: 31 d2 xor %edx,%edx if ( mask & RTEMS_ASR_MASK ) { 110e28: f7 45 0c 00 04 00 00 testl $0x400,0xc(%ebp) 110e2f: 74 2a je 110e5b * Output: * *previous_mode_set - previous mode set * always return RTEMS_SUCCESSFUL; */ rtems_status_code rtems_task_mode( 110e31: f7 45 08 00 04 00 00 testl $0x400,0x8(%ebp) 110e38: 0f 94 c0 sete %al is_asr_enabled = false; needs_asr_dispatching = false; if ( mask & RTEMS_ASR_MASK ) { is_asr_enabled = _Modes_Is_asr_disabled( mode_set ) ? false : true; if ( is_asr_enabled != asr->is_enabled ) { 110e3b: 3a 43 08 cmp 0x8(%ebx),%al 110e3e: 74 1b je 110e5b asr->is_enabled = is_asr_enabled; 110e40: 88 43 08 mov %al,0x8(%ebx) ) { rtems_signal_set _signals; ISR_Level _level; _ISR_Disable( _level ); 110e43: 9c pushf 110e44: fa cli 110e45: 58 pop %eax _signals = information->signals_pending; 110e46: 8b 53 18 mov 0x18(%ebx),%edx information->signals_pending = information->signals_posted; 110e49: 8b 4b 14 mov 0x14(%ebx),%ecx 110e4c: 89 4b 18 mov %ecx,0x18(%ebx) information->signals_posted = _signals; 110e4f: 89 53 14 mov %edx,0x14(%ebx) _ISR_Enable( _level ); 110e52: 50 push %eax 110e53: 9d popf /* * This is specific to the RTEMS API */ is_asr_enabled = false; needs_asr_dispatching = false; 110e54: 83 7b 14 00 cmpl $0x0,0x14(%ebx) 110e58: 0f 95 c2 setne %dl if ( _System_state_Is_up( _System_state_Get() ) ) if ( _Thread_Evaluate_mode() || needs_asr_dispatching ) _Thread_Dispatch(); return RTEMS_SUCCESSFUL; 110e5b: 31 c0 xor %eax,%eax needs_asr_dispatching = true; } } } if ( _System_state_Is_up( _System_state_Get() ) ) 110e5d: 83 3d 64 43 12 00 03 cmpl $0x3,0x124364 110e64: 75 2f jne 110e95 <== NEVER TAKEN */ RTEMS_INLINE_ROUTINE bool _Thread_Evaluate_mode( void ) { Thread_Control *executing; executing = _Thread_Executing; 110e66: a1 34 47 12 00 mov 0x124734,%eax if ( !_States_Is_ready( executing->current_state ) || 110e6b: 83 78 10 00 cmpl $0x0,0x10(%eax) 110e6f: 75 0e jne 110e7f <== NEVER TAKEN 110e71: 3b 05 38 47 12 00 cmp 0x124738,%eax 110e77: 74 0f je 110e88 ( !_Thread_Is_heir( executing ) && executing->is_preemptible ) ) { 110e79: 80 78 74 00 cmpb $0x0,0x74(%eax) 110e7d: 74 09 je 110e88 <== NEVER TAKEN _Context_Switch_necessary = true; 110e7f: c6 05 40 47 12 00 01 movb $0x1,0x124740 110e86: eb 06 jmp 110e8e if ( _Thread_Evaluate_mode() || needs_asr_dispatching ) _Thread_Dispatch(); return RTEMS_SUCCESSFUL; 110e88: 31 c0 xor %eax,%eax } } } if ( _System_state_Is_up( _System_state_Get() ) ) if ( _Thread_Evaluate_mode() || needs_asr_dispatching ) 110e8a: 84 d2 test %dl,%dl 110e8c: 74 07 je 110e95 _Thread_Dispatch(); 110e8e: e8 69 af ff ff call 10bdfc <_Thread_Dispatch> return RTEMS_SUCCESSFUL; 110e93: 31 c0 xor %eax,%eax } 110e95: 83 c4 1c add $0x1c,%esp 110e98: 5b pop %ebx 110e99: 5e pop %esi 110e9a: 5f pop %edi 110e9b: c9 leave 110e9c: c3 ret =============================================================================== 0010dda4 : rtems_status_code rtems_task_set_priority( rtems_id id, rtems_task_priority new_priority, rtems_task_priority *old_priority ) { 10dda4: 55 push %ebp 10dda5: 89 e5 mov %esp,%ebp 10dda7: 56 push %esi 10dda8: 53 push %ebx 10dda9: 83 ec 10 sub $0x10,%esp 10ddac: 8b 5d 0c mov 0xc(%ebp),%ebx 10ddaf: 8b 75 10 mov 0x10(%ebp),%esi register Thread_Control *the_thread; Objects_Locations location; if ( new_priority != RTEMS_CURRENT_PRIORITY && 10ddb2: 85 db test %ebx,%ebx 10ddb4: 74 10 je 10ddc6 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 ) ); 10ddb6: 0f b6 15 f4 41 12 00 movzbl 0x1241f4,%edx !_RTEMS_tasks_Priority_is_valid( new_priority ) ) return RTEMS_INVALID_PRIORITY; 10ddbd: b8 13 00 00 00 mov $0x13,%eax ) { register Thread_Control *the_thread; Objects_Locations location; if ( new_priority != RTEMS_CURRENT_PRIORITY && 10ddc2: 39 d3 cmp %edx,%ebx 10ddc4: 77 52 ja 10de18 !_RTEMS_tasks_Priority_is_valid( new_priority ) ) return RTEMS_INVALID_PRIORITY; if ( !old_priority ) return RTEMS_INVALID_ADDRESS; 10ddc6: 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 ) 10ddcb: 85 f6 test %esi,%esi 10ddcd: 74 49 je 10de18 return RTEMS_INVALID_ADDRESS; the_thread = _Thread_Get( id, &location ); 10ddcf: 51 push %ecx 10ddd0: 51 push %ecx 10ddd1: 8d 45 f4 lea -0xc(%ebp),%eax 10ddd4: 50 push %eax 10ddd5: ff 75 08 pushl 0x8(%ebp) 10ddd8: e8 fb 1b 00 00 call 10f9d8 <_Thread_Get> switch ( location ) { 10dddd: 83 c4 10 add $0x10,%esp 10dde0: 83 7d f4 00 cmpl $0x0,-0xc(%ebp) 10dde4: 75 2d jne 10de13 case OBJECTS_LOCAL: /* XXX need helper to "convert" from core priority */ *old_priority = the_thread->current_priority; 10dde6: 8b 50 14 mov 0x14(%eax),%edx 10dde9: 89 16 mov %edx,(%esi) if ( new_priority != RTEMS_CURRENT_PRIORITY ) { 10ddeb: 85 db test %ebx,%ebx 10dded: 74 1b je 10de0a the_thread->real_priority = new_priority; 10ddef: 89 58 18 mov %ebx,0x18(%eax) if ( the_thread->resource_count == 0 || 10ddf2: 83 78 1c 00 cmpl $0x0,0x1c(%eax) 10ddf6: 74 05 je 10ddfd 10ddf8: 39 58 14 cmp %ebx,0x14(%eax) 10ddfb: 76 0d jbe 10de0a <== ALWAYS TAKEN the_thread->current_priority > new_priority ) _Thread_Change_priority( the_thread, new_priority, false ); 10ddfd: 52 push %edx 10ddfe: 6a 00 push $0x0 10de00: 53 push %ebx 10de01: 50 push %eax 10de02: e8 1d 17 00 00 call 10f524 <_Thread_Change_priority> 10de07: 83 c4 10 add $0x10,%esp } _Thread_Enable_dispatch(); 10de0a: e8 a7 1b 00 00 call 10f9b6 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 10de0f: 31 c0 xor %eax,%eax 10de11: eb 05 jmp 10de18 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 10de13: b8 04 00 00 00 mov $0x4,%eax } 10de18: 8d 65 f8 lea -0x8(%ebp),%esp 10de1b: 5b pop %ebx 10de1c: 5e pop %esi 10de1d: c9 leave 10de1e: c3 ret =============================================================================== 00116498 : */ rtems_status_code rtems_timer_cancel( rtems_id id ) { 116498: 55 push %ebp 116499: 89 e5 mov %esp,%ebp 11649b: 83 ec 1c sub $0x1c,%esp Timer_Control *the_timer; Objects_Locations location; the_timer = _Timer_Get( id, &location ); 11649e: 8d 45 f4 lea -0xc(%ebp),%eax Objects_Id id, Objects_Locations *location ) { return (Timer_Control *) _Objects_Get( &_Timer_Information, id, location ); 1164a1: 50 push %eax 1164a2: ff 75 08 pushl 0x8(%ebp) 1164a5: 68 04 ef 13 00 push $0x13ef04 1164aa: e8 35 27 00 00 call 118be4 <_Objects_Get> switch ( location ) { 1164af: 83 c4 10 add $0x10,%esp 1164b2: 83 7d f4 00 cmpl $0x0,-0xc(%ebp) 1164b6: 75 1e jne 1164d6 case OBJECTS_LOCAL: if ( !_Timer_Is_dormant_class( the_timer->the_class ) ) 1164b8: 83 78 38 04 cmpl $0x4,0x38(%eax) 1164bc: 74 0f je 1164cd <== NEVER TAKEN (void) _Watchdog_Remove( &the_timer->Ticker ); 1164be: 83 ec 0c sub $0xc,%esp 1164c1: 83 c0 10 add $0x10,%eax 1164c4: 50 push %eax 1164c5: e8 36 41 00 00 call 11a600 <_Watchdog_Remove> 1164ca: 83 c4 10 add $0x10,%esp _Thread_Enable_dispatch(); 1164cd: e8 ec 2e 00 00 call 1193be <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 1164d2: 31 c0 xor %eax,%eax 1164d4: eb 05 jmp 1164db #endif case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 1164d6: b8 04 00 00 00 mov $0x4,%eax } 1164db: c9 leave 1164dc: c3 ret =============================================================================== 001168f8 : rtems_id id, rtems_time_of_day *wall_time, rtems_timer_service_routine_entry routine, void *user_data ) { 1168f8: 55 push %ebp 1168f9: 89 e5 mov %esp,%ebp 1168fb: 57 push %edi 1168fc: 56 push %esi 1168fd: 53 push %ebx 1168fe: 83 ec 1c sub $0x1c,%esp 116901: 8b 7d 0c mov 0xc(%ebp),%edi Timer_Control *the_timer; Objects_Locations location; rtems_interval seconds; Timer_server_Control *timer_server = _Timer_server; 116904: 8b 35 44 ef 13 00 mov 0x13ef44,%esi if ( !timer_server ) return RTEMS_INCORRECT_STATE; 11690a: bb 0e 00 00 00 mov $0xe,%ebx Timer_Control *the_timer; Objects_Locations location; rtems_interval seconds; Timer_server_Control *timer_server = _Timer_server; if ( !timer_server ) 11690f: 85 f6 test %esi,%esi 116911: 0f 84 b1 00 00 00 je 1169c8 return RTEMS_INCORRECT_STATE; if ( !_TOD_Is_set ) return RTEMS_NOT_DEFINED; 116917: b3 0b mov $0xb,%bl Timer_server_Control *timer_server = _Timer_server; if ( !timer_server ) return RTEMS_INCORRECT_STATE; if ( !_TOD_Is_set ) 116919: 80 3d cc e5 13 00 00 cmpb $0x0,0x13e5cc 116920: 0f 84 a2 00 00 00 je 1169c8 <== NEVER TAKEN return RTEMS_NOT_DEFINED; if ( !routine ) return RTEMS_INVALID_ADDRESS; 116926: b3 09 mov $0x9,%bl return RTEMS_INCORRECT_STATE; if ( !_TOD_Is_set ) return RTEMS_NOT_DEFINED; if ( !routine ) 116928: 83 7d 10 00 cmpl $0x0,0x10(%ebp) 11692c: 0f 84 96 00 00 00 je 1169c8 return RTEMS_INVALID_ADDRESS; if ( !_TOD_Validate( wall_time ) ) 116932: 83 ec 0c sub $0xc,%esp 116935: 57 push %edi 116936: e8 99 d6 ff ff call 113fd4 <_TOD_Validate> 11693b: 83 c4 10 add $0x10,%esp return RTEMS_INVALID_CLOCK; 11693e: b3 14 mov $0x14,%bl return RTEMS_NOT_DEFINED; if ( !routine ) return RTEMS_INVALID_ADDRESS; if ( !_TOD_Validate( wall_time ) ) 116940: 84 c0 test %al,%al 116942: 0f 84 80 00 00 00 je 1169c8 return RTEMS_INVALID_CLOCK; seconds = _TOD_To_seconds( wall_time ); 116948: 83 ec 0c sub $0xc,%esp 11694b: 57 push %edi 11694c: e8 1b d6 ff ff call 113f6c <_TOD_To_seconds> 116951: 89 c7 mov %eax,%edi if ( seconds <= _TOD_Seconds_since_epoch() ) 116953: 83 c4 10 add $0x10,%esp 116956: 3b 05 44 e6 13 00 cmp 0x13e644,%eax 11695c: 76 6a jbe 1169c8 11695e: 51 push %ecx return RTEMS_INVALID_CLOCK; the_timer = _Timer_Get( id, &location ); 11695f: 8d 45 e4 lea -0x1c(%ebp),%eax 116962: 50 push %eax 116963: ff 75 08 pushl 0x8(%ebp) 116966: 68 04 ef 13 00 push $0x13ef04 11696b: e8 74 22 00 00 call 118be4 <_Objects_Get> 116970: 89 c3 mov %eax,%ebx switch ( location ) { 116972: 83 c4 10 add $0x10,%esp 116975: 83 7d e4 00 cmpl $0x0,-0x1c(%ebp) 116979: 75 48 jne 1169c3 case OBJECTS_LOCAL: (void) _Watchdog_Remove( &the_timer->Ticker ); 11697b: 83 ec 0c sub $0xc,%esp 11697e: 8d 40 10 lea 0x10(%eax),%eax 116981: 50 push %eax 116982: e8 79 3c 00 00 call 11a600 <_Watchdog_Remove> the_timer->the_class = TIMER_TIME_OF_DAY_ON_TASK; 116987: c7 43 38 03 00 00 00 movl $0x3,0x38(%ebx) Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 11698e: c7 43 18 00 00 00 00 movl $0x0,0x18(%ebx) the_watchdog->routine = routine; 116995: 8b 45 10 mov 0x10(%ebp),%eax 116998: 89 43 2c mov %eax,0x2c(%ebx) the_watchdog->id = id; 11699b: 8b 45 08 mov 0x8(%ebp),%eax 11699e: 89 43 30 mov %eax,0x30(%ebx) the_watchdog->user_data = user_data; 1169a1: 8b 45 14 mov 0x14(%ebp),%eax 1169a4: 89 43 34 mov %eax,0x34(%ebx) _Watchdog_Initialize( &the_timer->Ticker, routine, id, user_data ); the_timer->Ticker.initial = seconds - _TOD_Seconds_since_epoch(); 1169a7: 2b 3d 44 e6 13 00 sub 0x13e644,%edi 1169ad: 89 7b 1c mov %edi,0x1c(%ebx) (*timer_server->schedule_operation)( timer_server, the_timer ); 1169b0: 58 pop %eax 1169b1: 5a pop %edx 1169b2: 53 push %ebx 1169b3: 56 push %esi 1169b4: ff 56 04 call *0x4(%esi) _Thread_Enable_dispatch(); 1169b7: e8 02 2a 00 00 call 1193be <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 1169bc: 83 c4 10 add $0x10,%esp 1169bf: 31 db xor %ebx,%ebx 1169c1: eb 05 jmp 1169c8 #endif case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 1169c3: bb 04 00 00 00 mov $0x4,%ebx } 1169c8: 89 d8 mov %ebx,%eax 1169ca: 8d 65 f4 lea -0xc(%ebp),%esp 1169cd: 5b pop %ebx 1169ce: 5e pop %esi 1169cf: 5f pop %edi 1169d0: c9 leave 1169d1: c3 ret =============================================================================== 0010a948 : #include int sched_get_priority_max( int policy ) { 10a948: 55 push %ebp 10a949: 89 e5 mov %esp,%ebp 10a94b: 83 ec 08 sub $0x8,%esp 10a94e: 8b 4d 08 mov 0x8(%ebp),%ecx switch ( policy ) { 10a951: 83 f9 04 cmp $0x4,%ecx 10a954: 77 0b ja 10a961 10a956: b8 01 00 00 00 mov $0x1,%eax 10a95b: d3 e0 shl %cl,%eax 10a95d: a8 17 test $0x17,%al 10a95f: 75 10 jne 10a971 <== ALWAYS TAKEN case SCHED_RR: case SCHED_SPORADIC: break; default: rtems_set_errno_and_return_minus_one( EINVAL ); 10a961: e8 f2 73 00 00 call 111d58 <__errno> 10a966: c7 00 16 00 00 00 movl $0x16,(%eax) 10a96c: 83 c8 ff or $0xffffffff,%eax 10a96f: eb 08 jmp 10a979 } return POSIX_SCHEDULER_MAXIMUM_PRIORITY; 10a971: 0f b6 05 18 12 12 00 movzbl 0x121218,%eax 10a978: 48 dec %eax } 10a979: c9 leave 10a97a: c3 ret =============================================================================== 0010a97c : #include int sched_get_priority_min( int policy ) { 10a97c: 55 push %ebp 10a97d: 89 e5 mov %esp,%ebp 10a97f: 83 ec 08 sub $0x8,%esp 10a982: 8b 4d 08 mov 0x8(%ebp),%ecx switch ( policy ) { 10a985: 83 f9 04 cmp $0x4,%ecx 10a988: 77 11 ja 10a99b 10a98a: ba 01 00 00 00 mov $0x1,%edx 10a98f: d3 e2 shl %cl,%edx default: rtems_set_errno_and_return_minus_one( EINVAL ); } return POSIX_SCHEDULER_MINIMUM_PRIORITY; 10a991: b8 01 00 00 00 mov $0x1,%eax int sched_get_priority_min( int policy ) { switch ( policy ) { 10a996: 80 e2 17 and $0x17,%dl 10a999: 75 0e jne 10a9a9 <== ALWAYS TAKEN case SCHED_RR: case SCHED_SPORADIC: break; default: rtems_set_errno_and_return_minus_one( EINVAL ); 10a99b: e8 b8 73 00 00 call 111d58 <__errno> 10a9a0: c7 00 16 00 00 00 movl $0x16,(%eax) 10a9a6: 83 c8 ff or $0xffffffff,%eax } return POSIX_SCHEDULER_MINIMUM_PRIORITY; } 10a9a9: c9 leave 10a9aa: c3 ret =============================================================================== 0010a9ac : int sched_rr_get_interval( pid_t pid, struct timespec *interval ) { 10a9ac: 55 push %ebp 10a9ad: 89 e5 mov %esp,%ebp 10a9af: 56 push %esi 10a9b0: 53 push %ebx 10a9b1: 8b 75 08 mov 0x8(%ebp),%esi 10a9b4: 8b 5d 0c mov 0xc(%ebp),%ebx /* * Only supported for the "calling process" (i.e. this node). */ if ( pid && pid != getpid() ) 10a9b7: 85 f6 test %esi,%esi 10a9b9: 74 16 je 10a9d1 <== NEVER TAKEN 10a9bb: e8 fc cf ff ff call 1079bc 10a9c0: 39 c6 cmp %eax,%esi 10a9c2: 74 0d je 10a9d1 rtems_set_errno_and_return_minus_one( ESRCH ); 10a9c4: e8 8f 73 00 00 call 111d58 <__errno> 10a9c9: c7 00 03 00 00 00 movl $0x3,(%eax) 10a9cf: eb 0f jmp 10a9e0 if ( !interval ) 10a9d1: 85 db test %ebx,%ebx 10a9d3: 75 10 jne 10a9e5 rtems_set_errno_and_return_minus_one( EINVAL ); 10a9d5: e8 7e 73 00 00 call 111d58 <__errno> 10a9da: c7 00 16 00 00 00 movl $0x16,(%eax) 10a9e0: 83 c8 ff or $0xffffffff,%eax 10a9e3: eb 13 jmp 10a9f8 _Timespec_From_ticks( _Thread_Ticks_per_timeslice, interval ); 10a9e5: 50 push %eax 10a9e6: 50 push %eax 10a9e7: 53 push %ebx 10a9e8: ff 35 a4 51 12 00 pushl 0x1251a4 10a9ee: e8 b5 2f 00 00 call 10d9a8 <_Timespec_From_ticks> return 0; 10a9f3: 83 c4 10 add $0x10,%esp 10a9f6: 31 c0 xor %eax,%eax } 10a9f8: 8d 65 f8 lea -0x8(%ebp),%esp 10a9fb: 5b pop %ebx 10a9fc: 5e pop %esi 10a9fd: c9 leave 10a9fe: c3 ret =============================================================================== 0010d094 : int oflag, ... /* mode_t mode, */ /* unsigned int value */ ) { 10d094: 55 push %ebp 10d095: 89 e5 mov %esp,%ebp 10d097: 57 push %edi 10d098: 56 push %esi 10d099: 53 push %ebx 10d09a: 83 ec 2c sub $0x2c,%esp 10d09d: 8b 75 08 mov 0x8(%ebp),%esi rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 10d0a0: a1 cc a3 12 00 mov 0x12a3cc,%eax 10d0a5: 40 inc %eax 10d0a6: a3 cc a3 12 00 mov %eax,0x12a3cc va_list arg; mode_t mode; unsigned int value = 0; 10d0ab: 31 ff xor %edi,%edi POSIX_Semaphore_Control *the_semaphore; Objects_Locations location; _Thread_Disable_dispatch(); if ( oflag & O_CREAT ) { 10d0ad: 8b 45 0c mov 0xc(%ebp),%eax 10d0b0: 25 00 02 00 00 and $0x200,%eax 10d0b5: 89 45 d4 mov %eax,-0x2c(%ebp) 10d0b8: 74 03 je 10d0bd va_start(arg, oflag); mode = (mode_t) va_arg( arg, unsigned int ); value = va_arg( arg, unsigned int ); 10d0ba: 8b 7d 14 mov 0x14(%ebp),%edi va_end(arg); } status = _POSIX_Semaphore_Name_to_id( name, &the_semaphore_id ); 10d0bd: 52 push %edx 10d0be: 52 push %edx 10d0bf: 8d 45 e4 lea -0x1c(%ebp),%eax 10d0c2: 50 push %eax 10d0c3: 56 push %esi 10d0c4: e8 23 58 00 00 call 1128ec <_POSIX_Semaphore_Name_to_id> 10d0c9: 89 c3 mov %eax,%ebx * and we can just return a pointer to the id. Otherwise we may * need to check to see if this is a "semaphore does not exist" * or some other miscellaneous error on the name. */ if ( status ) { 10d0cb: 83 c4 10 add $0x10,%esp 10d0ce: 85 c0 test %eax,%eax 10d0d0: 74 19 je 10d0eb /* * 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) ) ) { 10d0d2: 83 f8 02 cmp $0x2,%eax 10d0d5: 75 06 jne 10d0dd <== NEVER TAKEN 10d0d7: 83 7d d4 00 cmpl $0x0,-0x2c(%ebp) 10d0db: 75 59 jne 10d136 _Thread_Enable_dispatch(); 10d0dd: e8 6c 25 00 00 call 10f64e <_Thread_Enable_dispatch> rtems_set_errno_and_return_minus_one_cast( status, sem_t * ); 10d0e2: e8 79 7f 00 00 call 115060 <__errno> 10d0e7: 89 18 mov %ebx,(%eax) 10d0e9: eb 1f jmp 10d10a /* * Check for existence with creation. */ if ( (oflag & (O_CREAT | O_EXCL)) == (O_CREAT | O_EXCL) ) { 10d0eb: 8b 45 0c mov 0xc(%ebp),%eax 10d0ee: 25 00 0a 00 00 and $0xa00,%eax 10d0f3: 3d 00 0a 00 00 cmp $0xa00,%eax 10d0f8: 75 15 jne 10d10f _Thread_Enable_dispatch(); 10d0fa: e8 4f 25 00 00 call 10f64e <_Thread_Enable_dispatch> rtems_set_errno_and_return_minus_one_cast( EEXIST, sem_t * ); 10d0ff: e8 5c 7f 00 00 call 115060 <__errno> 10d104: c7 00 11 00 00 00 movl $0x11,(%eax) 10d10a: 83 c8 ff or $0xffffffff,%eax 10d10d: eb 4a jmp 10d159 10d10f: 50 push %eax } the_semaphore = _POSIX_Semaphore_Get( &the_semaphore_id, &location ); 10d110: 8d 45 dc lea -0x24(%ebp),%eax 10d113: 50 push %eax 10d114: ff 75 e4 pushl -0x1c(%ebp) 10d117: 68 98 a6 12 00 push $0x12a698 10d11c: e8 df 1c 00 00 call 10ee00 <_Objects_Get> 10d121: 89 45 e0 mov %eax,-0x20(%ebp) the_semaphore->open_count += 1; 10d124: ff 40 18 incl 0x18(%eax) _Thread_Enable_dispatch(); 10d127: e8 22 25 00 00 call 10f64e <_Thread_Enable_dispatch> _Thread_Enable_dispatch(); 10d12c: e8 1d 25 00 00 call 10f64e <_Thread_Enable_dispatch> goto return_id; 10d131: 83 c4 10 add $0x10,%esp 10d134: eb 1d jmp 10d153 /* * 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( 10d136: 8d 45 e0 lea -0x20(%ebp),%eax 10d139: 50 push %eax 10d13a: 57 push %edi 10d13b: 6a 00 push $0x0 10d13d: 56 push %esi 10d13e: e8 75 56 00 00 call 1127b8 <_POSIX_Semaphore_Create_support> 10d143: 89 c3 mov %eax,%ebx /* * errno was set by Create_support, so don't set it again. */ _Thread_Enable_dispatch(); 10d145: e8 04 25 00 00 call 10f64e <_Thread_Enable_dispatch> if ( status == -1 ) 10d14a: 83 c4 10 add $0x10,%esp return SEM_FAILED; 10d14d: 83 c8 ff or $0xffffffff,%eax * errno was set by Create_support, so don't set it again. */ _Thread_Enable_dispatch(); if ( status == -1 ) 10d150: 43 inc %ebx 10d151: 74 06 je 10d159 return_id: #if defined(RTEMS_USE_16_BIT_OBJECT) the_semaphore->Semaphore_id = the_semaphore->Object.id; id = &the_semaphore->Semaphore_id; #else id = (sem_t *)&the_semaphore->Object.id; 10d153: 8b 45 e0 mov -0x20(%ebp),%eax 10d156: 83 c0 08 add $0x8,%eax #endif return id; } 10d159: 8d 65 f4 lea -0xc(%ebp),%esp 10d15c: 5b pop %ebx 10d15d: 5e pop %esi 10d15e: 5f pop %edi 10d15f: c9 leave 10d160: c3 ret =============================================================================== 0010a830 : int sigaction( int sig, const struct sigaction *act, struct sigaction *oact ) { 10a830: 55 push %ebp 10a831: 89 e5 mov %esp,%ebp 10a833: 57 push %edi 10a834: 56 push %esi 10a835: 53 push %ebx 10a836: 83 ec 1c sub $0x1c,%esp 10a839: 8b 5d 08 mov 0x8(%ebp),%ebx 10a83c: 8b 55 0c mov 0xc(%ebp),%edx 10a83f: 8b 45 10 mov 0x10(%ebp),%eax ISR_Level level; if ( oact ) 10a842: 85 c0 test %eax,%eax 10a844: 74 12 je 10a858 *oact = _POSIX_signals_Vectors[ sig ]; 10a846: 6b f3 0c imul $0xc,%ebx,%esi 10a849: 81 c6 84 67 12 00 add $0x126784,%esi 10a84f: b9 03 00 00 00 mov $0x3,%ecx 10a854: 89 c7 mov %eax,%edi 10a856: f3 a5 rep movsl %ds:(%esi),%es:(%edi) if ( !sig ) 10a858: 85 db test %ebx,%ebx 10a85a: 74 0d je 10a869 static inline bool is_valid_signo( int signo ) { return ((signo) >= 1 && (signo) <= 32 ); 10a85c: 8d 43 ff lea -0x1(%ebx),%eax rtems_set_errno_and_return_minus_one( EINVAL ); if ( !is_valid_signo(sig) ) 10a85f: 83 f8 1f cmp $0x1f,%eax 10a862: 77 05 ja 10a869 * * NOTE: Solaris documentation claims to "silently enforce" this which * contradicts the POSIX specification. */ if ( sig == SIGKILL ) 10a864: 83 fb 09 cmp $0x9,%ebx 10a867: 75 10 jne 10a879 rtems_set_errno_and_return_minus_one( EINVAL ); 10a869: e8 6e 77 00 00 call 111fdc <__errno> 10a86e: c7 00 16 00 00 00 movl $0x16,(%eax) 10a874: 83 c8 ff or $0xffffffff,%eax 10a877: eb 57 jmp 10a8d0 * 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; 10a879: 31 c0 xor %eax,%eax /* * Evaluate the new action structure and set the global signal vector * appropriately. */ if ( act ) { 10a87b: 85 d2 test %edx,%edx 10a87d: 74 51 je 10a8d0 <== 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 ); 10a87f: 9c pushf 10a880: fa cli 10a881: 8f 45 e4 popl -0x1c(%ebp) if ( act->sa_handler == SIG_DFL ) { 10a884: 83 7a 08 00 cmpl $0x0,0x8(%edx) 10a888: 75 1a jne 10a8a4 _POSIX_signals_Vectors[ sig ] = _POSIX_signals_Default_vectors[ sig ]; 10a88a: 6b f3 0c imul $0xc,%ebx,%esi 10a88d: 8d 86 84 67 12 00 lea 0x126784(%esi),%eax 10a893: 81 c6 28 0b 12 00 add $0x120b28,%esi 10a899: b9 03 00 00 00 mov $0x3,%ecx 10a89e: 89 c7 mov %eax,%edi 10a8a0: f3 a5 rep movsl %ds:(%esi),%es:(%edi) 10a8a2: eb 26 jmp 10a8ca } else { _POSIX_signals_Clear_process_signals( sig ); 10a8a4: 83 ec 0c sub $0xc,%esp 10a8a7: 53 push %ebx 10a8a8: 89 55 e0 mov %edx,-0x20(%ebp) 10a8ab: e8 54 4d 00 00 call 10f604 <_POSIX_signals_Clear_process_signals> _POSIX_signals_Vectors[ sig ] = *act; 10a8b0: 6b db 0c imul $0xc,%ebx,%ebx 10a8b3: 81 c3 84 67 12 00 add $0x126784,%ebx 10a8b9: b9 03 00 00 00 mov $0x3,%ecx 10a8be: 8b 55 e0 mov -0x20(%ebp),%edx 10a8c1: 89 df mov %ebx,%edi 10a8c3: 89 d6 mov %edx,%esi 10a8c5: f3 a5 rep movsl %ds:(%esi),%es:(%edi) 10a8c7: 83 c4 10 add $0x10,%esp } _ISR_Enable( level ); 10a8ca: ff 75 e4 pushl -0x1c(%ebp) 10a8cd: 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; 10a8ce: 31 c0 xor %eax,%eax } 10a8d0: 8d 65 f4 lea -0xc(%ebp),%esp 10a8d3: 5b pop %ebx 10a8d4: 5e pop %esi 10a8d5: 5f pop %edi 10a8d6: c9 leave 10a8d7: c3 ret =============================================================================== 0010c820 : #include int sigsuspend( const sigset_t *sigmask ) { 10c820: 55 push %ebp 10c821: 89 e5 mov %esp,%ebp 10c823: 56 push %esi 10c824: 53 push %ebx 10c825: 83 ec 14 sub $0x14,%esp int status; POSIX_API_Control *api; api = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; status = sigprocmask( SIG_BLOCK, sigmask, &saved_signals_blocked ); 10c828: 8d 5d f4 lea -0xc(%ebp),%ebx 10c82b: 53 push %ebx 10c82c: ff 75 08 pushl 0x8(%ebp) 10c82f: 6a 01 push $0x1 10c831: e8 c6 ff ff ff call 10c7fc (void) sigfillset( &all_signals ); 10c836: 8d 75 f0 lea -0x10(%ebp),%esi 10c839: 89 34 24 mov %esi,(%esp) 10c83c: e8 17 ff ff ff call 10c758 status = sigtimedwait( &all_signals, NULL, NULL ); 10c841: 83 c4 0c add $0xc,%esp 10c844: 6a 00 push $0x0 10c846: 6a 00 push $0x0 10c848: 56 push %esi 10c849: e8 69 00 00 00 call 10c8b7 10c84e: 89 c6 mov %eax,%esi (void) sigprocmask( SIG_SETMASK, &saved_signals_blocked, NULL ); 10c850: 83 c4 0c add $0xc,%esp 10c853: 6a 00 push $0x0 10c855: 53 push %ebx 10c856: 6a 00 push $0x0 10c858: e8 9f ff ff ff call 10c7fc /* * sigtimedwait() returns the signal number while sigsuspend() * is supposed to return -1 and EINTR when a signal is caught. */ if ( status != -1 ) 10c85d: 83 c4 10 add $0x10,%esp 10c860: 46 inc %esi 10c861: 74 0b je 10c86e <== NEVER TAKEN rtems_set_errno_and_return_minus_one( EINTR ); 10c863: e8 04 75 00 00 call 113d6c <__errno> 10c868: c7 00 04 00 00 00 movl $0x4,(%eax) return status; } 10c86e: 83 c8 ff or $0xffffffff,%eax 10c871: 8d 65 f8 lea -0x8(%ebp),%esp 10c874: 5b pop %ebx 10c875: 5e pop %esi 10c876: c9 leave 10c877: c3 ret =============================================================================== 0010abf7 : int sigtimedwait( const sigset_t *set, siginfo_t *info, const struct timespec *timeout ) { 10abf7: 55 push %ebp 10abf8: 89 e5 mov %esp,%ebp 10abfa: 57 push %edi 10abfb: 56 push %esi 10abfc: 53 push %ebx 10abfd: 83 ec 2c sub $0x2c,%esp 10ac00: 8b 7d 08 mov 0x8(%ebp),%edi 10ac03: 8b 5d 10 mov 0x10(%ebp),%ebx ISR_Level level; /* * Error check parameters before disabling interrupts. */ if ( !set ) 10ac06: 85 ff test %edi,%edi 10ac08: 74 24 je 10ac2e /* NOTE: This is very specifically a RELATIVE not ABSOLUTE time * in the Open Group specification. */ interval = 0; if ( timeout ) { 10ac0a: 85 db test %ebx,%ebx 10ac0c: 74 33 je 10ac41 if ( !_Timespec_Is_valid( timeout ) ) 10ac0e: 83 ec 0c sub $0xc,%esp 10ac11: 53 push %ebx 10ac12: e8 29 30 00 00 call 10dc40 <_Timespec_Is_valid> 10ac17: 83 c4 10 add $0x10,%esp 10ac1a: 84 c0 test %al,%al 10ac1c: 74 10 je 10ac2e rtems_set_errno_and_return_minus_one( EINVAL ); interval = _Timespec_To_ticks( timeout ); 10ac1e: 83 ec 0c sub $0xc,%esp 10ac21: 53 push %ebx 10ac22: e8 71 30 00 00 call 10dc98 <_Timespec_To_ticks> if ( !interval ) 10ac27: 83 c4 10 add $0x10,%esp 10ac2a: 85 c0 test %eax,%eax 10ac2c: 75 15 jne 10ac43 <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one( EINVAL ); 10ac2e: e8 2d 79 00 00 call 112560 <__errno> 10ac33: c7 00 16 00 00 00 movl $0x16,(%eax) 10ac39: 83 cf ff or $0xffffffff,%edi 10ac3c: e9 13 01 00 00 jmp 10ad54 /* NOTE: This is very specifically a RELATIVE not ABSOLUTE time * in the Open Group specification. */ interval = 0; 10ac41: 31 c0 xor %eax,%eax /* * Initialize local variables. */ the_info = ( info ) ? info : &signal_information; 10ac43: 8b 5d 0c mov 0xc(%ebp),%ebx 10ac46: 85 db test %ebx,%ebx 10ac48: 75 03 jne 10ac4d 10ac4a: 8d 5d dc lea -0x24(%ebp),%ebx the_thread = _Thread_Executing; 10ac4d: 8b 15 74 78 12 00 mov 0x127874,%edx api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 10ac53: 8b b2 f8 00 00 00 mov 0xf8(%edx),%esi * What if they are already pending? */ /* API signals pending? */ _ISR_Disable( level ); 10ac59: 9c pushf 10ac5a: fa cli 10ac5b: 8f 45 d4 popl -0x2c(%ebp) if ( *set & api->signals_pending ) { 10ac5e: 8b 0f mov (%edi),%ecx 10ac60: 89 4d d0 mov %ecx,-0x30(%ebp) 10ac63: 8b 8e d0 00 00 00 mov 0xd0(%esi),%ecx 10ac69: 85 4d d0 test %ecx,-0x30(%ebp) 10ac6c: 74 32 je 10aca0 /* XXX real info later */ the_info->si_signo = _POSIX_signals_Get_highest( api->signals_pending ); 10ac6e: 83 ec 0c sub $0xc,%esp 10ac71: 51 push %ecx 10ac72: e8 41 ff ff ff call 10abb8 <_POSIX_signals_Get_highest> 10ac77: 89 03 mov %eax,(%ebx) _POSIX_signals_Clear_signals( 10ac79: c7 04 24 00 00 00 00 movl $0x0,(%esp) 10ac80: 6a 00 push $0x0 10ac82: 53 push %ebx 10ac83: 50 push %eax 10ac84: 56 push %esi 10ac85: e8 a2 4f 00 00 call 10fc2c <_POSIX_signals_Clear_signals> the_info->si_signo, the_info, false, false ); _ISR_Enable( level ); 10ac8a: ff 75 d4 pushl -0x2c(%ebp) 10ac8d: 9d popf the_info->si_code = SI_USER; 10ac8e: c7 43 04 01 00 00 00 movl $0x1,0x4(%ebx) the_info->si_value.sival_int = 0; 10ac95: c7 43 08 00 00 00 00 movl $0x0,0x8(%ebx) return the_info->si_signo; 10ac9c: 8b 3b mov (%ebx),%edi 10ac9e: eb 3b jmp 10acdb } /* Process pending signals? */ if ( *set & _POSIX_signals_Pending ) { 10aca0: 8b 0d 78 7a 12 00 mov 0x127a78,%ecx 10aca6: 85 4d d0 test %ecx,-0x30(%ebp) 10aca9: 74 35 je 10ace0 signo = _POSIX_signals_Get_highest( _POSIX_signals_Pending ); 10acab: 83 ec 0c sub $0xc,%esp 10acae: 51 push %ecx 10acaf: e8 04 ff ff ff call 10abb8 <_POSIX_signals_Get_highest> 10acb4: 89 c7 mov %eax,%edi _POSIX_signals_Clear_signals( api, signo, the_info, true, false ); 10acb6: c7 04 24 00 00 00 00 movl $0x0,(%esp) 10acbd: 6a 01 push $0x1 10acbf: 53 push %ebx 10acc0: 50 push %eax 10acc1: 56 push %esi 10acc2: e8 65 4f 00 00 call 10fc2c <_POSIX_signals_Clear_signals> _ISR_Enable( level ); 10acc7: ff 75 d4 pushl -0x2c(%ebp) 10acca: 9d popf the_info->si_signo = signo; 10accb: 89 3b mov %edi,(%ebx) the_info->si_code = SI_USER; 10accd: c7 43 04 01 00 00 00 movl $0x1,0x4(%ebx) the_info->si_value.sival_int = 0; 10acd4: c7 43 08 00 00 00 00 movl $0x0,0x8(%ebx) return signo; 10acdb: 83 c4 20 add $0x20,%esp 10acde: eb 74 jmp 10ad54 } the_info->si_signo = -1; 10ace0: c7 03 ff ff ff ff movl $0xffffffff,(%ebx) 10ace6: 8b 0d 24 73 12 00 mov 0x127324,%ecx 10acec: 41 inc %ecx 10aced: 89 0d 24 73 12 00 mov %ecx,0x127324 _Thread_Disable_dispatch(); the_thread->Wait.queue = &_POSIX_signals_Wait_queue; 10acf3: c7 42 44 10 7a 12 00 movl $0x127a10,0x44(%edx) the_thread->Wait.return_code = EINTR; 10acfa: c7 42 34 04 00 00 00 movl $0x4,0x34(%edx) the_thread->Wait.option = *set; 10ad01: 8b 0f mov (%edi),%ecx 10ad03: 89 4a 30 mov %ecx,0x30(%edx) the_thread->Wait.return_argument = the_info; 10ad06: 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; 10ad09: c7 05 40 7a 12 00 01 movl $0x1,0x127a40 10ad10: 00 00 00 _Thread_queue_Enter_critical_section( &_POSIX_signals_Wait_queue ); _ISR_Enable( level ); 10ad13: ff 75 d4 pushl -0x2c(%ebp) 10ad16: 9d popf _Thread_queue_Enqueue( &_POSIX_signals_Wait_queue, interval ); 10ad17: 52 push %edx 10ad18: 68 38 d8 10 00 push $0x10d838 10ad1d: 50 push %eax 10ad1e: 68 10 7a 12 00 push $0x127a10 10ad23: e8 38 28 00 00 call 10d560 <_Thread_queue_Enqueue_with_handler> _Thread_Enable_dispatch(); 10ad28: e8 a9 23 00 00 call 10d0d6 <_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 ); 10ad2d: c7 04 24 00 00 00 00 movl $0x0,(%esp) 10ad34: 6a 00 push $0x0 10ad36: 53 push %ebx 10ad37: ff 33 pushl (%ebx) 10ad39: 56 push %esi 10ad3a: e8 ed 4e 00 00 call 10fc2c <_POSIX_signals_Clear_signals> errno = _Thread_Executing->Wait.return_code; 10ad3f: 83 c4 20 add $0x20,%esp 10ad42: e8 19 78 00 00 call 112560 <__errno> 10ad47: 8b 15 74 78 12 00 mov 0x127874,%edx 10ad4d: 8b 52 34 mov 0x34(%edx),%edx 10ad50: 89 10 mov %edx,(%eax) return the_info->si_signo; 10ad52: 8b 3b mov (%ebx),%edi } 10ad54: 89 f8 mov %edi,%eax 10ad56: 8d 65 f4 lea -0xc(%ebp),%esp 10ad59: 5b pop %ebx 10ad5a: 5e pop %esi 10ad5b: 5f pop %edi 10ad5c: c9 leave 10ad5d: c3 ret =============================================================================== 0010ca38 : int sigwait( const sigset_t *set, int *sig ) { 10ca38: 55 push %ebp 10ca39: 89 e5 mov %esp,%ebp 10ca3b: 53 push %ebx 10ca3c: 83 ec 08 sub $0x8,%esp 10ca3f: 8b 5d 0c mov 0xc(%ebp),%ebx int status; status = sigtimedwait( set, NULL, NULL ); 10ca42: 6a 00 push $0x0 10ca44: 6a 00 push $0x0 10ca46: ff 75 08 pushl 0x8(%ebp) 10ca49: e8 69 fe ff ff call 10c8b7 10ca4e: 89 c2 mov %eax,%edx if ( status != -1 ) { 10ca50: 83 c4 10 add $0x10,%esp 10ca53: 83 f8 ff cmp $0xffffffff,%eax 10ca56: 74 0a je 10ca62 if ( sig ) *sig = status; return 0; 10ca58: 31 c0 xor %eax,%eax int status; status = sigtimedwait( set, NULL, NULL ); if ( status != -1 ) { if ( sig ) 10ca5a: 85 db test %ebx,%ebx 10ca5c: 74 0b je 10ca69 <== NEVER TAKEN *sig = status; 10ca5e: 89 13 mov %edx,(%ebx) 10ca60: eb 07 jmp 10ca69 return 0; } return errno; 10ca62: e8 05 73 00 00 call 113d6c <__errno> 10ca67: 8b 00 mov (%eax),%eax } 10ca69: 8b 5d fc mov -0x4(%ebp),%ebx 10ca6c: c9 leave 10ca6d: c3 ret =============================================================================== 0010a094 : int timer_create( clockid_t clock_id, struct sigevent *evp, timer_t *timerid ) { 10a094: 55 push %ebp 10a095: 89 e5 mov %esp,%ebp 10a097: 56 push %esi 10a098: 53 push %ebx 10a099: 8b 5d 0c mov 0xc(%ebp),%ebx 10a09c: 8b 75 10 mov 0x10(%ebp),%esi POSIX_Timer_Control *ptimer; if ( clock_id != CLOCK_REALTIME ) 10a09f: 83 7d 08 01 cmpl $0x1,0x8(%ebp) 10a0a3: 75 1d jne 10a0c2 rtems_set_errno_and_return_minus_one( EINVAL ); if ( !timerid ) 10a0a5: 85 f6 test %esi,%esi 10a0a7: 74 19 je 10a0c2 /* * The data of the structure evp are checked in order to verify if they * are coherent. */ if (evp != NULL) { 10a0a9: 85 db test %ebx,%ebx 10a0ab: 74 22 je 10a0cf /* The structure has data */ if ( ( evp->sigev_notify != SIGEV_NONE ) && 10a0ad: 8b 03 mov (%ebx),%eax 10a0af: 48 dec %eax 10a0b0: 83 f8 01 cmp $0x1,%eax 10a0b3: 77 0d ja 10a0c2 <== NEVER TAKEN ( evp->sigev_notify != SIGEV_SIGNAL ) ) { /* The value of the field sigev_notify is not valid */ rtems_set_errno_and_return_minus_one( EINVAL ); } if ( !evp->sigev_signo ) 10a0b5: 8b 43 04 mov 0x4(%ebx),%eax 10a0b8: 85 c0 test %eax,%eax 10a0ba: 74 06 je 10a0c2 <== NEVER TAKEN static inline bool is_valid_signo( int signo ) { return ((signo) >= 1 && (signo) <= 32 ); 10a0bc: 48 dec %eax rtems_set_errno_and_return_minus_one( EINVAL ); if ( !is_valid_signo(evp->sigev_signo) ) 10a0bd: 83 f8 1f cmp $0x1f,%eax 10a0c0: 76 0d jbe 10a0cf <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one( EINVAL ); 10a0c2: e8 a1 7c 00 00 call 111d68 <__errno> 10a0c7: c7 00 16 00 00 00 movl $0x16,(%eax) 10a0cd: eb 2f jmp 10a0fe rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 10a0cf: a1 38 62 12 00 mov 0x126238,%eax 10a0d4: 40 inc %eax 10a0d5: a3 38 62 12 00 mov %eax,0x126238 * 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 ); 10a0da: 83 ec 0c sub $0xc,%esp 10a0dd: 68 44 65 12 00 push $0x126544 10a0e2: e8 71 1b 00 00 call 10bc58 <_Objects_Allocate> /* * Allocate a timer */ ptimer = _POSIX_Timer_Allocate(); if ( !ptimer ) { 10a0e7: 83 c4 10 add $0x10,%esp 10a0ea: 85 c0 test %eax,%eax 10a0ec: 75 18 jne 10a106 _Thread_Enable_dispatch(); 10a0ee: e8 6b 27 00 00 call 10c85e <_Thread_Enable_dispatch> rtems_set_errno_and_return_minus_one( EAGAIN ); 10a0f3: e8 70 7c 00 00 call 111d68 <__errno> 10a0f8: c7 00 0b 00 00 00 movl $0xb,(%eax) 10a0fe: 83 c8 ff or $0xffffffff,%eax 10a101: e9 83 00 00 00 jmp 10a189 } /* The data of the created timer are stored to use them later */ ptimer->state = POSIX_TIMER_STATE_CREATE_NEW; 10a106: c6 40 3c 02 movb $0x2,0x3c(%eax) ptimer->thread_id = _Thread_Executing->Object.id; 10a10a: 8b 15 88 67 12 00 mov 0x126788,%edx 10a110: 8b 52 08 mov 0x8(%edx),%edx 10a113: 89 50 38 mov %edx,0x38(%eax) if ( evp != NULL ) { 10a116: 85 db test %ebx,%ebx 10a118: 74 11 je 10a12b ptimer->inf.sigev_notify = evp->sigev_notify; 10a11a: 8b 13 mov (%ebx),%edx 10a11c: 89 50 40 mov %edx,0x40(%eax) ptimer->inf.sigev_signo = evp->sigev_signo; 10a11f: 8b 53 04 mov 0x4(%ebx),%edx 10a122: 89 50 44 mov %edx,0x44(%eax) ptimer->inf.sigev_value = evp->sigev_value; 10a125: 8b 53 08 mov 0x8(%ebx),%edx 10a128: 89 50 48 mov %edx,0x48(%eax) } ptimer->overrun = 0; 10a12b: c7 40 68 00 00 00 00 movl $0x0,0x68(%eax) ptimer->timer_data.it_value.tv_sec = 0; 10a132: c7 40 5c 00 00 00 00 movl $0x0,0x5c(%eax) ptimer->timer_data.it_value.tv_nsec = 0; 10a139: c7 40 60 00 00 00 00 movl $0x0,0x60(%eax) ptimer->timer_data.it_interval.tv_sec = 0; 10a140: c7 40 54 00 00 00 00 movl $0x0,0x54(%eax) ptimer->timer_data.it_interval.tv_nsec = 0; 10a147: 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; 10a14e: c7 40 18 00 00 00 00 movl $0x0,0x18(%eax) the_watchdog->routine = routine; 10a155: c7 40 2c 00 00 00 00 movl $0x0,0x2c(%eax) the_watchdog->id = id; 10a15c: c7 40 30 00 00 00 00 movl $0x0,0x30(%eax) the_watchdog->user_data = user_data; 10a163: 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 ), 10a16a: 8b 50 08 mov 0x8(%eax),%edx Objects_Information *information, Objects_Control *the_object, uint32_t name ) { _Objects_Set_local_object( 10a16d: 0f b7 da movzwl %dx,%ebx #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 10a170: 8b 0d 60 65 12 00 mov 0x126560,%ecx 10a176: 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; 10a179: 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; 10a180: 89 16 mov %edx,(%esi) _Thread_Enable_dispatch(); 10a182: e8 d7 26 00 00 call 10c85e <_Thread_Enable_dispatch> return 0; 10a187: 31 c0 xor %eax,%eax } 10a189: 8d 65 f8 lea -0x8(%ebp),%esp 10a18c: 5b pop %ebx 10a18d: 5e pop %esi 10a18e: c9 leave 10a18f: c3 ret =============================================================================== 0010a190 : timer_t timerid, int flags, const struct itimerspec *value, struct itimerspec *ovalue ) { 10a190: 55 push %ebp 10a191: 89 e5 mov %esp,%ebp 10a193: 57 push %edi 10a194: 56 push %esi 10a195: 53 push %ebx 10a196: 83 ec 2c sub $0x2c,%esp 10a199: 8b 5d 0c mov 0xc(%ebp),%ebx Objects_Locations location; bool activated; uint32_t initial_period; struct itimerspec normalize; if ( !value ) 10a19c: 83 7d 10 00 cmpl $0x0,0x10(%ebp) 10a1a0: 0f 84 58 01 00 00 je 10a2fe <== NEVER TAKEN /* * First, it verifies if the structure "value" is correct * if the number of nanoseconds is not correct return EINVAL */ if ( !_Timespec_Is_valid( &(value->it_value) ) ) { 10a1a6: 83 ec 0c sub $0xc,%esp 10a1a9: 8b 45 10 mov 0x10(%ebp),%eax 10a1ac: 83 c0 08 add $0x8,%eax 10a1af: 50 push %eax 10a1b0: e8 37 32 00 00 call 10d3ec <_Timespec_Is_valid> 10a1b5: 83 c4 10 add $0x10,%esp 10a1b8: 84 c0 test %al,%al 10a1ba: 0f 84 3e 01 00 00 je 10a2fe rtems_set_errno_and_return_minus_one( EINVAL ); } if ( !_Timespec_Is_valid( &(value->it_interval) ) ) { 10a1c0: 83 ec 0c sub $0xc,%esp 10a1c3: ff 75 10 pushl 0x10(%ebp) 10a1c6: e8 21 32 00 00 call 10d3ec <_Timespec_Is_valid> 10a1cb: 83 c4 10 add $0x10,%esp 10a1ce: 84 c0 test %al,%al 10a1d0: 0f 84 28 01 00 00 je 10a2fe <== NEVER TAKEN rtems_set_errno_and_return_minus_one( EINVAL ); } if ( flags != TIMER_ABSTIME && flags != POSIX_TIMER_RELATIVE ) { 10a1d6: 85 db test %ebx,%ebx 10a1d8: 74 09 je 10a1e3 10a1da: 83 fb 04 cmp $0x4,%ebx 10a1dd: 0f 85 1b 01 00 00 jne 10a2fe rtems_set_errno_and_return_minus_one( EINVAL ); } normalize = *value; 10a1e3: 8d 7d cc lea -0x34(%ebp),%edi 10a1e6: b9 04 00 00 00 mov $0x4,%ecx 10a1eb: 8b 75 10 mov 0x10(%ebp),%esi 10a1ee: f3 a5 rep movsl %ds:(%esi),%es:(%edi) /* Convert absolute to relative time */ if (flags == TIMER_ABSTIME) { 10a1f0: 83 fb 04 cmp $0x4,%ebx 10a1f3: 75 2f jne 10a224 struct timespec now; _TOD_Get( &now ); 10a1f5: 83 ec 0c sub $0xc,%esp 10a1f8: 8d 5d dc lea -0x24(%ebp),%ebx 10a1fb: 53 push %ebx 10a1fc: e8 9b 15 00 00 call 10b79c <_TOD_Get> /* Check for seconds in the past */ if ( _Timespec_Greater_than( &now, &normalize.it_value ) ) 10a201: 59 pop %ecx 10a202: 5e pop %esi 10a203: 8d 75 d4 lea -0x2c(%ebp),%esi 10a206: 56 push %esi 10a207: 53 push %ebx 10a208: e8 bb 31 00 00 call 10d3c8 <_Timespec_Greater_than> 10a20d: 83 c4 10 add $0x10,%esp 10a210: 84 c0 test %al,%al 10a212: 0f 85 e6 00 00 00 jne 10a2fe rtems_set_errno_and_return_minus_one( EINVAL ); _Timespec_Subtract( &now, &normalize.it_value, &normalize.it_value ); 10a218: 52 push %edx 10a219: 56 push %esi 10a21a: 56 push %esi 10a21b: 53 push %ebx 10a21c: e8 ef 31 00 00 call 10d410 <_Timespec_Subtract> 10a221: 83 c4 10 add $0x10,%esp timer_t id, Objects_Locations *location ) { return (POSIX_Timer_Control *) _Objects_Get( &_POSIX_Timer_Information, (Objects_Id) id, location ); 10a224: 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 ); 10a225: 8d 45 e4 lea -0x1c(%ebp),%eax 10a228: 50 push %eax 10a229: ff 75 08 pushl 0x8(%ebp) 10a22c: 68 44 65 12 00 push $0x126544 10a231: e8 4e 1e 00 00 call 10c084 <_Objects_Get> 10a236: 89 c3 mov %eax,%ebx switch ( location ) { 10a238: 83 c4 10 add $0x10,%esp 10a23b: 83 7d e4 00 cmpl $0x0,-0x1c(%ebp) 10a23f: 0f 85 b9 00 00 00 jne 10a2fe 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 ) { 10a245: 83 7d d4 00 cmpl $0x0,-0x2c(%ebp) 10a249: 75 3b jne 10a286 10a24b: 83 7d d8 00 cmpl $0x0,-0x28(%ebp) 10a24f: 75 35 jne 10a286 /* Stop the timer */ (void) _Watchdog_Remove( &ptimer->Timer ); 10a251: 83 ec 0c sub $0xc,%esp 10a254: 8d 40 10 lea 0x10(%eax),%eax 10a257: 50 push %eax 10a258: e8 77 35 00 00 call 10d7d4 <_Watchdog_Remove> /* The old data of the timer are returned */ if ( ovalue ) 10a25d: 83 c4 10 add $0x10,%esp 10a260: 83 7d 14 00 cmpl $0x0,0x14(%ebp) 10a264: 74 0d je 10a273 *ovalue = ptimer->timer_data; 10a266: 8d 73 54 lea 0x54(%ebx),%esi 10a269: b9 04 00 00 00 mov $0x4,%ecx 10a26e: 8b 7d 14 mov 0x14(%ebp),%edi 10a271: f3 a5 rep movsl %ds:(%esi),%es:(%edi) /* The new data are set */ ptimer->timer_data = normalize; 10a273: 8d 7b 54 lea 0x54(%ebx),%edi 10a276: 8d 75 cc lea -0x34(%ebp),%esi 10a279: b9 04 00 00 00 mov $0x4,%ecx 10a27e: f3 a5 rep movsl %ds:(%esi),%es:(%edi) /* Indicates that the timer is created and stopped */ ptimer->state = POSIX_TIMER_STATE_CREATE_STOP; 10a280: c6 43 3c 04 movb $0x4,0x3c(%ebx) 10a284: eb 35 jmp 10a2bb _Thread_Enable_dispatch(); return 0; } /* Convert from seconds and nanoseconds to ticks */ ptimer->ticks = _Timespec_To_ticks( &value->it_interval ); 10a286: 83 ec 0c sub $0xc,%esp 10a289: ff 75 10 pushl 0x10(%ebp) 10a28c: e8 b3 31 00 00 call 10d444 <_Timespec_To_ticks> 10a291: 89 43 64 mov %eax,0x64(%ebx) initial_period = _Timespec_To_ticks( &normalize.it_value ); 10a294: 8d 45 d4 lea -0x2c(%ebp),%eax 10a297: 89 04 24 mov %eax,(%esp) 10a29a: e8 a5 31 00 00 call 10d444 <_Timespec_To_ticks> activated = _POSIX_Timer_Insert_helper( 10a29f: 89 1c 24 mov %ebx,(%esp) 10a2a2: 68 14 a3 10 00 push $0x10a314 10a2a7: ff 73 08 pushl 0x8(%ebx) 10a2aa: 50 push %eax 10a2ab: 8d 43 10 lea 0x10(%ebx),%eax 10a2ae: 50 push %eax 10a2af: e8 e8 55 00 00 call 10f89c <_POSIX_Timer_Insert_helper> initial_period, ptimer->Object.id, _POSIX_Timer_TSR, ptimer ); if ( !activated ) { 10a2b4: 83 c4 20 add $0x20,%esp 10a2b7: 84 c0 test %al,%al 10a2b9: 75 07 jne 10a2c2 _Thread_Enable_dispatch(); 10a2bb: e8 9e 25 00 00 call 10c85e <_Thread_Enable_dispatch> 10a2c0: eb 38 jmp 10a2fa /* * The timer has been started and is running. So we return the * old ones in "ovalue" */ if ( ovalue ) 10a2c2: 83 7d 14 00 cmpl $0x0,0x14(%ebp) 10a2c6: 74 0d je 10a2d5 *ovalue = ptimer->timer_data; 10a2c8: 8d 73 54 lea 0x54(%ebx),%esi 10a2cb: b9 04 00 00 00 mov $0x4,%ecx 10a2d0: 8b 7d 14 mov 0x14(%ebp),%edi 10a2d3: f3 a5 rep movsl %ds:(%esi),%es:(%edi) ptimer->timer_data = normalize; 10a2d5: 8d 7b 54 lea 0x54(%ebx),%edi 10a2d8: 8d 75 cc lea -0x34(%ebp),%esi 10a2db: b9 04 00 00 00 mov $0x4,%ecx 10a2e0: f3 a5 rep movsl %ds:(%esi),%es:(%edi) /* Indicate that the time is running */ ptimer->state = POSIX_TIMER_STATE_CREATE_RUN; 10a2e2: c6 43 3c 03 movb $0x3,0x3c(%ebx) _TOD_Get( &ptimer->time ); 10a2e6: 83 ec 0c sub $0xc,%esp 10a2e9: 83 c3 6c add $0x6c,%ebx 10a2ec: 53 push %ebx 10a2ed: e8 aa 14 00 00 call 10b79c <_TOD_Get> _Thread_Enable_dispatch(); 10a2f2: e8 67 25 00 00 call 10c85e <_Thread_Enable_dispatch> return 0; 10a2f7: 83 c4 10 add $0x10,%esp 10a2fa: 31 c0 xor %eax,%eax 10a2fc: eb 0e jmp 10a30c #endif case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( EINVAL ); 10a2fe: e8 65 7a 00 00 call 111d68 <__errno> 10a303: c7 00 16 00 00 00 movl $0x16,(%eax) 10a309: 83 c8 ff or $0xffffffff,%eax } 10a30c: 8d 65 f4 lea -0xc(%ebp),%esp 10a30f: 5b pop %ebx 10a310: 5e pop %esi 10a311: 5f pop %edi 10a312: c9 leave 10a313: c3 ret =============================================================================== 00109fcc : useconds_t ualarm( useconds_t useconds, useconds_t interval ) { 109fcc: 55 push %ebp 109fcd: 89 e5 mov %esp,%ebp 109fcf: 57 push %edi 109fd0: 56 push %esi 109fd1: 53 push %ebx 109fd2: 83 ec 1c sub $0x1c,%esp 109fd5: 8b 75 08 mov 0x8(%ebp),%esi /* * Initialize the timer used to implement alarm(). */ if ( !the_timer->routine ) { 109fd8: 83 3d 28 6b 12 00 00 cmpl $0x0,0x126b28 109fdf: 75 2c jne 10a00d <== NEVER TAKEN Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 109fe1: c7 05 14 6b 12 00 00 movl $0x0,0x126b14 109fe8: 00 00 00 the_watchdog->routine = routine; 109feb: c7 05 28 6b 12 00 94 movl $0x109f94,0x126b28 109ff2: 9f 10 00 the_watchdog->id = id; 109ff5: c7 05 2c 6b 12 00 00 movl $0x0,0x126b2c 109ffc: 00 00 00 the_watchdog->user_data = user_data; 109fff: c7 05 30 6b 12 00 00 movl $0x0,0x126b30 10a006: 00 00 00 useconds_t ualarm( useconds_t useconds, useconds_t interval ) { useconds_t remaining = 0; 10a009: 31 db xor %ebx,%ebx 10a00b: eb 4f jmp 10a05c if ( !the_timer->routine ) { _Watchdog_Initialize( the_timer, _POSIX_signals_Ualarm_TSR, 0, NULL ); } else { Watchdog_States state; state = _Watchdog_Remove( the_timer ); 10a00d: 83 ec 0c sub $0xc,%esp 10a010: 68 0c 6b 12 00 push $0x126b0c 10a015: e8 aa 33 00 00 call 10d3c4 <_Watchdog_Remove> if ( (state == WATCHDOG_ACTIVE) || (state == WATCHDOG_REMOVE_IT) ) { 10a01a: 83 e8 02 sub $0x2,%eax 10a01d: 83 c4 10 add $0x10,%esp useconds_t ualarm( useconds_t useconds, useconds_t interval ) { useconds_t remaining = 0; 10a020: 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) ) { 10a022: 83 f8 01 cmp $0x1,%eax 10a025: 77 35 ja 10a05c <== 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); 10a027: a1 20 6b 12 00 mov 0x126b20,%eax 10a02c: 03 05 18 6b 12 00 add 0x126b18,%eax /* remaining is now in ticks */ _Timespec_From_ticks( ticks, &tp ); 10a032: 57 push %edi 10a033: 57 push %edi 10a034: 8d 55 e0 lea -0x20(%ebp),%edx 10a037: 52 push %edx * 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); 10a038: 2b 05 24 6b 12 00 sub 0x126b24,%eax /* remaining is now in ticks */ _Timespec_From_ticks( ticks, &tp ); 10a03e: 50 push %eax 10a03f: e8 28 2f 00 00 call 10cf6c <_Timespec_From_ticks> remaining = tp.tv_sec * TOD_MICROSECONDS_PER_SECOND; 10a044: 69 4d e0 40 42 0f 00 imul $0xf4240,-0x20(%ebp),%ecx remaining += tp.tv_nsec / 1000; 10a04b: 8b 45 e4 mov -0x1c(%ebp),%eax 10a04e: bf e8 03 00 00 mov $0x3e8,%edi 10a053: 99 cltd 10a054: f7 ff idiv %edi 10a056: 8d 1c 08 lea (%eax,%ecx,1),%ebx 10a059: 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 ) { 10a05c: 85 f6 test %esi,%esi 10a05e: 74 44 je 10a0a4 Watchdog_Interval ticks; tp.tv_sec = useconds / TOD_MICROSECONDS_PER_SECOND; 10a060: b9 40 42 0f 00 mov $0xf4240,%ecx 10a065: 89 f0 mov %esi,%eax 10a067: 31 d2 xor %edx,%edx 10a069: f7 f1 div %ecx 10a06b: 89 45 e0 mov %eax,-0x20(%ebp) tp.tv_nsec = (useconds % TOD_MICROSECONDS_PER_SECOND) * 1000; 10a06e: 69 d2 e8 03 00 00 imul $0x3e8,%edx,%edx 10a074: 89 55 e4 mov %edx,-0x1c(%ebp) ticks = _Timespec_To_ticks( &tp ); 10a077: 83 ec 0c sub $0xc,%esp 10a07a: 8d 75 e0 lea -0x20(%ebp),%esi 10a07d: 56 push %esi 10a07e: e8 45 2f 00 00 call 10cfc8 <_Timespec_To_ticks> if ( ticks == 0 ) ticks = 1; _Watchdog_Insert_ticks( the_timer, _Timespec_To_ticks( &tp ) ); 10a083: 89 34 24 mov %esi,(%esp) 10a086: e8 3d 2f 00 00 call 10cfc8 <_Timespec_To_ticks> Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 10a08b: a3 18 6b 12 00 mov %eax,0x126b18 _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 10a090: 59 pop %ecx 10a091: 5e pop %esi 10a092: 68 0c 6b 12 00 push $0x126b0c 10a097: 68 fc 62 12 00 push $0x1262fc 10a09c: e8 0b 32 00 00 call 10d2ac <_Watchdog_Insert> 10a0a1: 83 c4 10 add $0x10,%esp } return remaining; } 10a0a4: 89 d8 mov %ebx,%eax 10a0a6: 8d 65 f4 lea -0xc(%ebp),%esp 10a0a9: 5b pop %ebx 10a0aa: 5e pop %esi 10a0ab: 5f pop %edi 10a0ac: c9 leave 10a0ad: c3 ret