RTEMS 4.11
Annotated Report
Fri Mar 18 22:27:33 2011

00014488 <_Timer_server_Body>:                                        
 *  @a arg points to the corresponding timer server control block.    
 */                                                                   
static rtems_task _Timer_server_Body(                                 
  rtems_task_argument arg                                             
)                                                                     
{                                                                     
   14488:	e92d4ff0 	push	{r4, r5, r6, r7, r8, r9, sl, fp, lr}         
   1448c:	e24dd01c 	sub	sp, sp, #28                                   
)                                                                     
{                                                                     
  Chain_Node *head = _Chain_Head( the_chain );                        
  Chain_Node *tail = _Chain_Tail( the_chain );                        
                                                                      
  head->next = tail;                                                  
   14490:	e28d9010 	add	r9, sp, #16                                   
   14494:	e28d6004 	add	r6, sp, #4                                    
   14498:	e2893004 	add	r3, r9, #4                                    
  head->previous = NULL;                                              
   1449c:	e3a02000 	mov	r2, #0                                        
)                                                                     
{                                                                     
  Chain_Node *head = _Chain_Head( the_chain );                        
  Chain_Node *tail = _Chain_Tail( the_chain );                        
                                                                      
  head->next = tail;                                                  
   144a0:	e2868004 	add	r8, r6, #4                                    
   144a4:	e58d3010 	str	r3, [sp, #16]                                 
  head->previous = NULL;                                              
   144a8:	e58d2014 	str	r2, [sp, #20]                                 
  tail->previous = head;                                              
   144ac:	e58d9018 	str	r9, [sp, #24]                                 
)                                                                     
{                                                                     
  Chain_Node *head = _Chain_Head( the_chain );                        
  Chain_Node *tail = _Chain_Tail( the_chain );                        
                                                                      
  head->next = tail;                                                  
   144b0:	e58d8004 	str	r8, [sp, #4]                                  
  head->previous = NULL;                                              
   144b4:	e58d2008 	str	r2, [sp, #8]                                  
  tail->previous = head;                                              
   144b8:	e58d600c 	str	r6, [sp, #12]                                 
static void _Timer_server_Process_interval_watchdogs(                 
  Timer_server_Watchdogs *watchdogs,                                  
  Chain_Control *fire_chain                                           
)                                                                     
{                                                                     
  Watchdog_Interval snapshot = _Watchdog_Ticks_since_boot;            
   144bc:	e59fb168 	ldr	fp, [pc, #360]	; 1462c <_Timer_server_Body+0x1a4>
 */                                                                   
RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_tail(         
  const Chain_Control *the_chain                                      
)                                                                     
{                                                                     
  return &the_chain->Tail.Node;                                       
   144c0:	e58d3000 	str	r3, [sp]                                      
 *  @a arg points to the corresponding timer server control block.    
 */                                                                   
static rtems_task _Timer_server_Body(                                 
  rtems_task_argument arg                                             
)                                                                     
{                                                                     
   144c4:	e1a04000 	mov	r4, r0                                        
{                                                                     
  /*                                                                  
   *  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;                                    
   144c8:	e5849078 	str	r9, [r4, #120]	; 0x78                         
   */                                                                 
  Watchdog_Interval delta = snapshot - watchdogs->last_snapshot;      
                                                                      
  watchdogs->last_snapshot = snapshot;                                
                                                                      
  _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain );  
   144cc:	e284a030 	add	sl, r4, #48	; 0x30                            
     /*                                                               
      *  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 ); 
   144d0:	e2847068 	add	r7, r4, #104	; 0x68                           
static void _Timer_server_Process_interval_watchdogs(                 
  Timer_server_Watchdogs *watchdogs,                                  
  Chain_Control *fire_chain                                           
)                                                                     
{                                                                     
  Watchdog_Interval snapshot = _Watchdog_Ticks_since_boot;            
   144d4:	e59b3000 	ldr	r3, [fp]                                      
                                                                      
  /*                                                                  
   *  We assume adequate unsigned arithmetic here.                    
   */                                                                 
  Watchdog_Interval delta = snapshot - watchdogs->last_snapshot;      
   144d8:	e594103c 	ldr	r1, [r4, #60]	; 0x3c                          
                                                                      
  watchdogs->last_snapshot = snapshot;                                
                                                                      
  _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain );  
   144dc:	e1a02006 	mov	r2, r6                                        
  /*                                                                  
   *  We assume adequate unsigned arithmetic here.                    
   */                                                                 
  Watchdog_Interval delta = snapshot - watchdogs->last_snapshot;      
                                                                      
  watchdogs->last_snapshot = snapshot;                                
   144e0:	e584303c 	str	r3, [r4, #60]	; 0x3c                          
                                                                      
  _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain );  
   144e4:	e1a0000a 	mov	r0, sl                                        
   144e8:	e0611003 	rsb	r1, r1, r3                                    
   144ec:	eb001056 	bl	1864c <_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();
   144f0:	e59f2138 	ldr	r2, [pc, #312]	; 14630 <_Timer_server_Body+0x1a8>
   144f4:	e5925000 	ldr	r5, [r2]                                      
  Watchdog_Interval last_snapshot = watchdogs->last_snapshot;         
   144f8:	e5942074 	ldr	r2, [r4, #116]	; 0x74                         
  /*                                                                  
   *  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 ) {                                   
   144fc:	e1550002 	cmp	r5, r2                                        
   14500:	9a000004 	bls	14518 <_Timer_server_Body+0x90>               
    /*                                                                
     *  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 );
   14504:	e0621005 	rsb	r1, r2, r5                                    
   14508:	e1a00007 	mov	r0, r7                                        
   1450c:	e1a02006 	mov	r2, r6                                        
   14510:	eb00104d 	bl	1864c <_Watchdog_Adjust_to_chain>              
   14514:	ea000003 	b	14528 <_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 ); 
   14518:	31a00007 	movcc	r0, r7                                      
   1451c:	33a01001 	movcc	r1, #1                                      
   14520:	30652002 	rsbcc	r2, r5, r2                                  
   14524:	3b001020 	blcc	185ac <_Watchdog_Adjust>                     
  }                                                                   
                                                                      
  watchdogs->last_snapshot = snapshot;                                
   14528:	e5845074 	str	r5, [r4, #116]	; 0x74                         
}                                                                     
                                                                      
static void _Timer_server_Process_insertions( Timer_server_Control *ts )
{                                                                     
  while ( true ) {                                                    
    Timer_Control *timer = (Timer_Control *) _Chain_Get( ts->insert_chain );
   1452c:	e5940078 	ldr	r0, [r4, #120]	; 0x78                         
   14530:	eb000288 	bl	14f58 <_Chain_Get>                             
                                                                      
    if ( timer == NULL ) {                                            
   14534:	e2505000 	subs	r5, r0, #0                                   
   14538:	0a000009 	beq	14564 <_Timer_server_Body+0xdc>               
static void _Timer_server_Insert_timer(                               
  Timer_server_Control *ts,                                           
  Timer_Control *timer                                                
)                                                                     
{                                                                     
  if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) {                 
   1453c:	e5953038 	ldr	r3, [r5, #56]	; 0x38                          
   14540:	e3530001 	cmp	r3, #1                                        
    _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker );
   14544:	01a0000a 	moveq	r0, sl                                      
static void _Timer_server_Insert_timer(                               
  Timer_server_Control *ts,                                           
  Timer_Control *timer                                                
)                                                                     
{                                                                     
  if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) {                 
   14548:	0a000002 	beq	14558 <_Timer_server_Body+0xd0>               
    _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker );
  } else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) {       
   1454c:	e3530003 	cmp	r3, #3                                        
   14550:	1afffff5 	bne	1452c <_Timer_server_Body+0xa4>               
    _Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker );     
   14554:	e1a00007 	mov	r0, r7                                        
   14558:	e2851010 	add	r1, r5, #16                                   
   1455c:	eb001065 	bl	186f8 <_Watchdog_Insert>                       
   14560:	eafffff1 	b	1452c <_Timer_server_Body+0xa4>                 
     *  of zero it will be processed in the next iteration of the timer server
     *  body loop.                                                    
     */                                                               
    _Timer_server_Process_insertions( ts );                           
                                                                      
    _ISR_Disable( level );                                            
   14564:	ebffff95 	bl	143c0 <arm_interrupt_disable>                  
    if ( _Chain_Is_empty( insert_chain ) ) {                          
   14568:	e59d3010 	ldr	r3, [sp, #16]                                 
   1456c:	e59d2000 	ldr	r2, [sp]                                      
   14570:	e1530002 	cmp	r3, r2                                        
   14574:	1a000006 	bne	14594 <_Timer_server_Body+0x10c>              
      ts->insert_chain = NULL;                                        
   14578:	e5845078 	str	r5, [r4, #120]	; 0x78                         
   1457c:	e129f000 	msr	CPSR_fc, r0                                   
  _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 ) ) {                          
   14580:	e59d3004 	ldr	r3, [sp, #4]                                  
   14584:	e1530008 	cmp	r3, r8                                        
)                                                                     
{                                                                     
  if ( !_Chain_Is_empty(the_chain))                                   
    return _Chain_Get_first_unprotected(the_chain);                   
  else                                                                
    return NULL;                                                      
   14588:	13a05000 	movne	r5, #0                                      
   1458c:	1a000002 	bne	1459c <_Timer_server_Body+0x114>              
   14590:	ea000013 	b	145e4 <_Timer_server_Body+0x15c>                
   14594:	e129f000 	msr	CPSR_fc, r0                                   <== NOT EXECUTED
   14598:	eaffffcd 	b	144d4 <_Timer_server_Body+0x4c>                 <== 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 );                                        
   1459c:	ebffff87 	bl	143c0 <arm_interrupt_disable>                  
      initialized = false;                                            
    }                                                                 
  #endif                                                              
                                                                      
  return status;                                                      
}                                                                     
   145a0:	e59d3004 	ldr	r3, [sp, #4]                                  
 */                                                                   
RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected(              
  Chain_Control *the_chain                                            
)                                                                     
{                                                                     
  if ( !_Chain_Is_empty(the_chain))                                   
   145a4:	e1530008 	cmp	r3, r8                                        
   145a8:	0a00000b 	beq	145dc <_Timer_server_Body+0x154>              
  Chain_Control *the_chain                                            
)                                                                     
{                                                                     
  Chain_Node *head = _Chain_Head( the_chain );                        
  Chain_Node *old_first = head->next;                                 
  Chain_Node *new_first = old_first->next;                            
   145ac:	e5932000 	ldr	r2, [r3]                                      
         *  It is essential that interrupts are disable here since an interrupt
         *  service routine may remove a watchdog from the chain.     
         */                                                           
        _ISR_Disable( level );                                        
        watchdog = (Watchdog_Control *) _Chain_Get_unprotected( &fire_chain );
        if ( watchdog != NULL ) {                                     
   145b0:	e3530000 	cmp	r3, #0                                        
                                                                      
  head->next = new_first;                                             
   145b4:	e58d2004 	str	r2, [sp, #4]                                  
  new_first->previous = head;                                         
   145b8:	e5826004 	str	r6, [r2, #4]                                  
   145bc:	0a000006 	beq	145dc <_Timer_server_Body+0x154>              
          watchdog->state = WATCHDOG_INACTIVE;                        
   145c0:	e5835008 	str	r5, [r3, #8]                                  
   145c4:	e129f000 	msr	CPSR_fc, r0                                   
        /*                                                            
         *  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 );    
   145c8:	e2830020 	add	r0, r3, #32                                   
   145cc:	e8900003 	ldm	r0, {r0, r1}                                  
   145d0:	e1a0e00f 	mov	lr, pc                                        
   145d4:	e593f01c 	ldr	pc, [r3, #28]                                 
      }                                                               
   145d8:	eaffffef 	b	1459c <_Timer_server_Body+0x114>                
   145dc:	e129f000 	msr	CPSR_fc, r0                                   
   145e0:	eaffffb8 	b	144c8 <_Timer_server_Body+0x40>                 
    } else {                                                          
      ts->active = false;                                             
   145e4:	e3a03000 	mov	r3, #0                                        
   145e8:	e5c4307c 	strb	r3, [r4, #124]	; 0x7c                        
                                                                      
      /*                                                              
       *  Block until there is something to do.                       
       */                                                             
      _Thread_Disable_dispatch();                                     
   145ec:	ebffff77 	bl	143d0 <_Thread_Disable_dispatch>               
        _Thread_Set_state( ts->thread, STATES_DELAYING );             
   145f0:	e3a01008 	mov	r1, #8                                        
   145f4:	e5940000 	ldr	r0, [r4]                                      
   145f8:	eb000e70 	bl	17fc0 <_Thread_Set_state>                      
        _Timer_server_Reset_interval_system_watchdog( ts );           
   145fc:	e1a00004 	mov	r0, r4                                        
   14600:	ebffff78 	bl	143e8 <_Timer_server_Reset_interval_system_watchdog>
        _Timer_server_Reset_tod_system_watchdog( ts );                
   14604:	e1a00004 	mov	r0, r4                                        
   14608:	ebffff8a 	bl	14438 <_Timer_server_Reset_tod_system_watchdog>
      _Thread_Enable_dispatch();                                      
   1460c:	eb000c4d 	bl	17748 <_Thread_Enable_dispatch>                
                                                                      
      ts->active = true;                                              
   14610:	e3a03001 	mov	r3, #1                                        
   14614:	e5c4307c 	strb	r3, [r4, #124]	; 0x7c                        
                                                                      
static void _Timer_server_Stop_interval_system_watchdog(              
  Timer_server_Control *ts                                            
)                                                                     
{                                                                     
  _Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog );        
   14618:	e2840008 	add	r0, r4, #8                                    
   1461c:	eb00108d 	bl	18858 <_Watchdog_Remove>                       
                                                                      
static void _Timer_server_Stop_tod_system_watchdog(                   
  Timer_server_Control *ts                                            
)                                                                     
{                                                                     
  _Watchdog_Remove( &ts->TOD_watchdogs.System_watchdog );             
   14620:	e2840040 	add	r0, r4, #64	; 0x40                            
   14624:	eb00108b 	bl	18858 <_Watchdog_Remove>                       
   14628:	eaffffa6 	b	144c8 <_Timer_server_Body+0x40>