=============================================================================== 00117408 <_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 ) { 117408: 55 push %ebp 117409: 89 e5 mov %esp,%ebp 11740b: 57 push %edi 11740c: 56 push %esi 11740d: 53 push %ebx 11740e: 83 ec 1c sub $0x1c,%esp 117411: 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; 117414: 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 ) { 117419: 8b 55 10 mov 0x10(%ebp),%edx 11741c: 3b 53 4c cmp 0x4c(%ebx),%edx 11741f: 77 4e ja 11746f <_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 ) { 117421: 83 7b 48 00 cmpl $0x0,0x48(%ebx) 117425: 75 09 jne 117430 <_CORE_message_queue_Broadcast+0x28> 117427: c7 45 e4 00 00 00 00 movl $0x0,-0x1c(%ebp) 11742e: eb 23 jmp 117453 <_CORE_message_queue_Broadcast+0x4b> *count = 0; 117430: 8b 45 1c mov 0x1c(%ebp),%eax 117433: c7 00 00 00 00 00 movl $0x0,(%eax) 117439: eb 32 jmp 11746d <_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; 11743b: ff 45 e4 incl -0x1c(%ebp) const void *source, void *destination, size_t size ) { memcpy(destination, source, size); 11743e: 8b 42 2c mov 0x2c(%edx),%eax 117441: 89 c7 mov %eax,%edi 117443: 8b 75 0c mov 0xc(%ebp),%esi 117446: 8b 4d 10 mov 0x10(%ebp),%ecx 117449: f3 a4 rep movsb %ds:(%esi),%es:(%edi) buffer, waitp->return_argument_second.mutable_object, size ); *(size_t *) the_thread->Wait.return_argument = size; 11744b: 8b 42 28 mov 0x28(%edx),%eax 11744e: 8b 55 10 mov 0x10(%ebp),%edx 117451: 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 = 117453: 83 ec 0c sub $0xc,%esp 117456: 53 push %ebx 117457: e8 84 21 00 00 call 1195e0 <_Thread_queue_Dequeue> 11745c: 89 c2 mov %eax,%edx 11745e: 83 c4 10 add $0x10,%esp 117461: 85 c0 test %eax,%eax 117463: 75 d6 jne 11743b <_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; 117465: 8b 55 e4 mov -0x1c(%ebp),%edx 117468: 8b 45 1c mov 0x1c(%ebp),%eax 11746b: 89 10 mov %edx,(%eax) return CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL; 11746d: 31 c0 xor %eax,%eax } 11746f: 8d 65 f4 lea -0xc(%ebp),%esp 117472: 5b pop %ebx 117473: 5e pop %esi 117474: 5f pop %edi 117475: c9 leave 117476: c3 ret =============================================================================== 00112228 <_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 ) { 112228: 55 push %ebp 112229: 89 e5 mov %esp,%ebp 11222b: 57 push %edi 11222c: 56 push %esi 11222d: 53 push %ebx 11222e: 83 ec 1c sub $0x1c,%esp 112231: 8b 5d 08 mov 0x8(%ebp),%ebx 112234: 8b 7d 10 mov 0x10(%ebp),%edi 112237: 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; 11223a: 89 7b 44 mov %edi,0x44(%ebx) the_message_queue->number_of_pending_messages = 0; 11223d: c7 43 48 00 00 00 00 movl $0x0,0x48(%ebx) the_message_queue->maximum_message_size = maximum_message_size; 112244: 89 53 4c mov %edx,0x4c(%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)) { 112247: 89 d0 mov %edx,%eax 112249: f6 c2 03 test $0x3,%dl 11224c: 74 0c je 11225a <_CORE_message_queue_Initialize+0x32> allocated_message_size += sizeof(uint32_t); 11224e: 83 c0 04 add $0x4,%eax allocated_message_size &= ~(sizeof(uint32_t) - 1); 112251: 83 e0 fc and $0xfffffffc,%eax } if (allocated_message_size < maximum_message_size) return false; 112254: 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) 112256: 39 d0 cmp %edx,%eax 112258: 72 68 jb 1122c2 <_CORE_message_queue_Initialize+0x9a><== 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)); 11225a: 8d 50 10 lea 0x10(%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 * 11225d: 89 d1 mov %edx,%ecx 11225f: 0f af cf imul %edi,%ecx (allocated_message_size + sizeof(CORE_message_queue_Buffer_control)); if (message_buffering_required < allocated_message_size) return false; 112262: 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) 112264: 39 c1 cmp %eax,%ecx 112266: 72 5a jb 1122c2 <_CORE_message_queue_Initialize+0x9a><== NEVER TAKEN /* * Attempt to allocate the message memory */ the_message_queue->message_buffers = (CORE_message_queue_Buffer *) _Workspace_Allocate( message_buffering_required ); 112268: 83 ec 0c sub $0xc,%esp 11226b: 51 push %ecx 11226c: 89 55 e4 mov %edx,-0x1c(%ebp) 11226f: e8 72 25 00 00 call 1147e6 <_Workspace_Allocate> return false; /* * Attempt to allocate the message memory */ the_message_queue->message_buffers = (CORE_message_queue_Buffer *) 112274: 89 43 5c mov %eax,0x5c(%ebx) _Workspace_Allocate( message_buffering_required ); if (the_message_queue->message_buffers == 0) 112277: 83 c4 10 add $0x10,%esp 11227a: 85 c0 test %eax,%eax 11227c: 8b 55 e4 mov -0x1c(%ebp),%edx 11227f: 74 41 je 1122c2 <_CORE_message_queue_Initialize+0x9a> /* * Initialize the pool of inactive messages, pending messages, * and set of waiting threads. */ _Chain_Initialize ( 112281: 52 push %edx 112282: 57 push %edi 112283: 50 push %eax 112284: 8d 43 60 lea 0x60(%ebx),%eax 112287: 50 push %eax 112288: e8 ef 3e 00 00 call 11617c <_Chain_Initialize> */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 11228d: 8d 43 54 lea 0x54(%ebx),%eax 112290: 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; 112293: 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 ); 11229a: 8d 43 50 lea 0x50(%ebx),%eax 11229d: 89 43 58 mov %eax,0x58(%ebx) _Thread_queue_Initialize( 1122a0: 6a 06 push $0x6 1122a2: 68 80 00 00 00 push $0x80 1122a7: 8b 45 0c mov 0xc(%ebp),%eax 1122aa: 83 38 01 cmpl $0x1,(%eax) 1122ad: 0f 94 c0 sete %al 1122b0: 0f b6 c0 movzbl %al,%eax 1122b3: 50 push %eax 1122b4: 53 push %ebx 1122b5: e8 0a 1c 00 00 call 113ec4 <_Thread_queue_Initialize> THREAD_QUEUE_DISCIPLINE_PRIORITY : THREAD_QUEUE_DISCIPLINE_FIFO, STATES_WAITING_FOR_MESSAGE, CORE_MESSAGE_QUEUE_STATUS_TIMEOUT ); return true; 1122ba: 83 c4 20 add $0x20,%esp 1122bd: be 01 00 00 00 mov $0x1,%esi } 1122c2: 89 f0 mov %esi,%eax 1122c4: 8d 65 f4 lea -0xc(%ebp),%esp 1122c7: 5b pop %ebx 1122c8: 5e pop %esi 1122c9: 5f pop %edi 1122ca: c9 leave 1122cb: c3 ret =============================================================================== 001122cc <_CORE_message_queue_Seize>: void *buffer, size_t *size_p, bool wait, Watchdog_Interval timeout ) { 1122cc: 55 push %ebp 1122cd: 89 e5 mov %esp,%ebp 1122cf: 57 push %edi 1122d0: 56 push %esi 1122d1: 53 push %ebx 1122d2: 83 ec 2c sub $0x2c,%esp 1122d5: 8b 45 08 mov 0x8(%ebp),%eax 1122d8: 8b 55 0c mov 0xc(%ebp),%edx 1122db: 89 55 dc mov %edx,-0x24(%ebp) 1122de: 8b 55 10 mov 0x10(%ebp),%edx 1122e1: 89 55 e4 mov %edx,-0x1c(%ebp) 1122e4: 8b 7d 14 mov 0x14(%ebp),%edi 1122e7: 8b 55 1c mov 0x1c(%ebp),%edx 1122ea: 89 55 d4 mov %edx,-0x2c(%ebp) 1122ed: 8a 55 18 mov 0x18(%ebp),%dl 1122f0: 88 55 db mov %dl,-0x25(%ebp) ISR_Level level; CORE_message_queue_Buffer_control *the_message; Thread_Control *executing; executing = _Thread_Executing; 1122f3: 8b 0d 18 b5 12 00 mov 0x12b518,%ecx executing->Wait.return_code = CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL; 1122f9: c7 41 34 00 00 00 00 movl $0x0,0x34(%ecx) _ISR_Disable( level ); 112300: 9c pushf 112301: fa cli 112302: 8f 45 e0 popl -0x20(%ebp) */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 112305: 8b 50 50 mov 0x50(%eax),%edx */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 112308: 8d 58 54 lea 0x54(%eax),%ebx */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected( Chain_Control *the_chain ) { if ( !_Chain_Is_empty(the_chain)) 11230b: 39 da cmp %ebx,%edx 11230d: 74 47 je 112356 <_CORE_message_queue_Seize+0x8a> { Chain_Node *return_node; Chain_Node *new_first; return_node = the_chain->first; new_first = return_node->next; 11230f: 8b 32 mov (%edx),%esi the_chain->first = new_first; 112311: 89 70 50 mov %esi,0x50(%eax) 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 ); 112314: 8d 58 50 lea 0x50(%eax),%ebx 112317: 89 5e 04 mov %ebx,0x4(%esi) the_message = _CORE_message_queue_Get_pending_message( the_message_queue ); if ( the_message != NULL ) { 11231a: 85 d2 test %edx,%edx 11231c: 74 38 je 112356 <_CORE_message_queue_Seize+0x8a><== NEVER TAKEN the_message_queue->number_of_pending_messages -= 1; 11231e: ff 48 48 decl 0x48(%eax) _ISR_Enable( level ); 112321: ff 75 e0 pushl -0x20(%ebp) 112324: 9d popf *size_p = the_message->Contents.size; 112325: 8b 4a 08 mov 0x8(%edx),%ecx 112328: 89 0f mov %ecx,(%edi) _Thread_Executing->Wait.count = 11232a: 8b 0d 18 b5 12 00 mov 0x12b518,%ecx 112330: c7 41 24 00 00 00 00 movl $0x0,0x24(%ecx) _CORE_message_queue_Get_message_priority( the_message ); _CORE_message_queue_Copy_buffer( the_message->Contents.buffer, 112337: 8d 72 0c lea 0xc(%edx),%esi const void *source, void *destination, size_t size ) { memcpy(destination, source, size); 11233a: 8b 0f mov (%edi),%ecx 11233c: 8b 7d e4 mov -0x1c(%ebp),%edi 11233f: f3 a4 rep movsb %ds:(%esi),%es:(%edi) 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 ); 112341: 89 55 0c mov %edx,0xc(%ebp) 112344: 83 c0 60 add $0x60,%eax 112347: 89 45 08 mov %eax,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 ); } 11234a: 83 c4 2c add $0x2c,%esp 11234d: 5b pop %ebx 11234e: 5e pop %esi 11234f: 5f pop %edi 112350: c9 leave 112351: e9 52 fe ff ff jmp 1121a8 <_Chain_Append> return; } #endif } if ( !wait ) { 112356: 80 7d db 00 cmpb $0x0,-0x25(%ebp) 11235a: 75 13 jne 11236f <_CORE_message_queue_Seize+0xa3> _ISR_Enable( level ); 11235c: ff 75 e0 pushl -0x20(%ebp) 11235f: 9d popf executing->Wait.return_code = CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED_NOWAIT; 112360: c7 41 34 04 00 00 00 movl $0x4,0x34(%ecx) 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 ); } 112367: 83 c4 2c add $0x2c,%esp 11236a: 5b pop %ebx 11236b: 5e pop %esi 11236c: 5f pop %edi 11236d: c9 leave 11236e: 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; 11236f: c7 40 30 01 00 00 00 movl $0x1,0x30(%eax) 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; 112376: 89 41 44 mov %eax,0x44(%ecx) executing->Wait.id = id; 112379: 8b 55 dc mov -0x24(%ebp),%edx 11237c: 89 51 20 mov %edx,0x20(%ecx) executing->Wait.return_argument_second.mutable_object = buffer; 11237f: 8b 55 e4 mov -0x1c(%ebp),%edx 112382: 89 51 2c mov %edx,0x2c(%ecx) executing->Wait.return_argument = size_p; 112385: 89 79 28 mov %edi,0x28(%ecx) /* Wait.count will be filled in with the message priority */ _ISR_Enable( level ); 112388: ff 75 e0 pushl -0x20(%ebp) 11238b: 9d popf _Thread_queue_Enqueue( &the_message_queue->Wait_queue, timeout ); 11238c: c7 45 10 74 3f 11 00 movl $0x113f74,0x10(%ebp) 112393: 8b 55 d4 mov -0x2c(%ebp),%edx 112396: 89 55 0c mov %edx,0xc(%ebp) 112399: 89 45 08 mov %eax,0x8(%ebp) } 11239c: 83 c4 2c add $0x2c,%esp 11239f: 5b pop %ebx 1123a0: 5e pop %esi 1123a1: 5f pop %edi 1123a2: 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 ); 1123a3: e9 f4 18 00 00 jmp 113c9c <_Thread_queue_Enqueue_with_handler> =============================================================================== 0010abcd <_CORE_mutex_Seize>: Objects_Id _id, bool _wait, Watchdog_Interval _timeout, ISR_Level _level ) { 10abcd: 55 push %ebp 10abce: 89 e5 mov %esp,%ebp 10abd0: 53 push %ebx 10abd1: 83 ec 14 sub $0x14,%esp 10abd4: 8b 5d 08 mov 0x8(%ebp),%ebx 10abd7: 8a 55 10 mov 0x10(%ebp),%dl _CORE_mutex_Seize_body( _the_mutex, _id, _wait, _timeout, _level ); 10abda: a1 64 31 12 00 mov 0x123164,%eax 10abdf: 85 c0 test %eax,%eax 10abe1: 74 19 je 10abfc <_CORE_mutex_Seize+0x2f> 10abe3: 84 d2 test %dl,%dl 10abe5: 74 15 je 10abfc <_CORE_mutex_Seize+0x2f><== NEVER TAKEN 10abe7: 83 3d e4 32 12 00 01 cmpl $0x1,0x1232e4 10abee: 76 0c jbe 10abfc <_CORE_mutex_Seize+0x2f> 10abf0: 53 push %ebx 10abf1: 6a 12 push $0x12 10abf3: 6a 00 push $0x0 10abf5: 6a 00 push $0x0 10abf7: e8 f0 05 00 00 call 10b1ec <_Internal_error_Occurred> 10abfc: 51 push %ecx 10abfd: 51 push %ecx 10abfe: 8d 45 18 lea 0x18(%ebp),%eax 10ac01: 50 push %eax 10ac02: 53 push %ebx 10ac03: 88 55 f4 mov %dl,-0xc(%ebp) 10ac06: e8 f9 3b 00 00 call 10e804 <_CORE_mutex_Seize_interrupt_trylock> 10ac0b: 83 c4 10 add $0x10,%esp 10ac0e: 85 c0 test %eax,%eax 10ac10: 8a 55 f4 mov -0xc(%ebp),%dl 10ac13: 74 48 je 10ac5d <_CORE_mutex_Seize+0x90> 10ac15: 84 d2 test %dl,%dl 10ac17: 75 12 jne 10ac2b <_CORE_mutex_Seize+0x5e> 10ac19: ff 75 18 pushl 0x18(%ebp) 10ac1c: 9d popf 10ac1d: a1 a8 33 12 00 mov 0x1233a8,%eax 10ac22: c7 40 34 01 00 00 00 movl $0x1,0x34(%eax) 10ac29: eb 32 jmp 10ac5d <_CORE_mutex_Seize+0x90> 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; 10ac2b: c7 43 30 01 00 00 00 movl $0x1,0x30(%ebx) 10ac32: a1 a8 33 12 00 mov 0x1233a8,%eax 10ac37: 89 58 44 mov %ebx,0x44(%eax) 10ac3a: 8b 55 0c mov 0xc(%ebp),%edx 10ac3d: 89 50 20 mov %edx,0x20(%eax) 10ac40: a1 64 31 12 00 mov 0x123164,%eax 10ac45: 40 inc %eax 10ac46: a3 64 31 12 00 mov %eax,0x123164 10ac4b: ff 75 18 pushl 0x18(%ebp) 10ac4e: 9d popf 10ac4f: 50 push %eax 10ac50: 50 push %eax 10ac51: ff 75 14 pushl 0x14(%ebp) 10ac54: 53 push %ebx 10ac55: e8 26 ff ff ff call 10ab80 <_CORE_mutex_Seize_interrupt_blocking> 10ac5a: 83 c4 10 add $0x10,%esp } 10ac5d: 8b 5d fc mov -0x4(%ebp),%ebx 10ac60: c9 leave 10ac61: c3 ret =============================================================================== 0010e804 <_CORE_mutex_Seize_interrupt_trylock>: #if defined(__RTEMS_DO_NOT_INLINE_CORE_MUTEX_SEIZE__) int _CORE_mutex_Seize_interrupt_trylock( CORE_mutex_Control *the_mutex, ISR_Level *level_p ) { 10e804: 55 push %ebp 10e805: 89 e5 mov %esp,%ebp 10e807: 57 push %edi 10e808: 56 push %esi 10e809: 53 push %ebx 10e80a: 83 ec 0c sub $0xc,%esp 10e80d: 8b 55 08 mov 0x8(%ebp),%edx 10e810: 8b 5d 0c mov 0xc(%ebp),%ebx { Thread_Control *executing; /* disabled when you get here */ executing = _Thread_Executing; 10e813: 8b 0d a8 33 12 00 mov 0x1233a8,%ecx executing->Wait.return_code = CORE_MUTEX_STATUS_SUCCESSFUL; 10e819: c7 41 34 00 00 00 00 movl $0x0,0x34(%ecx) if ( !_CORE_mutex_Is_locked( the_mutex ) ) { 10e820: 83 7a 50 00 cmpl $0x0,0x50(%edx) 10e824: 0f 84 89 00 00 00 je 10e8b3 <_CORE_mutex_Seize_interrupt_trylock+0xaf> the_mutex->lock = CORE_MUTEX_LOCKED; 10e82a: c7 42 50 00 00 00 00 movl $0x0,0x50(%edx) the_mutex->holder = executing; 10e831: 89 4a 5c mov %ecx,0x5c(%edx) the_mutex->holder_id = executing->Object.id; 10e834: 8b 41 08 mov 0x8(%ecx),%eax 10e837: 89 42 60 mov %eax,0x60(%edx) the_mutex->nest_count = 1; 10e83a: c7 42 54 01 00 00 00 movl $0x1,0x54(%edx) return _CORE_mutex_Seize_interrupt_trylock_body( the_mutex, level_p ); } 10e841: 8b 42 48 mov 0x48(%edx),%eax if ( _CORE_mutex_Is_inherit_priority( &the_mutex->Attributes ) || 10e844: 83 f8 02 cmp $0x2,%eax 10e847: 74 05 je 10e84e <_CORE_mutex_Seize_interrupt_trylock+0x4a> 10e849: 83 f8 03 cmp $0x3,%eax 10e84c: 75 0e jne 10e85c <_CORE_mutex_Seize_interrupt_trylock+0x58> _Chain_Prepend_unprotected( &executing->lock_mutex, &the_mutex->queue.lock_queue ); the_mutex->queue.priority_before = executing->current_priority; #endif executing->resource_count++; 10e84e: 8b 71 1c mov 0x1c(%ecx),%esi 10e851: 8d 7e 01 lea 0x1(%esi),%edi 10e854: 89 79 1c mov %edi,0x1c(%ecx) } if ( !_CORE_mutex_Is_priority_ceiling( &the_mutex->Attributes ) ) { 10e857: 83 f8 03 cmp $0x3,%eax 10e85a: 74 05 je 10e861 <_CORE_mutex_Seize_interrupt_trylock+0x5d> _ISR_Enable( *level_p ); 10e85c: ff 33 pushl (%ebx) 10e85e: 9d popf 10e85f: eb 7c jmp 10e8dd <_CORE_mutex_Seize_interrupt_trylock+0xd9> Priority_Control ceiling; Priority_Control current; ceiling = the_mutex->Attributes.priority_ceiling; current = executing->current_priority; if ( current == ceiling ) { 10e861: 8b 42 4c mov 0x4c(%edx),%eax 10e864: 39 41 14 cmp %eax,0x14(%ecx) 10e867: 75 05 jne 10e86e <_CORE_mutex_Seize_interrupt_trylock+0x6a> _ISR_Enable( *level_p ); 10e869: ff 33 pushl (%ebx) 10e86b: 9d popf 10e86c: eb 6f jmp 10e8dd <_CORE_mutex_Seize_interrupt_trylock+0xd9> return 0; } if ( current > ceiling ) { 10e86e: 76 26 jbe 10e896 <_CORE_mutex_Seize_interrupt_trylock+0x92> rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 10e870: a1 64 31 12 00 mov 0x123164,%eax 10e875: 40 inc %eax 10e876: a3 64 31 12 00 mov %eax,0x123164 _Thread_Disable_dispatch(); _ISR_Enable( *level_p ); 10e87b: ff 33 pushl (%ebx) 10e87d: 9d popf _Thread_Change_priority( 10e87e: 50 push %eax 10e87f: 6a 00 push $0x0 10e881: ff 72 4c pushl 0x4c(%edx) 10e884: ff 72 5c pushl 0x5c(%edx) 10e887: e8 38 d1 ff ff call 10b9c4 <_Thread_Change_priority> the_mutex->holder, the_mutex->Attributes.priority_ceiling, false ); _Thread_Enable_dispatch(); 10e88c: e8 c5 d5 ff ff call 10be56 <_Thread_Enable_dispatch> 10e891: 83 c4 10 add $0x10,%esp 10e894: eb 47 jmp 10e8dd <_CORE_mutex_Seize_interrupt_trylock+0xd9> return 0; } /* if ( current < ceiling ) */ { executing->Wait.return_code = CORE_MUTEX_STATUS_CEILING_VIOLATED; 10e896: c7 41 34 06 00 00 00 movl $0x6,0x34(%ecx) the_mutex->lock = CORE_MUTEX_UNLOCKED; 10e89d: c7 42 50 01 00 00 00 movl $0x1,0x50(%edx) the_mutex->nest_count = 0; /* undo locking above */ 10e8a4: c7 42 54 00 00 00 00 movl $0x0,0x54(%edx) executing->resource_count--; /* undo locking above */ 10e8ab: 89 71 1c mov %esi,0x1c(%ecx) _ISR_Enable( *level_p ); 10e8ae: ff 33 pushl (%ebx) 10e8b0: 9d popf 10e8b1: eb 2a jmp 10e8dd <_CORE_mutex_Seize_interrupt_trylock+0xd9> /* * At this point, we know the mutex was not available. If this thread * is the thread that has locked the mutex, let's see if we are allowed * to nest access. */ if ( _Thread_Is_executing( the_mutex->holder ) ) { 10e8b3: 8b 72 5c mov 0x5c(%edx),%esi /* * The mutex is not available and the caller must deal with the possibility * of blocking. */ return 1; 10e8b6: b8 01 00 00 00 mov $0x1,%eax /* * At this point, we know the mutex was not available. If this thread * is the thread that has locked the mutex, let's see if we are allowed * to nest access. */ if ( _Thread_Is_executing( the_mutex->holder ) ) { 10e8bb: 39 ce cmp %ecx,%esi 10e8bd: 75 20 jne 10e8df <_CORE_mutex_Seize_interrupt_trylock+0xdb> switch ( the_mutex->Attributes.lock_nesting_behavior ) { 10e8bf: 8b 4a 40 mov 0x40(%edx),%ecx 10e8c2: 85 c9 test %ecx,%ecx 10e8c4: 74 05 je 10e8cb <_CORE_mutex_Seize_interrupt_trylock+0xc7> 10e8c6: 49 dec %ecx 10e8c7: 75 16 jne 10e8df <_CORE_mutex_Seize_interrupt_trylock+0xdb><== ALWAYS TAKEN 10e8c9: eb 08 jmp 10e8d3 <_CORE_mutex_Seize_interrupt_trylock+0xcf><== NOT EXECUTED case CORE_MUTEX_NESTING_ACQUIRES: the_mutex->nest_count++; 10e8cb: ff 42 54 incl 0x54(%edx) _ISR_Enable( *level_p ); 10e8ce: ff 33 pushl (%ebx) 10e8d0: 9d popf 10e8d1: eb 0a jmp 10e8dd <_CORE_mutex_Seize_interrupt_trylock+0xd9> return 0; case CORE_MUTEX_NESTING_IS_ERROR: executing->Wait.return_code = CORE_MUTEX_STATUS_NESTING_NOT_ALLOWED; 10e8d3: c7 46 34 02 00 00 00 movl $0x2,0x34(%esi) <== NOT EXECUTED _ISR_Enable( *level_p ); 10e8da: ff 33 pushl (%ebx) <== NOT EXECUTED 10e8dc: 9d popf <== NOT EXECUTED return 0; 10e8dd: 31 c0 xor %eax,%eax 10e8df: 8d 65 f4 lea -0xc(%ebp),%esp 10e8e2: 5b pop %ebx 10e8e3: 5e pop %esi 10e8e4: 5f pop %edi 10e8e5: c9 leave 10e8e6: c3 ret =============================================================================== 0010ad88 <_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 ) { 10ad88: 55 push %ebp 10ad89: 89 e5 mov %esp,%ebp 10ad8b: 53 push %ebx 10ad8c: 83 ec 10 sub $0x10,%esp 10ad8f: 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)) ) { 10ad92: 53 push %ebx 10ad93: e8 18 14 00 00 call 10c1b0 <_Thread_queue_Dequeue> 10ad98: 89 c2 mov %eax,%edx 10ad9a: 83 c4 10 add $0x10,%esp { Thread_Control *the_thread; ISR_Level level; CORE_semaphore_Status status; status = CORE_SEMAPHORE_STATUS_SUCCESSFUL; 10ad9d: 31 c0 xor %eax,%eax if ( (the_thread = _Thread_queue_Dequeue(&the_semaphore->Wait_queue)) ) { 10ad9f: 85 d2 test %edx,%edx 10ada1: 75 15 jne 10adb8 <_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 ); 10ada3: 9c pushf 10ada4: fa cli 10ada5: 59 pop %ecx if ( the_semaphore->count < the_semaphore->Attributes.maximum_count ) 10ada6: 8b 53 48 mov 0x48(%ebx),%edx the_semaphore->count += 1; else status = CORE_SEMAPHORE_MAXIMUM_COUNT_EXCEEDED; 10ada9: 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 ) 10adab: 3b 53 40 cmp 0x40(%ebx),%edx 10adae: 73 06 jae 10adb6 <_CORE_semaphore_Surrender+0x2e><== NEVER TAKEN the_semaphore->count += 1; 10adb0: 42 inc %edx 10adb1: 89 53 48 mov %edx,0x48(%ebx) { Thread_Control *the_thread; ISR_Level level; CORE_semaphore_Status status; status = CORE_SEMAPHORE_STATUS_SUCCESSFUL; 10adb4: 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 ); 10adb6: 51 push %ecx 10adb7: 9d popf } return status; } 10adb8: 8b 5d fc mov -0x4(%ebp),%ebx 10adbb: c9 leave 10adbc: 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 a8 33 12 00 mov 0x1233a8,%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 f0 00 00 00 mov 0xf0(%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 b8 33 12 00 01 movl $0x1,0x1233b8 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 2c 32 12 00 push $0x12322c 109d0f: e8 bc 2e 00 00 call 10cbd0 <_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 08 29 00 00 call 10c62c <_Thread_Set_state> _ISR_Disable( level ); 109d24: 9c pushf 109d25: fa cli 109d26: 5a pop %edx sync_state = _Event_Sync_state; 109d27: a1 b8 33 12 00 mov 0x1233b8,%eax _Event_Sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; 109d2c: c7 05 b8 33 12 00 00 movl $0x0,0x1233b8 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 21 1c 00 00 jmp 10b978 <_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 f0 00 00 00 mov 0xf0(%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 a4 33 12 00 00 cmpl $0x0,0x1233a4 109de1: 74 49 je 109e2c <_Event_Surrender+0x80> 109de3: 3b 1d a8 33 12 00 cmp 0x1233a8,%ebx 109de9: 75 41 jne 109e2c <_Event_Surrender+0x80> _Thread_Is_executing( the_thread ) && ((_Event_Sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || 109deb: 8b 0d b8 33 12 00 mov 0x1233b8,%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 b8 33 12 00 mov 0x1233b8,%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 b8 33 12 00 03 movl $0x3,0x1233b8 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 73 2e 00 00 call 10cce8 <_Watchdog_Remove> 109e75: 58 pop %eax 109e76: 5a pop %edx 109e77: 68 f8 ff 03 10 push $0x1003fff8 109e7c: 53 push %ebx 109e7d: e8 62 1c 00 00 call 10bae4 <_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 d2 1f 00 00 call 10be78 <_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 a8 33 12 00 cmp 0x1233a8,%eax 109ebf: 75 13 jne 109ed4 <_Event_Timeout+0x40> if ( _Event_Sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) 109ec1: 8b 0d b8 33 12 00 mov 0x1233b8,%ecx 109ec7: 49 dec %ecx 109ec8: 75 0a jne 109ed4 <_Event_Timeout+0x40> _Event_Sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT; 109eca: c7 05 b8 33 12 00 02 movl $0x2,0x1233b8 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 fa 1b 00 00 call 10bae4 <_Thread_Clear_state> */ RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void ) { RTEMS_COMPILER_MEMORY_BARRIER(); _Thread_Dispatch_disable_level -= 1; 109eea: a1 64 31 12 00 mov 0x123164,%eax 109eef: 48 dec %eax 109ef0: a3 64 31 12 00 mov %eax,0x123164 _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 =============================================================================== 0010e944 <_Heap_Allocate_aligned_with_boundary>: Heap_Control *heap, uintptr_t alloc_size, uintptr_t alignment, uintptr_t boundary ) { 10e944: 55 push %ebp 10e945: 89 e5 mov %esp,%ebp 10e947: 57 push %edi 10e948: 56 push %esi 10e949: 53 push %ebx 10e94a: 83 ec 3c sub $0x3c,%esp 10e94d: 8b 75 08 mov 0x8(%ebp),%esi 10e950: 8b 7d 0c mov 0xc(%ebp),%edi if ( stats->max_search < search_count ) { stats->max_search = search_count; } return (void *) alloc_begin; } 10e953: 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 10e956: 8d 47 04 lea 0x4(%edi),%eax 10e959: 89 45 d0 mov %eax,-0x30(%ebp) - HEAP_BLOCK_SIZE_OFFSET; uintptr_t const page_size = heap->page_size; 10e95c: 8b 46 10 mov 0x10(%esi),%eax 10e95f: 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; 10e962: 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 ) { 10e964: 39 7d d0 cmp %edi,-0x30(%ebp) 10e967: 0f 82 22 01 00 00 jb 10ea8f <_Heap_Allocate_aligned_with_boundary+0x14b> /* Integer overflow occured */ return NULL; } if ( boundary != 0 ) { 10e96d: 83 7d 14 00 cmpl $0x0,0x14(%ebp) 10e971: 74 15 je 10e988 <_Heap_Allocate_aligned_with_boundary+0x44> if ( boundary < alloc_size ) { 10e973: 39 7d 14 cmp %edi,0x14(%ebp) 10e976: 0f 82 13 01 00 00 jb 10ea8f <_Heap_Allocate_aligned_with_boundary+0x14b> return NULL; } if ( alignment == 0 ) { 10e97c: 83 7d 10 00 cmpl $0x0,0x10(%ebp) 10e980: 75 06 jne 10e988 <_Heap_Allocate_aligned_with_boundary+0x44> alignment = page_size; 10e982: 8b 45 e0 mov -0x20(%ebp),%eax 10e985: 89 45 10 mov %eax,0x10(%ebp) 10e988: 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 10e98f: 8b 45 e0 mov -0x20(%ebp),%eax 10e992: 83 c0 07 add $0x7,%eax 10e995: 89 45 c4 mov %eax,-0x3c(%ebp) + HEAP_BLOCK_HEADER_SIZE + page_size - 1; uintptr_t alloc_end = block_end + HEAP_BLOCK_SIZE_OFFSET; 10e998: c7 45 d4 04 00 00 00 movl $0x4,-0x2c(%ebp) 10e99f: 29 7d d4 sub %edi,-0x2c(%ebp) 10e9a2: 89 75 dc mov %esi,-0x24(%ebp) 10e9a5: e9 ca 00 00 00 jmp 10ea74 <_Heap_Allocate_aligned_with_boundary+0x130> while ( block != free_list_tail ) { _HAssert( _Heap_Is_prev_used( block ) ); /* Statistics */ ++search_count; 10e9aa: 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 ) { 10e9ad: 8b 59 04 mov 0x4(%ecx),%ebx 10e9b0: 3b 5d d0 cmp -0x30(%ebp),%ebx 10e9b3: 0f 86 b8 00 00 00 jbe 10ea71 <_Heap_Allocate_aligned_with_boundary+0x12d> if ( alignment == 0 ) { 10e9b9: 83 7d 10 00 cmpl $0x0,0x10(%ebp) 10e9bd: 8d 41 08 lea 0x8(%ecx),%eax 10e9c0: 89 45 d8 mov %eax,-0x28(%ebp) 10e9c3: 75 07 jne 10e9cc <_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; 10e9c5: 89 c3 mov %eax,%ebx 10e9c7: e9 8a 00 00 00 jmp 10ea56 <_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; 10e9cc: 8b 45 dc mov -0x24(%ebp),%eax 10e9cf: 8b 40 14 mov 0x14(%eax),%eax 10e9d2: 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; 10e9d5: 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; 10e9d8: 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; 10e9db: 8b 75 c4 mov -0x3c(%ebp),%esi 10e9de: 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 10e9e0: 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; 10e9e2: 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); 10e9e5: 89 d8 mov %ebx,%eax 10e9e7: 31 d2 xor %edx,%edx 10e9e9: f7 75 10 divl 0x10(%ebp) 10e9ec: 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 ) { 10e9ee: 39 f3 cmp %esi,%ebx 10e9f0: 76 0b jbe 10e9fd <_Heap_Allocate_aligned_with_boundary+0xb9> 10e9f2: 89 f0 mov %esi,%eax 10e9f4: 31 d2 xor %edx,%edx 10e9f6: f7 75 10 divl 0x10(%ebp) 10e9f9: 89 f3 mov %esi,%ebx 10e9fb: 29 d3 sub %edx,%ebx } alloc_end = alloc_begin + alloc_size; /* Ensure boundary constaint */ if ( boundary != 0 ) { 10e9fd: 83 7d 14 00 cmpl $0x0,0x14(%ebp) 10ea01: 74 35 je 10ea38 <_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; 10ea03: 8d 34 3b lea (%ebx,%edi,1),%esi /* Ensure boundary constaint */ if ( boundary != 0 ) { uintptr_t const boundary_floor = alloc_begin_floor + alloc_size; 10ea06: 8b 45 d8 mov -0x28(%ebp),%eax 10ea09: 01 f8 add %edi,%eax 10ea0b: 89 45 c8 mov %eax,-0x38(%ebp) 10ea0e: eb 15 jmp 10ea25 <_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 ) { 10ea10: 3b 45 c8 cmp -0x38(%ebp),%eax 10ea13: 72 5c jb 10ea71 <_Heap_Allocate_aligned_with_boundary+0x12d> return 0; } alloc_begin = boundary_line - alloc_size; 10ea15: 89 c3 mov %eax,%ebx 10ea17: 29 fb sub %edi,%ebx 10ea19: 89 d8 mov %ebx,%eax 10ea1b: 31 d2 xor %edx,%edx 10ea1d: f7 75 10 divl 0x10(%ebp) 10ea20: 29 d3 sub %edx,%ebx alloc_begin = _Heap_Align_down( alloc_begin, alignment ); alloc_end = alloc_begin + alloc_size; 10ea22: 8d 34 3b lea (%ebx,%edi,1),%esi 10ea25: 89 f0 mov %esi,%eax 10ea27: 31 d2 xor %edx,%edx 10ea29: f7 75 14 divl 0x14(%ebp) 10ea2c: 89 f0 mov %esi,%eax 10ea2e: 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 ) { 10ea30: 39 f0 cmp %esi,%eax 10ea32: 73 04 jae 10ea38 <_Heap_Allocate_aligned_with_boundary+0xf4> 10ea34: 39 c3 cmp %eax,%ebx 10ea36: 72 d8 jb 10ea10 <_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 ) { 10ea38: 3b 5d d8 cmp -0x28(%ebp),%ebx 10ea3b: 72 34 jb 10ea71 <_Heap_Allocate_aligned_with_boundary+0x12d> 10ea3d: be f8 ff ff ff mov $0xfffffff8,%esi 10ea42: 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); 10ea44: 01 de add %ebx,%esi RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 10ea46: 89 d8 mov %ebx,%eax 10ea48: 31 d2 xor %edx,%edx 10ea4a: 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 ) { 10ea4d: 29 d6 sub %edx,%esi 10ea4f: 74 05 je 10ea56 <_Heap_Allocate_aligned_with_boundary+0x112> 10ea51: 3b 75 cc cmp -0x34(%ebp),%esi 10ea54: 72 1b jb 10ea71 <_Heap_Allocate_aligned_with_boundary+0x12d> boundary ); } } if ( alloc_begin != 0 ) { 10ea56: 85 db test %ebx,%ebx 10ea58: 74 17 je 10ea71 <_Heap_Allocate_aligned_with_boundary+0x12d><== NEVER TAKEN 10ea5a: 8b 75 dc mov -0x24(%ebp),%esi block = block->next; } if ( alloc_begin != 0 ) { /* Statistics */ stats->searches += search_count; 10ea5d: 8b 45 e4 mov -0x1c(%ebp),%eax 10ea60: 01 46 4c add %eax,0x4c(%esi) block = _Heap_Block_allocate( heap, block, alloc_begin, alloc_size ); 10ea63: 57 push %edi 10ea64: 53 push %ebx 10ea65: 51 push %ecx 10ea66: 56 push %esi 10ea67: e8 a1 c6 ff ff call 10b10d <_Heap_Block_allocate> 10ea6c: 83 c4 10 add $0x10,%esp 10ea6f: eb 11 jmp 10ea82 <_Heap_Allocate_aligned_with_boundary+0x13e> if ( alloc_begin != 0 ) { break; } block = block->next; 10ea71: 8b 49 08 mov 0x8(%ecx),%ecx if ( alignment == 0 ) { alignment = page_size; } } while ( block != free_list_tail ) { 10ea74: 3b 4d dc cmp -0x24(%ebp),%ecx 10ea77: 0f 85 2d ff ff ff jne 10e9aa <_Heap_Allocate_aligned_with_boundary+0x66> 10ea7d: 8b 75 dc mov -0x24(%ebp),%esi 10ea80: 31 db xor %ebx,%ebx boundary ); } /* Statistics */ if ( stats->max_search < search_count ) { 10ea82: 8b 45 e4 mov -0x1c(%ebp),%eax 10ea85: 39 46 44 cmp %eax,0x44(%esi) 10ea88: 73 03 jae 10ea8d <_Heap_Allocate_aligned_with_boundary+0x149> stats->max_search = search_count; 10ea8a: 89 46 44 mov %eax,0x44(%esi) } return (void *) alloc_begin; 10ea8d: 89 d8 mov %ebx,%eax } 10ea8f: 8d 65 f4 lea -0xc(%ebp),%esp 10ea92: 5b pop %ebx 10ea93: 5e pop %esi 10ea94: 5f pop %edi 10ea95: c9 leave 10ea96: c3 ret =============================================================================== 0010ee33 <_Heap_Extend>: Heap_Control *heap, void *extend_area_begin_ptr, uintptr_t extend_area_size, uintptr_t *extended_size_ptr ) { 10ee33: 55 push %ebp 10ee34: 89 e5 mov %esp,%ebp 10ee36: 57 push %edi 10ee37: 56 push %esi 10ee38: 53 push %ebx 10ee39: 83 ec 4c sub $0x4c,%esp 10ee3c: 8b 5d 08 mov 0x8(%ebp),%ebx 10ee3f: 8b 4d 10 mov 0x10(%ebp),%ecx Heap_Statistics *const stats = &heap->stats; Heap_Block *const first_block = heap->first_block; 10ee42: 8b 43 20 mov 0x20(%ebx),%eax 10ee45: 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; 10ee48: c7 45 e4 00 00 00 00 movl $0x0,-0x1c(%ebp) Heap_Block *extend_last_block = NULL; 10ee4f: c7 45 e0 00 00 00 00 movl $0x0,-0x20(%ebp) uintptr_t const page_size = heap->page_size; 10ee56: 8b 53 10 mov 0x10(%ebx),%edx 10ee59: 89 55 c4 mov %edx,-0x3c(%ebp) uintptr_t const min_block_size = heap->min_block_size; 10ee5c: 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; 10ee5f: 8b 7b 30 mov 0x30(%ebx),%edi 10ee62: 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; 10ee65: 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 ) { 10ee67: 8b 7d 0c mov 0xc(%ebp),%edi 10ee6a: 01 cf add %ecx,%edi 10ee6c: 0f 82 d4 01 00 00 jb 10f046 <_Heap_Extend+0x213> <== NEVER TAKEN return false; } extend_area_ok = _Heap_Get_first_and_last_block( 10ee72: 52 push %edx 10ee73: 52 push %edx 10ee74: 8d 55 e0 lea -0x20(%ebp),%edx 10ee77: 52 push %edx 10ee78: 8d 55 e4 lea -0x1c(%ebp),%edx 10ee7b: 52 push %edx 10ee7c: 50 push %eax 10ee7d: ff 75 c4 pushl -0x3c(%ebp) 10ee80: 51 push %ecx 10ee81: ff 75 0c pushl 0xc(%ebp) 10ee84: e8 7b c3 ff ff call 10b204 <_Heap_Get_first_and_last_block> page_size, min_block_size, &extend_first_block, &extend_last_block ); if (!extend_area_ok ) { 10ee89: 83 c4 20 add $0x20,%esp 10ee8c: 84 c0 test %al,%al 10ee8e: 0f 84 b2 01 00 00 je 10f046 <_Heap_Extend+0x213> 10ee94: 8b 4d c0 mov -0x40(%ebp),%ecx 10ee97: c7 45 cc 00 00 00 00 movl $0x0,-0x34(%ebp) 10ee9e: c7 45 c8 00 00 00 00 movl $0x0,-0x38(%ebp) 10eea5: 31 f6 xor %esi,%esi 10eea7: 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; 10eeae: 8b 43 18 mov 0x18(%ebx),%eax 10eeb1: 89 5d b8 mov %ebx,-0x48(%ebp) 10eeb4: eb 02 jmp 10eeb8 <_Heap_Extend+0x85> 10eeb6: 89 c8 mov %ecx,%eax uintptr_t const sub_area_end = start_block->prev_size; 10eeb8: 8b 19 mov (%ecx),%ebx Heap_Block *const end_block = _Heap_Block_of_alloc_area( sub_area_end, page_size ); if ( 10eeba: 39 c7 cmp %eax,%edi 10eebc: 76 09 jbe 10eec7 <_Heap_Extend+0x94> 10eebe: 39 5d 0c cmp %ebx,0xc(%ebp) 10eec1: 0f 82 7d 01 00 00 jb 10f044 <_Heap_Extend+0x211> sub_area_end > extend_area_begin && extend_area_end > sub_area_begin ) { return false; } if ( extend_area_end == sub_area_begin ) { 10eec7: 39 c7 cmp %eax,%edi 10eec9: 74 06 je 10eed1 <_Heap_Extend+0x9e> merge_below_block = start_block; } else if ( extend_area_end < sub_area_end ) { 10eecb: 39 df cmp %ebx,%edi 10eecd: 72 07 jb 10eed6 <_Heap_Extend+0xa3> 10eecf: eb 08 jmp 10eed9 <_Heap_Extend+0xa6> sub_area_end > extend_area_begin && extend_area_end > sub_area_begin ) { return false; } if ( extend_area_end == sub_area_begin ) { 10eed1: 89 4d d0 mov %ecx,-0x30(%ebp) 10eed4: eb 03 jmp 10eed9 <_Heap_Extend+0xa6> merge_below_block = start_block; } else if ( extend_area_end < sub_area_end ) { 10eed6: 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); 10eed9: 8d 43 f8 lea -0x8(%ebx),%eax 10eedc: 89 45 d4 mov %eax,-0x2c(%ebp) 10eedf: 89 d8 mov %ebx,%eax 10eee1: 31 d2 xor %edx,%edx 10eee3: 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); 10eee6: 29 55 d4 sub %edx,-0x2c(%ebp) link_below_block = start_block; } if ( sub_area_end == extend_area_begin ) { 10eee9: 3b 5d 0c cmp 0xc(%ebp),%ebx 10eeec: 75 07 jne 10eef5 <_Heap_Extend+0xc2> start_block->prev_size = extend_area_end; 10eeee: 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 ) 10eef0: 8b 75 d4 mov -0x2c(%ebp),%esi 10eef3: eb 08 jmp 10eefd <_Heap_Extend+0xca> merge_above_block = end_block; } else if ( sub_area_end < extend_area_begin ) { 10eef5: 73 06 jae 10eefd <_Heap_Extend+0xca> 10eef7: 8b 55 d4 mov -0x2c(%ebp),%edx 10eefa: 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; 10eefd: 8b 45 d4 mov -0x2c(%ebp),%eax 10ef00: 8b 48 04 mov 0x4(%eax),%ecx 10ef03: 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); 10ef06: 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 ); 10ef08: 3b 4d c0 cmp -0x40(%ebp),%ecx 10ef0b: 75 a9 jne 10eeb6 <_Heap_Extend+0x83> 10ef0d: 8b 5d b8 mov -0x48(%ebp),%ebx if ( extend_area_begin < heap->area_begin ) { 10ef10: 8b 55 0c mov 0xc(%ebp),%edx 10ef13: 3b 53 18 cmp 0x18(%ebx),%edx 10ef16: 73 05 jae 10ef1d <_Heap_Extend+0xea> heap->area_begin = extend_area_begin; 10ef18: 89 53 18 mov %edx,0x18(%ebx) 10ef1b: eb 08 jmp 10ef25 <_Heap_Extend+0xf2> } else if ( heap->area_end < extend_area_end ) { 10ef1d: 39 7b 1c cmp %edi,0x1c(%ebx) 10ef20: 73 03 jae 10ef25 <_Heap_Extend+0xf2> heap->area_end = extend_area_end; 10ef22: 89 7b 1c mov %edi,0x1c(%ebx) } extend_first_block_size = (uintptr_t) extend_last_block - (uintptr_t) extend_first_block; 10ef25: 8b 45 e0 mov -0x20(%ebp),%eax 10ef28: 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 = 10ef2b: 89 c1 mov %eax,%ecx 10ef2d: 29 d1 sub %edx,%ecx 10ef2f: 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; 10ef32: 89 3a mov %edi,(%edx) extend_first_block->size_and_flag = extend_first_block_size | HEAP_PREV_BLOCK_USED; 10ef34: 83 c9 01 or $0x1,%ecx 10ef37: 89 4a 04 mov %ecx,0x4(%edx) extend_last_block->prev_size = extend_first_block_size; 10ef3a: 8b 4d d4 mov -0x2c(%ebp),%ecx 10ef3d: 89 08 mov %ecx,(%eax) extend_last_block->size_and_flag = 0; 10ef3f: c7 40 04 00 00 00 00 movl $0x0,0x4(%eax) if ( (uintptr_t) extend_first_block < (uintptr_t) heap->first_block ) { 10ef46: 39 53 20 cmp %edx,0x20(%ebx) 10ef49: 76 05 jbe 10ef50 <_Heap_Extend+0x11d> heap->first_block = extend_first_block; 10ef4b: 89 53 20 mov %edx,0x20(%ebx) 10ef4e: eb 08 jmp 10ef58 <_Heap_Extend+0x125> } else if ( (uintptr_t) extend_last_block > (uintptr_t) heap->last_block ) { 10ef50: 39 43 24 cmp %eax,0x24(%ebx) 10ef53: 73 03 jae 10ef58 <_Heap_Extend+0x125> heap->last_block = extend_last_block; 10ef55: 89 43 24 mov %eax,0x24(%ebx) } if ( merge_below_block != NULL ) { 10ef58: 83 7d d0 00 cmpl $0x0,-0x30(%ebp) 10ef5c: 74 3b je 10ef99 <_Heap_Extend+0x166> Heap_Control *heap, uintptr_t extend_area_begin, Heap_Block *first_block ) { uintptr_t const page_size = heap->page_size; 10ef5e: 8b 43 10 mov 0x10(%ebx),%eax 10ef61: 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 ); 10ef64: 8b 4d 0c mov 0xc(%ebp),%ecx 10ef67: 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; 10ef6a: 89 c8 mov %ecx,%eax 10ef6c: 31 d2 xor %edx,%edx 10ef6e: f7 75 d4 divl -0x2c(%ebp) if ( remainder != 0 ) { 10ef71: 85 d2 test %edx,%edx 10ef73: 74 05 je 10ef7a <_Heap_Extend+0x147> <== ALWAYS TAKEN return value - remainder + alignment; 10ef75: 03 4d d4 add -0x2c(%ebp),%ecx <== NOT EXECUTED 10ef78: 29 d1 sub %edx,%ecx <== NOT EXECUTED uintptr_t const new_first_block_begin = 10ef7a: 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; 10ef7d: 8b 45 d0 mov -0x30(%ebp),%eax 10ef80: 8b 00 mov (%eax),%eax 10ef82: 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 = 10ef85: 8b 45 d0 mov -0x30(%ebp),%eax 10ef88: 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; 10ef8a: 83 c8 01 or $0x1,%eax 10ef8d: 89 42 04 mov %eax,0x4(%edx) _Heap_Free_block( heap, new_first_block ); 10ef90: 89 d8 mov %ebx,%eax 10ef92: e8 81 fe ff ff call 10ee18 <_Heap_Free_block> 10ef97: eb 14 jmp 10efad <_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 ) { 10ef99: 83 7d c8 00 cmpl $0x0,-0x38(%ebp) 10ef9d: 74 0e je 10efad <_Heap_Extend+0x17a> _Heap_Link_below( 10ef9f: 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; 10efa2: 8b 45 c8 mov -0x38(%ebp),%eax 10efa5: 29 d0 sub %edx,%eax 10efa7: 83 c8 01 or $0x1,%eax 10efaa: 89 42 04 mov %eax,0x4(%edx) link_below_block, extend_last_block ); } if ( merge_above_block != NULL ) { 10efad: 85 f6 test %esi,%esi 10efaf: 74 30 je 10efe1 <_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, 10efb1: 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( 10efb4: 29 f7 sub %esi,%edi RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 10efb6: 89 f8 mov %edi,%eax 10efb8: 31 d2 xor %edx,%edx 10efba: f7 73 10 divl 0x10(%ebx) 10efbd: 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) 10efbf: 8b 46 04 mov 0x4(%esi),%eax 10efc2: 29 f8 sub %edi,%eax | HEAP_PREV_BLOCK_USED; 10efc4: 83 c8 01 or $0x1,%eax 10efc7: 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; 10efcb: 8b 46 04 mov 0x4(%esi),%eax 10efce: 83 e0 01 and $0x1,%eax block->size_and_flag = size | flag; 10efd1: 09 f8 or %edi,%eax 10efd3: 89 46 04 mov %eax,0x4(%esi) _Heap_Block_set_size( last_block, last_block_new_size ); _Heap_Free_block( heap, last_block ); 10efd6: 89 f2 mov %esi,%edx 10efd8: 89 d8 mov %ebx,%eax 10efda: e8 39 fe ff ff call 10ee18 <_Heap_Free_block> 10efdf: eb 21 jmp 10f002 <_Heap_Extend+0x1cf> ); } if ( merge_above_block != NULL ) { _Heap_Merge_above( heap, merge_above_block, extend_area_end ); } else if ( link_above_block != NULL ) { 10efe1: 83 7d cc 00 cmpl $0x0,-0x34(%ebp) 10efe5: 74 1b je 10f002 <_Heap_Extend+0x1cf> _Heap_Link_above( 10efe7: 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 ); 10efea: 8b 45 e4 mov -0x1c(%ebp),%eax 10efed: 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; 10eff0: 8b 7d cc mov -0x34(%ebp),%edi 10eff3: 8b 57 04 mov 0x4(%edi),%edx 10eff6: 83 e2 01 and $0x1,%edx block->size_and_flag = size | flag; 10eff9: 09 d0 or %edx,%eax 10effb: 89 47 04 mov %eax,0x4(%edi) last_block->size_and_flag |= HEAP_PREV_BLOCK_USED; 10effe: 83 49 04 01 orl $0x1,0x4(%ecx) extend_first_block, extend_last_block ); } if ( merge_below_block == NULL && merge_above_block == NULL ) { 10f002: 85 f6 test %esi,%esi 10f004: 75 10 jne 10f016 <_Heap_Extend+0x1e3> 10f006: 83 7d d0 00 cmpl $0x0,-0x30(%ebp) 10f00a: 75 0a jne 10f016 <_Heap_Extend+0x1e3> _Heap_Free_block( heap, extend_first_block ); 10f00c: 8b 55 e4 mov -0x1c(%ebp),%edx 10f00f: 89 d8 mov %ebx,%eax 10f011: e8 02 fe ff ff call 10ee18 <_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 10f016: 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( 10f019: 8b 43 20 mov 0x20(%ebx),%eax 10f01c: 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; 10f01e: 8b 4a 04 mov 0x4(%edx),%ecx 10f021: 83 e1 01 and $0x1,%ecx block->size_and_flag = size | flag; 10f024: 09 c8 or %ecx,%eax 10f026: 89 42 04 mov %eax,0x4(%edx) } _Heap_Set_last_block_size( heap ); extended_size = stats->free_size - free_size; 10f029: 8b 43 30 mov 0x30(%ebx),%eax 10f02c: 2b 45 bc sub -0x44(%ebp),%eax /* Statistics */ stats->size += extended_size; 10f02f: 01 43 2c add %eax,0x2c(%ebx) if ( extended_size_ptr != NULL ) *extended_size_ptr = extended_size; return true; 10f032: 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 ) 10f037: 83 7d 14 00 cmpl $0x0,0x14(%ebp) 10f03b: 74 09 je 10f046 <_Heap_Extend+0x213> <== NEVER TAKEN *extended_size_ptr = extended_size; 10f03d: 8b 55 14 mov 0x14(%ebp),%edx 10f040: 89 02 mov %eax,(%edx) 10f042: eb 02 jmp 10f046 <_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; 10f044: 31 f6 xor %esi,%esi if ( extended_size_ptr != NULL ) *extended_size_ptr = extended_size; return true; } 10f046: 89 f0 mov %esi,%eax 10f048: 8d 65 f4 lea -0xc(%ebp),%esp 10f04b: 5b pop %ebx 10f04c: 5e pop %esi 10f04d: 5f pop %edi 10f04e: c9 leave 10f04f: c3 ret =============================================================================== 0010ea98 <_Heap_Free>: #include #include #include bool _Heap_Free( Heap_Control *heap, void *alloc_begin_ptr ) { 10ea98: 55 push %ebp 10ea99: 89 e5 mov %esp,%ebp 10ea9b: 57 push %edi 10ea9c: 56 push %esi 10ea9d: 53 push %ebx 10ea9e: 83 ec 14 sub $0x14,%esp 10eaa1: 8b 4d 08 mov 0x8(%ebp),%ecx 10eaa4: 8b 45 0c mov 0xc(%ebp),%eax 10eaa7: 8d 58 f8 lea -0x8(%eax),%ebx 10eaaa: 31 d2 xor %edx,%edx 10eaac: 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); 10eaaf: 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 10eab1: 8b 41 20 mov 0x20(%ecx),%eax 10eab4: 89 45 ec mov %eax,-0x14(%ebp) && (uintptr_t) block <= (uintptr_t) heap->last_block; 10eab7: 31 d2 xor %edx,%edx 10eab9: 39 c3 cmp %eax,%ebx 10eabb: 72 08 jb 10eac5 <_Heap_Free+0x2d> 10eabd: 31 d2 xor %edx,%edx 10eabf: 39 59 24 cmp %ebx,0x24(%ecx) 10eac2: 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; 10eac5: 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 ) ) { 10eac7: 85 d2 test %edx,%edx 10eac9: 0f 84 21 01 00 00 je 10ebf0 <_Heap_Free+0x158> --stats->used_blocks; ++stats->frees; stats->free_size += block_size; return( true ); } 10eacf: 8b 43 04 mov 0x4(%ebx),%eax 10ead2: 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; 10ead5: 89 c6 mov %eax,%esi 10ead7: 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); 10eada: 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; 10eadd: 31 ff xor %edi,%edi 10eadf: 3b 55 ec cmp -0x14(%ebp),%edx 10eae2: 72 0a jb 10eaee <_Heap_Free+0x56> <== NEVER TAKEN 10eae4: 31 c0 xor %eax,%eax 10eae6: 39 51 24 cmp %edx,0x24(%ecx) 10eae9: 0f 93 c0 setae %al 10eaec: 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; 10eaee: 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 ) ) { 10eaf0: 85 ff test %edi,%edi 10eaf2: 0f 84 f8 00 00 00 je 10ebf0 <_Heap_Free+0x158> <== NEVER TAKEN --stats->used_blocks; ++stats->frees; stats->free_size += block_size; return( true ); } 10eaf8: 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 ) ) { 10eafb: f7 c7 01 00 00 00 test $0x1,%edi 10eb01: 0f 84 e9 00 00 00 je 10ebf0 <_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; 10eb07: 83 e7 fe and $0xfffffffe,%edi 10eb0a: 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 10eb0d: 8b 41 24 mov 0x24(%ecx),%eax 10eb10: 89 45 e4 mov %eax,-0x1c(%ebp) && !_Heap_Is_prev_used( _Heap_Block_at( next_block, next_block_size )); 10eb13: 31 c0 xor %eax,%eax 10eb15: 3b 55 e4 cmp -0x1c(%ebp),%edx 10eb18: 74 0a je 10eb24 <_Heap_Free+0x8c> 10eb1a: 31 c0 xor %eax,%eax 10eb1c: f6 44 3a 04 01 testb $0x1,0x4(%edx,%edi,1) 10eb21: 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 10eb24: 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 ) ) { 10eb27: f6 45 f0 01 testb $0x1,-0x10(%ebp) 10eb2b: 75 62 jne 10eb8f <_Heap_Free+0xf7> uintptr_t const prev_size = block->prev_size; 10eb2d: 8b 03 mov (%ebx),%eax 10eb2f: 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); 10eb32: 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; 10eb34: 31 ff xor %edi,%edi 10eb36: 3b 5d ec cmp -0x14(%ebp),%ebx 10eb39: 72 0a jb 10eb45 <_Heap_Free+0xad> <== NEVER TAKEN 10eb3b: 31 c0 xor %eax,%eax 10eb3d: 39 5d e4 cmp %ebx,-0x1c(%ebp) 10eb40: 0f 93 c0 setae %al 10eb43: 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 ); 10eb45: 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 ) ) { 10eb47: 85 ff test %edi,%edi 10eb49: 0f 84 a1 00 00 00 je 10ebf0 <_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) ) { 10eb4f: f6 43 04 01 testb $0x1,0x4(%ebx) 10eb53: 0f 84 97 00 00 00 je 10ebf0 <_Heap_Free+0x158> <== NEVER TAKEN _HAssert( false ); return( false ); } if ( next_is_free ) { /* coalesce both */ 10eb59: 80 7d e3 00 cmpb $0x0,-0x1d(%ebp) 10eb5d: 74 1a je 10eb79 <_Heap_Free+0xe1> uintptr_t const size = block_size + prev_size + next_block_size; 10eb5f: 8b 45 e8 mov -0x18(%ebp),%eax 10eb62: 8d 04 06 lea (%esi,%eax,1),%eax 10eb65: 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; 10eb68: 8b 7a 08 mov 0x8(%edx),%edi Heap_Block *prev = block->prev; 10eb6b: 8b 52 0c mov 0xc(%edx),%edx prev->next = next; 10eb6e: 89 7a 08 mov %edi,0x8(%edx) next->prev = prev; 10eb71: 89 57 0c mov %edx,0xc(%edi) _Heap_Free_list_remove( next_block ); stats->free_blocks -= 1; 10eb74: ff 49 38 decl 0x38(%ecx) 10eb77: eb 33 jmp 10ebac <_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; 10eb79: 8b 45 f0 mov -0x10(%ebp),%eax 10eb7c: 8d 04 06 lea (%esi,%eax,1),%eax prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 10eb7f: 89 c7 mov %eax,%edi 10eb81: 83 cf 01 or $0x1,%edi 10eb84: 89 7b 04 mov %edi,0x4(%ebx) next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 10eb87: 83 62 04 fe andl $0xfffffffe,0x4(%edx) next_block->prev_size = size; 10eb8b: 89 02 mov %eax,(%edx) 10eb8d: eb 56 jmp 10ebe5 <_Heap_Free+0x14d> } } else if ( next_is_free ) { /* coalesce next */ 10eb8f: 80 7d e3 00 cmpb $0x0,-0x1d(%ebp) 10eb93: 74 24 je 10ebb9 <_Heap_Free+0x121> uintptr_t const size = block_size + next_block_size; 10eb95: 8b 45 e8 mov -0x18(%ebp),%eax 10eb98: 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; 10eb9a: 8b 7a 08 mov 0x8(%edx),%edi Heap_Block *prev = old_block->prev; 10eb9d: 8b 52 0c mov 0xc(%edx),%edx new_block->next = next; 10eba0: 89 7b 08 mov %edi,0x8(%ebx) new_block->prev = prev; 10eba3: 89 53 0c mov %edx,0xc(%ebx) next->prev = new_block; 10eba6: 89 5f 0c mov %ebx,0xc(%edi) prev->next = new_block; 10eba9: 89 5a 08 mov %ebx,0x8(%edx) _Heap_Free_list_replace( next_block, block ); block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 10ebac: 89 c2 mov %eax,%edx 10ebae: 83 ca 01 or $0x1,%edx 10ebb1: 89 53 04 mov %edx,0x4(%ebx) next_block = _Heap_Block_at( block, size ); next_block->prev_size = size; 10ebb4: 89 04 03 mov %eax,(%ebx,%eax,1) 10ebb7: eb 2c jmp 10ebe5 <_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; 10ebb9: 8b 41 08 mov 0x8(%ecx),%eax new_block->next = next; 10ebbc: 89 43 08 mov %eax,0x8(%ebx) new_block->prev = block_before; 10ebbf: 89 4b 0c mov %ecx,0xc(%ebx) block_before->next = new_block; 10ebc2: 89 59 08 mov %ebx,0x8(%ecx) next->prev = new_block; 10ebc5: 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; 10ebc8: 89 f0 mov %esi,%eax 10ebca: 83 c8 01 or $0x1,%eax 10ebcd: 89 43 04 mov %eax,0x4(%ebx) next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 10ebd0: 83 62 04 fe andl $0xfffffffe,0x4(%edx) next_block->prev_size = block_size; 10ebd4: 89 32 mov %esi,(%edx) /* Statistics */ ++stats->free_blocks; 10ebd6: 8b 41 38 mov 0x38(%ecx),%eax 10ebd9: 40 inc %eax 10ebda: 89 41 38 mov %eax,0x38(%ecx) if ( stats->max_free_blocks < stats->free_blocks ) { 10ebdd: 39 41 3c cmp %eax,0x3c(%ecx) 10ebe0: 73 03 jae 10ebe5 <_Heap_Free+0x14d> stats->max_free_blocks = stats->free_blocks; 10ebe2: 89 41 3c mov %eax,0x3c(%ecx) } } /* Statistics */ --stats->used_blocks; 10ebe5: ff 49 40 decl 0x40(%ecx) ++stats->frees; 10ebe8: ff 41 50 incl 0x50(%ecx) stats->free_size += block_size; 10ebeb: 01 71 30 add %esi,0x30(%ecx) return( true ); 10ebee: b0 01 mov $0x1,%al } 10ebf0: 83 c4 14 add $0x14,%esp 10ebf3: 5b pop %ebx 10ebf4: 5e pop %esi 10ebf5: 5f pop %edi 10ebf6: c9 leave 10ebf7: c3 ret =============================================================================== 0011bfbc <_Heap_Size_of_alloc_area>: bool _Heap_Size_of_alloc_area( Heap_Control *heap, void *alloc_begin_ptr, uintptr_t *alloc_size ) { 11bfbc: 55 push %ebp 11bfbd: 89 e5 mov %esp,%ebp 11bfbf: 57 push %edi 11bfc0: 56 push %esi 11bfc1: 53 push %ebx 11bfc2: 8b 5d 08 mov 0x8(%ebp),%ebx 11bfc5: 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); 11bfc8: 8d 4e f8 lea -0x8(%esi),%ecx 11bfcb: 89 f0 mov %esi,%eax 11bfcd: 31 d2 xor %edx,%edx 11bfcf: 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); 11bfd2: 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 11bfd4: 8b 53 20 mov 0x20(%ebx),%edx && (uintptr_t) block <= (uintptr_t) heap->last_block; 11bfd7: 31 ff xor %edi,%edi 11bfd9: 39 d1 cmp %edx,%ecx 11bfdb: 72 0a jb 11bfe7 <_Heap_Size_of_alloc_area+0x2b> 11bfdd: 31 c0 xor %eax,%eax 11bfdf: 39 4b 24 cmp %ecx,0x24(%ebx) 11bfe2: 0f 93 c0 setae %al 11bfe5: 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; 11bfe7: 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 ) ) { 11bfe9: 85 ff test %edi,%edi 11bfeb: 74 30 je 11c01d <_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; 11bfed: 8b 41 04 mov 0x4(%ecx),%eax 11bff0: 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); 11bff3: 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; 11bff5: 31 ff xor %edi,%edi 11bff7: 39 d1 cmp %edx,%ecx 11bff9: 72 0a jb 11c005 <_Heap_Size_of_alloc_area+0x49><== NEVER TAKEN 11bffb: 31 c0 xor %eax,%eax 11bffd: 39 4b 24 cmp %ecx,0x24(%ebx) 11c000: 0f 93 c0 setae %al 11c003: 89 c7 mov %eax,%edi if ( !_Heap_Is_block_in_heap( heap, next_block ) || !_Heap_Is_prev_used( next_block ) ) { return false; 11c005: 31 c0 xor %eax,%eax } block_size = _Heap_Block_size( block ); next_block = _Heap_Block_at( block, block_size ); if ( 11c007: 85 ff test %edi,%edi 11c009: 74 12 je 11c01d <_Heap_Size_of_alloc_area+0x61><== NEVER TAKEN !_Heap_Is_block_in_heap( heap, next_block ) || !_Heap_Is_prev_used( next_block ) 11c00b: f6 41 04 01 testb $0x1,0x4(%ecx) 11c00f: 74 0c je 11c01d <_Heap_Size_of_alloc_area+0x61><== NEVER TAKEN ) { return false; } *alloc_size = (uintptr_t) next_block + HEAP_BLOCK_SIZE_OFFSET - alloc_begin; 11c011: 29 f1 sub %esi,%ecx 11c013: 8d 51 04 lea 0x4(%ecx),%edx 11c016: 8b 45 10 mov 0x10(%ebp),%eax 11c019: 89 10 mov %edx,(%eax) return true; 11c01b: b0 01 mov $0x1,%al } 11c01d: 5b pop %ebx 11c01e: 5e pop %esi 11c01f: 5f pop %edi 11c020: c9 leave 11c021: c3 ret =============================================================================== 0010bbba <_Heap_Walk>: bool _Heap_Walk( Heap_Control *heap, int source, bool dump ) { 10bbba: 55 push %ebp 10bbbb: 89 e5 mov %esp,%ebp 10bbbd: 57 push %edi 10bbbe: 56 push %esi 10bbbf: 53 push %ebx 10bbc0: 83 ec 4c sub $0x4c,%esp 10bbc3: 8b 75 08 mov 0x8(%ebp),%esi 10bbc6: 8b 5d 0c mov 0xc(%ebp),%ebx uintptr_t const page_size = heap->page_size; 10bbc9: 8b 46 10 mov 0x10(%esi),%eax 10bbcc: 89 45 d8 mov %eax,-0x28(%ebp) uintptr_t const min_block_size = heap->min_block_size; 10bbcf: 8b 4e 14 mov 0x14(%esi),%ecx 10bbd2: 89 4d d4 mov %ecx,-0x2c(%ebp) Heap_Block *const first_block = heap->first_block; 10bbd5: 8b 46 20 mov 0x20(%esi),%eax 10bbd8: 89 45 d0 mov %eax,-0x30(%ebp) Heap_Block *const last_block = heap->last_block; 10bbdb: 8b 4e 24 mov 0x24(%esi),%ecx 10bbde: 89 4d c8 mov %ecx,-0x38(%ebp) Heap_Block *block = first_block; Heap_Walk_printer printer = dump ? _Heap_Walk_print : _Heap_Walk_print_nothing; 10bbe1: c7 45 e4 7c bb 10 00 movl $0x10bb7c,-0x1c(%ebp) 10bbe8: 80 7d 10 00 cmpb $0x0,0x10(%ebp) 10bbec: 74 07 je 10bbf5 <_Heap_Walk+0x3b> 10bbee: c7 45 e4 81 bb 10 00 movl $0x10bb81,-0x1c(%ebp) if ( !_System_state_Is_up( _System_state_Get() ) ) { return true; 10bbf5: 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() ) ) { 10bbf7: 83 3d 6c 53 12 00 03 cmpl $0x3,0x12536c 10bbfe: 0f 85 e8 02 00 00 jne 10beec <_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)( 10bc04: 52 push %edx 10bc05: ff 76 0c pushl 0xc(%esi) 10bc08: ff 76 08 pushl 0x8(%esi) 10bc0b: ff 75 c8 pushl -0x38(%ebp) 10bc0e: ff 75 d0 pushl -0x30(%ebp) 10bc11: ff 76 1c pushl 0x1c(%esi) 10bc14: ff 76 18 pushl 0x18(%esi) 10bc17: ff 75 d4 pushl -0x2c(%ebp) 10bc1a: ff 75 d8 pushl -0x28(%ebp) 10bc1d: 68 b1 ea 11 00 push $0x11eab1 10bc22: 6a 00 push $0x0 10bc24: 53 push %ebx 10bc25: 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 ) { 10bc28: 83 c4 30 add $0x30,%esp 10bc2b: 83 7d d8 00 cmpl $0x0,-0x28(%ebp) 10bc2f: 75 0b jne 10bc3c <_Heap_Walk+0x82> (*printer)( source, true, "page size is zero\n" ); 10bc31: 50 push %eax 10bc32: 68 42 eb 11 00 push $0x11eb42 10bc37: e9 6b 02 00 00 jmp 10bea7 <_Heap_Walk+0x2ed> return false; } if ( !_Addresses_Is_aligned( (void *) page_size ) ) { 10bc3c: f6 45 d8 03 testb $0x3,-0x28(%ebp) 10bc40: 74 0d je 10bc4f <_Heap_Walk+0x95> (*printer)( 10bc42: ff 75 d8 pushl -0x28(%ebp) 10bc45: 68 55 eb 11 00 push $0x11eb55 10bc4a: e9 58 02 00 00 jmp 10bea7 <_Heap_Walk+0x2ed> RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 10bc4f: 8b 45 d4 mov -0x2c(%ebp),%eax 10bc52: 31 d2 xor %edx,%edx 10bc54: f7 75 d8 divl -0x28(%ebp) ); return false; } if ( !_Heap_Is_aligned( min_block_size, page_size ) ) { 10bc57: 85 d2 test %edx,%edx 10bc59: 74 0d je 10bc68 <_Heap_Walk+0xae> (*printer)( 10bc5b: ff 75 d4 pushl -0x2c(%ebp) 10bc5e: 68 73 eb 11 00 push $0x11eb73 10bc63: e9 3f 02 00 00 jmp 10bea7 <_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; 10bc68: 8b 45 d0 mov -0x30(%ebp),%eax 10bc6b: 83 c0 08 add $0x8,%eax RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 10bc6e: 31 d2 xor %edx,%edx 10bc70: f7 75 d8 divl -0x28(%ebp) ); return false; } if ( 10bc73: 85 d2 test %edx,%edx 10bc75: 74 0d je 10bc84 <_Heap_Walk+0xca> !_Heap_Is_aligned( _Heap_Alloc_area_of_block( first_block ), page_size ) ) { (*printer)( 10bc77: ff 75 d0 pushl -0x30(%ebp) 10bc7a: 68 97 eb 11 00 push $0x11eb97 10bc7f: e9 23 02 00 00 jmp 10bea7 <_Heap_Walk+0x2ed> ); return false; } if ( !_Heap_Is_prev_used( first_block ) ) { 10bc84: 8b 45 d0 mov -0x30(%ebp),%eax 10bc87: f6 40 04 01 testb $0x1,0x4(%eax) 10bc8b: 75 0b jne 10bc98 <_Heap_Walk+0xde> (*printer)( 10bc8d: 57 push %edi 10bc8e: 68 c8 eb 11 00 push $0x11ebc8 10bc93: e9 0f 02 00 00 jmp 10bea7 <_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; 10bc98: 8b 4d c8 mov -0x38(%ebp),%ecx 10bc9b: 8b 79 04 mov 0x4(%ecx),%edi 10bc9e: 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); 10bca1: 01 cf add %ecx,%edi ); return false; } if ( _Heap_Is_free( last_block ) ) { 10bca3: f6 47 04 01 testb $0x1,0x4(%edi) 10bca7: 75 0b jne 10bcb4 <_Heap_Walk+0xfa> (*printer)( 10bca9: 56 push %esi 10bcaa: 68 f6 eb 11 00 push $0x11ebf6 10bcaf: e9 f3 01 00 00 jmp 10bea7 <_Heap_Walk+0x2ed> ); return false; } if ( 10bcb4: 3b 7d d0 cmp -0x30(%ebp),%edi 10bcb7: 74 0b je 10bcc4 <_Heap_Walk+0x10a> <== ALWAYS TAKEN _Heap_Block_at( last_block, _Heap_Block_size( last_block ) ) != first_block ) { (*printer)( 10bcb9: 51 push %ecx <== NOT EXECUTED 10bcba: 68 0b ec 11 00 push $0x11ec0b <== NOT EXECUTED 10bcbf: e9 e3 01 00 00 jmp 10bea7 <_Heap_Walk+0x2ed> <== NOT EXECUTED int source, Heap_Walk_printer printer, Heap_Control *heap ) { uintptr_t const page_size = heap->page_size; 10bcc4: 8b 46 10 mov 0x10(%esi),%eax 10bcc7: 89 45 e0 mov %eax,-0x20(%ebp) block = next_block; } while ( block != first_block ); return true; } 10bcca: 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 ); 10bccd: 89 75 dc mov %esi,-0x24(%ebp) 10bcd0: eb 75 jmp 10bd47 <_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; 10bcd2: 31 c0 xor %eax,%eax 10bcd4: 39 4e 20 cmp %ecx,0x20(%esi) 10bcd7: 77 08 ja 10bce1 <_Heap_Walk+0x127> 10bcd9: 31 c0 xor %eax,%eax 10bcdb: 39 4e 24 cmp %ecx,0x24(%esi) 10bcde: 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 ) ) { 10bce1: 85 c0 test %eax,%eax 10bce3: 75 0b jne 10bcf0 <_Heap_Walk+0x136> (*printer)( 10bce5: 51 push %ecx 10bce6: 68 3a ec 11 00 push $0x11ec3a 10bceb: e9 b7 01 00 00 jmp 10bea7 <_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; 10bcf0: 8d 41 08 lea 0x8(%ecx),%eax RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 10bcf3: 31 d2 xor %edx,%edx 10bcf5: f7 75 e0 divl -0x20(%ebp) ); return false; } if ( 10bcf8: 85 d2 test %edx,%edx 10bcfa: 74 0b je 10bd07 <_Heap_Walk+0x14d> !_Heap_Is_aligned( _Heap_Alloc_area_of_block( free_block ), page_size ) ) { (*printer)( 10bcfc: 51 push %ecx 10bcfd: 68 5a ec 11 00 push $0x11ec5a 10bd02: e9 a0 01 00 00 jmp 10bea7 <_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; 10bd07: 8b 41 04 mov 0x4(%ecx),%eax 10bd0a: 83 e0 fe and $0xfffffffe,%eax ); return false; } if ( _Heap_Is_used( free_block ) ) { 10bd0d: f6 44 01 04 01 testb $0x1,0x4(%ecx,%eax,1) 10bd12: 74 0b je 10bd1f <_Heap_Walk+0x165> (*printer)( 10bd14: 51 push %ecx 10bd15: 68 8a ec 11 00 push $0x11ec8a 10bd1a: e9 88 01 00 00 jmp 10bea7 <_Heap_Walk+0x2ed> ); return false; } if ( free_block->prev != prev_block ) { 10bd1f: 8b 41 0c mov 0xc(%ecx),%eax 10bd22: 3b 45 dc cmp -0x24(%ebp),%eax 10bd25: 74 1a je 10bd41 <_Heap_Walk+0x187> (*printer)( 10bd27: 83 ec 0c sub $0xc,%esp 10bd2a: 50 push %eax 10bd2b: 51 push %ecx 10bd2c: 68 a6 ec 11 00 push $0x11eca6 10bd31: 6a 01 push $0x1 10bd33: 53 push %ebx 10bd34: ff 55 e4 call *-0x1c(%ebp) 10bd37: 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; 10bd3a: 31 c0 xor %eax,%eax 10bd3c: e9 ab 01 00 00 jmp 10beec <_Heap_Walk+0x332> return false; } prev_block = free_block; free_block = free_block->next; 10bd41: 89 4d dc mov %ecx,-0x24(%ebp) 10bd44: 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 ) { 10bd47: 39 f1 cmp %esi,%ecx 10bd49: 75 87 jne 10bcd2 <_Heap_Walk+0x118> 10bd4b: 89 5d dc mov %ebx,-0x24(%ebp) 10bd4e: eb 02 jmp 10bd52 <_Heap_Walk+0x198> block->prev_size ); } block = next_block; } while ( block != first_block ); 10bd50: 89 df mov %ebx,%edi return true; } 10bd52: 8b 4f 04 mov 0x4(%edi),%ecx 10bd55: 89 4d cc mov %ecx,-0x34(%ebp) 10bd58: 83 e1 fe and $0xfffffffe,%ecx 10bd5b: 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); 10bd5e: 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; 10bd61: 31 c0 xor %eax,%eax 10bd63: 39 5e 20 cmp %ebx,0x20(%esi) 10bd66: 77 08 ja 10bd70 <_Heap_Walk+0x1b6> <== NEVER TAKEN 10bd68: 31 c0 xor %eax,%eax 10bd6a: 39 5e 24 cmp %ebx,0x24(%esi) 10bd6d: 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 ) ) { 10bd70: 85 c0 test %eax,%eax 10bd72: 75 11 jne 10bd85 <_Heap_Walk+0x1cb> 10bd74: 89 d9 mov %ebx,%ecx 10bd76: 8b 5d dc mov -0x24(%ebp),%ebx (*printer)( 10bd79: 83 ec 0c sub $0xc,%esp 10bd7c: 51 push %ecx 10bd7d: 57 push %edi 10bd7e: 68 d8 ec 11 00 push $0x11ecd8 10bd83: eb ac jmp 10bd31 <_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; 10bd85: 3b 7d c8 cmp -0x38(%ebp),%edi 10bd88: 0f 95 c1 setne %cl RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 10bd8b: 8b 45 e0 mov -0x20(%ebp),%eax 10bd8e: 31 d2 xor %edx,%edx 10bd90: f7 75 d8 divl -0x28(%ebp) ); return false; } if ( !_Heap_Is_aligned( block_size, page_size ) && is_not_last_block ) { 10bd93: 85 d2 test %edx,%edx 10bd95: 74 15 je 10bdac <_Heap_Walk+0x1f2> 10bd97: 84 c9 test %cl,%cl 10bd99: 74 11 je 10bdac <_Heap_Walk+0x1f2> 10bd9b: 8b 5d dc mov -0x24(%ebp),%ebx (*printer)( 10bd9e: 83 ec 0c sub $0xc,%esp 10bda1: ff 75 e0 pushl -0x20(%ebp) 10bda4: 57 push %edi 10bda5: 68 05 ed 11 00 push $0x11ed05 10bdaa: eb 85 jmp 10bd31 <_Heap_Walk+0x177> ); return false; } if ( block_size < min_block_size && is_not_last_block ) { 10bdac: 8b 45 d4 mov -0x2c(%ebp),%eax 10bdaf: 39 45 e0 cmp %eax,-0x20(%ebp) 10bdb2: 73 18 jae 10bdcc <_Heap_Walk+0x212> 10bdb4: 84 c9 test %cl,%cl 10bdb6: 74 14 je 10bdcc <_Heap_Walk+0x212> <== NEVER TAKEN 10bdb8: 8b 5d dc mov -0x24(%ebp),%ebx (*printer)( 10bdbb: 52 push %edx 10bdbc: 52 push %edx 10bdbd: 50 push %eax 10bdbe: ff 75 e0 pushl -0x20(%ebp) 10bdc1: 57 push %edi 10bdc2: 68 33 ed 11 00 push $0x11ed33 10bdc7: e9 65 ff ff ff jmp 10bd31 <_Heap_Walk+0x177> ); return false; } if ( next_block_begin <= block_begin && is_not_last_block ) { 10bdcc: 39 fb cmp %edi,%ebx 10bdce: 77 18 ja 10bde8 <_Heap_Walk+0x22e> 10bdd0: 84 c9 test %cl,%cl 10bdd2: 74 14 je 10bde8 <_Heap_Walk+0x22e> 10bdd4: 89 d9 mov %ebx,%ecx 10bdd6: 8b 5d dc mov -0x24(%ebp),%ebx (*printer)( 10bdd9: 83 ec 0c sub $0xc,%esp 10bddc: 51 push %ecx 10bddd: 57 push %edi 10bdde: 68 5e ed 11 00 push $0x11ed5e 10bde3: e9 49 ff ff ff jmp 10bd31 <_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; 10bde8: 8b 4d cc mov -0x34(%ebp),%ecx 10bdeb: 83 e1 01 and $0x1,%ecx 10bdee: 89 4d c4 mov %ecx,-0x3c(%ebp) ); return false; } if ( !_Heap_Is_prev_used( next_block ) ) { 10bdf1: f6 43 04 01 testb $0x1,0x4(%ebx) 10bdf5: 0f 85 ba 00 00 00 jne 10beb5 <_Heap_Walk+0x2fb> block = next_block; } while ( block != first_block ); return true; } 10bdfb: 8b 46 08 mov 0x8(%esi),%eax 10bdfe: 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 ? 10be01: 8b 4f 08 mov 0x8(%edi),%ecx 10be04: 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)( 10be07: ba 7e ea 11 00 mov $0x11ea7e,%edx 10be0c: 3b 4e 0c cmp 0xc(%esi),%ecx 10be0f: 74 0e je 10be1f <_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)" : "") 10be11: ba b5 e9 11 00 mov $0x11e9b5,%edx 10be16: 39 f1 cmp %esi,%ecx 10be18: 75 05 jne 10be1f <_Heap_Walk+0x265> 10be1a: ba 8d ea 11 00 mov $0x11ea8d,%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 ? 10be1f: 8b 47 0c mov 0xc(%edi),%eax 10be22: 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)( 10be25: b8 97 ea 11 00 mov $0x11ea97,%eax 10be2a: 8b 4d c0 mov -0x40(%ebp),%ecx 10be2d: 39 4d cc cmp %ecx,-0x34(%ebp) 10be30: 74 0f je 10be41 <_Heap_Walk+0x287> block, block_size, block->prev, block->prev == first_free_block ? " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), 10be32: b8 b5 e9 11 00 mov $0x11e9b5,%eax 10be37: 39 75 cc cmp %esi,-0x34(%ebp) 10be3a: 75 05 jne 10be41 <_Heap_Walk+0x287> 10be3c: b8 a7 ea 11 00 mov $0x11eaa7,%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)( 10be41: 83 ec 0c sub $0xc,%esp 10be44: 52 push %edx 10be45: ff 75 b4 pushl -0x4c(%ebp) 10be48: 50 push %eax 10be49: ff 75 cc pushl -0x34(%ebp) 10be4c: ff 75 e0 pushl -0x20(%ebp) 10be4f: 57 push %edi 10be50: 68 92 ed 11 00 push $0x11ed92 10be55: 6a 00 push $0x0 10be57: ff 75 dc pushl -0x24(%ebp) 10be5a: 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 ) { 10be5d: 8b 03 mov (%ebx),%eax 10be5f: 83 c4 30 add $0x30,%esp 10be62: 39 45 e0 cmp %eax,-0x20(%ebp) 10be65: 74 16 je 10be7d <_Heap_Walk+0x2c3> 10be67: 89 d9 mov %ebx,%ecx 10be69: 8b 5d dc mov -0x24(%ebp),%ebx (*printer)( 10be6c: 56 push %esi 10be6d: 51 push %ecx 10be6e: 50 push %eax 10be6f: ff 75 e0 pushl -0x20(%ebp) 10be72: 57 push %edi 10be73: 68 c7 ed 11 00 push $0x11edc7 10be78: e9 b4 fe ff ff jmp 10bd31 <_Heap_Walk+0x177> ); return false; } if ( !prev_used ) { 10be7d: 83 7d c4 00 cmpl $0x0,-0x3c(%ebp) 10be81: 75 0b jne 10be8e <_Heap_Walk+0x2d4> 10be83: 8b 5d dc mov -0x24(%ebp),%ebx (*printer)( 10be86: 57 push %edi 10be87: 68 00 ee 11 00 push $0x11ee00 10be8c: eb 19 jmp 10bea7 <_Heap_Walk+0x2ed> block = next_block; } while ( block != first_block ); return true; } 10be8e: 8b 46 08 mov 0x8(%esi),%eax 10be91: eb 07 jmp 10be9a <_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 ) { 10be93: 39 f8 cmp %edi,%eax 10be95: 74 4a je 10bee1 <_Heap_Walk+0x327> return true; } free_block = free_block->next; 10be97: 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 ) { 10be9a: 39 f0 cmp %esi,%eax 10be9c: 75 f5 jne 10be93 <_Heap_Walk+0x2d9> 10be9e: 8b 5d dc mov -0x24(%ebp),%ebx return false; } if ( !_Heap_Walk_is_in_free_list( heap, block ) ) { (*printer)( 10bea1: 57 push %edi 10bea2: 68 6b ee 11 00 push $0x11ee6b 10bea7: 6a 01 push $0x1 10bea9: 53 push %ebx 10beaa: ff 55 e4 call *-0x1c(%ebp) 10bead: 83 c4 10 add $0x10,%esp 10beb0: e9 85 fe ff ff jmp 10bd3a <_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) { 10beb5: 83 7d c4 00 cmpl $0x0,-0x3c(%ebp) 10beb9: 74 0e je 10bec9 <_Heap_Walk+0x30f> (*printer)( 10bebb: 83 ec 0c sub $0xc,%esp 10bebe: ff 75 e0 pushl -0x20(%ebp) 10bec1: 57 push %edi 10bec2: 68 2f ee 11 00 push $0x11ee2f 10bec7: eb 0d jmp 10bed6 <_Heap_Walk+0x31c> "block 0x%08x: size %u\n", block, block_size ); } else { (*printer)( 10bec9: 51 push %ecx 10beca: 51 push %ecx 10becb: ff 37 pushl (%edi) 10becd: ff 75 e0 pushl -0x20(%ebp) 10bed0: 57 push %edi 10bed1: 68 46 ee 11 00 push $0x11ee46 10bed6: 6a 00 push $0x0 10bed8: ff 75 dc pushl -0x24(%ebp) 10bedb: ff 55 e4 call *-0x1c(%ebp) 10bede: 83 c4 20 add $0x20,%esp block->prev_size ); } block = next_block; } while ( block != first_block ); 10bee1: 3b 5d d0 cmp -0x30(%ebp),%ebx 10bee4: 0f 85 66 fe ff ff jne 10bd50 <_Heap_Walk+0x196> return true; 10beea: b0 01 mov $0x1,%al } 10beec: 8d 65 f4 lea -0xc(%ebp),%esp 10beef: 5b pop %ebx 10bef0: 5e pop %esi 10bef1: 5f pop %edi 10bef2: c9 leave 10bef3: c3 ret =============================================================================== 0010b1ec <_Internal_error_Occurred>: void _Internal_error_Occurred( Internal_errors_Source the_source, bool is_internal, Internal_errors_t the_error ) { 10b1ec: 55 push %ebp 10b1ed: 89 e5 mov %esp,%ebp 10b1ef: 53 push %ebx 10b1f0: 83 ec 08 sub $0x8,%esp 10b1f3: 8b 45 08 mov 0x8(%ebp),%eax 10b1f6: 8b 55 0c mov 0xc(%ebp),%edx 10b1f9: 8b 5d 10 mov 0x10(%ebp),%ebx _Internal_errors_What_happened.the_source = the_source; 10b1fc: a3 fc 31 12 00 mov %eax,0x1231fc _Internal_errors_What_happened.is_internal = is_internal; 10b201: 88 15 00 32 12 00 mov %dl,0x123200 _Internal_errors_What_happened.the_error = the_error; 10b207: 89 1d 04 32 12 00 mov %ebx,0x123204 _User_extensions_Fatal( the_source, is_internal, the_error ); 10b20d: 53 push %ebx 10b20e: 0f b6 d2 movzbl %dl,%edx 10b211: 52 push %edx 10b212: 50 push %eax 10b213: e8 97 18 00 00 call 10caaf <_User_extensions_Fatal> RTEMS_INLINE_ROUTINE void _System_state_Set ( System_state_Codes state ) { _System_state_Current = state; 10b218: c7 05 e4 32 12 00 05 movl $0x5,0x1232e4 <== NOT EXECUTED 10b21f: 00 00 00 _System_state_Set( SYSTEM_STATE_FAILED ); _CPU_Fatal_halt( the_error ); 10b222: fa cli <== NOT EXECUTED 10b223: 89 d8 mov %ebx,%eax <== NOT EXECUTED 10b225: f4 hlt <== NOT EXECUTED 10b226: 83 c4 10 add $0x10,%esp <== NOT EXECUTED 10b229: eb fe jmp 10b229 <_Internal_error_Occurred+0x3d><== NOT EXECUTED =============================================================================== 0010b27c <_Objects_Allocate>: */ Objects_Control *_Objects_Allocate( Objects_Information *information ) { 10b27c: 55 push %ebp 10b27d: 89 e5 mov %esp,%ebp 10b27f: 56 push %esi 10b280: 53 push %ebx 10b281: 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; 10b284: 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 ) 10b286: 83 7b 18 00 cmpl $0x0,0x18(%ebx) 10b28a: 74 53 je 10b2df <_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 ); 10b28c: 8d 73 20 lea 0x20(%ebx),%esi 10b28f: 83 ec 0c sub $0xc,%esp 10b292: 56 push %esi 10b293: e8 88 f7 ff ff call 10aa20 <_Chain_Get> 10b298: 89 c1 mov %eax,%ecx if ( information->auto_extend ) { 10b29a: 83 c4 10 add $0x10,%esp 10b29d: 80 7b 12 00 cmpb $0x0,0x12(%ebx) 10b2a1: 74 3c je 10b2df <_Objects_Allocate+0x63> /* * If the list is empty then we are out of objects and need to * extend information base. */ if ( !the_object ) { 10b2a3: 85 c0 test %eax,%eax 10b2a5: 75 1a jne 10b2c1 <_Objects_Allocate+0x45> _Objects_Extend_information( information ); 10b2a7: 83 ec 0c sub $0xc,%esp 10b2aa: 53 push %ebx 10b2ab: e8 60 00 00 00 call 10b310 <_Objects_Extend_information> the_object = (Objects_Control *) _Chain_Get( &information->Inactive ); 10b2b0: 89 34 24 mov %esi,(%esp) 10b2b3: e8 68 f7 ff ff call 10aa20 <_Chain_Get> 10b2b8: 89 c1 mov %eax,%ecx } if ( the_object ) { 10b2ba: 83 c4 10 add $0x10,%esp 10b2bd: 85 c0 test %eax,%eax 10b2bf: 74 1e je 10b2df <_Objects_Allocate+0x63> uint32_t block; block = (uint32_t) _Objects_Get_index( the_object->id ) - 10b2c1: 0f b7 41 08 movzwl 0x8(%ecx),%eax 10b2c5: 0f b7 53 08 movzwl 0x8(%ebx),%edx 10b2c9: 29 d0 sub %edx,%eax _Objects_Get_index( information->minimum_id ); block /= information->allocation_size; 10b2cb: 0f b7 73 14 movzwl 0x14(%ebx),%esi 10b2cf: 31 d2 xor %edx,%edx 10b2d1: f7 f6 div %esi information->inactive_per_block[ block ]--; 10b2d3: c1 e0 02 shl $0x2,%eax 10b2d6: 03 43 30 add 0x30(%ebx),%eax 10b2d9: ff 08 decl (%eax) information->inactive--; 10b2db: 66 ff 4b 2c decw 0x2c(%ebx) ); } #endif return the_object; } 10b2df: 89 c8 mov %ecx,%eax 10b2e1: 8d 65 f8 lea -0x8(%ebp),%esp 10b2e4: 5b pop %ebx 10b2e5: 5e pop %esi 10b2e6: c9 leave 10b2e7: c3 ret =============================================================================== 0010b604 <_Objects_Get_information>: Objects_Information *_Objects_Get_information( Objects_APIs the_api, uint32_t the_class ) { 10b604: 55 push %ebp 10b605: 89 e5 mov %esp,%ebp 10b607: 57 push %edi 10b608: 56 push %esi 10b609: 53 push %ebx 10b60a: 83 ec 0c sub $0xc,%esp 10b60d: 8b 7d 08 mov 0x8(%ebp),%edi 10b610: 8b 75 0c mov 0xc(%ebp),%esi Objects_Information *info; int the_class_api_maximum; if ( !the_class ) return NULL; 10b613: 31 db xor %ebx,%ebx ) { Objects_Information *info; int the_class_api_maximum; if ( !the_class ) 10b615: 85 f6 test %esi,%esi 10b617: 74 34 je 10b64d <_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 ); 10b619: 83 ec 0c sub $0xc,%esp 10b61c: 57 push %edi 10b61d: e8 d6 35 00 00 call 10ebf8 <_Objects_API_maximum_class> if ( the_class_api_maximum == 0 ) 10b622: 83 c4 10 add $0x10,%esp 10b625: 85 c0 test %eax,%eax 10b627: 74 24 je 10b64d <_Objects_Get_information+0x49> return NULL; if ( the_class > (uint32_t) the_class_api_maximum ) 10b629: 39 c6 cmp %eax,%esi 10b62b: 77 20 ja 10b64d <_Objects_Get_information+0x49> return NULL; if ( !_Objects_Information_table[ the_api ] ) 10b62d: 8b 04 bd 3c 31 12 00 mov 0x12313c(,%edi,4),%eax 10b634: 85 c0 test %eax,%eax 10b636: 74 15 je 10b64d <_Objects_Get_information+0x49><== NEVER TAKEN return NULL; info = _Objects_Information_table[ the_api ][ the_class ]; 10b638: 8b 1c b0 mov (%eax,%esi,4),%ebx if ( !info ) 10b63b: 85 db test %ebx,%ebx 10b63d: 74 0e je 10b64d <_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; 10b63f: 31 c0 xor %eax,%eax 10b641: 66 83 7b 10 00 cmpw $0x0,0x10(%ebx) 10b646: 0f 95 c0 setne %al 10b649: f7 d8 neg %eax 10b64b: 21 c3 and %eax,%ebx #endif return info; } 10b64d: 89 d8 mov %ebx,%eax 10b64f: 8d 65 f4 lea -0xc(%ebp),%esp 10b652: 5b pop %ebx 10b653: 5e pop %esi 10b654: 5f pop %edi 10b655: c9 leave 10b656: c3 ret =============================================================================== 00118a9c <_Objects_Get_no_protection>: Objects_Control *_Objects_Get_no_protection( Objects_Information *information, Objects_Id id, Objects_Locations *location ) { 118a9c: 55 push %ebp 118a9d: 89 e5 mov %esp,%ebp 118a9f: 53 push %ebx 118aa0: 8b 55 08 mov 0x8(%ebp),%edx 118aa3: 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; 118aa6: b8 01 00 00 00 mov $0x1,%eax 118aab: 2b 42 08 sub 0x8(%edx),%eax 118aae: 03 45 0c add 0xc(%ebp),%eax if ( information->maximum >= index ) { 118ab1: 0f b7 5a 10 movzwl 0x10(%edx),%ebx 118ab5: 39 c3 cmp %eax,%ebx 118ab7: 72 12 jb 118acb <_Objects_Get_no_protection+0x2f> if ( (the_object = information->local_table[ index ]) != NULL ) { 118ab9: 8b 52 1c mov 0x1c(%edx),%edx 118abc: 8b 04 82 mov (%edx,%eax,4),%eax 118abf: 85 c0 test %eax,%eax 118ac1: 74 08 je 118acb <_Objects_Get_no_protection+0x2f><== NEVER TAKEN *location = OBJECTS_LOCAL; 118ac3: c7 01 00 00 00 00 movl $0x0,(%ecx) return the_object; 118ac9: eb 08 jmp 118ad3 <_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; 118acb: c7 01 01 00 00 00 movl $0x1,(%ecx) return NULL; 118ad1: 31 c0 xor %eax,%eax } 118ad3: 5b pop %ebx 118ad4: c9 leave 118ad5: c3 ret =============================================================================== 0010c814 <_Objects_Id_to_name>: */ Objects_Name_or_id_lookup_errors _Objects_Id_to_name ( Objects_Id id, Objects_Name *name ) { 10c814: 55 push %ebp 10c815: 89 e5 mov %esp,%ebp 10c817: 53 push %ebx 10c818: 83 ec 14 sub $0x14,%esp /* * Caller is trusted for name != NULL. */ tmpId = (id == OBJECTS_ID_OF_SELF) ? _Thread_Executing->Object.id : id; 10c81b: 8b 45 08 mov 0x8(%ebp),%eax 10c81e: 85 c0 test %eax,%eax 10c820: 75 08 jne 10c82a <_Objects_Id_to_name+0x16> 10c822: a1 34 66 12 00 mov 0x126634,%eax 10c827: 8b 40 08 mov 0x8(%eax),%eax 10c82a: 89 c2 mov %eax,%edx 10c82c: c1 ea 18 shr $0x18,%edx 10c82f: 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 ) 10c832: 8d 4a ff lea -0x1(%edx),%ecx the_api = _Objects_Get_API( tmpId ); if ( !_Objects_Is_api_valid( the_api ) ) return OBJECTS_INVALID_ID; 10c835: bb 03 00 00 00 mov $0x3,%ebx 10c83a: 83 f9 02 cmp $0x2,%ecx 10c83d: 77 30 ja 10c86f <_Objects_Id_to_name+0x5b> 10c83f: eb 35 jmp 10c876 <_Objects_Id_to_name+0x62> */ RTEMS_INLINE_ROUTINE uint32_t _Objects_Get_class( Objects_Id id ) { return (uint32_t) 10c841: 89 c1 mov %eax,%ecx 10c843: 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 ]; 10c846: 8b 14 8a mov (%edx,%ecx,4),%edx if ( !information ) 10c849: 85 d2 test %edx,%edx 10c84b: 74 22 je 10c86f <_Objects_Id_to_name+0x5b><== NEVER TAKEN #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES) if ( information->is_string ) return OBJECTS_INVALID_ID; #endif the_object = _Objects_Get( information, tmpId, &ignored_location ); 10c84d: 51 push %ecx 10c84e: 8d 4d f4 lea -0xc(%ebp),%ecx 10c851: 51 push %ecx 10c852: 50 push %eax 10c853: 52 push %edx 10c854: e8 63 ff ff ff call 10c7bc <_Objects_Get> if ( !the_object ) 10c859: 83 c4 10 add $0x10,%esp 10c85c: 85 c0 test %eax,%eax 10c85e: 74 0f je 10c86f <_Objects_Id_to_name+0x5b> return OBJECTS_INVALID_ID; *name = the_object->name; 10c860: 8b 50 0c mov 0xc(%eax),%edx 10c863: 8b 45 0c mov 0xc(%ebp),%eax 10c866: 89 10 mov %edx,(%eax) _Thread_Enable_dispatch(); 10c868: e8 6d 07 00 00 call 10cfda <_Thread_Enable_dispatch> return OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL; 10c86d: 31 db xor %ebx,%ebx } 10c86f: 89 d8 mov %ebx,%eax 10c871: 8b 5d fc mov -0x4(%ebp),%ebx 10c874: c9 leave 10c875: 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 ] ) 10c876: 8b 14 95 c8 63 12 00 mov 0x1263c8(,%edx,4),%edx 10c87d: 85 d2 test %edx,%edx 10c87f: 75 c0 jne 10c841 <_Objects_Id_to_name+0x2d><== ALWAYS TAKEN 10c881: eb ec jmp 10c86f <_Objects_Id_to_name+0x5b><== NOT EXECUTED =============================================================================== 0010b700 <_Objects_Initialize_information>: , bool supports_global, Objects_Thread_queue_Extract_callout extract #endif ) { 10b700: 55 push %ebp 10b701: 89 e5 mov %esp,%ebp 10b703: 57 push %edi 10b704: 56 push %esi 10b705: 53 push %ebx 10b706: 83 ec 0c sub $0xc,%esp 10b709: 8b 45 08 mov 0x8(%ebp),%eax 10b70c: 8b 75 0c mov 0xc(%ebp),%esi 10b70f: 8b 5d 10 mov 0x10(%ebp),%ebx 10b712: 8b 4d 14 mov 0x14(%ebp),%ecx 10b715: 8b 7d 20 mov 0x20(%ebp),%edi 10b718: 0f b7 55 18 movzwl 0x18(%ebp),%edx uint32_t maximum_per_allocation; #if defined(RTEMS_MULTIPROCESSING) uint32_t index; #endif information->the_api = the_api; 10b71c: 89 30 mov %esi,(%eax) information->the_class = the_class; 10b71e: 66 89 58 04 mov %bx,0x4(%eax) information->size = size; 10b722: 89 50 18 mov %edx,0x18(%eax) information->local_table = 0; 10b725: c7 40 1c 00 00 00 00 movl $0x0,0x1c(%eax) information->inactive_per_block = 0; 10b72c: c7 40 30 00 00 00 00 movl $0x0,0x30(%eax) information->object_blocks = 0; 10b733: c7 40 34 00 00 00 00 movl $0x0,0x34(%eax) information->inactive = 0; 10b73a: 66 c7 40 2c 00 00 movw $0x0,0x2c(%eax) /* * Set the maximum value to 0. It will be updated when objects are * added to the inactive set from _Objects_Extend_information() */ information->maximum = 0; 10b740: 66 c7 40 10 00 00 movw $0x0,0x10(%eax) /* * Register this Object Class in the Object Information Table. */ _Objects_Information_table[ the_api ][ the_class ] = information; 10b746: 8b 14 b5 3c 31 12 00 mov 0x12313c(,%esi,4),%edx 10b74d: 89 04 9a mov %eax,(%edx,%ebx,4) /* * Are we operating in limited or unlimited (e.g. auto-extend) mode. */ information->auto_extend = (maximum & OBJECTS_UNLIMITED_OBJECTS) ? true : false; 10b750: 89 ca mov %ecx,%edx 10b752: c1 ea 1f shr $0x1f,%edx _Objects_Information_table[ the_api ][ the_class ] = information; /* * Are we operating in limited or unlimited (e.g. auto-extend) mode. */ information->auto_extend = 10b755: 88 50 12 mov %dl,0x12(%eax) (maximum & OBJECTS_UNLIMITED_OBJECTS) ? true : false; maximum_per_allocation = maximum & ~OBJECTS_UNLIMITED_OBJECTS; 10b758: 81 e1 ff ff ff 7f and $0x7fffffff,%ecx /* * Unlimited and maximum of zero is illogical. */ if ( information->auto_extend && maximum_per_allocation == 0) { 10b75e: 85 d2 test %edx,%edx 10b760: 74 10 je 10b772 <_Objects_Initialize_information+0x72> 10b762: 85 c9 test %ecx,%ecx 10b764: 75 0c jne 10b772 <_Objects_Initialize_information+0x72> _Internal_error_Occurred( 10b766: 50 push %eax 10b767: 6a 13 push $0x13 10b769: 6a 01 push $0x1 10b76b: 6a 00 push $0x0 10b76d: e8 7a fa ff ff call 10b1ec <_Internal_error_Occurred> } /* * The allocation unit is the maximum value */ information->allocation_size = maximum_per_allocation; 10b772: 66 89 48 14 mov %cx,0x14(%eax) /* * Provide a null local table entry for the case of any empty table. */ information->local_table = &null_local_table; 10b776: c7 40 1c 1c 2e 12 00 movl $0x122e1c,0x1c(%eax) uint32_t the_class, uint32_t node, uint32_t index ) { return (( (Objects_Id) the_api ) << OBJECTS_API_START_BIT) | 10b77d: 89 f2 mov %esi,%edx 10b77f: c1 e2 18 shl $0x18,%edx 10b782: 81 ca 00 00 01 00 or $0x10000,%edx (( (Objects_Id) the_class ) << OBJECTS_CLASS_START_BIT) | 10b788: c1 e3 1b shl $0x1b,%ebx 10b78b: 09 da or %ebx,%edx /* * Calculate minimum and maximum Id's */ minimum_index = (maximum_per_allocation == 0) ? 0 : 1; 10b78d: 31 db xor %ebx,%ebx 10b78f: 85 c9 test %ecx,%ecx 10b791: 0f 95 c3 setne %bl uint32_t the_class, uint32_t node, uint32_t index ) { return (( (Objects_Id) the_api ) << OBJECTS_API_START_BIT) | 10b794: 09 da or %ebx,%edx 10b796: 89 50 08 mov %edx,0x8(%eax) /* * Calculate the maximum name length */ name_length = maximum_name_length; if ( name_length & (OBJECTS_NAME_ALIGNMENT-1) ) 10b799: 89 fa mov %edi,%edx 10b79b: f6 c2 03 test $0x3,%dl 10b79e: 74 06 je 10b7a6 <_Objects_Initialize_information+0xa6><== ALWAYS TAKEN name_length = (name_length + OBJECTS_NAME_ALIGNMENT) & 10b7a0: 83 c2 04 add $0x4,%edx <== NOT EXECUTED 10b7a3: 83 e2 fc and $0xfffffffc,%edx <== NOT EXECUTED ~(OBJECTS_NAME_ALIGNMENT-1); information->name_length = name_length; 10b7a6: 66 89 50 38 mov %dx,0x38(%eax) */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 10b7aa: 8d 50 24 lea 0x24(%eax),%edx 10b7ad: 89 50 20 mov %edx,0x20(%eax) RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); the_chain->permanent_null = NULL; 10b7b0: c7 40 24 00 00 00 00 movl $0x0,0x24(%eax) _Chain_Initialize_empty( &information->Inactive ); 10b7b7: 8d 50 20 lea 0x20(%eax),%edx 10b7ba: 89 50 28 mov %edx,0x28(%eax) /* * Initialize objects .. if there are any */ if ( maximum_per_allocation ) { 10b7bd: 85 c9 test %ecx,%ecx 10b7bf: 74 0f je 10b7d0 <_Objects_Initialize_information+0xd0> /* * Always have the maximum size available so the current performance * figures are create are met. If the user moves past the maximum * number then a performance hit is taken. */ _Objects_Extend_information( information ); 10b7c1: 89 45 08 mov %eax,0x8(%ebp) _Chain_Initialize_empty( &information->global_table[ index ] ); } else information->global_table = NULL; #endif } 10b7c4: 8d 65 f4 lea -0xc(%ebp),%esp 10b7c7: 5b pop %ebx 10b7c8: 5e pop %esi 10b7c9: 5f pop %edi 10b7ca: c9 leave /* * Always have the maximum size available so the current performance * figures are create are met. If the user moves past the maximum * number then a performance hit is taken. */ _Objects_Extend_information( information ); 10b7cb: e9 40 fb ff ff jmp 10b310 <_Objects_Extend_information> _Chain_Initialize_empty( &information->global_table[ index ] ); } else information->global_table = NULL; #endif } 10b7d0: 8d 65 f4 lea -0xc(%ebp),%esp 10b7d3: 5b pop %ebx 10b7d4: 5e pop %esi 10b7d5: 5f pop %edi 10b7d6: c9 leave 10b7d7: c3 ret =============================================================================== 0010e6d8 <_RTEMS_Tasks_Invoke_task_variable_dtor>: void _RTEMS_Tasks_Invoke_task_variable_dtor( Thread_Control *the_thread, rtems_task_variable_t *tvp ) { 10e6d8: 55 push %ebp 10e6d9: 89 e5 mov %esp,%ebp 10e6db: 56 push %esi 10e6dc: 53 push %ebx 10e6dd: 8b 5d 0c mov 0xc(%ebp),%ebx void (*dtor)(void *); void *value; dtor = tvp->dtor; 10e6e0: 8b 43 10 mov 0x10(%ebx),%eax if (_Thread_Is_executing(the_thread)) { 10e6e3: 8b 15 a8 33 12 00 mov 0x1233a8,%edx 10e6e9: 39 55 08 cmp %edx,0x8(%ebp) 10e6ec: 75 0c jne 10e6fa <_RTEMS_Tasks_Invoke_task_variable_dtor+0x22><== NEVER TAKEN value = *tvp->ptr; 10e6ee: 8b 4b 04 mov 0x4(%ebx),%ecx 10e6f1: 8b 11 mov (%ecx),%edx *tvp->ptr = tvp->gval; 10e6f3: 8b 73 08 mov 0x8(%ebx),%esi 10e6f6: 89 31 mov %esi,(%ecx) 10e6f8: eb 03 jmp 10e6fd <_RTEMS_Tasks_Invoke_task_variable_dtor+0x25> } else { value = tvp->tval; 10e6fa: 8b 53 0c mov 0xc(%ebx),%edx } if ( dtor ) 10e6fd: 85 c0 test %eax,%eax 10e6ff: 74 09 je 10e70a <_RTEMS_Tasks_Invoke_task_variable_dtor+0x32> (*dtor)(value); 10e701: 83 ec 0c sub $0xc,%esp 10e704: 52 push %edx 10e705: ff d0 call *%eax 10e707: 83 c4 10 add $0x10,%esp _Workspace_Free(tvp); 10e70a: 89 5d 08 mov %ebx,0x8(%ebp) } 10e70d: 8d 65 f8 lea -0x8(%ebp),%esp 10e710: 5b pop %ebx 10e711: 5e pop %esi 10e712: c9 leave } if ( dtor ) (*dtor)(value); _Workspace_Free(tvp); 10e713: e9 03 e7 ff ff jmp 10ce1b <_Workspace_Free> =============================================================================== 0010e505 <_RTEMS_tasks_Post_switch_extension>: */ void _RTEMS_tasks_Post_switch_extension( Thread_Control *executing ) { 10e505: 55 push %ebp 10e506: 89 e5 mov %esp,%ebp 10e508: 57 push %edi 10e509: 56 push %esi 10e50a: 53 push %ebx 10e50b: 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 ]; 10e50e: 8b 45 08 mov 0x8(%ebp),%eax 10e511: 8b 98 f0 00 00 00 mov 0xf0(%eax),%ebx if ( !api ) 10e517: 85 db test %ebx,%ebx 10e519: 74 45 je 10e560 <_RTEMS_tasks_Post_switch_extension+0x5b><== NEVER TAKEN * Signal Processing */ asr = &api->Signal; _ISR_Disable( level ); 10e51b: 9c pushf 10e51c: fa cli 10e51d: 58 pop %eax signal_set = asr->signals_posted; 10e51e: 8b 7b 14 mov 0x14(%ebx),%edi asr->signals_posted = 0; 10e521: c7 43 14 00 00 00 00 movl $0x0,0x14(%ebx) _ISR_Enable( level ); 10e528: 50 push %eax 10e529: 9d popf if ( !signal_set ) /* similar to _ASR_Are_signals_pending( asr ) */ 10e52a: 85 ff test %edi,%edi 10e52c: 74 32 je 10e560 <_RTEMS_tasks_Post_switch_extension+0x5b> return; asr->nest_level += 1; 10e52e: ff 43 1c incl 0x1c(%ebx) rtems_task_mode( asr->mode_set, RTEMS_ALL_MODE_MASKS, &prev_mode ); 10e531: 50 push %eax 10e532: 8d 75 e4 lea -0x1c(%ebp),%esi 10e535: 56 push %esi 10e536: 68 ff ff 00 00 push $0xffff 10e53b: ff 73 10 pushl 0x10(%ebx) 10e53e: e8 09 1a 00 00 call 10ff4c (*asr->handler)( signal_set ); 10e543: 89 3c 24 mov %edi,(%esp) 10e546: ff 53 0c call *0xc(%ebx) asr->nest_level -= 1; 10e549: ff 4b 1c decl 0x1c(%ebx) rtems_task_mode( prev_mode, RTEMS_ALL_MODE_MASKS, &prev_mode ); 10e54c: 83 c4 0c add $0xc,%esp 10e54f: 56 push %esi 10e550: 68 ff ff 00 00 push $0xffff 10e555: ff 75 e4 pushl -0x1c(%ebp) 10e558: e8 ef 19 00 00 call 10ff4c 10e55d: 83 c4 10 add $0x10,%esp } 10e560: 8d 65 f4 lea -0xc(%ebp),%esp 10e563: 5b pop %ebx 10e564: 5e pop %esi 10e565: 5f pop %edi 10e566: c9 leave 10e567: 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 54 69 12 00 push $0x126954 10b423: e8 fc 19 00 00 call 10ce24 <_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 0f 1e 00 00 call 10d260 <_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 10 6b 12 00 push $0x126b10 10b47b: e8 60 30 00 00 call 10e4e0 <_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 48 6a 12 00 mov 0x126a48,%eax 10b491: 48 dec %eax 10b492: a3 48 6a 12 00 mov %eax,0x126a48 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 04 22 12 00 mov 0x122204,%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 a8 03 12 00 mov 0x1203a8(,%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 74 03 12 00 mov 0x120374(,%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 =============================================================================== 0010b9c4 <_Thread_Change_priority>: void _Thread_Change_priority( Thread_Control *the_thread, Priority_Control new_priority, bool prepend_it ) { 10b9c4: 55 push %ebp 10b9c5: 89 e5 mov %esp,%ebp 10b9c7: 57 push %edi 10b9c8: 56 push %esi 10b9c9: 53 push %ebx 10b9ca: 83 ec 28 sub $0x28,%esp 10b9cd: 8b 5d 08 mov 0x8(%ebp),%ebx 10b9d0: 8b 7d 0c mov 0xc(%ebp),%edi 10b9d3: 8a 45 10 mov 0x10(%ebp),%al 10b9d6: 88 45 e7 mov %al,-0x19(%ebp) */ /* * Save original state */ original_state = the_thread->current_state; 10b9d9: 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 ); 10b9dc: 53 push %ebx 10b9dd: e8 1a 0d 00 00 call 10c6fc <_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 ) 10b9e2: 83 c4 10 add $0x10,%esp 10b9e5: 39 7b 14 cmp %edi,0x14(%ebx) 10b9e8: 74 0c je 10b9f6 <_Thread_Change_priority+0x32> _Thread_Set_priority( the_thread, new_priority ); 10b9ea: 50 push %eax 10b9eb: 50 push %eax 10b9ec: 57 push %edi 10b9ed: 53 push %ebx 10b9ee: e8 d1 0b 00 00 call 10c5c4 <_Thread_Set_priority> 10b9f3: 83 c4 10 add $0x10,%esp _ISR_Disable( level ); 10b9f6: 9c pushf 10b9f7: fa cli 10b9f8: 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; 10b9f9: 8b 43 10 mov 0x10(%ebx),%eax if ( state != STATES_TRANSIENT ) { 10b9fc: 83 f8 04 cmp $0x4,%eax 10b9ff: 74 2f je 10ba30 <_Thread_Change_priority+0x6c> /* Only clear the transient state if it wasn't set already */ if ( ! _States_Is_transient( original_state ) ) 10ba01: 83 e6 04 and $0x4,%esi 10ba04: 75 08 jne 10ba0e <_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); 10ba06: 89 c2 mov %eax,%edx 10ba08: 83 e2 fb and $0xfffffffb,%edx 10ba0b: 89 53 10 mov %edx,0x10(%ebx) the_thread->current_state = _States_Clear( STATES_TRANSIENT, state ); _ISR_Enable( level ); 10ba0e: 51 push %ecx 10ba0f: 9d popf if ( _States_Is_waiting_on_thread_queue( state ) ) { 10ba10: a9 e0 be 03 00 test $0x3bee0,%eax 10ba15: 0f 84 c0 00 00 00 je 10badb <_Thread_Change_priority+0x117> _Thread_queue_Requeue( the_thread->Wait.queue, the_thread ); 10ba1b: 89 5d 0c mov %ebx,0xc(%ebp) 10ba1e: 8b 43 44 mov 0x44(%ebx),%eax 10ba21: 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 ); } 10ba24: 8d 65 f4 lea -0xc(%ebp),%esp 10ba27: 5b pop %ebx 10ba28: 5e pop %esi 10ba29: 5f pop %edi 10ba2a: 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 ); 10ba2b: e9 0c 0b 00 00 jmp 10c53c <_Thread_queue_Requeue> } return; } /* Only clear the transient state if it wasn't set already */ if ( ! _States_Is_transient( original_state ) ) { 10ba30: 83 e6 04 and $0x4,%esi 10ba33: 75 53 jne 10ba88 <_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 ); 10ba35: 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; 10ba3c: 8b 83 90 00 00 00 mov 0x90(%ebx),%eax 10ba42: 66 8b 93 96 00 00 00 mov 0x96(%ebx),%dx 10ba49: 66 09 10 or %dx,(%eax) _Priority_Major_bit_map |= the_priority_map->ready_major; 10ba4c: 66 a1 08 32 12 00 mov 0x123208,%ax 10ba52: 0b 83 94 00 00 00 or 0x94(%ebx),%eax 10ba58: 66 a3 08 32 12 00 mov %ax,0x123208 _Priority_Add_to_bit_map( &the_thread->Priority_map ); if ( prepend_it ) 10ba5e: 80 7d e7 00 cmpb $0x0,-0x19(%ebp) 10ba62: 8b 83 8c 00 00 00 mov 0x8c(%ebx),%eax 10ba68: 74 0e je 10ba78 <_Thread_Change_priority+0xb4> Chain_Node *the_node ) { Chain_Node *before_node; the_node->previous = after_node; 10ba6a: 89 43 04 mov %eax,0x4(%ebx) before_node = after_node->next; 10ba6d: 8b 10 mov (%eax),%edx after_node->next = the_node; 10ba6f: 89 18 mov %ebx,(%eax) the_node->next = before_node; 10ba71: 89 13 mov %edx,(%ebx) before_node->previous = the_node; 10ba73: 89 5a 04 mov %ebx,0x4(%edx) 10ba76: eb 10 jmp 10ba88 <_Thread_Change_priority+0xc4> */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 10ba78: 8d 50 04 lea 0x4(%eax),%edx 10ba7b: 89 13 mov %edx,(%ebx) ) { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); old_last_node = the_chain->last; 10ba7d: 8b 50 08 mov 0x8(%eax),%edx the_chain->last = the_node; 10ba80: 89 58 08 mov %ebx,0x8(%eax) old_last_node->next = the_node; 10ba83: 89 1a mov %ebx,(%edx) the_node->previous = old_last_node; 10ba85: 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 ); 10ba88: 51 push %ecx 10ba89: 9d popf 10ba8a: 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 ); 10ba8b: 66 8b 1d 08 32 12 00 mov 0x123208,%bx 10ba92: 31 c0 xor %eax,%eax 10ba94: 89 c2 mov %eax,%edx 10ba96: 66 0f bc d3 bsf %bx,%dx _Bitfield_Find_first_bit( _Priority_Bit_map[major], minor ); 10ba9a: 0f b7 d2 movzwl %dx,%edx 10ba9d: 66 8b 9c 12 78 32 12 mov 0x123278(%edx,%edx,1),%bx 10baa4: 00 10baa5: 66 0f bc c3 bsf %bx,%ax return (_Priority_Bits_index( major ) << 4) + 10baa9: c1 e2 04 shl $0x4,%edx 10baac: 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; 10baaf: 8d 04 02 lea (%edx,%eax,1),%eax 10bab2: 6b c0 0c imul $0xc,%eax,%eax 10bab5: 03 05 30 31 12 00 add 0x123130,%eax * ready thread. */ RTEMS_INLINE_ROUTINE void _Thread_Calculate_heir( void ) { _Thread_Heir = (Thread_Control *) 10babb: 8b 10 mov (%eax),%edx 10babd: 89 15 ac 33 12 00 mov %edx,0x1233ac * is also the heir thread, and false otherwise. */ RTEMS_INLINE_ROUTINE bool _Thread_Is_executing_also_the_heir( void ) { return ( _Thread_Executing == _Thread_Heir ); 10bac3: a1 a8 33 12 00 mov 0x1233a8,%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() && 10bac8: 39 d0 cmp %edx,%eax 10baca: 74 0d je 10bad9 <_Thread_Change_priority+0x115> 10bacc: 80 78 74 00 cmpb $0x0,0x74(%eax) 10bad0: 74 07 je 10bad9 <_Thread_Change_priority+0x115> _Thread_Executing->is_preemptible ) _Context_Switch_necessary = true; 10bad2: c6 05 b4 33 12 00 01 movb $0x1,0x1233b4 _ISR_Enable( level ); 10bad9: 51 push %ecx 10bada: 9d popf } 10badb: 8d 65 f4 lea -0xc(%ebp),%esp 10bade: 5b pop %ebx 10badf: 5e pop %esi 10bae0: 5f pop %edi 10bae1: c9 leave 10bae2: c3 ret =============================================================================== 0010bae4 <_Thread_Clear_state>: void _Thread_Clear_state( Thread_Control *the_thread, States_Control state ) { 10bae4: 55 push %ebp 10bae5: 89 e5 mov %esp,%ebp 10bae7: 53 push %ebx 10bae8: 8b 45 08 mov 0x8(%ebp),%eax 10baeb: 8b 55 0c mov 0xc(%ebp),%edx ISR_Level level; States_Control current_state; _ISR_Disable( level ); 10baee: 9c pushf 10baef: fa cli 10baf0: 59 pop %ecx current_state = the_thread->current_state; 10baf1: 8b 58 10 mov 0x10(%eax),%ebx if ( current_state & state ) { 10baf4: 85 da test %ebx,%edx 10baf6: 74 71 je 10bb69 <_Thread_Clear_state+0x85> 10baf8: f7 d2 not %edx 10bafa: 21 da and %ebx,%edx current_state = the_thread->current_state = _States_Clear( state, current_state ); 10bafc: 89 50 10 mov %edx,0x10(%eax) if ( _States_Is_ready( current_state ) ) { 10baff: 85 d2 test %edx,%edx 10bb01: 75 66 jne 10bb69 <_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; 10bb03: 8b 90 90 00 00 00 mov 0x90(%eax),%edx 10bb09: 66 8b 98 96 00 00 00 mov 0x96(%eax),%bx 10bb10: 66 09 1a or %bx,(%edx) _Priority_Major_bit_map |= the_priority_map->ready_major; 10bb13: 66 8b 15 08 32 12 00 mov 0x123208,%dx 10bb1a: 0b 90 94 00 00 00 or 0x94(%eax),%edx 10bb20: 66 89 15 08 32 12 00 mov %dx,0x123208 _Priority_Add_to_bit_map( &the_thread->Priority_map ); _Chain_Append_unprotected(the_thread->ready, &the_thread->Object.Node); 10bb27: 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; 10bb2d: 8d 5a 04 lea 0x4(%edx),%ebx 10bb30: 89 18 mov %ebx,(%eax) ) { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); old_last_node = the_chain->last; 10bb32: 8b 5a 08 mov 0x8(%edx),%ebx the_chain->last = the_node; 10bb35: 89 42 08 mov %eax,0x8(%edx) old_last_node->next = the_node; 10bb38: 89 03 mov %eax,(%ebx) the_node->previous = old_last_node; 10bb3a: 89 58 04 mov %ebx,0x4(%eax) _ISR_Flash( level ); 10bb3d: 51 push %ecx 10bb3e: 9d popf 10bb3f: 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 ) { 10bb40: 8b 50 14 mov 0x14(%eax),%edx 10bb43: 8b 1d ac 33 12 00 mov 0x1233ac,%ebx 10bb49: 3b 53 14 cmp 0x14(%ebx),%edx 10bb4c: 73 1b jae 10bb69 <_Thread_Clear_state+0x85> _Thread_Heir = the_thread; 10bb4e: a3 ac 33 12 00 mov %eax,0x1233ac if ( _Thread_Executing->is_preemptible || 10bb53: a1 a8 33 12 00 mov 0x1233a8,%eax 10bb58: 80 78 74 00 cmpb $0x0,0x74(%eax) 10bb5c: 75 04 jne 10bb62 <_Thread_Clear_state+0x7e> 10bb5e: 85 d2 test %edx,%edx 10bb60: 75 07 jne 10bb69 <_Thread_Clear_state+0x85><== ALWAYS TAKEN the_thread->current_priority == 0 ) _Context_Switch_necessary = true; 10bb62: c6 05 b4 33 12 00 01 movb $0x1,0x1233b4 } } } _ISR_Enable( level ); 10bb69: 51 push %ecx 10bb6a: 9d popf } 10bb6b: 5b pop %ebx 10bb6c: c9 leave 10bb6d: c3 ret =============================================================================== 0010bce4 <_Thread_Delay_ended>: void _Thread_Delay_ended( Objects_Id id, void *ignored __attribute__((unused)) ) { 10bce4: 55 push %ebp 10bce5: 89 e5 mov %esp,%ebp 10bce7: 83 ec 20 sub $0x20,%esp Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); 10bcea: 8d 45 f4 lea -0xc(%ebp),%eax 10bced: 50 push %eax 10bcee: ff 75 08 pushl 0x8(%ebp) 10bcf1: e8 82 01 00 00 call 10be78 <_Thread_Get> switch ( location ) { 10bcf6: 83 c4 10 add $0x10,%esp 10bcf9: 83 7d f4 00 cmpl $0x0,-0xc(%ebp) 10bcfd: 75 1b jne 10bd1a <_Thread_Delay_ended+0x36><== NEVER TAKEN #if defined(RTEMS_MULTIPROCESSING) case OBJECTS_REMOTE: /* impossible */ #endif break; case OBJECTS_LOCAL: _Thread_Clear_state( 10bcff: 52 push %edx 10bd00: 52 push %edx 10bd01: 68 18 00 00 10 push $0x10000018 10bd06: 50 push %eax 10bd07: e8 d8 fd ff ff call 10bae4 <_Thread_Clear_state> 10bd0c: a1 64 31 12 00 mov 0x123164,%eax 10bd11: 48 dec %eax 10bd12: a3 64 31 12 00 mov %eax,0x123164 10bd17: 83 c4 10 add $0x10,%esp | STATES_INTERRUPTIBLE_BY_SIGNAL ); _Thread_Unnest_dispatch(); break; } } 10bd1a: c9 leave 10bd1b: c3 ret =============================================================================== 0010bd1c <_Thread_Dispatch>: * dispatch thread * no dispatch thread */ void _Thread_Dispatch( void ) { 10bd1c: 55 push %ebp 10bd1d: 89 e5 mov %esp,%ebp 10bd1f: 57 push %edi 10bd20: 56 push %esi 10bd21: 53 push %ebx 10bd22: 83 ec 1c sub $0x1c,%esp Thread_Control *executing; Thread_Control *heir; ISR_Level level; executing = _Thread_Executing; 10bd25: 8b 1d a8 33 12 00 mov 0x1233a8,%ebx _ISR_Disable( level ); 10bd2b: 9c pushf 10bd2c: fa cli 10bd2d: 58 pop %eax #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ { Timestamp_Control uptime, ran; _TOD_Get_uptime( &uptime ); _Timestamp_Subtract( 10bd2e: 8d 7d d8 lea -0x28(%ebp),%edi Thread_Control *heir; ISR_Level level; executing = _Thread_Executing; _ISR_Disable( level ); while ( _Context_Switch_necessary == true ) { 10bd31: e9 f9 00 00 00 jmp 10be2f <_Thread_Dispatch+0x113> heir = _Thread_Heir; 10bd36: 8b 35 ac 33 12 00 mov 0x1233ac,%esi _Thread_Dispatch_disable_level = 1; 10bd3c: c7 05 64 31 12 00 01 movl $0x1,0x123164 10bd43: 00 00 00 _Context_Switch_necessary = false; 10bd46: c6 05 b4 33 12 00 00 movb $0x0,0x1233b4 _Thread_Executing = heir; 10bd4d: 89 35 a8 33 12 00 mov %esi,0x1233a8 /* * 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 ) 10bd53: 39 de cmp %ebx,%esi 10bd55: 0f 84 e2 00 00 00 je 10be3d <_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 ) 10bd5b: 83 7e 7c 01 cmpl $0x1,0x7c(%esi) 10bd5f: 75 09 jne 10bd6a <_Thread_Dispatch+0x4e> heir->cpu_time_budget = _Thread_Ticks_per_timeslice; 10bd61: 8b 15 34 31 12 00 mov 0x123134,%edx 10bd67: 89 56 78 mov %edx,0x78(%esi) _ISR_Enable( level ); 10bd6a: 50 push %eax 10bd6b: 9d popf #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ { Timestamp_Control uptime, ran; _TOD_Get_uptime( &uptime ); 10bd6c: 83 ec 0c sub $0xc,%esp 10bd6f: 8d 45 e0 lea -0x20(%ebp),%eax 10bd72: 50 push %eax 10bd73: e8 70 2b 00 00 call 10e8e8 <_TOD_Get_uptime> _Timestamp_Subtract( 10bd78: 83 c4 0c add $0xc,%esp 10bd7b: 57 push %edi 10bd7c: 8d 45 e0 lea -0x20(%ebp),%eax 10bd7f: 50 push %eax 10bd80: 68 18 32 12 00 push $0x123218 10bd85: e8 da 0b 00 00 call 10c964 <_Timespec_Subtract> &_Thread_Time_of_last_context_switch, &uptime, &ran ); _Timestamp_Add_to( &executing->cpu_time_used, &ran ); 10bd8a: 58 pop %eax 10bd8b: 5a pop %edx 10bd8c: 57 push %edi 10bd8d: 8d 83 84 00 00 00 lea 0x84(%ebx),%eax 10bd93: 50 push %eax 10bd94: e8 9b 0b 00 00 call 10c934 <_Timespec_Add_to> _Thread_Time_of_last_context_switch = uptime; 10bd99: 8b 45 e0 mov -0x20(%ebp),%eax 10bd9c: 8b 55 e4 mov -0x1c(%ebp),%edx 10bd9f: a3 18 32 12 00 mov %eax,0x123218 10bda4: 89 15 1c 32 12 00 mov %edx,0x12321c #endif /* * Switch libc's task specific data. */ if ( _Thread_libc_reent ) { 10bdaa: a1 ec 31 12 00 mov 0x1231ec,%eax 10bdaf: 83 c4 10 add $0x10,%esp 10bdb2: 85 c0 test %eax,%eax 10bdb4: 74 10 je 10bdc6 <_Thread_Dispatch+0xaa> <== NEVER TAKEN executing->libc_reent = *_Thread_libc_reent; 10bdb6: 8b 10 mov (%eax),%edx 10bdb8: 89 93 ec 00 00 00 mov %edx,0xec(%ebx) *_Thread_libc_reent = heir->libc_reent; 10bdbe: 8b 96 ec 00 00 00 mov 0xec(%esi),%edx 10bdc4: 89 10 mov %edx,(%eax) } _User_extensions_Thread_switch( executing, heir ); 10bdc6: 51 push %ecx 10bdc7: 51 push %ecx 10bdc8: 56 push %esi 10bdc9: 53 push %ebx 10bdca: e8 cd 0d 00 00 call 10cb9c <_User_extensions_Thread_switch> if ( executing->fp_context != NULL ) _Context_Save_fp( &executing->fp_context ); #endif #endif _Context_Switch( &executing->Registers, &heir->Registers ); 10bdcf: 58 pop %eax 10bdd0: 5a pop %edx 10bdd1: 81 c6 d0 00 00 00 add $0xd0,%esi 10bdd7: 56 push %esi 10bdd8: 8d 83 d0 00 00 00 lea 0xd0(%ebx),%eax 10bdde: 50 push %eax 10bddf: e8 7c 10 00 00 call 10ce60 <_CPU_Context_switch> #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) #if ( CPU_USE_DEFERRED_FP_SWITCH == TRUE ) if ( (executing->fp_context != NULL) && 10bde4: 83 c4 10 add $0x10,%esp 10bde7: 83 bb e8 00 00 00 00 cmpl $0x0,0xe8(%ebx) 10bdee: 74 36 je 10be26 <_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 ); 10bdf0: a1 e8 31 12 00 mov 0x1231e8,%eax 10bdf5: 39 c3 cmp %eax,%ebx 10bdf7: 74 2d je 10be26 <_Thread_Dispatch+0x10a> !_Thread_Is_allocated_fp( executing ) ) { if ( _Thread_Allocated_fp != NULL ) 10bdf9: 85 c0 test %eax,%eax 10bdfb: 74 11 je 10be0e <_Thread_Dispatch+0xf2> _Context_Save_fp( &_Thread_Allocated_fp->fp_context ); 10bdfd: 83 ec 0c sub $0xc,%esp 10be00: 05 e8 00 00 00 add $0xe8,%eax 10be05: 50 push %eax 10be06: e8 89 10 00 00 call 10ce94 <_CPU_Context_save_fp> 10be0b: 83 c4 10 add $0x10,%esp _Context_Restore_fp( &executing->fp_context ); 10be0e: 83 ec 0c sub $0xc,%esp 10be11: 8d 83 e8 00 00 00 lea 0xe8(%ebx),%eax 10be17: 50 push %eax 10be18: e8 81 10 00 00 call 10ce9e <_CPU_Context_restore_fp> _Thread_Allocated_fp = executing; 10be1d: 89 1d e8 31 12 00 mov %ebx,0x1231e8 10be23: 83 c4 10 add $0x10,%esp if ( executing->fp_context != NULL ) _Context_Restore_fp( &executing->fp_context ); #endif #endif executing = _Thread_Executing; 10be26: 8b 1d a8 33 12 00 mov 0x1233a8,%ebx _ISR_Disable( level ); 10be2c: 9c pushf 10be2d: fa cli 10be2e: 58 pop %eax Thread_Control *heir; ISR_Level level; executing = _Thread_Executing; _ISR_Disable( level ); while ( _Context_Switch_necessary == true ) { 10be2f: 8a 15 b4 33 12 00 mov 0x1233b4,%dl 10be35: 84 d2 test %dl,%dl 10be37: 0f 85 f9 fe ff ff jne 10bd36 <_Thread_Dispatch+0x1a> _ISR_Disable( level ); } post_switch: _Thread_Dispatch_disable_level = 0; 10be3d: c7 05 64 31 12 00 00 movl $0x0,0x123164 10be44: 00 00 00 _ISR_Enable( level ); 10be47: 50 push %eax 10be48: 9d popf _API_extensions_Run_postswitch(); 10be49: e8 99 ea ff ff call 10a8e7 <_API_extensions_Run_postswitch> } 10be4e: 8d 65 f4 lea -0xc(%ebp),%esp 10be51: 5b pop %ebx 10be52: 5e pop %esi 10be53: 5f pop %edi 10be54: c9 leave 10be55: c3 ret =============================================================================== 0010be78 <_Thread_Get>: Thread_Control *_Thread_Get ( Objects_Id id, Objects_Locations *location ) { 10be78: 55 push %ebp 10be79: 89 e5 mov %esp,%ebp 10be7b: 53 push %ebx 10be7c: 83 ec 04 sub $0x4,%esp 10be7f: 8b 55 08 mov 0x8(%ebp),%edx 10be82: 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 ) ) { 10be85: 85 d2 test %edx,%edx 10be87: 75 1a jne 10bea3 <_Thread_Get+0x2b> rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 10be89: 8b 15 64 31 12 00 mov 0x123164,%edx 10be8f: 42 inc %edx 10be90: 89 15 64 31 12 00 mov %edx,0x123164 _Thread_Disable_dispatch(); *location = OBJECTS_LOCAL; 10be96: c7 00 00 00 00 00 movl $0x0,(%eax) tp = _Thread_Executing; 10be9c: a1 a8 33 12 00 mov 0x1233a8,%eax goto done; 10bea1: eb 3a jmp 10bedd <_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); 10bea3: 89 d1 mov %edx,%ecx 10bea5: c1 e9 18 shr $0x18,%ecx 10bea8: 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 ) 10beab: 8d 59 ff lea -0x1(%ecx),%ebx 10beae: 83 fb 02 cmp $0x2,%ebx 10beb1: 76 2f jbe 10bee2 <_Thread_Get+0x6a> 10beb3: eb 12 jmp 10bec7 <_Thread_Get+0x4f> if ( the_class != 1 ) { /* threads are always first class :) */ *location = OBJECTS_ERROR; goto done; } api_information = _Objects_Information_table[ the_api ]; 10beb5: 8b 0c 8d 3c 31 12 00 mov 0x12313c(,%ecx,4),%ecx if ( !api_information ) { 10bebc: 85 c9 test %ecx,%ecx 10bebe: 74 07 je 10bec7 <_Thread_Get+0x4f> <== NEVER TAKEN *location = OBJECTS_ERROR; goto done; } information = api_information[ the_class ]; 10bec0: 8b 49 04 mov 0x4(%ecx),%ecx if ( !information ) { 10bec3: 85 c9 test %ecx,%ecx 10bec5: 75 0a jne 10bed1 <_Thread_Get+0x59> *location = OBJECTS_ERROR; 10bec7: 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; 10becd: 31 c0 xor %eax,%eax } information = api_information[ the_class ]; if ( !information ) { *location = OBJECTS_ERROR; goto done; 10becf: eb 0c jmp 10bedd <_Thread_Get+0x65> } tp = (Thread_Control *) _Objects_Get( information, id, location ); 10bed1: 53 push %ebx 10bed2: 50 push %eax 10bed3: 52 push %edx 10bed4: 51 push %ecx 10bed5: e8 ce f7 ff ff call 10b6a8 <_Objects_Get> 10beda: 83 c4 10 add $0x10,%esp done: return tp; } 10bedd: 8b 5d fc mov -0x4(%ebp),%ebx 10bee0: c9 leave 10bee1: c3 ret */ RTEMS_INLINE_ROUTINE uint32_t _Objects_Get_class( Objects_Id id ) { return (uint32_t) 10bee2: 89 d3 mov %edx,%ebx 10bee4: 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 :) */ 10bee7: 4b dec %ebx 10bee8: 74 cb je 10beb5 <_Thread_Get+0x3d> 10beea: eb db jmp 10bec7 <_Thread_Get+0x4f> =============================================================================== 00110178 <_Thread_Handler>: * * Output parameters: NONE */ void _Thread_Handler( void ) { 110178: 55 push %ebp 110179: 89 e5 mov %esp,%ebp 11017b: 53 push %ebx 11017c: 83 ec 14 sub $0x14,%esp #if defined(EXECUTE_GLOBAL_CONSTRUCTORS) static char doneConstructors; char doneCons; #endif executing = _Thread_Executing; 11017f: 8b 1d a8 33 12 00 mov 0x1233a8,%ebx /* * have to put level into a register for those cpu's that use * inline asm here */ level = executing->Start.isr_level; 110185: 8b 83 b8 00 00 00 mov 0xb8(%ebx),%eax _ISR_Set_level(level); 11018b: 85 c0 test %eax,%eax 11018d: 74 03 je 110192 <_Thread_Handler+0x1a> 11018f: fa cli 110190: eb 01 jmp 110193 <_Thread_Handler+0x1b> 110192: fb sti #if defined(EXECUTE_GLOBAL_CONSTRUCTORS) doneCons = doneConstructors; 110193: a0 24 2e 12 00 mov 0x122e24,%al 110198: 88 45 f7 mov %al,-0x9(%ebp) doneConstructors = 1; 11019b: c6 05 24 2e 12 00 01 movb $0x1,0x122e24 #endif #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) #if ( CPU_USE_DEFERRED_FP_SWITCH == TRUE ) if ( (executing->fp_context != NULL) && 1101a2: 83 bb e8 00 00 00 00 cmpl $0x0,0xe8(%ebx) 1101a9: 74 24 je 1101cf <_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 ); 1101ab: a1 e8 31 12 00 mov 0x1231e8,%eax 1101b0: 39 c3 cmp %eax,%ebx 1101b2: 74 1b je 1101cf <_Thread_Handler+0x57> !_Thread_Is_allocated_fp( executing ) ) { if ( _Thread_Allocated_fp != NULL ) 1101b4: 85 c0 test %eax,%eax 1101b6: 74 11 je 1101c9 <_Thread_Handler+0x51> _Context_Save_fp( &_Thread_Allocated_fp->fp_context ); 1101b8: 83 ec 0c sub $0xc,%esp 1101bb: 05 e8 00 00 00 add $0xe8,%eax 1101c0: 50 push %eax 1101c1: e8 ce cc ff ff call 10ce94 <_CPU_Context_save_fp> 1101c6: 83 c4 10 add $0x10,%esp _Thread_Allocated_fp = executing; 1101c9: 89 1d e8 31 12 00 mov %ebx,0x1231e8 /* * 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 ); 1101cf: 83 ec 0c sub $0xc,%esp 1101d2: 53 push %ebx 1101d3: e8 74 c8 ff ff call 10ca4c <_User_extensions_Thread_begin> /* * At this point, the dispatch disable level BETTER be 1. */ _Thread_Enable_dispatch(); 1101d8: e8 79 bc ff ff call 10be56 <_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) */ { 1101dd: 83 c4 10 add $0x10,%esp 1101e0: 80 7d f7 00 cmpb $0x0,-0x9(%ebp) 1101e4: 75 05 jne 1101eb <_Thread_Handler+0x73> INIT_NAME (); 1101e6: e8 35 c0 00 00 call 11c220 <__start_set_sysctl_set> } #endif if ( executing->Start.prototype == THREAD_START_NUMERIC ) { 1101eb: 83 bb a0 00 00 00 00 cmpl $0x0,0xa0(%ebx) 1101f2: 75 15 jne 110209 <_Thread_Handler+0x91> <== NEVER TAKEN executing->Wait.return_argument = (*(Thread_Entry_numeric) executing->Start.entry_point)( 1101f4: 83 ec 0c sub $0xc,%esp 1101f7: ff b3 a8 00 00 00 pushl 0xa8(%ebx) 1101fd: ff 93 9c 00 00 00 call *0x9c(%ebx) INIT_NAME (); } #endif if ( executing->Start.prototype == THREAD_START_NUMERIC ) { executing->Wait.return_argument = 110203: 89 43 28 mov %eax,0x28(%ebx) 110206: 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 ); 110209: 83 ec 0c sub $0xc,%esp 11020c: 53 push %ebx 11020d: e8 6b c8 ff ff call 10ca7d <_User_extensions_Thread_exitted> _Internal_error_Occurred( 110212: 83 c4 0c add $0xc,%esp 110215: 6a 05 push $0x5 110217: 6a 01 push $0x1 110219: 6a 00 push $0x0 11021b: e8 cc af ff ff call 10b1ec <_Internal_error_Occurred> =============================================================================== 0010beec <_Thread_Initialize>: Thread_CPU_budget_algorithms budget_algorithm, Thread_CPU_budget_algorithm_callout budget_callout, uint32_t isr_level, Objects_Name name ) { 10beec: 55 push %ebp 10beed: 89 e5 mov %esp,%ebp 10beef: 57 push %edi 10bef0: 56 push %esi 10bef1: 53 push %ebx 10bef2: 83 ec 24 sub $0x24,%esp 10bef5: 8b 5d 0c mov 0xc(%ebp),%ebx 10bef8: 8b 75 14 mov 0x14(%ebp),%esi 10befb: 8a 55 18 mov 0x18(%ebp),%dl 10befe: 8a 45 20 mov 0x20(%ebp),%al 10bf01: 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; 10bf04: c7 83 f0 00 00 00 00 movl $0x0,0xf0(%ebx) 10bf0b: 00 00 00 10bf0e: c7 83 f4 00 00 00 00 movl $0x0,0xf4(%ebx) 10bf15: 00 00 00 extensions_area = NULL; the_thread->libc_reent = NULL; 10bf18: c7 83 ec 00 00 00 00 movl $0x0,0xec(%ebx) 10bf1f: 00 00 00 /* * Allocate and Initialize the stack for this thread. */ #if !defined(RTEMS_SCORE_THREAD_ENABLE_USER_PROVIDED_STACK_VIA_API) actual_stack_size = _Thread_Stack_Allocate( the_thread, stack_size ); 10bf22: 56 push %esi 10bf23: 53 push %ebx 10bf24: 88 55 e0 mov %dl,-0x20(%ebp) 10bf27: e8 44 08 00 00 call 10c770 <_Thread_Stack_Allocate> if ( !actual_stack_size || actual_stack_size < stack_size ) 10bf2c: 83 c4 10 add $0x10,%esp 10bf2f: 39 f0 cmp %esi,%eax 10bf31: 8a 55 e0 mov -0x20(%ebp),%dl 10bf34: 0f 82 a1 01 00 00 jb 10c0db <_Thread_Initialize+0x1ef> 10bf3a: 85 c0 test %eax,%eax 10bf3c: 0f 84 99 01 00 00 je 10c0db <_Thread_Initialize+0x1ef><== NEVER TAKEN Stack_Control *the_stack, void *starting_address, size_t size ) { the_stack->area = starting_address; 10bf42: 8b 8b cc 00 00 00 mov 0xcc(%ebx),%ecx 10bf48: 89 8b c4 00 00 00 mov %ecx,0xc4(%ebx) the_stack->size = size; 10bf4e: 89 83 c0 00 00 00 mov %eax,0xc0(%ebx) extensions_area = NULL; the_thread->libc_reent = NULL; #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) fp_area = NULL; 10bf54: 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 ) { 10bf56: 84 d2 test %dl,%dl 10bf58: 74 17 je 10bf71 <_Thread_Initialize+0x85> fp_area = _Workspace_Allocate( CONTEXT_FP_SIZE ); 10bf5a: 83 ec 0c sub $0xc,%esp 10bf5d: 6a 6c push $0x6c 10bf5f: e8 9e 0e 00 00 call 10ce02 <_Workspace_Allocate> 10bf64: 89 c7 mov %eax,%edi if ( !fp_area ) 10bf66: 83 c4 10 add $0x10,%esp 10bf69: 85 c0 test %eax,%eax 10bf6b: 0f 84 fa 00 00 00 je 10c06b <_Thread_Initialize+0x17f> goto failed; fp_area = _Context_Fp_start( fp_area, 0 ); } the_thread->fp_context = fp_area; 10bf71: 89 bb e8 00 00 00 mov %edi,0xe8(%ebx) the_thread->Start.fp_context = fp_area; 10bf77: 89 bb c8 00 00 00 mov %edi,0xc8(%ebx) Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 10bf7d: c7 43 50 00 00 00 00 movl $0x0,0x50(%ebx) the_watchdog->routine = routine; 10bf84: c7 43 64 00 00 00 00 movl $0x0,0x64(%ebx) the_watchdog->id = id; 10bf8b: c7 43 68 00 00 00 00 movl $0x0,0x68(%ebx) the_watchdog->user_data = user_data; 10bf92: c7 43 6c 00 00 00 00 movl $0x0,0x6c(%ebx) #endif /* * Allocate the extensions area for this thread */ if ( _Thread_Maximum_extensions ) { 10bf99: a1 f8 31 12 00 mov 0x1231f8,%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; 10bf9e: 31 f6 xor %esi,%esi #endif /* * Allocate the extensions area for this thread */ if ( _Thread_Maximum_extensions ) { 10bfa0: 85 c0 test %eax,%eax 10bfa2: 74 1d je 10bfc1 <_Thread_Initialize+0xd5> extensions_area = _Workspace_Allocate( 10bfa4: 83 ec 0c sub $0xc,%esp 10bfa7: 8d 04 85 04 00 00 00 lea 0x4(,%eax,4),%eax 10bfae: 50 push %eax 10bfaf: e8 4e 0e 00 00 call 10ce02 <_Workspace_Allocate> 10bfb4: 89 c6 mov %eax,%esi (_Thread_Maximum_extensions + 1) * sizeof( void * ) ); if ( !extensions_area ) 10bfb6: 83 c4 10 add $0x10,%esp 10bfb9: 85 c0 test %eax,%eax 10bfbb: 0f 84 ac 00 00 00 je 10c06d <_Thread_Initialize+0x181> goto failed; } the_thread->extensions = (void **) extensions_area; 10bfc1: 89 b3 f8 00 00 00 mov %esi,0xf8(%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 ) { 10bfc7: 85 f6 test %esi,%esi 10bfc9: 74 16 je 10bfe1 <_Thread_Initialize+0xf5> for ( i = 0; i <= _Thread_Maximum_extensions ; i++ ) 10bfcb: 8b 15 f8 31 12 00 mov 0x1231f8,%edx 10bfd1: 31 c0 xor %eax,%eax 10bfd3: eb 08 jmp 10bfdd <_Thread_Initialize+0xf1> the_thread->extensions[i] = NULL; 10bfd5: 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++ ) 10bfdc: 40 inc %eax 10bfdd: 39 d0 cmp %edx,%eax 10bfdf: 76 f4 jbe 10bfd5 <_Thread_Initialize+0xe9> /* * General initialization */ the_thread->Start.is_preemptible = is_preemptible; 10bfe1: 8a 45 e7 mov -0x19(%ebp),%al 10bfe4: 88 83 ac 00 00 00 mov %al,0xac(%ebx) the_thread->Start.budget_algorithm = budget_algorithm; 10bfea: 8b 45 24 mov 0x24(%ebp),%eax 10bfed: 89 83 b0 00 00 00 mov %eax,0xb0(%ebx) the_thread->Start.budget_callout = budget_callout; 10bff3: 8b 45 28 mov 0x28(%ebp),%eax 10bff6: 89 83 b4 00 00 00 mov %eax,0xb4(%ebx) case THREAD_CPU_BUDGET_ALGORITHM_CALLOUT: break; #endif } the_thread->Start.isr_level = isr_level; 10bffc: 8b 45 2c mov 0x2c(%ebp),%eax 10bfff: 89 83 b8 00 00 00 mov %eax,0xb8(%ebx) the_thread->current_state = STATES_DORMANT; 10c005: c7 43 10 01 00 00 00 movl $0x1,0x10(%ebx) the_thread->Wait.queue = NULL; 10c00c: c7 43 44 00 00 00 00 movl $0x0,0x44(%ebx) the_thread->resource_count = 0; 10c013: c7 43 1c 00 00 00 00 movl $0x0,0x1c(%ebx) the_thread->real_priority = priority; 10c01a: 8b 45 1c mov 0x1c(%ebp),%eax 10c01d: 89 43 18 mov %eax,0x18(%ebx) the_thread->Start.initial_priority = priority; 10c020: 89 83 bc 00 00 00 mov %eax,0xbc(%ebx) _Thread_Set_priority( the_thread, priority ); 10c026: 52 push %edx 10c027: 52 push %edx 10c028: 50 push %eax 10c029: 53 push %ebx 10c02a: e8 95 05 00 00 call 10c5c4 <_Thread_Set_priority> /* * Initialize the CPU usage statistics */ #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ _Timestamp_Set_to_zero( &the_thread->cpu_time_used ); 10c02f: c7 83 84 00 00 00 00 movl $0x0,0x84(%ebx) 10c036: 00 00 00 10c039: c7 83 88 00 00 00 00 movl $0x0,0x88(%ebx) 10c040: 00 00 00 _Thread_Stack_Free( the_thread ); return false; } 10c043: 8b 45 08 mov 0x8(%ebp),%eax 10c046: 8b 40 1c mov 0x1c(%eax),%eax Objects_Information *information, Objects_Control *the_object, Objects_Name name ) { _Objects_Set_local_object( 10c049: 0f b7 53 08 movzwl 0x8(%ebx),%edx #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 10c04d: 89 1c 90 mov %ebx,(%eax,%edx,4) information, _Objects_Get_index( the_object->id ), the_object ); the_object->name = name; 10c050: 8b 45 30 mov 0x30(%ebp),%eax 10c053: 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 ); 10c056: 89 1c 24 mov %ebx,(%esp) 10c059: e8 8e 0a 00 00 call 10caec <_User_extensions_Thread_create> 10c05e: 88 c2 mov %al,%dl if ( extension_status ) 10c060: 83 c4 10 add $0x10,%esp return true; 10c063: 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 ) 10c065: 84 d2 test %dl,%dl 10c067: 74 04 je 10c06d <_Thread_Initialize+0x181> 10c069: eb 72 jmp 10c0dd <_Thread_Initialize+0x1f1> * Zero out all the allocated memory fields */ for ( i=0 ; i <= THREAD_API_LAST ; i++ ) the_thread->API_Extensions[i] = NULL; extensions_area = NULL; 10c06b: 31 f6 xor %esi,%esi extension_status = _User_extensions_Thread_create( the_thread ); if ( extension_status ) return true; failed: if ( the_thread->libc_reent ) 10c06d: 8b 83 ec 00 00 00 mov 0xec(%ebx),%eax 10c073: 85 c0 test %eax,%eax 10c075: 74 0c je 10c083 <_Thread_Initialize+0x197> _Workspace_Free( the_thread->libc_reent ); 10c077: 83 ec 0c sub $0xc,%esp 10c07a: 50 push %eax 10c07b: e8 9b 0d 00 00 call 10ce1b <_Workspace_Free> 10c080: 83 c4 10 add $0x10,%esp for ( i=0 ; i <= THREAD_API_LAST ; i++ ) if ( the_thread->API_Extensions[i] ) 10c083: 8b 83 f0 00 00 00 mov 0xf0(%ebx),%eax 10c089: 85 c0 test %eax,%eax 10c08b: 74 0c je 10c099 <_Thread_Initialize+0x1ad> _Workspace_Free( the_thread->API_Extensions[i] ); 10c08d: 83 ec 0c sub $0xc,%esp 10c090: 50 push %eax 10c091: e8 85 0d 00 00 call 10ce1b <_Workspace_Free> 10c096: 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] ) 10c099: 8b 83 f4 00 00 00 mov 0xf4(%ebx),%eax 10c09f: 85 c0 test %eax,%eax 10c0a1: 74 0c je 10c0af <_Thread_Initialize+0x1c3><== ALWAYS TAKEN _Workspace_Free( the_thread->API_Extensions[i] ); 10c0a3: 83 ec 0c sub $0xc,%esp <== NOT EXECUTED 10c0a6: 50 push %eax <== NOT EXECUTED 10c0a7: e8 6f 0d 00 00 call 10ce1b <_Workspace_Free> <== NOT EXECUTED 10c0ac: 83 c4 10 add $0x10,%esp <== NOT EXECUTED if ( extensions_area ) 10c0af: 85 f6 test %esi,%esi 10c0b1: 74 0c je 10c0bf <_Thread_Initialize+0x1d3> (void) _Workspace_Free( extensions_area ); 10c0b3: 83 ec 0c sub $0xc,%esp 10c0b6: 56 push %esi 10c0b7: e8 5f 0d 00 00 call 10ce1b <_Workspace_Free> 10c0bc: 83 c4 10 add $0x10,%esp #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) if ( fp_area ) 10c0bf: 85 ff test %edi,%edi 10c0c1: 74 0c je 10c0cf <_Thread_Initialize+0x1e3> (void) _Workspace_Free( fp_area ); 10c0c3: 83 ec 0c sub $0xc,%esp 10c0c6: 57 push %edi 10c0c7: e8 4f 0d 00 00 call 10ce1b <_Workspace_Free> 10c0cc: 83 c4 10 add $0x10,%esp #endif _Thread_Stack_Free( the_thread ); 10c0cf: 83 ec 0c sub $0xc,%esp 10c0d2: 53 push %ebx 10c0d3: e8 e8 06 00 00 call 10c7c0 <_Thread_Stack_Free> return false; 10c0d8: 83 c4 10 add $0x10,%esp * Allocate and Initialize the stack for this thread. */ #if !defined(RTEMS_SCORE_THREAD_ENABLE_USER_PROVIDED_STACK_VIA_API) actual_stack_size = _Thread_Stack_Allocate( the_thread, stack_size ); if ( !actual_stack_size || actual_stack_size < stack_size ) return false; /* stack allocation failed */ 10c0db: 31 c0 xor %eax,%eax _Thread_Stack_Free( the_thread ); return false; } 10c0dd: 8d 65 f4 lea -0xc(%ebp),%esp 10c0e0: 5b pop %ebx 10c0e1: 5e pop %esi 10c0e2: 5f pop %edi 10c0e3: c9 leave 10c0e4: c3 ret =============================================================================== 0010f360 <_Thread_Resume>: void _Thread_Resume( Thread_Control *the_thread, bool force ) { 10f360: 55 push %ebp 10f361: 89 e5 mov %esp,%ebp 10f363: 53 push %ebx 10f364: 8b 45 08 mov 0x8(%ebp),%eax ISR_Level level; States_Control current_state; _ISR_Disable( level ); 10f367: 9c pushf 10f368: fa cli 10f369: 59 pop %ecx current_state = the_thread->current_state; 10f36a: 8b 50 10 mov 0x10(%eax),%edx if ( current_state & STATES_SUSPENDED ) { 10f36d: f6 c2 02 test $0x2,%dl 10f370: 74 70 je 10f3e2 <_Thread_Resume+0x82> <== NEVER TAKEN 10f372: 83 e2 fd and $0xfffffffd,%edx current_state = the_thread->current_state = _States_Clear(STATES_SUSPENDED, current_state); 10f375: 89 50 10 mov %edx,0x10(%eax) if ( _States_Is_ready( current_state ) ) { 10f378: 85 d2 test %edx,%edx 10f37a: 75 66 jne 10f3e2 <_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; 10f37c: 8b 90 90 00 00 00 mov 0x90(%eax),%edx 10f382: 66 8b 98 96 00 00 00 mov 0x96(%eax),%bx 10f389: 66 09 1a or %bx,(%edx) _Priority_Major_bit_map |= the_priority_map->ready_major; 10f38c: 66 8b 15 d8 62 12 00 mov 0x1262d8,%dx 10f393: 0b 90 94 00 00 00 or 0x94(%eax),%edx 10f399: 66 89 15 d8 62 12 00 mov %dx,0x1262d8 _Priority_Add_to_bit_map( &the_thread->Priority_map ); _Chain_Append_unprotected(the_thread->ready, &the_thread->Object.Node); 10f3a0: 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; 10f3a6: 8d 5a 04 lea 0x4(%edx),%ebx 10f3a9: 89 18 mov %ebx,(%eax) ) { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); old_last_node = the_chain->last; 10f3ab: 8b 5a 08 mov 0x8(%edx),%ebx the_chain->last = the_node; 10f3ae: 89 42 08 mov %eax,0x8(%edx) old_last_node->next = the_node; 10f3b1: 89 03 mov %eax,(%ebx) the_node->previous = old_last_node; 10f3b3: 89 58 04 mov %ebx,0x4(%eax) _ISR_Flash( level ); 10f3b6: 51 push %ecx 10f3b7: 9d popf 10f3b8: fa cli if ( the_thread->current_priority < _Thread_Heir->current_priority ) { 10f3b9: 8b 50 14 mov 0x14(%eax),%edx 10f3bc: 8b 1d 7c 64 12 00 mov 0x12647c,%ebx 10f3c2: 3b 53 14 cmp 0x14(%ebx),%edx 10f3c5: 73 1b jae 10f3e2 <_Thread_Resume+0x82> _Thread_Heir = the_thread; 10f3c7: a3 7c 64 12 00 mov %eax,0x12647c if ( _Thread_Executing->is_preemptible || 10f3cc: a1 78 64 12 00 mov 0x126478,%eax 10f3d1: 80 78 74 00 cmpb $0x0,0x74(%eax) 10f3d5: 75 04 jne 10f3db <_Thread_Resume+0x7b> 10f3d7: 85 d2 test %edx,%edx 10f3d9: 75 07 jne 10f3e2 <_Thread_Resume+0x82> <== ALWAYS TAKEN the_thread->current_priority == 0 ) _Context_Switch_necessary = true; 10f3db: c6 05 84 64 12 00 01 movb $0x1,0x126484 } } } _ISR_Enable( level ); 10f3e2: 51 push %ecx 10f3e3: 9d popf } 10f3e4: 5b pop %ebx 10f3e5: c9 leave 10f3e6: c3 ret =============================================================================== 0010c8d8 <_Thread_Yield_processor>: * ready chain * select heir */ void _Thread_Yield_processor( void ) { 10c8d8: 55 push %ebp 10c8d9: 89 e5 mov %esp,%ebp 10c8db: 57 push %edi 10c8dc: 56 push %esi 10c8dd: 53 push %ebx ISR_Level level; Thread_Control *executing; Chain_Control *ready; executing = _Thread_Executing; 10c8de: a1 a8 33 12 00 mov 0x1233a8,%eax ready = executing->ready; 10c8e3: 8b 90 8c 00 00 00 mov 0x8c(%eax),%edx _ISR_Disable( level ); 10c8e9: 9c pushf 10c8ea: fa cli 10c8eb: 5b pop %ebx */ RTEMS_INLINE_ROUTINE bool _Chain_Has_only_one_node( const Chain_Control *the_chain ) { return (the_chain->first == the_chain->last); 10c8ec: 8b 4a 08 mov 0x8(%edx),%ecx if ( !_Chain_Has_only_one_node( ready ) ) { 10c8ef: 39 0a cmp %ecx,(%edx) 10c8f1: 74 2b je 10c91e <_Thread_Yield_processor+0x46> ) { Chain_Node *next; Chain_Node *previous; next = the_node->next; 10c8f3: 8b 38 mov (%eax),%edi previous = the_node->previous; 10c8f5: 8b 70 04 mov 0x4(%eax),%esi next->previous = previous; 10c8f8: 89 77 04 mov %esi,0x4(%edi) previous->next = next; 10c8fb: 89 3e mov %edi,(%esi) */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 10c8fd: 8d 72 04 lea 0x4(%edx),%esi 10c900: 89 30 mov %esi,(%eax) { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); old_last_node = the_chain->last; the_chain->last = the_node; 10c902: 89 42 08 mov %eax,0x8(%edx) old_last_node->next = the_node; 10c905: 89 01 mov %eax,(%ecx) the_node->previous = old_last_node; 10c907: 89 48 04 mov %ecx,0x4(%eax) _Chain_Extract_unprotected( &executing->Object.Node ); _Chain_Append_unprotected( ready, &executing->Object.Node ); _ISR_Flash( level ); 10c90a: 53 push %ebx 10c90b: 9d popf 10c90c: fa cli if ( _Thread_Is_heir( executing ) ) 10c90d: 3b 05 ac 33 12 00 cmp 0x1233ac,%eax 10c913: 75 11 jne 10c926 <_Thread_Yield_processor+0x4e><== NEVER TAKEN _Thread_Heir = (Thread_Control *) ready->first; 10c915: 8b 02 mov (%edx),%eax 10c917: a3 ac 33 12 00 mov %eax,0x1233ac 10c91c: eb 08 jmp 10c926 <_Thread_Yield_processor+0x4e> _Context_Switch_necessary = true; } else if ( !_Thread_Is_heir( executing ) ) 10c91e: 3b 05 ac 33 12 00 cmp 0x1233ac,%eax 10c924: 74 07 je 10c92d <_Thread_Yield_processor+0x55><== ALWAYS TAKEN _Context_Switch_necessary = true; 10c926: c6 05 b4 33 12 00 01 movb $0x1,0x1233b4 _ISR_Enable( level ); 10c92d: 53 push %ebx 10c92e: 9d popf } 10c92f: 5b pop %ebx 10c930: 5e pop %esi 10c931: 5f pop %edi 10c932: c9 leave 10c933: c3 ret =============================================================================== 0010ed70 <_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 ) { 10ed70: 55 push %ebp 10ed71: 89 e5 mov %esp,%ebp 10ed73: 57 push %edi 10ed74: 56 push %esi 10ed75: 53 push %ebx 10ed76: 83 ec 1c sub $0x1c,%esp 10ed79: 8b 5d 0c mov 0xc(%ebp),%ebx 10ed7c: 8a 45 10 mov 0x10(%ebp),%al 10ed7f: 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 ); 10ed82: 9c pushf 10ed83: fa cli 10ed84: 8f 45 e4 popl -0x1c(%ebp) if ( !_States_Is_waiting_on_thread_queue( the_thread->current_state ) ) { 10ed87: f7 43 10 e0 be 03 00 testl $0x3bee0,0x10(%ebx) 10ed8e: 75 09 jne 10ed99 <_Thread_queue_Extract_priority_helper+0x29> _ISR_Enable( level ); 10ed90: ff 75 e4 pushl -0x1c(%ebp) 10ed93: 9d popf return; 10ed94: e9 82 00 00 00 jmp 10ee1b <_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; 10ed99: 8b 13 mov (%ebx),%edx previous_node = the_node->previous; 10ed9b: 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)); 10ed9e: 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; 10eda1: 8d 73 3c lea 0x3c(%ebx),%esi if ( !_Chain_Is_empty( &the_thread->Wait.Block2n ) ) { 10eda4: 39 f0 cmp %esi,%eax 10eda6: 74 26 je 10edce <_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; 10eda8: 8b 73 40 mov 0x40(%ebx),%esi new_second_node = new_first_node->next; 10edab: 8b 38 mov (%eax),%edi previous_node->next = new_first_node; 10edad: 89 01 mov %eax,(%ecx) next_node->previous = new_first_node; 10edaf: 89 42 04 mov %eax,0x4(%edx) new_first_node->next = next_node; 10edb2: 89 10 mov %edx,(%eax) new_first_node->previous = previous_node; 10edb4: 89 48 04 mov %ecx,0x4(%eax) if ( !_Chain_Has_only_one_node( &the_thread->Wait.Block2n ) ) { 10edb7: 39 f0 cmp %esi,%eax 10edb9: 74 18 je 10edd3 <_Thread_queue_Extract_priority_helper+0x63> /* > two threads on 2-n */ new_second_node->previous = _Chain_Head( &new_first_thread->Wait.Block2n ); 10edbb: 8d 50 38 lea 0x38(%eax),%edx 10edbe: 89 57 04 mov %edx,0x4(%edi) new_first_thread->Wait.Block2n.first = new_second_node; 10edc1: 89 78 38 mov %edi,0x38(%eax) new_first_thread->Wait.Block2n.last = last_node; 10edc4: 89 70 40 mov %esi,0x40(%eax) 10edc7: 83 c0 3c add $0x3c,%eax 10edca: 89 06 mov %eax,(%esi) 10edcc: eb 05 jmp 10edd3 <_Thread_queue_Extract_priority_helper+0x63> last_node->next = _Chain_Tail( &new_first_thread->Wait.Block2n ); } } else { previous_node->next = next_node; 10edce: 89 11 mov %edx,(%ecx) next_node->previous = previous_node; 10edd0: 89 4a 04 mov %ecx,0x4(%edx) /* * If we are not supposed to touch timers or the thread's state, return. */ if ( requeuing ) { 10edd3: 80 7d e3 00 cmpb $0x0,-0x1d(%ebp) 10edd7: 74 06 je 10eddf <_Thread_queue_Extract_priority_helper+0x6f> _ISR_Enable( level ); 10edd9: ff 75 e4 pushl -0x1c(%ebp) 10eddc: 9d popf 10eddd: eb 3c jmp 10ee1b <_Thread_queue_Extract_priority_helper+0xab> return; } if ( !_Watchdog_Is_active( &the_thread->Timer ) ) { 10eddf: 83 7b 50 02 cmpl $0x2,0x50(%ebx) 10ede3: 74 06 je 10edeb <_Thread_queue_Extract_priority_helper+0x7b><== NEVER TAKEN _ISR_Enable( level ); 10ede5: ff 75 e4 pushl -0x1c(%ebp) 10ede8: 9d popf 10ede9: eb 1a jmp 10ee05 <_Thread_queue_Extract_priority_helper+0x95> 10edeb: c7 43 50 03 00 00 00 movl $0x3,0x50(%ebx) <== NOT EXECUTED } else { _Watchdog_Deactivate( &the_thread->Timer ); _ISR_Enable( level ); 10edf2: ff 75 e4 pushl -0x1c(%ebp) <== NOT EXECUTED 10edf5: 9d popf <== NOT EXECUTED (void) _Watchdog_Remove( &the_thread->Timer ); 10edf6: 83 ec 0c sub $0xc,%esp <== NOT EXECUTED 10edf9: 8d 43 48 lea 0x48(%ebx),%eax <== NOT EXECUTED 10edfc: 50 push %eax <== NOT EXECUTED 10edfd: e8 e6 de ff ff call 10cce8 <_Watchdog_Remove> <== NOT EXECUTED 10ee02: 83 c4 10 add $0x10,%esp <== NOT EXECUTED 10ee05: c7 45 0c f8 ff 03 10 movl $0x1003fff8,0xc(%ebp) 10ee0c: 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 } 10ee0f: 8d 65 f4 lea -0xc(%ebp),%esp 10ee12: 5b pop %ebx 10ee13: 5e pop %esi 10ee14: 5f pop %edi 10ee15: c9 leave 10ee16: e9 c9 cc ff ff jmp 10bae4 <_Thread_Clear_state> 10ee1b: 8d 65 f4 lea -0xc(%ebp),%esp 10ee1e: 5b pop %ebx 10ee1f: 5e pop %esi 10ee20: 5f pop %edi 10ee21: c9 leave 10ee22: c3 ret =============================================================================== 0010c53c <_Thread_queue_Requeue>: void _Thread_queue_Requeue( Thread_queue_Control *the_thread_queue, Thread_Control *the_thread ) { 10c53c: 55 push %ebp 10c53d: 89 e5 mov %esp,%ebp 10c53f: 57 push %edi 10c540: 56 push %esi 10c541: 53 push %ebx 10c542: 83 ec 1c sub $0x1c,%esp 10c545: 8b 75 08 mov 0x8(%ebp),%esi 10c548: 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 ) 10c54b: 85 f6 test %esi,%esi 10c54d: 74 36 je 10c585 <_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 ) { 10c54f: 83 7e 34 01 cmpl $0x1,0x34(%esi) 10c553: 75 30 jne 10c585 <_Thread_queue_Requeue+0x49><== NEVER TAKEN Thread_queue_Control *tq = the_thread_queue; ISR_Level level; ISR_Level level_ignored; _ISR_Disable( level ); 10c555: 9c pushf 10c556: fa cli 10c557: 5b pop %ebx if ( _States_Is_waiting_on_thread_queue( the_thread->current_state ) ) { 10c558: f7 47 10 e0 be 03 00 testl $0x3bee0,0x10(%edi) 10c55f: 74 22 je 10c583 <_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; 10c561: 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 ); 10c568: 50 push %eax 10c569: 6a 01 push $0x1 10c56b: 57 push %edi 10c56c: 56 push %esi 10c56d: e8 fe 27 00 00 call 10ed70 <_Thread_queue_Extract_priority_helper> (void) _Thread_queue_Enqueue_priority( tq, the_thread, &level_ignored ); 10c572: 83 c4 0c add $0xc,%esp 10c575: 8d 45 e4 lea -0x1c(%ebp),%eax 10c578: 50 push %eax 10c579: 57 push %edi 10c57a: 56 push %esi 10c57b: e8 c4 fd ff ff call 10c344 <_Thread_queue_Enqueue_priority> 10c580: 83 c4 10 add $0x10,%esp } _ISR_Enable( level ); 10c583: 53 push %ebx 10c584: 9d popf } } 10c585: 8d 65 f4 lea -0xc(%ebp),%esp 10c588: 5b pop %ebx 10c589: 5e pop %esi 10c58a: 5f pop %edi 10c58b: c9 leave 10c58c: c3 ret =============================================================================== 0010c590 <_Thread_queue_Timeout>: void _Thread_queue_Timeout( Objects_Id id, void *ignored __attribute__((unused)) ) { 10c590: 55 push %ebp 10c591: 89 e5 mov %esp,%ebp 10c593: 83 ec 20 sub $0x20,%esp Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); 10c596: 8d 45 f4 lea -0xc(%ebp),%eax 10c599: 50 push %eax 10c59a: ff 75 08 pushl 0x8(%ebp) 10c59d: e8 d6 f8 ff ff call 10be78 <_Thread_Get> switch ( location ) { 10c5a2: 83 c4 10 add $0x10,%esp 10c5a5: 83 7d f4 00 cmpl $0x0,-0xc(%ebp) 10c5a9: 75 17 jne 10c5c2 <_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 ); 10c5ab: 83 ec 0c sub $0xc,%esp 10c5ae: 50 push %eax 10c5af: e8 70 28 00 00 call 10ee24 <_Thread_queue_Process_timeout> */ RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void ) { RTEMS_COMPILER_MEMORY_BARRIER(); _Thread_Dispatch_disable_level -= 1; 10c5b4: a1 64 31 12 00 mov 0x123164,%eax 10c5b9: 48 dec %eax 10c5ba: a3 64 31 12 00 mov %eax,0x123164 10c5bf: 83 c4 10 add $0x10,%esp _Thread_Unnest_dispatch(); break; } } 10c5c2: c9 leave 10c5c3: 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 70 c6 13 00 mov 0x13c670,%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 f4 37 00 00 call 11a2cc <_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 c4 c5 13 00 mov 0x13c5c4,%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 d0 37 00 00 call 11a2cc <_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 53 37 00 00 call 11a260 <_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 8a 08 00 00 call 1173ac <_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> 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 116b2c: 83 fa 01 cmp $0x1,%edx 116b2f: 75 0b jne 116b3c <_Timer_server_Body+0xcc> _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); 116b31: 52 push %edx 116b32: 52 push %edx 116b33: 83 c0 10 add $0x10,%eax 116b36: 50 push %eax 116b37: ff 75 c0 pushl -0x40(%ebp) 116b3a: eb 0c jmp 116b48 <_Timer_server_Body+0xd8> } else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) { 116b3c: 83 fa 03 cmp $0x3,%edx 116b3f: 75 d5 jne 116b16 <_Timer_server_Body+0xa6><== NEVER TAKEN _Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker ); 116b41: 51 push %ecx 116b42: 51 push %ecx 116b43: 83 c0 10 add $0x10,%eax 116b46: 50 push %eax 116b47: 56 push %esi 116b48: e8 07 38 00 00 call 11a354 <_Watchdog_Insert> 116b4d: 83 c4 10 add $0x10,%esp 116b50: eb c4 jmp 116b16 <_Timer_server_Body+0xa6> * 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 a6 2f 00 00 call 119b68 <_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 b1 26 00 00 call 119286 <_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 8a 38 00 00 call 11a46c <_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 7f 38 00 00 call 11a46c <_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> * 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 70 c6 13 00 mov 0x13c670,%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 f1 36 00 00 call 11a354 <_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 c4 c5 13 00 mov 0x13c5c4,%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 84 36 00 00 call 11a354 <_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 99 25 00 00 jmp 119286 <_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 116cf0: 89 75 0c mov %esi,0xc(%ebp) 116cf3: 89 45 08 mov %eax,0x8(%ebp) } } 116cf6: 8d 65 f4 lea -0xc(%ebp),%esp 116cf9: 5b pop %ebx 116cfa: 5e pop %esi 116cfb: 5f pop %edi 116cfc: c9 leave * 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 6e 06 00 00 jmp 117370 <_Chain_Append> =============================================================================== 0010e22c <_Timespec_Greater_than>: bool _Timespec_Greater_than( const struct timespec *lhs, const struct timespec *rhs ) { 10e22c: 55 push %ebp 10e22d: 89 e5 mov %esp,%ebp 10e22f: 53 push %ebx 10e230: 8b 4d 08 mov 0x8(%ebp),%ecx 10e233: 8b 55 0c mov 0xc(%ebp),%edx if ( lhs->tv_sec > rhs->tv_sec ) return true; 10e236: b0 01 mov $0x1,%al bool _Timespec_Greater_than( const struct timespec *lhs, const struct timespec *rhs ) { if ( lhs->tv_sec > rhs->tv_sec ) 10e238: 8b 1a mov (%edx),%ebx 10e23a: 39 19 cmp %ebx,(%ecx) 10e23c: 7f 0d jg 10e24b <_Timespec_Greater_than+0x1f> return true; if ( lhs->tv_sec < rhs->tv_sec ) return false; 10e23e: b0 00 mov $0x0,%al ) { if ( lhs->tv_sec > rhs->tv_sec ) return true; if ( lhs->tv_sec < rhs->tv_sec ) 10e240: 7c 09 jl 10e24b <_Timespec_Greater_than+0x1f><== NEVER TAKEN #include #include #include bool _Timespec_Greater_than( 10e242: 8b 42 04 mov 0x4(%edx),%eax 10e245: 39 41 04 cmp %eax,0x4(%ecx) 10e248: 0f 9f c0 setg %al /* ASSERT: lhs->tv_sec == rhs->tv_sec */ if ( lhs->tv_nsec > rhs->tv_nsec ) return true; return false; } 10e24b: 5b pop %ebx 10e24c: c9 leave 10e24d: c3 ret =============================================================================== 0010caaf <_User_extensions_Fatal>: void _User_extensions_Fatal ( Internal_errors_Source the_source, bool is_internal, Internal_errors_t the_error ) { 10caaf: 55 push %ebp 10cab0: 89 e5 mov %esp,%ebp 10cab2: 57 push %edi 10cab3: 56 push %esi 10cab4: 53 push %ebx 10cab5: 83 ec 0c sub $0xc,%esp 10cab8: 8b 7d 10 mov 0x10(%ebp),%edi Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _User_extensions_List.last ; 10cabb: 8b 1d 60 33 12 00 mov 0x123360,%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 ); 10cac1: 0f b6 75 0c movzbl 0xc(%ebp),%esi ) { Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _User_extensions_List.last ; 10cac5: eb 15 jmp 10cadc <_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 ) 10cac7: 8b 43 30 mov 0x30(%ebx),%eax 10caca: 85 c0 test %eax,%eax 10cacc: 74 0b je 10cad9 <_User_extensions_Fatal+0x2a> (*the_extension->Callouts.fatal)( the_source, is_internal, the_error ); 10cace: 52 push %edx 10cacf: 57 push %edi 10cad0: 56 push %esi 10cad1: ff 75 08 pushl 0x8(%ebp) 10cad4: ff d0 call *%eax 10cad6: 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 ) { 10cad9: 8b 5b 04 mov 0x4(%ebx),%ebx ) { Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _User_extensions_List.last ; 10cadc: 81 fb 58 33 12 00 cmp $0x123358,%ebx 10cae2: 75 e3 jne 10cac7 <_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 ); } } 10cae4: 8d 65 f4 lea -0xc(%ebp),%esp 10cae7: 5b pop %ebx 10cae8: 5e pop %esi 10cae9: 5f pop %edi 10caea: c9 leave 10caeb: c3 ret =============================================================================== 0010c998 <_User_extensions_Handler_initialization>: #include #include #include void _User_extensions_Handler_initialization(void) { 10c998: 55 push %ebp 10c999: 89 e5 mov %esp,%ebp 10c99b: 57 push %edi 10c99c: 56 push %esi 10c99d: 53 push %ebx 10c99e: 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; 10c9a1: a1 30 f2 11 00 mov 0x11f230,%eax 10c9a6: 89 45 e4 mov %eax,-0x1c(%ebp) initial_extensions = Configuration.User_extension_table; 10c9a9: 8b 35 34 f2 11 00 mov 0x11f234,%esi */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 10c9af: c7 05 58 33 12 00 5c movl $0x12335c,0x123358 10c9b6: 33 12 00 the_chain->permanent_null = NULL; 10c9b9: c7 05 5c 33 12 00 00 movl $0x0,0x12335c 10c9c0: 00 00 00 the_chain->last = _Chain_Head(the_chain); 10c9c3: c7 05 60 33 12 00 58 movl $0x123358,0x123360 10c9ca: 33 12 00 */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 10c9cd: c7 05 68 31 12 00 6c movl $0x12316c,0x123168 10c9d4: 31 12 00 the_chain->permanent_null = NULL; 10c9d7: c7 05 6c 31 12 00 00 movl $0x0,0x12316c 10c9de: 00 00 00 the_chain->last = _Chain_Head(the_chain); 10c9e1: c7 05 70 31 12 00 68 movl $0x123168,0x123170 10c9e8: 31 12 00 _Chain_Initialize_empty( &_User_extensions_List ); _Chain_Initialize_empty( &_User_extensions_Switches_list ); if ( initial_extensions ) { 10c9eb: 85 f6 test %esi,%esi 10c9ed: 74 53 je 10ca42 <_User_extensions_Handler_initialization+0xaa><== NEVER TAKEN extension = (User_extensions_Control *) _Workspace_Allocate_or_fatal_error( 10c9ef: 6b c8 34 imul $0x34,%eax,%ecx 10c9f2: 83 ec 0c sub $0xc,%esp 10c9f5: 51 push %ecx 10c9f6: 89 4d e0 mov %ecx,-0x20(%ebp) 10c9f9: e8 32 04 00 00 call 10ce30 <_Workspace_Allocate_or_fatal_error> 10c9fe: 89 c3 mov %eax,%ebx number_of_extensions * sizeof( User_extensions_Control ) ); memset ( 10ca00: 31 c0 xor %eax,%eax 10ca02: 8b 4d e0 mov -0x20(%ebp),%ecx 10ca05: 89 df mov %ebx,%edi 10ca07: f3 aa rep stos %al,%es:(%edi) 10ca09: 89 f0 mov %esi,%eax extension, 0, number_of_extensions * sizeof( User_extensions_Control ) ); for ( i = 0 ; i < number_of_extensions ; i++ ) { 10ca0b: 83 c4 10 add $0x10,%esp 10ca0e: 31 d2 xor %edx,%edx 10ca10: eb 2b jmp 10ca3d <_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; 10ca12: 8d 7b 14 lea 0x14(%ebx),%edi 10ca15: 89 c6 mov %eax,%esi 10ca17: b9 08 00 00 00 mov $0x8,%ecx 10ca1c: f3 a5 rep movsl %ds:(%esi),%es:(%edi) _User_extensions_Add_set( extension ); 10ca1e: 83 ec 0c sub $0xc,%esp 10ca21: 53 push %ebx 10ca22: 89 45 dc mov %eax,-0x24(%ebp) 10ca25: 89 55 e0 mov %edx,-0x20(%ebp) 10ca28: e8 b3 25 00 00 call 10efe0 <_User_extensions_Add_set> _User_extensions_Add_set_with_table (extension, &initial_extensions[i]); extension++; 10ca2d: 83 c3 34 add $0x34,%ebx extension, 0, number_of_extensions * sizeof( User_extensions_Control ) ); for ( i = 0 ; i < number_of_extensions ; i++ ) { 10ca30: 8b 55 e0 mov -0x20(%ebp),%edx 10ca33: 42 inc %edx 10ca34: 8b 45 dc mov -0x24(%ebp),%eax 10ca37: 83 c0 20 add $0x20,%eax 10ca3a: 83 c4 10 add $0x10,%esp 10ca3d: 3b 55 e4 cmp -0x1c(%ebp),%edx 10ca40: 72 d0 jb 10ca12 <_User_extensions_Handler_initialization+0x7a> _User_extensions_Add_set_with_table (extension, &initial_extensions[i]); extension++; } } } 10ca42: 8d 65 f4 lea -0xc(%ebp),%esp 10ca45: 5b pop %ebx 10ca46: 5e pop %esi 10ca47: 5f pop %edi 10ca48: c9 leave 10ca49: c3 ret =============================================================================== 0010ca7d <_User_extensions_Thread_exitted>: void _User_extensions_Thread_exitted ( Thread_Control *executing ) { 10ca7d: 55 push %ebp 10ca7e: 89 e5 mov %esp,%ebp 10ca80: 56 push %esi 10ca81: 53 push %ebx 10ca82: 8b 75 08 mov 0x8(%ebp),%esi Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _User_extensions_List.last ; 10ca85: 8b 1d 60 33 12 00 mov 0x123360,%ebx 10ca8b: eb 13 jmp 10caa0 <_User_extensions_Thread_exitted+0x23> !_Chain_Is_head( &_User_extensions_List, the_node ) ; the_node = the_node->previous ) { the_extension = (User_extensions_Control *) the_node; if ( the_extension->Callouts.thread_exitted != NULL ) 10ca8d: 8b 43 2c mov 0x2c(%ebx),%eax 10ca90: 85 c0 test %eax,%eax 10ca92: 74 09 je 10ca9d <_User_extensions_Thread_exitted+0x20> (*the_extension->Callouts.thread_exitted)( executing ); 10ca94: 83 ec 0c sub $0xc,%esp 10ca97: 56 push %esi 10ca98: ff d0 call *%eax 10ca9a: 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 ) { 10ca9d: 8b 5b 04 mov 0x4(%ebx),%ebx ) { Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _User_extensions_List.last ; 10caa0: 81 fb 58 33 12 00 cmp $0x123358,%ebx 10caa6: 75 e5 jne 10ca8d <_User_extensions_Thread_exitted+0x10> the_extension = (User_extensions_Control *) the_node; if ( the_extension->Callouts.thread_exitted != NULL ) (*the_extension->Callouts.thread_exitted)( executing ); } } 10caa8: 8d 65 f8 lea -0x8(%ebp),%esp 10caab: 5b pop %ebx 10caac: 5e pop %esi 10caad: c9 leave 10caae: c3 ret =============================================================================== 0010e3c0 <_Watchdog_Adjust>: void _Watchdog_Adjust( Chain_Control *header, Watchdog_Adjust_directions direction, Watchdog_Interval units ) { 10e3c0: 55 push %ebp 10e3c1: 89 e5 mov %esp,%ebp 10e3c3: 57 push %edi 10e3c4: 56 push %esi 10e3c5: 53 push %ebx 10e3c6: 83 ec 1c sub $0x1c,%esp 10e3c9: 8b 75 08 mov 0x8(%ebp),%esi 10e3cc: 8b 7d 0c mov 0xc(%ebp),%edi 10e3cf: 8b 5d 10 mov 0x10(%ebp),%ebx ISR_Level level; _ISR_Disable( level ); 10e3d2: 9c pushf 10e3d3: fa cli 10e3d4: 58 pop %eax */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 10e3d5: 8b 16 mov (%esi),%edx */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 10e3d7: 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 ) ) { 10e3da: 39 ca cmp %ecx,%edx 10e3dc: 74 44 je 10e422 <_Watchdog_Adjust+0x62> switch ( direction ) { 10e3de: 85 ff test %edi,%edi 10e3e0: 74 3c je 10e41e <_Watchdog_Adjust+0x5e> 10e3e2: 4f dec %edi 10e3e3: 75 3d jne 10e422 <_Watchdog_Adjust+0x62> <== NEVER TAKEN case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; 10e3e5: 01 5a 10 add %ebx,0x10(%edx) break; 10e3e8: eb 38 jmp 10e422 <_Watchdog_Adjust+0x62> RTEMS_INLINE_ROUTINE Watchdog_Control *_Watchdog_First( Chain_Control *header ) { return ( (Watchdog_Control *) header->first ); 10e3ea: 8b 16 mov (%esi),%edx case WATCHDOG_FORWARD: while ( units ) { if ( units < _Watchdog_First( header )->delta_interval ) { 10e3ec: 8b 7a 10 mov 0x10(%edx),%edi 10e3ef: 39 fb cmp %edi,%ebx 10e3f1: 73 07 jae 10e3fa <_Watchdog_Adjust+0x3a> _Watchdog_First( header )->delta_interval -= units; 10e3f3: 29 df sub %ebx,%edi 10e3f5: 89 7a 10 mov %edi,0x10(%edx) break; 10e3f8: eb 28 jmp 10e422 <_Watchdog_Adjust+0x62> } else { units -= _Watchdog_First( header )->delta_interval; _Watchdog_First( header )->delta_interval = 1; 10e3fa: c7 42 10 01 00 00 00 movl $0x1,0x10(%edx) _ISR_Enable( level ); 10e401: 50 push %eax 10e402: 9d popf _Watchdog_Tickle( header ); 10e403: 83 ec 0c sub $0xc,%esp 10e406: 56 push %esi 10e407: 89 4d e4 mov %ecx,-0x1c(%ebp) 10e40a: e8 9d 01 00 00 call 10e5ac <_Watchdog_Tickle> _ISR_Disable( level ); 10e40f: 9c pushf 10e410: fa cli 10e411: 58 pop %eax if ( _Chain_Is_empty( header ) ) 10e412: 83 c4 10 add $0x10,%esp 10e415: 8b 4d e4 mov -0x1c(%ebp),%ecx 10e418: 39 0e cmp %ecx,(%esi) 10e41a: 74 06 je 10e422 <_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; 10e41c: 29 fb sub %edi,%ebx switch ( direction ) { case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; break; case WATCHDOG_FORWARD: while ( units ) { 10e41e: 85 db test %ebx,%ebx 10e420: 75 c8 jne 10e3ea <_Watchdog_Adjust+0x2a> <== ALWAYS TAKEN } break; } } _ISR_Enable( level ); 10e422: 50 push %eax 10e423: 9d popf } 10e424: 8d 65 f4 lea -0xc(%ebp),%esp 10e427: 5b pop %ebx 10e428: 5e pop %esi 10e429: 5f pop %edi 10e42a: c9 leave 10e42b: c3 ret =============================================================================== 0010cce8 <_Watchdog_Remove>: */ Watchdog_States _Watchdog_Remove( Watchdog_Control *the_watchdog ) { 10cce8: 55 push %ebp 10cce9: 89 e5 mov %esp,%ebp 10cceb: 56 push %esi 10ccec: 53 push %ebx 10cced: 8b 55 08 mov 0x8(%ebp),%edx ISR_Level level; Watchdog_States previous_state; Watchdog_Control *next_watchdog; _ISR_Disable( level ); 10ccf0: 9c pushf 10ccf1: fa cli 10ccf2: 5e pop %esi previous_state = the_watchdog->state; 10ccf3: 8b 42 08 mov 0x8(%edx),%eax switch ( previous_state ) { 10ccf6: 83 f8 01 cmp $0x1,%eax 10ccf9: 74 09 je 10cd04 <_Watchdog_Remove+0x1c> 10ccfb: 72 42 jb 10cd3f <_Watchdog_Remove+0x57> 10ccfd: 83 f8 03 cmp $0x3,%eax 10cd00: 77 3d ja 10cd3f <_Watchdog_Remove+0x57> <== NEVER TAKEN 10cd02: eb 09 jmp 10cd0d <_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; 10cd04: c7 42 08 00 00 00 00 movl $0x0,0x8(%edx) break; 10cd0b: eb 32 jmp 10cd3f <_Watchdog_Remove+0x57> case WATCHDOG_ACTIVE: case WATCHDOG_REMOVE_IT: the_watchdog->state = WATCHDOG_INACTIVE; 10cd0d: 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 ); } 10cd14: 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) ) 10cd16: 83 39 00 cmpl $0x0,(%ecx) 10cd19: 74 06 je 10cd21 <_Watchdog_Remove+0x39> next_watchdog->delta_interval += the_watchdog->delta_interval; 10cd1b: 8b 5a 10 mov 0x10(%edx),%ebx 10cd1e: 01 59 10 add %ebx,0x10(%ecx) if ( _Watchdog_Sync_count ) 10cd21: 8b 1d 98 32 12 00 mov 0x123298,%ebx 10cd27: 85 db test %ebx,%ebx 10cd29: 74 0c je 10cd37 <_Watchdog_Remove+0x4f> _Watchdog_Sync_level = _ISR_Nest_level; 10cd2b: 8b 1d a4 33 12 00 mov 0x1233a4,%ebx 10cd31: 89 1d 10 32 12 00 mov %ebx,0x123210 { Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; 10cd37: 8b 5a 04 mov 0x4(%edx),%ebx next->previous = previous; 10cd3a: 89 59 04 mov %ebx,0x4(%ecx) previous->next = next; 10cd3d: 89 0b mov %ecx,(%ebx) _Chain_Extract_unprotected( &the_watchdog->Node ); break; } the_watchdog->stop_time = _Watchdog_Ticks_since_boot; 10cd3f: 8b 0d 9c 32 12 00 mov 0x12329c,%ecx 10cd45: 89 4a 18 mov %ecx,0x18(%edx) _ISR_Enable( level ); 10cd48: 56 push %esi 10cd49: 9d popf return( previous_state ); } 10cd4a: 5b pop %ebx 10cd4b: 5e pop %esi 10cd4c: c9 leave 10cd4d: c3 ret =============================================================================== 0010df58 <_Watchdog_Report_chain>: void _Watchdog_Report_chain( const char *name, Chain_Control *header ) { 10df58: 55 push %ebp 10df59: 89 e5 mov %esp,%ebp 10df5b: 57 push %edi 10df5c: 56 push %esi 10df5d: 53 push %ebx 10df5e: 83 ec 20 sub $0x20,%esp 10df61: 8b 7d 08 mov 0x8(%ebp),%edi 10df64: 8b 75 0c mov 0xc(%ebp),%esi ISR_Level level; Chain_Node *node; _ISR_Disable( level ); 10df67: 9c pushf 10df68: fa cli 10df69: 8f 45 e4 popl -0x1c(%ebp) printk( "Watchdog Chain: %s %p\n", name, header ); 10df6c: 56 push %esi 10df6d: 57 push %edi 10df6e: 68 04 ff 11 00 push $0x11ff04 10df73: e8 14 ab ff ff call 108a8c */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 10df78: 8b 1e mov (%esi),%ebx */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 10df7a: 83 c6 04 add $0x4,%esi if ( !_Chain_Is_empty( header ) ) { 10df7d: 83 c4 10 add $0x10,%esp 10df80: 39 f3 cmp %esi,%ebx 10df82: 74 1d je 10dfa1 <_Watchdog_Report_chain+0x49> node != _Chain_Tail(header) ; node = node->next ) { Watchdog_Control *watch = (Watchdog_Control *) node; _Watchdog_Report( NULL, watch ); 10df84: 52 push %edx 10df85: 52 push %edx 10df86: 53 push %ebx 10df87: 6a 00 push $0x0 10df89: e8 32 00 00 00 call 10dfc0 <_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 ) 10df8e: 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 ; 10df90: 83 c4 10 add $0x10,%esp 10df93: 39 f3 cmp %esi,%ebx 10df95: 75 ed jne 10df84 <_Watchdog_Report_chain+0x2c><== NEVER TAKEN { Watchdog_Control *watch = (Watchdog_Control *) node; _Watchdog_Report( NULL, watch ); } printk( "== end of %s \n", name ); 10df97: 50 push %eax 10df98: 50 push %eax 10df99: 57 push %edi 10df9a: 68 1b ff 11 00 push $0x11ff1b 10df9f: eb 08 jmp 10dfa9 <_Watchdog_Report_chain+0x51> } else { printk( "Chain is empty\n" ); 10dfa1: 83 ec 0c sub $0xc,%esp 10dfa4: 68 2a ff 11 00 push $0x11ff2a 10dfa9: e8 de aa ff ff call 108a8c 10dfae: 83 c4 10 add $0x10,%esp } _ISR_Enable( level ); 10dfb1: ff 75 e4 pushl -0x1c(%ebp) 10dfb4: 9d popf } 10dfb5: 8d 65 f4 lea -0xc(%ebp),%esp 10dfb8: 5b pop %ebx 10dfb9: 5e pop %esi 10dfba: 5f pop %edi 10dfbb: c9 leave 10dfbc: c3 ret =============================================================================== 0010cd50 <_Watchdog_Tickle>: */ void _Watchdog_Tickle( Chain_Control *header ) { 10cd50: 55 push %ebp 10cd51: 89 e5 mov %esp,%ebp 10cd53: 57 push %edi 10cd54: 56 push %esi 10cd55: 53 push %ebx 10cd56: 83 ec 1c sub $0x1c,%esp 10cd59: 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 ); 10cd5c: 9c pushf 10cd5d: fa cli 10cd5e: 5e pop %esi */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 10cd5f: 8b 1f mov (%edi),%ebx */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 10cd61: 8d 47 04 lea 0x4(%edi),%eax 10cd64: 89 45 e4 mov %eax,-0x1c(%ebp) if ( _Chain_Is_empty( header ) ) 10cd67: 39 c3 cmp %eax,%ebx 10cd69: 74 40 je 10cdab <_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) { 10cd6b: 8b 43 10 mov 0x10(%ebx),%eax 10cd6e: 85 c0 test %eax,%eax 10cd70: 74 08 je 10cd7a <_Watchdog_Tickle+0x2a> the_watchdog->delta_interval--; 10cd72: 48 dec %eax 10cd73: 89 43 10 mov %eax,0x10(%ebx) if ( the_watchdog->delta_interval != 0 ) 10cd76: 85 c0 test %eax,%eax 10cd78: 75 31 jne 10cdab <_Watchdog_Tickle+0x5b> goto leave; } do { watchdog_state = _Watchdog_Remove( the_watchdog ); 10cd7a: 83 ec 0c sub $0xc,%esp 10cd7d: 53 push %ebx 10cd7e: e8 65 ff ff ff call 10cce8 <_Watchdog_Remove> _ISR_Enable( level ); 10cd83: 56 push %esi 10cd84: 9d popf switch( watchdog_state ) { 10cd85: 83 c4 10 add $0x10,%esp 10cd88: 83 f8 02 cmp $0x2,%eax 10cd8b: 75 0e jne 10cd9b <_Watchdog_Tickle+0x4b> <== NEVER TAKEN case WATCHDOG_ACTIVE: (*the_watchdog->routine)( 10cd8d: 50 push %eax 10cd8e: 50 push %eax 10cd8f: ff 73 24 pushl 0x24(%ebx) 10cd92: ff 73 20 pushl 0x20(%ebx) 10cd95: ff 53 1c call *0x1c(%ebx) the_watchdog->id, the_watchdog->user_data ); break; 10cd98: 83 c4 10 add $0x10,%esp case WATCHDOG_REMOVE_IT: break; } _ISR_Disable( level ); 10cd9b: 9c pushf 10cd9c: fa cli 10cd9d: 5e pop %esi } while ( !_Chain_Is_empty( header ) && (the_watchdog->delta_interval == 0) ); leave: _ISR_Enable(level); } 10cd9e: 8b 1f mov (%edi),%ebx _ISR_Disable( level ); the_watchdog = _Watchdog_First( header ); } while ( !_Chain_Is_empty( header ) && (the_watchdog->delta_interval == 0) ); 10cda0: 3b 5d e4 cmp -0x1c(%ebp),%ebx 10cda3: 74 06 je 10cdab <_Watchdog_Tickle+0x5b> } _ISR_Disable( level ); the_watchdog = _Watchdog_First( header ); } while ( !_Chain_Is_empty( header ) && 10cda5: 83 7b 10 00 cmpl $0x0,0x10(%ebx) 10cda9: eb cd jmp 10cd78 <_Watchdog_Tickle+0x28> (the_watchdog->delta_interval == 0) ); leave: _ISR_Enable(level); 10cdab: 56 push %esi 10cdac: 9d popf } 10cdad: 8d 65 f4 lea -0xc(%ebp),%esp 10cdb0: 5b pop %ebx 10cdb1: 5e pop %esi 10cdb2: 5f pop %edi 10cdb3: c9 leave 10cdb4: c3 ret =============================================================================== 0010c700 : #include #include void rtems_iterate_over_all_threads(rtems_per_thread_routine routine) { 10c700: 55 push %ebp 10c701: 89 e5 mov %esp,%ebp 10c703: 57 push %edi 10c704: 56 push %esi 10c705: 53 push %ebx 10c706: 83 ec 0c sub $0xc,%esp uint32_t i; uint32_t api_index; Thread_Control *the_thread; Objects_Information *information; if ( !routine ) 10c709: 83 7d 08 00 cmpl $0x0,0x8(%ebp) 10c70d: 74 41 je 10c750 <== NEVER TAKEN 10c70f: 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 ] ) 10c714: 8b 04 9d 20 df 12 00 mov 0x12df20(,%ebx,4),%eax 10c71b: 85 c0 test %eax,%eax 10c71d: 74 2b je 10c74a continue; information = _Objects_Information_table[ api_index ][ 1 ]; 10c71f: 8b 78 04 mov 0x4(%eax),%edi if ( !information ) 10c722: be 01 00 00 00 mov $0x1,%esi 10c727: 85 ff test %edi,%edi 10c729: 75 17 jne 10c742 10c72b: eb 1d jmp 10c74a continue; for ( i=1 ; i <= information->maximum ; i++ ) { the_thread = (Thread_Control *)information->local_table[ i ]; 10c72d: 8b 47 1c mov 0x1c(%edi),%eax 10c730: 8b 04 b0 mov (%eax,%esi,4),%eax if ( !the_thread ) 10c733: 85 c0 test %eax,%eax 10c735: 74 0a je 10c741 <== NEVER TAKEN continue; (*routine)(the_thread); 10c737: 83 ec 0c sub $0xc,%esp 10c73a: 50 push %eax 10c73b: ff 55 08 call *0x8(%ebp) 10c73e: 83 c4 10 add $0x10,%esp information = _Objects_Information_table[ api_index ][ 1 ]; if ( !information ) continue; for ( i=1 ; i <= information->maximum ; i++ ) { 10c741: 46 inc %esi 10c742: 0f b7 47 10 movzwl 0x10(%edi),%eax 10c746: 39 c6 cmp %eax,%esi 10c748: 76 e3 jbe 10c72d Objects_Information *information; if ( !routine ) return; for ( api_index = 1 ; api_index <= OBJECTS_APIS_LAST ; api_index++ ) { 10c74a: 43 inc %ebx 10c74b: 83 fb 04 cmp $0x4,%ebx 10c74e: 75 c4 jne 10c714 (*routine)(the_thread); } } } 10c750: 8d 65 f4 lea -0xc(%ebp),%esp 10c753: 5b pop %ebx 10c754: 5e pop %esi 10c755: 5f pop %edi 10c756: c9 leave 10c757: 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 38 c5 13 00 mov 0x13c538,%eax 11493e: 40 inc %eax 11493f: a3 38 c5 13 00 mov %eax,0x13c538 * 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 c4 c3 13 00 push $0x13c3c4 11494c: 89 55 e4 mov %edx,-0x1c(%ebp) 11494f: e8 1c 3d 00 00 call 118670 <_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 21 49 00 00 call 119286 <_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 3c 2a 00 00 call 1173d0 <_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 e0 c3 13 00 mov 0x13c3e0,%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 d3 48 00 00 call 119286 <_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 54 69 12 00 push $0x126954 10b0ae: e8 71 1d 00 00 call 10ce24 <_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 8c 6c 12 00 mov 0x126c8c,%eax 10b0c7: 39 47 40 cmp %eax,0x40(%edi) 10b0ca: 74 0f je 10b0db _Thread_Enable_dispatch(); 10b0cc: e8 01 25 00 00 call 10d5d2 <_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 64 fc 11 00 mov 0x11fc64(,%eax,4),%ebx case RATE_MONOTONIC_ACTIVE: default: /* unreached -- only to remove warnings */ return_value = RTEMS_SUCCESSFUL; break; } _Thread_Enable_dispatch(); 10b0ee: e8 df 24 00 00 call 10d5d2 <_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 10 6b 12 00 push $0x126b10 10b153: e8 88 33 00 00 call 10e4e0 <_Watchdog_Insert> _Thread_Enable_dispatch(); 10b158: e8 75 24 00 00 call 10d5d2 <_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 8c 6c 12 00 mov 0x126c8c,%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 17 2c 00 00 call 10dda8 <_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 8c 6c 12 00 pushl 0x126c8c 10b1b5: e8 a6 20 00 00 call 10d260 <_Thread_Clear_state> 10b1ba: 83 c4 10 add $0x10,%esp _Thread_Enable_dispatch(); 10b1bd: e8 10 24 00 00 call 10d5d2 <_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 10 6b 12 00 push $0x126b10 10b1eb: e8 f0 32 00 00 call 10e4e0 <_Watchdog_Insert> _Thread_Enable_dispatch(); 10b1f0: e8 dd 23 00 00 call 10d5d2 <_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 78 fc 11 00 push $0x11fc78 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 96 fc 11 00 push $0x11fc96 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 b8 fc 11 00 push $0x11fcb8 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 db fc 11 00 push $0x11fcdb 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 26 fd 11 00 push $0x11fd26 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 5c 69 12 00 mov 0x12695c,%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 1d 4b 00 00 call 10fd90 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 aa 4b 00 00 call 10fe34 #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 72 fd 11 00 push $0x11fd72 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 ec ff 11 00 push $0x11ffec 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 dc 2e 00 00 call 10e1b4 <_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 89 fd 11 00 push $0x11fd89 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 9b 2e 00 00 call 10e1b4 <_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 a8 fd 11 00 push $0x11fda8 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 60 69 12 00 cmp 0x126960,%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 47 36 00 00 call 1192a8 <_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 f0 00 00 00 mov 0xf0(%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 80 c7 13 00 00 cmpl $0x0,0x13c780 115c8b: 74 19 je 115ca6 115c8d: 3b 05 84 c7 13 00 cmp 0x13c784,%eax 115c93: 75 11 jne 115ca6 <== NEVER TAKEN _Context_Switch_necessary = true; 115c95: c6 05 90 c7 13 00 01 movb $0x1,0x13c790 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 db 35 00 00 call 119286 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 115cab: 31 c0 xor %eax,%eax 115cad: eb 11 jmp 115cc0 } _Thread_Enable_dispatch(); 115caf: e8 d2 35 00 00 call 119286 <_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 =============================================================================== 0010ff4c : rtems_status_code rtems_task_mode( rtems_mode mode_set, rtems_mode mask, rtems_mode *previous_mode_set ) { 10ff4c: 55 push %ebp 10ff4d: 89 e5 mov %esp,%ebp 10ff4f: 57 push %edi 10ff50: 56 push %esi 10ff51: 53 push %ebx 10ff52: 83 ec 1c sub $0x1c,%esp 10ff55: 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; 10ff58: 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 ) 10ff5d: 85 c9 test %ecx,%ecx 10ff5f: 0f 84 04 01 00 00 je 110069 return RTEMS_INVALID_ADDRESS; executing = _Thread_Executing; 10ff65: 8b 35 a8 33 12 00 mov 0x1233a8,%esi api = executing->API_Extensions[ THREAD_API_RTEMS ]; 10ff6b: 8b 9e f0 00 00 00 mov 0xf0(%esi),%ebx asr = &api->Signal; old_mode = (executing->is_preemptible) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT; 10ff71: 80 7e 74 01 cmpb $0x1,0x74(%esi) 10ff75: 19 ff sbb %edi,%edi 10ff77: 81 e7 00 01 00 00 and $0x100,%edi if ( executing->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_NONE ) 10ff7d: 83 7e 7c 00 cmpl $0x0,0x7c(%esi) 10ff81: 74 06 je 10ff89 old_mode |= RTEMS_NO_TIMESLICE; else old_mode |= RTEMS_TIMESLICE; 10ff83: 81 cf 00 02 00 00 or $0x200,%edi old_mode |= (asr->is_enabled) ? RTEMS_ASR : RTEMS_NO_ASR; 10ff89: 80 7b 08 01 cmpb $0x1,0x8(%ebx) 10ff8d: 19 d2 sbb %edx,%edx 10ff8f: 81 e2 00 04 00 00 and $0x400,%edx old_mode |= _ISR_Get_level(); 10ff95: 89 55 e4 mov %edx,-0x1c(%ebp) 10ff98: 89 4d e0 mov %ecx,-0x20(%ebp) 10ff9b: e8 25 d2 ff ff call 10d1c5 <_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; 10ffa0: 8b 55 e4 mov -0x1c(%ebp),%edx 10ffa3: 09 d0 or %edx,%eax old_mode |= _ISR_Get_level(); 10ffa5: 09 f8 or %edi,%eax 10ffa7: 8b 4d e0 mov -0x20(%ebp),%ecx 10ffaa: 89 01 mov %eax,(%ecx) /* * These are generic thread scheduling characteristics. */ if ( mask & RTEMS_PREEMPT_MASK ) 10ffac: f7 45 0c 00 01 00 00 testl $0x100,0xc(%ebp) 10ffb3: 74 0b je 10ffc0 executing->is_preemptible = _Modes_Is_preempt(mode_set) ? true : false; 10ffb5: f7 45 08 00 01 00 00 testl $0x100,0x8(%ebp) 10ffbc: 0f 94 46 74 sete 0x74(%esi) if ( mask & RTEMS_TIMESLICE_MASK ) { 10ffc0: f7 45 0c 00 02 00 00 testl $0x200,0xc(%ebp) 10ffc7: 74 21 je 10ffea if ( _Modes_Is_timeslice(mode_set) ) { 10ffc9: f7 45 08 00 02 00 00 testl $0x200,0x8(%ebp) 10ffd0: 74 11 je 10ffe3 executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE; 10ffd2: c7 46 7c 01 00 00 00 movl $0x1,0x7c(%esi) executing->cpu_time_budget = _Thread_Ticks_per_timeslice; 10ffd9: a1 34 31 12 00 mov 0x123134,%eax 10ffde: 89 46 78 mov %eax,0x78(%esi) 10ffe1: eb 07 jmp 10ffea } else executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE; 10ffe3: c7 46 7c 00 00 00 00 movl $0x0,0x7c(%esi) /* * Set the new interrupt level */ if ( mask & RTEMS_INTERRUPT_MASK ) 10ffea: f6 45 0c 01 testb $0x1,0xc(%ebp) 10ffee: 74 0a je 10fffa */ RTEMS_INLINE_ROUTINE void _Modes_Set_interrupt_level ( Modes_Control mode_set ) { _ISR_Set_level( _Modes_Get_interrupt_level( mode_set ) ); 10fff0: f6 45 08 01 testb $0x1,0x8(%ebp) 10fff4: 74 03 je 10fff9 10fff6: fa cli 10fff7: eb 01 jmp 10fffa 10fff9: fb sti /* * This is specific to the RTEMS API */ is_asr_enabled = false; needs_asr_dispatching = false; 10fffa: 31 d2 xor %edx,%edx if ( mask & RTEMS_ASR_MASK ) { 10fffc: f7 45 0c 00 04 00 00 testl $0x400,0xc(%ebp) 110003: 74 2a je 11002f * Output: * *previous_mode_set - previous mode set * always return RTEMS_SUCCESSFUL; */ rtems_status_code rtems_task_mode( 110005: f7 45 08 00 04 00 00 testl $0x400,0x8(%ebp) 11000c: 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 ) { 11000f: 3a 43 08 cmp 0x8(%ebx),%al 110012: 74 1b je 11002f asr->is_enabled = is_asr_enabled; 110014: 88 43 08 mov %al,0x8(%ebx) ) { rtems_signal_set _signals; ISR_Level _level; _ISR_Disable( _level ); 110017: 9c pushf 110018: fa cli 110019: 58 pop %eax _signals = information->signals_pending; 11001a: 8b 53 18 mov 0x18(%ebx),%edx information->signals_pending = information->signals_posted; 11001d: 8b 4b 14 mov 0x14(%ebx),%ecx 110020: 89 4b 18 mov %ecx,0x18(%ebx) information->signals_posted = _signals; 110023: 89 53 14 mov %edx,0x14(%ebx) _ISR_Enable( _level ); 110026: 50 push %eax 110027: 9d popf /* * This is specific to the RTEMS API */ is_asr_enabled = false; needs_asr_dispatching = false; 110028: 83 7b 14 00 cmpl $0x0,0x14(%ebx) 11002c: 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; 11002f: 31 c0 xor %eax,%eax needs_asr_dispatching = true; } } } if ( _System_state_Is_up( _System_state_Get() ) ) 110031: 83 3d e4 32 12 00 03 cmpl $0x3,0x1232e4 110038: 75 2f jne 110069 <== NEVER TAKEN */ RTEMS_INLINE_ROUTINE bool _Thread_Evaluate_mode( void ) { Thread_Control *executing; executing = _Thread_Executing; 11003a: a1 a8 33 12 00 mov 0x1233a8,%eax if ( !_States_Is_ready( executing->current_state ) || 11003f: 83 78 10 00 cmpl $0x0,0x10(%eax) 110043: 75 0e jne 110053 <== NEVER TAKEN 110045: 3b 05 ac 33 12 00 cmp 0x1233ac,%eax 11004b: 74 0f je 11005c ( !_Thread_Is_heir( executing ) && executing->is_preemptible ) ) { 11004d: 80 78 74 00 cmpb $0x0,0x74(%eax) 110051: 74 09 je 11005c <== NEVER TAKEN _Context_Switch_necessary = true; 110053: c6 05 b4 33 12 00 01 movb $0x1,0x1233b4 11005a: eb 06 jmp 110062 if ( _Thread_Evaluate_mode() || needs_asr_dispatching ) _Thread_Dispatch(); return RTEMS_SUCCESSFUL; 11005c: 31 c0 xor %eax,%eax } } } if ( _System_state_Is_up( _System_state_Get() ) ) if ( _Thread_Evaluate_mode() || needs_asr_dispatching ) 11005e: 84 d2 test %dl,%dl 110060: 74 07 je 110069 _Thread_Dispatch(); 110062: e8 b5 bc ff ff call 10bd1c <_Thread_Dispatch> return RTEMS_SUCCESSFUL; 110067: 31 c0 xor %eax,%eax } 110069: 83 c4 1c add $0x1c,%esp 11006c: 5b pop %ebx 11006d: 5e pop %esi 11006e: 5f pop %edi 11006f: c9 leave 110070: 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 b4 37 12 00 movzbl 0x1237b4,%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 1b 1b 00 00 call 10f8f8 <_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 3d 16 00 00 call 10f444 <_Thread_Change_priority> 10de07: 83 c4 10 add $0x10,%esp } _Thread_Enable_dispatch(); 10de0a: e8 c7 1a 00 00 call 10f8d6 <_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 d8 c7 13 00 push $0x13c7d8 1164aa: e8 29 26 00 00 call 118ad8 <_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 a2 3f 00 00 call 11a46c <_Watchdog_Remove> 1164ca: 83 c4 10 add $0x10,%esp _Thread_Enable_dispatch(); 1164cd: e8 b4 2d 00 00 call 119286 <_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 18 c8 13 00 mov 0x13c818,%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 4c c5 13 00 00 cmpb $0x0,0x13c54c 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 c4 c5 13 00 cmp 0x13c5c4,%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 d8 c7 13 00 push $0x13c7d8 11696b: e8 68 21 00 00 call 118ad8 <_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 e5 3a 00 00 call 11a46c <_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 c4 c5 13 00 sub 0x13c5c4,%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 ca 28 00 00 call 119286 <_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