RTEMS-6
Annotated Report
rtems
Sun Feb 28 12:23:07 2021

4000f554 <_Event_Seize>:                                                                  
  rtems_event_set    pending_events;                                                      
  bool               success;                                                             
  Thread_Wait_flags  intend_to_block;                                                     
  Per_CPU_Control   *cpu_self;                                                            
                                                                                          
  pending_events = event->pending_events;                                                 
4000f554:   0007ae03            lw  t3,0(a5)                                              
{                                                                                         
4000f558:   fd010113            addi    sp,sp,-48                                         
4000f55c:   02812423            sw  s0,40(sp)                                             
4000f560:   01312e23            sw  s3,28(sp)                                             
4000f564:   02112623            sw  ra,44(sp)                                             
4000f568:   02912223            sw  s1,36(sp)                                             
4000f56c:   03212023            sw  s2,32(sp)                                             
4000f570:   01412c23            sw  s4,24(sp)                                             
RTEMS_INLINE_ROUTINE rtems_event_set _Event_sets_Get(                                     
  rtems_event_set the_event_set,                                                          
  rtems_event_set the_event_condition                                                     
)                                                                                         
{                                                                                         
   return ( the_event_set & the_event_condition );                                        
4000f574:   00ae7333            and t1,t3,a0                                              
4000f578:   00070413            mv  s0,a4                                                 
4000f57c:   00080993            mv  s3,a6                                                 
  seized_events  = _Event_sets_Get( pending_events, event_in );                           
                                                                                          
  if ( !_Event_sets_Is_empty( seized_events ) &&                                          
4000f580:   00030a63            beqz    t1,4000f594 <_Event_Seize+0x40>                   
4000f584:   0e650263            beq a0,t1,4000f668 <_Event_Seize+0x114>                   
 */                                                                                       
RTEMS_INLINE_ROUTINE bool _Options_Is_any (                                               
  rtems_option option_set                                                                 
)                                                                                         
{                                                                                         
   return (option_set & RTEMS_EVENT_ANY) ? true : false;                                  
4000f588:   0015d713            srli    a4,a1,0x1                                         
       (seized_events == event_in || _Options_Is_any( option_set )) ) {                   
4000f58c:   00177713            andi    a4,a4,1                                           
4000f590:   0c071c63            bnez    a4,4000f668 <_Event_Seize+0x114>                  
    _Thread_Wait_release_default( executing, lock_context );                              
    *event_out = seized_events;                                                           
    return RTEMS_SUCCESSFUL;                                                              
  }                                                                                       
                                                                                          
  if ( _Options_Is_no_wait( option_set ) ) {                                              
4000f594:   0015f793            andi    a5,a1,1                                           
4000f598:   18079063            bnez    a5,4000f718 <_Event_Seize+0x1c4>                  
    _Thread_Wait_release_default( executing, lock_context );                              
    *event_out = seized_events;                                                           
    return RTEMS_UNSATISFIED;                                                             
  }                                                                                       
                                                                                          
  intend_to_block = wait_class | THREAD_WAIT_STATE_INTEND_TO_BLOCK;                       
4000f59c:   0019e913            ori s2,s3,1                                               
  disable_level = cpu_self->thread_dispatch_disable_level;                                
4000f5a0:   400234b7            lui s1,0x40023                                            
   *  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.return_code     = STATUS_SUCCESSFUL;                                    
4000f5a4:   04042623            sw  zero,76(s0)                                           
  executing->Wait.option          = option_set;                                           
4000f5a8:   04b42423            sw  a1,72(s0)                                             
  executing->Wait.count           = event_in;                                             
4000f5ac:   02a42e23            sw  a0,60(s0)                                             
  the_thread->Wait.flags = flags;                                                         
4000f5b0:   05242823            sw  s2,80(s0)                                             
4000f5b4:   f8048713            addi    a4,s1,-128 # 40022f80 <_Per_CPU_Information>      
4000f5b8:   03072783            lw  a5,48(a4)                                             
  executing->Wait.return_argument = event_out;                                            
4000f5bc:   04d42023            sw  a3,64(s0)                                             
  cpu_self->thread_dispatch_disable_level = disable_level + 1;                            
4000f5c0:   00178793            addi    a5,a5,1                                           
4000f5c4:   02f72823            sw  a5,48(a4)                                             
4000f5c8:   03012783            lw  a5,48(sp)                                             
4000f5cc:   0007a783            lw  a5,0(a5)                                              
4000f5d0:   3007a073            csrs    mstatus,a5                                        
  _Thread_Wait_flags_set( executing, intend_to_block );                                   
                                                                                          
  cpu_self = _Thread_Dispatch_disable_critical( lock_context );                           
  _Thread_Wait_release_default( executing, lock_context );                                
                                                                                          
  if ( ticks ) {                                                                          
4000f5d4:   0c061a63            bnez    a2,4000f6a8 <_Event_Seize+0x154>                  
    _Thread_Add_timeout_ticks( executing, cpu_self, ticks );                              
  }                                                                                       
                                                                                          
  _Thread_Set_state( executing, block_state );                                            
4000f5d8:   00088593            mv  a1,a7                                                 
4000f5dc:   00040513            mv  a0,s0                                                 
4000f5e0:   a95fb0ef            jal ra,4000b074 <_Thread_Set_state>                       
  __asm__ volatile (                                                                      
4000f5e4:   300477f3            csrrci  a5,mstatus,8                                      
  return mstatus & RISCV_MSTATUS_MIE;                                                     
4000f5e8:   0087f793            andi    a5,a5,8                                           
  bool success = ( the_thread->Wait.flags == expected_flags );                            
4000f5ec:   05042703            lw  a4,80(s0)                                             
  if ( success ) {                                                                        
4000f5f0:   06e90263            beq s2,a4,4000f654 <_Event_Seize+0x100>                   
  __asm__ volatile ( "csrrs zero, mstatus, %0" : : "r" ( level ) );                       
4000f5f4:   3007a073            csrs    mstatus,a5                                        
  success = _Thread_Wait_flags_try_change_acquire(                                        
    executing,                                                                            
    intend_to_block,                                                                      
    wait_class | THREAD_WAIT_STATE_BLOCKED                                                
  );                                                                                      
  if ( !success ) {                                                                       
4000f5f8:   02e91863            bne s2,a4,4000f628 <_Event_Seize+0xd4>                    
    _Thread_Timer_remove( executing );                                                    
    _Thread_Unblock( executing );                                                         
  }                                                                                       
                                                                                          
  _Thread_Dispatch_direct( cpu_self );                                                    
4000f5fc:   f8048513            addi    a0,s1,-128                                        
4000f600:   b04fa0ef            jal ra,40009904 <_Thread_Dispatch_direct>                 
                                                                                          
RTEMS_INLINE_ROUTINE rtems_status_code _Status_Get(                                       
  Status_Control status                                                                   
)                                                                                         
{                                                                                         
  return (rtems_status_code) STATUS_GET_CLASSIC( status );                                
4000f604:   04c44503            lbu a0,76(s0)                                             
  return _Status_Get_after_wait( executing );                                             
}                                                                                         
4000f608:   02c12083            lw  ra,44(sp)                                             
4000f60c:   02812403            lw  s0,40(sp)                                             
4000f610:   02412483            lw  s1,36(sp)                                             
4000f614:   02012903            lw  s2,32(sp)                                             
4000f618:   01c12983            lw  s3,28(sp)                                             
4000f61c:   01812a03            lw  s4,24(sp)                                             
4000f620:   03010113            addi    sp,sp,48                                          
4000f624:   00008067            ret                                                       
  __asm__ volatile (                                                                      
4000f628:   30047973            csrrci  s2,mstatus,8                                      
  _Watchdog_Remove(                                                                       
4000f62c:   06042503            lw  a0,96(s0)                                             
4000f630:   06840593            addi    a1,s0,104                                         
4000f634:   fddfb0ef            jal ra,4000b610 <_Watchdog_Remove>                        
  return mstatus & RISCV_MSTATUS_MIE;                                                     
4000f638:   00897913            andi    s2,s2,8                                           
  __asm__ volatile ( "csrrs zero, mstatus, %0" : : "r" ( level ) );                       
4000f63c:   30092073            csrs    mstatus,s2                                        
  _Thread_Clear_state( the_thread, STATES_BLOCKED );                                      
4000f640:   300165b7            lui a1,0x30016                                            
4000f644:   fff58593            addi    a1,a1,-1 # 30015fff <RamSize+0x2f015fff>          
4000f648:   00040513            mv  a0,s0                                                 
4000f64c:   7f4010ef            jal ra,40010e40 <_Thread_Clear_state>                     
}                                                                                         
4000f650:   fadff06f            j   4000f5fc <_Event_Seize+0xa8>                          
  success = _Thread_Wait_flags_try_change_acquire(                                        
4000f654:   0029e813            ori a6,s3,2                                               
    the_thread->Wait.flags = desired_flags;                                               
4000f658:   05042823            sw  a6,80(s0)                                             
4000f65c:   3007a073            csrs    mstatus,a5                                        
  if ( !success ) {                                                                       
4000f660:   f8e90ee3            beq s2,a4,4000f5fc <_Event_Seize+0xa8>                    
4000f664:   fc5ff06f            j   4000f628 <_Event_Seize+0xd4>                          <== NOT EXECUTED
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) );                                                
4000f668:   fff34713            not a4,t1                                                 
4000f66c:   01c77e33            and t3,a4,t3                                              
    event->pending_events =                                                               
4000f670:   01c7a023            sw  t3,0(a5)                                              
4000f674:   03012783            lw  a5,48(sp)                                             
4000f678:   0007a783            lw  a5,0(a5)                                              
4000f67c:   3007a073            csrs    mstatus,a5                                        
}                                                                                         
4000f680:   02c12083            lw  ra,44(sp)                                             
4000f684:   02812403            lw  s0,40(sp)                                             
    *event_out = seized_events;                                                           
4000f688:   0066a023            sw  t1,0(a3)                                              
}                                                                                         
4000f68c:   02412483            lw  s1,36(sp)                                             
4000f690:   02012903            lw  s2,32(sp)                                             
4000f694:   01c12983            lw  s3,28(sp)                                             
4000f698:   01812a03            lw  s4,24(sp)                                             
    return RTEMS_SUCCESSFUL;                                                              
4000f69c:   00000513            li  a0,0                                                  
}                                                                                         
4000f6a0:   03010113            addi    sp,sp,48                                          
4000f6a4:   00008067            ret                                                       
  __asm__ volatile (                                                                      
4000f6a8:   01112623            sw  a7,12(sp)                                             
4000f6ac:   30047a73            csrrci  s4,mstatus,8                                      
  expire = ticks + cpu->Watchdog.ticks;                                                   
4000f6b0:   04872783            lw  a5,72(a4)                                             
4000f6b4:   04c72683            lw  a3,76(a4)                                             
  the_thread->Timer.header =                                                              
4000f6b8:   40023537            lui a0,0x40023                                            
4000f6bc:   00f60733            add a4,a2,a5                                              
4000f6c0:   00c737b3            sltu    a5,a4,a2                                          
  the_thread->Timer.Watchdog.routine = _Thread_Timeout;                                   
4000f6c4:   4000b637            lui a2,0x4000b                                            
  the_thread->Timer.header =                                                              
4000f6c8:   fd050593            addi    a1,a0,-48 # 40022fd0 <_Per_CPU_Information+0x50>  
  the_thread->Timer.Watchdog.routine = _Thread_Timeout;                                   
4000f6cc:   27c60613            addi    a2,a2,636 # 4000b27c <_Thread_Timeout>            
  the_thread->Timer.header =                                                              
4000f6d0:   06b42023            sw  a1,96(s0)                                             
  the_thread->Timer.Watchdog.routine = _Thread_Timeout;                                   
4000f6d4:   06c42c23            sw  a2,120(s0)                                            
  _Watchdog_Insert(header, the_watchdog, expire);                                         
4000f6d8:   00d786b3            add a3,a5,a3                                              
4000f6dc:   00070613            mv  a2,a4                                                 
4000f6e0:   06840593            addi    a1,s0,104                                         
4000f6e4:   fd050513            addi    a0,a0,-48                                         
4000f6e8:   eb9fb0ef            jal ra,4000b5a0 <_Watchdog_Insert>                        
  return mstatus & RISCV_MSTATUS_MIE;                                                     
4000f6ec:   008a7a13            andi    s4,s4,8                                           
  __asm__ volatile ( "csrrs zero, mstatus, %0" : : "r" ( level ) );                       
4000f6f0:   300a2073            csrs    mstatus,s4                                        
4000f6f4:   00c12883            lw  a7,12(sp)                                             
  _Thread_Set_state( executing, block_state );                                            
4000f6f8:   00040513            mv  a0,s0                                                 
4000f6fc:   00088593            mv  a1,a7                                                 
4000f700:   975fb0ef            jal ra,4000b074 <_Thread_Set_state>                       
  __asm__ volatile (                                                                      
4000f704:   300477f3            csrrci  a5,mstatus,8                                      
  return mstatus & RISCV_MSTATUS_MIE;                                                     
4000f708:   0087f793            andi    a5,a5,8                                           
  bool success = ( the_thread->Wait.flags == expected_flags );                            
4000f70c:   05042703            lw  a4,80(s0)                                             
  if ( success ) {                                                                        
4000f710:   eee912e3            bne s2,a4,4000f5f4 <_Event_Seize+0xa0>                    
4000f714:   f41ff06f            j   4000f654 <_Event_Seize+0x100>                         
  __asm__ volatile ( "csrrs zero, mstatus, %0" : : "r" ( level ) );                       
4000f718:   03012783            lw  a5,48(sp)                                             
4000f71c:   0007a783            lw  a5,0(a5)                                              
4000f720:   3007a073            csrs    mstatus,a5                                        
}                                                                                         
4000f724:   02c12083            lw  ra,44(sp)                                             
4000f728:   02812403            lw  s0,40(sp)                                             
    *event_out = seized_events;                                                           
4000f72c:   0066a023            sw  t1,0(a3)                                              
}                                                                                         
4000f730:   02412483            lw  s1,36(sp)                                             
4000f734:   02012903            lw  s2,32(sp)                                             
4000f738:   01c12983            lw  s3,28(sp)                                             
4000f73c:   01812a03            lw  s4,24(sp)                                             
    return RTEMS_UNSATISFIED;                                                             
4000f740:   00d00513            li  a0,13                                                 
}                                                                                         
4000f744:   03010113            addi    sp,sp,48                                          
4000f748:   00008067            ret                                                       
                                                                                          

4001181c <_RTEMS_tasks_Create>: {
4001181c:   fb010113            addi    sp,sp,-80                                         
40011820:   04812423            sw  s0,72(sp)                                             
40011824:   00050413            mv  s0,a0                                                 
  if ( !rtems_is_name_valid( config->name ) ) {                                           
40011828:   00052503            lw  a0,0(a0)                                              
{                                                                                         
4001182c:   05212023            sw  s2,64(sp)                                             
40011830:   04112623            sw  ra,76(sp)                                             
40011834:   04912223            sw  s1,68(sp)                                             
40011838:   03312e23            sw  s3,60(sp)                                             
4001183c:   03412c23            sw  s4,56(sp)                                             
40011840:   03512a23            sw  s5,52(sp)                                             
    return RTEMS_INVALID_NAME;                                                            
40011844:   00300913            li  s2,3                                                  
  if ( !rtems_is_name_valid( config->name ) ) {                                           
40011848:   10050063            beqz    a0,40011948 <_RTEMS_tasks_Create+0x12c>           
4001184c:   00058493            mv  s1,a1                                                 
  if ( id == NULL ) {                                                                     
40011850:   12058663            beqz    a1,4001197c <_RTEMS_tasks_Create+0x160>           
  thread_config.budget_algorithm = _Modes_Is_timeslice( config->initial_modes ) ?         
40011854:   01842683            lw  a3,24(s0)                                             
  attributes = _Attributes_Set( config->attributes, ATTRIBUTES_REQUIRED );                
40011858:   01c42783            lw  a5,28(s0)                                             
  memset( &thread_config, 0, sizeof( thread_config ) );                                   
4001185c:   00060913            mv  s2,a2                                                 
 */                                                                                       
RTEMS_INLINE_ROUTINE bool _Modes_Is_preempt (                                             
  rtems_mode mode_set                                                                     
)                                                                                         
{                                                                                         
   return (mode_set & RTEMS_PREEMPT_MASK) == RTEMS_PREEMPT;                               
40011860:   0086d713            srli    a4,a3,0x8                                         
 */                                                                                       
RTEMS_INLINE_ROUTINE bool _Modes_Is_timeslice (                                           
  rtems_mode mode_set                                                                     
)                                                                                         
{                                                                                         
  return (mode_set & RTEMS_TIMESLICE_MASK) == RTEMS_TIMESLICE;                            
40011864:   0096d613            srli    a2,a3,0x9                                         
   return (mode_set & RTEMS_PREEMPT_MASK) == RTEMS_PREEMPT;                               
40011868:   00174713            xori    a4,a4,1                                           
4001186c:   02012423            sw  zero,40(sp)                                           
 */                                                                                       
RTEMS_INLINE_ROUTINE bool _Attributes_Is_floating_point(                                  
  rtems_attribute attribute_set                                                           
)                                                                                         
{                                                                                         
   return ( attribute_set & RTEMS_FLOATING_POINT ) ? true : false;                        
40011870:   0017f593            andi    a1,a5,1                                           
  return (mode_set & RTEMS_TIMESLICE_MASK) == RTEMS_TIMESLICE;                            
40011874:   00167613            andi    a2,a2,1                                           
 */                                                                                       
RTEMS_INLINE_ROUTINE ISR_Level _Modes_Get_interrupt_level (                               
  rtems_mode mode_set                                                                     
)                                                                                         
{                                                                                         
  return ( mode_set & RTEMS_INTERRUPT_MASK );                                             
40011878:   0016f693            andi    a3,a3,1                                           
   return (mode_set & RTEMS_PREEMPT_MASK) == RTEMS_PREEMPT;                               
4001187c:   00177713            andi    a4,a4,1                                           
 */                                                                                       
RTEMS_INLINE_ROUTINE bool _Attributes_Is_system_task(                                     
  rtems_attribute attribute_set                                                           
)                                                                                         
{                                                                                         
   return ( attribute_set & RTEMS_SYSTEM_TASK ) ? true : false;                           
40011880:   00f7d793            srli    a5,a5,0xf                                         
  thread_config.budget_algorithm = _Modes_Is_timeslice( config->initial_modes ) ?         
40011884:   00c12c23            sw  a2,24(sp)                                             
  thread_config.isr_level =  _Modes_Get_interrupt_level( config->initial_modes );         
40011888:   02d12223            sw  a3,36(sp)                                             
  thread_config.name.name_u32 = config->name;                                             
4001188c:   02a12023            sw  a0,32(sp)                                             
   return ( attribute_set & RTEMS_FLOATING_POINT ) ? true : false;                        
40011890:   02b10423            sb  a1,40(sp)                                             
  thread_config.is_preemptible = _Modes_Is_preempt( config->initial_modes );              
40011894:   02e104a3            sb  a4,41(sp)                                             
  if ( !_Attributes_Is_system_task( attributes ) ) {                                      
40011898:   0017f793            andi    a5,a5,1                                           
  memset( &thread_config, 0, sizeof( thread_config ) );                                   
4001189c:   00012223            sw  zero,4(sp)                                            
400118a0:   00012423            sw  zero,8(sp)                                            
400118a4:   00012623            sw  zero,12(sp)                                           
400118a8:   00012823            sw  zero,16(sp)                                           
400118ac:   00012a23            sw  zero,20(sp)                                           
400118b0:   00012e23            sw  zero,28(sp)                                           
400118b4:   02012623            sw  zero,44(sp)                                           
    if ( config->initial_priority == PRIORITY_MINIMUM ) {                                 
400118b8:   00442983            lw  s3,4(s0)                                              
  if ( !_Attributes_Is_system_task( attributes ) ) {                                      
400118bc:   00079463            bnez    a5,400118c4 <_RTEMS_tasks_Create+0xa8>            
    if ( config->initial_priority == PRIORITY_MINIMUM ) {                                 
400118c0:   0a098a63            beqz    s3,40011974 <_RTEMS_tasks_Create+0x158>           
  thread_config.scheduler =                                                               
400118c4:   4001e537            lui a0,0x4001e                                            
400118c8:   37050793            addi    a5,a0,880 # 4001e370 <_Scheduler_Table>           
  return ( *scheduler->Operations.map_priority )( scheduler, priority );                  
400118cc:   01c7a703            lw  a4,28(a5)                                             
  const Scheduler_Control *scheduler,                                                     
  rtems_task_priority      priority,                                                      
  bool                    *valid                                                          
)                                                                                         
{                                                                                         
  *valid = ( priority <= scheduler->maximum_priority );                                   
400118d0:   0447aa03            lw  s4,68(a5)                                             
400118d4:   00f12023            sw  a5,0(sp)                                              
400118d8:   00098593            mv  a1,s3                                                 
400118dc:   00000613            li  a2,0                                                  
400118e0:   37050513            addi    a0,a0,880                                         
400118e4:   0407aa83            lw  s5,64(a5)                                             
400118e8:   000700e7            jalr    a4                                                
  thread_config.priority = _RTEMS_Priority_To_core(                                       
400118ec:   00a12823            sw  a0,16(sp)                                             
400118f0:   00b12a23            sw  a1,20(sp)                                             
  if ( !valid ) {                                                                         
400118f4:   060a0e63            beqz    s4,40011970 <_RTEMS_tasks_Create+0x154>           <== ALWAYS TAKEN
  _RTEMS_Lock_allocator();                                                                
400118f8:   83df50ef            jal ra,40007134 <_RTEMS_Lock_allocator>                   
  return ( *information->allocate )( information );                                       
400118fc:   40020a37            lui s4,0x40020                                            
  _Thread_Kill_zombies();                                                                 
40011900:   a9cf90ef            jal ra,4000ab9c <_Thread_Kill_zombies>                    
40011904:   648a0793            addi    a5,s4,1608 # 40020648 <_RTEMS_tasks_Information>  
40011908:   0087a783            lw  a5,8(a5)                                              
4001190c:   648a0513            addi    a0,s4,1608                                        
40011910:   000780e7            jalr    a5                                                
40011914:   00050993            mv  s3,a0                                                 
  if ( !the_thread ) {                                                                    
40011918:   0a050863            beqz    a0,400119c8 <_RTEMS_tasks_Create+0x1ac>           
  status = ( *prepare_stack )( &thread_config, config );                                  
4001191c:   00040593            mv  a1,s0                                                 
40011920:   00010513            mv  a0,sp                                                 
40011924:   000900e7            jalr    s2                                                
40011928:   00050913            mv  s2,a0                                                 
  if ( status == RTEMS_SUCCESSFUL ) {                                                     
4001192c:   04050c63            beqz    a0,40011984 <_RTEMS_tasks_Create+0x168>           
  _Objects_Free(                                                                          
40011930:   0089a503            lw  a0,8(s3)                                              
40011934:   885fe0ef            jal ra,400101b8 <_Objects_Get_information_id>             
  ( *information->deallocate )( information, the_object );                                
40011938:   00c52783            lw  a5,12(a0)                                             
4001193c:   00098593            mv  a1,s3                                                 
40011940:   000780e7            jalr    a5                                                
  _RTEMS_Unlock_allocator();                                                              
40011944:   ffcf50ef            jal ra,40007140 <_RTEMS_Unlock_allocator>                 
}                                                                                         
40011948:   04c12083            lw  ra,76(sp)                                             
4001194c:   04812403            lw  s0,72(sp)                                             
40011950:   04412483            lw  s1,68(sp)                                             
40011954:   03c12983            lw  s3,60(sp)                                             
40011958:   03812a03            lw  s4,56(sp)                                             
4001195c:   03412a83            lw  s5,52(sp)                                             
40011960:   00090513            mv  a0,s2                                                 
40011964:   04012903            lw  s2,64(sp)                                             
40011968:   05010113            addi    sp,sp,80                                          
4001196c:   00008067            ret                                                       
  if ( !valid ) {                                                                         
40011970:   f93af4e3            bgeu    s5,s3,400118f8 <_RTEMS_tasks_Create+0xdc>         
      return RTEMS_INVALID_PRIORITY;                                                      
40011974:   01300913            li  s2,19                                                 
40011978:   fd1ff06f            j   40011948 <_RTEMS_tasks_Create+0x12c>                  
    return RTEMS_INVALID_ADDRESS;                                                         
4001197c:   00900913            li  s2,9                                                  
40011980:   fc9ff06f            j   40011948 <_RTEMS_tasks_Create+0x12c>                  
    ok = _Thread_Initialize(                                                              
40011984:   00010613            mv  a2,sp                                                 
40011988:   00098593            mv  a1,s3                                                 
4001198c:   648a0513            addi    a0,s4,1608                                        
40011990:   e60ff0ef            jal ra,40010ff0 <_Thread_Initialize>                      
    if ( !ok ) {                                                                          
40011994:   02050663            beqz    a0,400119c0 <_RTEMS_tasks_Create+0x1a4>           
  asr->is_enabled = !_Modes_Is_asr_disabled( config->initial_modes );                     
40011998:   01842783            lw  a5,24(s0)                                             
4001199c:   1949a683            lw  a3,404(s3)                                            
  *id = the_thread->Object.id;                                                            
400119a0:   0089a703            lw  a4,8(s3)                                              
  asr->is_enabled = !_Modes_Is_asr_disabled( config->initial_modes );                     
400119a4:   00a7d793            srli    a5,a5,0xa                                         
400119a8:   0017c793            xori    a5,a5,1                                           
400119ac:   0017f793            andi    a5,a5,1                                           
400119b0:   00f68423            sb  a5,8(a3)                                              
  *id = the_thread->Object.id;                                                            
400119b4:   00e4a023            sw  a4,0(s1)                                              
400119b8:   f88f50ef            jal ra,40007140 <_RTEMS_Unlock_allocator>                 
  return RTEMS_SUCCESSFUL;                                                                
400119bc:   f8dff06f            j   40011948 <_RTEMS_tasks_Create+0x12c>                  
      status = RTEMS_UNSATISFIED;                                                         
400119c0:   00d00913            li  s2,13                                                 
400119c4:   f6dff06f            j   40011930 <_RTEMS_tasks_Create+0x114>                  
400119c8:   f78f50ef            jal ra,40007140 <_RTEMS_Unlock_allocator>                 
    return RTEMS_TOO_MANY;                                                                
400119cc:   00500913            li  s2,5                                                  
400119d0:   f79ff06f            j   40011948 <_RTEMS_tasks_Create+0x12c>                  
                                                                                          

40006ee0 <_RTEMS_tasks_Initialize_user_task>: #include <rtems/score/assert.h> #include <rtems/score/threadimpl.h> #include <rtems/score/interr.h> void _RTEMS_tasks_Initialize_user_task( void ) {
40006ee0:   fe010113            addi    sp,sp,-32                                         
40006ee4:   00812c23            sw  s0,24(sp)                                             
  rtems_id                                id;                                             
  rtems_status_code                       return_value;                                   
  const rtems_initialization_tasks_table *user_task;                                      
                                                                                          
  user_task = &_RTEMS_tasks_User_task_table;                                              
  return_value = rtems_task_create(                                                       
40006ee8:   4001e437            lui s0,0x4001e                                            
40006eec:   35040413            addi    s0,s0,848 # 4001e350 <_RTEMS_tasks_User_task_table>
40006ef0:   00c42703            lw  a4,12(s0)                                             
40006ef4:   01442683            lw  a3,20(s0)                                             
40006ef8:   00442603            lw  a2,4(s0)                                              
40006efc:   00842583            lw  a1,8(s0)                                              
40006f00:   00042503            lw  a0,0(s0)                                              
40006f04:   00c10793            addi    a5,sp,12                                          
{                                                                                         
40006f08:   00112e23            sw  ra,28(sp)                                             
  return_value = rtems_task_create(                                                       
40006f0c:   26d080ef            jal ra,4000f978 <rtems_task_create>                       
    user_task->stack_size,                                                                
    user_task->mode_set,                                                                  
    user_task->attribute_set,                                                             
    &id                                                                                   
  );                                                                                      
  if ( !rtems_is_status_successful( return_value ) ) {                                    
40006f10:   02051663            bnez    a0,40006f3c <_RTEMS_tasks_Initialize_user_task+0x5c><== NEVER TAKEN
    _Internal_error( INTERNAL_ERROR_RTEMS_INIT_TASK_CREATE_FAILED );                      
  }                                                                                       
                                                                                          
  return_value = rtems_task_start(                                                        
40006f14:   01842603            lw  a2,24(s0)                                             
40006f18:   01042583            lw  a1,16(s0)                                             
40006f1c:   00c12503            lw  a0,12(sp)                                             
40006f20:   024000ef            jal ra,40006f44 <rtems_task_start>                        
  );                                                                                      
  _Assert( rtems_is_status_successful( return_value ) );                                  
  (void) return_value;                                                                    
                                                                                          
  _Assert( _Thread_Global_constructor == 0 );                                             
  _Thread_Global_constructor = id;                                                        
40006f24:   00c12703            lw  a4,12(sp)                                             
}                                                                                         
40006f28:   01c12083            lw  ra,28(sp)                                             
40006f2c:   01812403            lw  s0,24(sp)                                             
  _Thread_Global_constructor = id;                                                        
40006f30:   92e1ac23            sw  a4,-1736(gp) # 40020d78 <_Thread_Global_constructor>  
}                                                                                         
40006f34:   02010113            addi    sp,sp,32                                          
40006f38:   00008067            ret                                                       
    _Internal_error( INTERNAL_ERROR_RTEMS_INIT_TASK_CREATE_FAILED );                      
40006f3c:   02000513            li  a0,32                                                 
40006f40:   279000ef            jal ra,400079b8 <_Internal_error>                         <== NOT EXECUTED
                                                                                          

4000d5f8 <_Signal_Action_handler>: void _Signal_Action_handler( Thread_Control *executing, Thread_Action *action, ISR_lock_Context *lock_context ) {
4000d5f8:   fe010113            addi    sp,sp,-32                                         
4000d5fc:   00812c23            sw  s0,24(sp)                                             
                                                                                          
  /*                                                                                      
   *  Signal Processing                                                                   
   */                                                                                     
                                                                                          
  api = executing->API_Extensions[ THREAD_API_RTEMS ];                                    
4000d600:   19452403            lw  s0,404(a0)                                            
{                                                                                         
4000d604:   00912a23            sw  s1,20(sp)                                             
4000d608:   00112e23            sw  ra,28(sp)                                             
4000d60c:   01212823            sw  s2,16(sp)                                             
  ASR_Information *asr                                                                    
)                                                                                         
{                                                                                         
  rtems_signal_set signal_set;                                                            
                                                                                          
  signal_set = asr->signals_posted;                                                       
4000d610:   01442483            lw  s1,20(s0)                                             
  asr->signals_posted = 0;                                                                
4000d614:   00042a23            sw  zero,20(s0)                                           
4000d618:   00062783            lw  a5,0(a2)                                              
4000d61c:   3007a073            csrs    mstatus,a5                                        
  asr = &api->Signal;                                                                     
  signal_set = _ASR_Get_posted_signals( asr );                                            
                                                                                          
  _Thread_State_release( executing, lock_context );                                       
                                                                                          
  if ( signal_set == 0 ) {                                                                
4000d620:   04048663            beqz    s1,4000d66c <_Signal_Action_handler+0x74>         <== NEVER TAKEN
    return;                                                                               
  }                                                                                       
                                                                                          
  asr->nest_level += 1;                                                                   
4000d624:   01c42783            lw  a5,28(s0)                                             
  rtems_task_mode( asr->mode_set, RTEMS_ALL_MODE_MASKS, &prev_mode );                     
4000d628:   01042503            lw  a0,16(s0)                                             
4000d62c:   00010937            lui s2,0x10                                               
  asr->nest_level += 1;                                                                   
4000d630:   00178793            addi    a5,a5,1                                           
  rtems_task_mode( asr->mode_set, RTEMS_ALL_MODE_MASKS, &prev_mode );                     
4000d634:   00c10613            addi    a2,sp,12                                          
4000d638:   fff90593            addi    a1,s2,-1 # ffff <bsp_section_bss_size+0xca5b>     
  asr->nest_level += 1;                                                                   
4000d63c:   00f42e23            sw  a5,28(s0)                                             
  rtems_task_mode( asr->mode_set, RTEMS_ALL_MODE_MASKS, &prev_mode );                     
4000d640:   ef4f90ef            jal ra,40006d34 <rtems_task_mode>                         
                                                                                          
  (*asr->handler)( signal_set );                                                          
4000d644:   00c42783            lw  a5,12(s0)                                             
4000d648:   00048513            mv  a0,s1                                                 
4000d64c:   000780e7            jalr    a5                                                
                                                                                          
  asr->nest_level -= 1;                                                                   
4000d650:   01c42783            lw  a5,28(s0)                                             
  rtems_task_mode( prev_mode, RTEMS_ALL_MODE_MASKS, &prev_mode );                         
4000d654:   00c12503            lw  a0,12(sp)                                             
4000d658:   00c10613            addi    a2,sp,12                                          
  asr->nest_level -= 1;                                                                   
4000d65c:   fff78793            addi    a5,a5,-1                                          
4000d660:   00f42e23            sw  a5,28(s0)                                             
  rtems_task_mode( prev_mode, RTEMS_ALL_MODE_MASKS, &prev_mode );                         
4000d664:   fff90593            addi    a1,s2,-1                                          
4000d668:   eccf90ef            jal ra,40006d34 <rtems_task_mode>                         
}                                                                                         
4000d66c:   01c12083            lw  ra,28(sp)                                             
4000d670:   01812403            lw  s0,24(sp)                                             
4000d674:   01412483            lw  s1,20(sp)                                             
4000d678:   01012903            lw  s2,16(sp)                                             
4000d67c:   02010113            addi    sp,sp,32                                          
4000d680:   00008067            ret                                                       
                                                                                          

40004440 <_TOD_Validate>: ) { uint32_t days_in_month; uint32_t ticks_per_second; ticks_per_second = TOD_MICROSECONDS_PER_SECOND /
40004440:   8181a683            lw  a3,-2024(gp) # 40014408 <_Watchdog_Microseconds_per_tick>
40004444:   000f4737            lui a4,0xf4                                               
40004448:   24070713            addi    a4,a4,576 # f4240 <bsp_section_text_size+0xe2808> 
4000444c:   02d75733            divu    a4,a4,a3                                          
{                                                                                         
40004450:   00050793            mv  a5,a0                                                 
        rtems_configuration_get_microseconds_per_tick();                                  
  if ((!the_tod)                                  ||                                      
40004454:   08050663            beqz    a0,400044e0 <_TOD_Validate+0xa0>                  <== NEVER TAKEN
40004458:   01852683            lw  a3,24(a0)                                             
      (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;                                                                        
4000445c:   00000513            li  a0,0                                                  
  if ((!the_tod)                                  ||                                      
40004460:   08e6f263            bgeu    a3,a4,400044e4 <_TOD_Validate+0xa4>               
      (the_tod->ticks  >= ticks_per_second)       ||                                      
40004464:   0147a683            lw  a3,20(a5)                                             
40004468:   03b00713            li  a4,59                                                 
4000446c:   06d76c63            bltu    a4,a3,400044e4 <_TOD_Validate+0xa4>               
      (the_tod->second >= TOD_SECONDS_PER_MINUTE) ||                                      
40004470:   0107a683            lw  a3,16(a5)                                             
40004474:   06d76863            bltu    a4,a3,400044e4 <_TOD_Validate+0xa4>               
      (the_tod->minute >= TOD_MINUTES_PER_HOUR)   ||                                      
40004478:   00c7a683            lw  a3,12(a5)                                             
4000447c:   01700713            li  a4,23                                                 
40004480:   06d76263            bltu    a4,a3,400044e4 <_TOD_Validate+0xa4>               
      (the_tod->month  == 0)                      ||                                      
40004484:   0047a703            lw  a4,4(a5)                                              
      (the_tod->hour   >= TOD_HOURS_PER_DAY)      ||                                      
40004488:   00b00693            li  a3,11                                                 
4000448c:   fff70613            addi    a2,a4,-1                                          
40004490:   04c6ea63            bltu    a3,a2,400044e4 <_TOD_Validate+0xa4>               
      (the_tod->year   <  TOD_BASE_YEAR)          ||                                      
40004494:   0007a683            lw  a3,0(a5)                                              
      (the_tod->month  >  TOD_MONTHS_PER_YEAR)    ||                                      
40004498:   7c300613            li  a2,1987                                               
4000449c:   04d67463            bgeu    a2,a3,400044e4 <_TOD_Validate+0xa4>               
      (the_tod->day    == 0) )                                                            
400044a0:   0087a783            lw  a5,8(a5)                                              
      (the_tod->year   <  TOD_BASE_YEAR)          ||                                      
400044a4:   04078063            beqz    a5,400044e4 <_TOD_Validate+0xa4>                  <== NEVER TAKEN
                                                                                          
  if (((the_tod->year % 4) == 0 && (the_tod->year % 100 != 0)) ||                         
400044a8:   0036f613            andi    a2,a3,3                                           
400044ac:   02061e63            bnez    a2,400044e8 <_TOD_Validate+0xa8>                  
400044b0:   06400613            li  a2,100                                                
400044b4:   02c6f633            remu    a2,a3,a2                                          
400044b8:   02060863            beqz    a2,400044e8 <_TOD_Validate+0xa8>                  
     (the_tod->year % 400 == 0))                                                          
    days_in_month = _TOD_Days_per_month[ 1 ][ the_tod->month ];                           
400044bc:   00d70713            addi    a4,a4,13                                          
  else                                                                                    
    days_in_month = _TOD_Days_per_month[ 0 ][ the_tod->month ];                           
400044c0:   400126b7            lui a3,0x40012                                            
400044c4:   5c068693            addi    a3,a3,1472 # 400125c0 <_TOD_Days_per_month>       
400044c8:   00271713            slli    a4,a4,0x2                                         
400044cc:   00e68733            add a4,a3,a4                                              
400044d0:   00072503            lw  a0,0(a4)                                              
                                                                                          
  if ( the_tod->day > days_in_month )                                                     
400044d4:   00f53533            sltu    a0,a0,a5                                          
400044d8:   00154513            xori    a0,a0,1                                           
400044dc:   00008067            ret                                                       
     return false;                                                                        
400044e0:   00000513            li  a0,0                                                  <== NOT EXECUTED
    return false;                                                                         
                                                                                          
  return true;                                                                            
}                                                                                         
400044e4:   00008067            ret                                                       
400044e8:   19000613            li  a2,400                                                
400044ec:   02c6f6b3            remu    a3,a3,a2                                          
  if (((the_tod->year % 4) == 0 && (the_tod->year % 100 != 0)) ||                         
400044f0:   fc0698e3            bnez    a3,400044c0 <_TOD_Validate+0x80>                  
    days_in_month = _TOD_Days_per_month[ 1 ][ the_tod->month ];                           
400044f4:   00d70713            addi    a4,a4,13                                          
400044f8:   fc9ff06f            j   400044c0 <_TOD_Validate+0x80>                         
                                                                                          

40003aac <_Timer_Cancel>: return RB_COLOR( &the_watchdog->Node.RBTree, Node );
40003aac:   01c5a703            lw  a4,28(a1)                                             <== NOT EXECUTED
  if ( _Watchdog_Is_scheduled( &the_timer->Ticker ) ) {                                   
40003ab0:   00100693            li  a3,1                                                  <== NOT EXECUTED
  the_class = the_timer->the_class;                                                       
40003ab4:   0305a783            lw  a5,48(a1)                                             <== NOT EXECUTED
  if ( _Watchdog_Is_scheduled( &the_timer->Ticker ) ) {                                   
40003ab8:   02e6fe63            bgeu    a3,a4,40003af4 <_Timer_Cancel+0x48>               <== NOT EXECUTED
  return ( the_class & mask ) == mask;                                                    
40003abc:   0067f793            andi    a5,a5,6                                           <== NOT EXECUTED
  } else if ( _Timer_Is_on_task_class( the_class ) ) {                                    
40003ac0:   00600693            li  a3,6                                                  <== NOT EXECUTED
40003ac4:   00d78463            beq a5,a3,40003acc <_Timer_Cancel+0x20>                   <== NOT EXECUTED
}                                                                                         
40003ac8:   00008067            ret                                                       <== NOT EXECUTED
    timer_server = _Timer_server;                                                         
40003acc:   8bc1a783            lw  a5,-1860(gp) # 40010d54 <_Timer_server>               <== NOT EXECUTED
    if ( _Watchdog_Get_state( &the_timer->Ticker ) == WATCHDOG_PENDING ) {                
40003ad0:   00300793            li  a5,3                                                  <== NOT EXECUTED
40003ad4:   fef71ae3            bne a4,a5,40003ac8 <_Timer_Cancel+0x1c>                   <== NOT EXECUTED
  next           = the_node->next;                                                        
40003ad8:   0105a703            lw  a4,16(a1)                                             <== NOT EXECUTED
  previous       = the_node->previous;                                                    
40003adc:   0145a783            lw  a5,20(a1)                                             <== NOT EXECUTED
  RB_COLOR( &the_watchdog->Node.RBTree, Node ) = state;                                   
40003ae0:   00200693            li  a3,2                                                  <== NOT EXECUTED
40003ae4:   00d5ae23            sw  a3,28(a1)                                             <== NOT EXECUTED
  next->previous = previous;                                                              
40003ae8:   00f72223            sw  a5,4(a4)                                              <== NOT EXECUTED
  previous->next = next;                                                                  
40003aec:   00e7a023            sw  a4,0(a5)                                              <== NOT EXECUTED
}                                                                                         
40003af0:   00008067            ret                                                       <== NOT EXECUTED
  return (Watchdog_Interval) cpu->Watchdog.ticks;                                         
40003af4:   04852703            lw  a4,72(a0)                                             <== NOT EXECUTED
  return ( the_class & TIMER_CLASS_BIT_TIME_OF_DAY );                                     
40003af8:   0017f793            andi    a5,a5,1                                           <== NOT EXECUTED
    _Watchdog_Remove(                                                                     
40003afc:   00a78793            addi    a5,a5,10                                          <== NOT EXECUTED
40003b00:   00379793            slli    a5,a5,0x3                                         <== NOT EXECUTED
  return (Watchdog_Interval) cpu->Watchdog.ticks;                                         
40003b04:   04e5a223            sw  a4,68(a1)                                             <== NOT EXECUTED
40003b08:   00f50533            add a0,a0,a5                                              <== NOT EXECUTED
40003b0c:   01058593            addi    a1,a1,16                                          <== NOT EXECUTED
40003b10:   5540306f            j   40007064 <_Watchdog_Remove>                           <== NOT EXECUTED
                                                                                          

40004134 <rtems_clock_get_tod>: uint32_t day_secs; uint32_t year; uint32_t year_days; uint32_t leap_years; if ( !time_buffer ) 40004134: 1a050c63 beqz a0,400042ec <rtems_clock_get_tod+0x1b8> return RTEMS_INVALID_ADDRESS; if ( !_TOD_Is_set() )
40004138:   8d01c783            lbu a5,-1840(gp) # 400144c0 <_TOD>                        
{                                                                                         
4000413c:   fd010113            addi    sp,sp,-48                                         
40004140:   02912223            sw  s1,36(sp)                                             
40004144:   02112623            sw  ra,44(sp)                                             
40004148:   02812423            sw  s0,40(sp)                                             
4000414c:   03212023            sw  s2,32(sp)                                             
40004150:   01312e23            sw  s3,28(sp)                                             
40004154:   00050493            mv  s1,a0                                                 
    return RTEMS_NOT_DEFINED;                                                             
40004158:   00b00513            li  a0,11                                                 
  if ( !_TOD_Is_set() )                                                                   
4000415c:   12078663            beqz    a5,40004288 <rtems_clock_get_tod+0x154>           
 */                                                                                       
RTEMS_INLINE_ROUTINE void _TOD_Get_timeval(                                               
  struct timeval *time                                                                    
)                                                                                         
{                                                                                         
  _Timecounter_Microtime( time );                                                         
40004160:   00010513            mv  a0,sp                                                 
40004164:   59c010ef            jal ra,40005700 <_Timecounter_Microtime>                  
                                                                                          
  /* Obtain the current time */                                                           
  _TOD_Get_timeval( &now );                                                               
                                                                                          
  /* How many days and how many seconds in the day ? */                                   
  days = now.tv_sec / RTEMS_SECS_PER_DAY;                                                 
40004168:   00012903            lw  s2,0(sp)                                              
4000416c:   00412983            lw  s3,4(sp)                                              
40004170:   00015637            lui a2,0x15                                               
40004174:   18060613            addi    a2,a2,384 # 15180 <bsp_section_text_size+0x3748>  
40004178:   00000693            li  a3,0                                                  
4000417c:   00090513            mv  a0,s2                                                 
40004180:   00098593            mv  a1,s3                                                 
40004184:   5540a0ef            jal ra,4000e6d8 <__divdi3>                                
  day_secs = now.tv_sec % RTEMS_SECS_PER_DAY;                                             
40004188:   00015637            lui a2,0x15                                               
  days = now.tv_sec / RTEMS_SECS_PER_DAY;                                                 
4000418c:   00050413            mv  s0,a0                                                 
  day_secs = now.tv_sec % RTEMS_SECS_PER_DAY;                                             
40004190:   18060613            addi    a2,a2,384 # 15180 <bsp_section_text_size+0x3748>  
40004194:   00000693            li  a3,0                                                  
40004198:   00090513            mv  a0,s2                                                 
4000419c:   00098593            mv  a1,s3                                                 
400041a0:   2250a0ef            jal ra,4000ebc4 <__moddi3>                                
                                                                                          
  /* How many non-leap year years ? */                                                    
  year = ( days / RTEMS_DAYS_PER_YEAR ) + RTEMS_YEAR_BASE;                                
400041a4:   16d00613            li  a2,365                                                
400041a8:   02c45333            divu    t1,s0,a2                                          
  return (year / 4) - (year / 100) + (year / 400);                                        
400041ac:   19000593            li  a1,400                                                
400041b0:   06400893            li  a7,100                                                
  day_secs = now.tv_sec % RTEMS_SECS_PER_DAY;                                             
400041b4:   00050813            mv  a6,a0                                                 
  year -= 1;                                                                              
400041b8:   7b130793            addi    a5,t1,1969                                        
  return (year / 4) - (year / 100) + (year / 400);                                        
400041bc:   02b7d733            divu    a4,a5,a1                                          
400041c0:   0027d693            srli    a3,a5,0x2                                         
400041c4:   0317d533            divu    a0,a5,a7                                          
400041c8:   00e686b3            add a3,a3,a4                                              
400041cc:   e2368693            addi    a3,a3,-477                                        
                                                                                          
  /* Adjust the remaining number of days based on the leap years. */                      
  year_days = ( days - leap_years ) % RTEMS_DAYS_PER_YEAR;                                
                                                                                          
  /* Adjust the year and days in the year if in the leap year overflow. */                
  if ( leap_years > ( days % RTEMS_DAYS_PER_YEAR ) ) {                                    
400041d0:   02c47e33            remu    t3,s0,a2                                          
  year_days = ( days - leap_years ) % RTEMS_DAYS_PER_YEAR;                                
400041d4:   00a40733            add a4,s0,a0                                              
400041d8:   40d70733            sub a4,a4,a3                                              
  return _Leap_years_before( to ) - _Leap_years_before( from + 1 );                       
400041dc:   40a686b3            sub a3,a3,a0                                              
  year_days = ( days - leap_years ) % RTEMS_DAYS_PER_YEAR;                                
400041e0:   02c77733            remu    a4,a4,a2                                          
  if ( leap_years > ( days % RTEMS_DAYS_PER_YEAR ) ) {                                    
400041e4:   0cde6063            bltu    t3,a3,400042a4 <rtems_clock_get_tod+0x170>        
  year = ( days / RTEMS_DAYS_PER_YEAR ) + RTEMS_YEAR_BASE;                                
400041e8:   7b230793            addi    a5,t1,1970                                        
  return (((year % 4) == 0) && ((year % 100) != 0)) || ((year % 400) == 0);               
400041ec:   0037f693            andi    a3,a5,3                                           
    if ( _Leap_year( year ) ) {                                                           
      year_days += 1;                                                                     
    }                                                                                     
  }                                                                                       
                                                                                          
  time_buffer->year   = year;                                                             
400041f0:   00f4a023            sw  a5,0(s1)                                              
  return (((year % 4) == 0) && ((year % 100) != 0)) || ((year % 400) == 0);               
400041f4:   00069863            bnez    a3,40004204 <rtems_clock_get_tod+0xd0>            
400041f8:   06400693            li  a3,100                                                
400041fc:   02d7f6b3            remu    a3,a5,a3                                          
40004200:   00069863            bnez    a3,40004210 <rtems_clock_get_tod+0xdc>            
40004204:   19000693            li  a3,400                                                
40004208:   02d7f7b3            remu    a5,a5,a3                                          
4000420c:   0c079663            bnez    a5,400042d8 <rtems_clock_get_tod+0x1a4>           
    days_to_date = _TOD_Days_to_date[1];                                                  
40004210:   400127b7            lui a5,0x40012                                            
40004214:   5a678793            addi    a5,a5,1446 # 400125a6 <_TOD_Days_to_date+0x1a>    
  days_to_date += 2;                                                                      
40004218:   00478793            addi    a5,a5,4                                           
  uint32_t        month = 0;                                                              
4000421c:   00000693            li  a3,0                                                  
  while (month < 11) {                                                                    
40004220:   00b00593            li  a1,11                                                 
    if (*day < *days_to_date)                                                             
40004224:   0007d603            lhu a2,0(a5)                                              
    ++month;                                                                              
40004228:   00168693            addi    a3,a3,1                                           
    if (*day < *days_to_date)                                                             
4000422c:   08c76c63            bltu    a4,a2,400042c4 <rtems_clock_get_tod+0x190>        
    ++days_to_date;                                                                       
40004230:   00278793            addi    a5,a5,2                                           
  while (month < 11) {                                                                    
40004234:   feb698e3            bne a3,a1,40004224 <rtems_clock_get_tod+0xf0>             
40004238:   00c00693            li  a3,12                                                 
  time_buffer->month  = _Year_day_as_month( year, &year_days ) + 1;                       
  time_buffer->day    = year_days + 1;                                                    
  time_buffer->hour   = day_secs / RTEMS_SECS_PER_HOUR;                                   
4000423c:   000017b7            lui a5,0x1                                                
40004240:   e1078793            addi    a5,a5,-496 # e10 <bsp_section_data_size+0x73c>    
  time_buffer->minute = day_secs % RTEMS_SECS_PER_HOUR;                                   
40004244:   02f875b3            remu    a1,a6,a5                                          
  time_buffer->second = time_buffer->minute % RTEMS_SECS_PER_MINUTE;                      
40004248:   03c00893            li  a7,60                                                 
  time_buffer->day    = year_days + 1;                                                    
4000424c:   00170713            addi    a4,a4,1                                           
40004250:   40c70633            sub a2,a4,a2                                              
  time_buffer->month  = _Year_day_as_month( year, &year_days ) + 1;                       
40004254:   00d4a223            sw  a3,4(s1)                                              
  time_buffer->day    = year_days + 1;                                                    
40004258:   00c4a423            sw  a2,8(s1)                                              
  time_buffer->minute = time_buffer->minute / RTEMS_SECS_PER_MINUTE;                      
  time_buffer->ticks  = now.tv_usec /                                                     
    rtems_configuration_get_microseconds_per_tick( );                                     
                                                                                          
  return RTEMS_SUCCESSFUL;                                                                
4000425c:   00000513            li  a0,0                                                  
  time_buffer->second = time_buffer->minute % RTEMS_SECS_PER_MINUTE;                      
40004260:   0315f733            remu    a4,a1,a7                                          
  time_buffer->hour   = day_secs / RTEMS_SECS_PER_HOUR;                                   
40004264:   02f857b3            divu    a5,a6,a5                                          
  time_buffer->second = time_buffer->minute % RTEMS_SECS_PER_MINUTE;                      
40004268:   00e4aa23            sw  a4,20(s1)                                             
  time_buffer->ticks  = now.tv_usec /                                                     
4000426c:   8181a703            lw  a4,-2024(gp) # 40014408 <_Watchdog_Microseconds_per_tick>
  time_buffer->hour   = day_secs / RTEMS_SECS_PER_HOUR;                                   
40004270:   00f4a623            sw  a5,12(s1)                                             
  time_buffer->ticks  = now.tv_usec /                                                     
40004274:   00812783            lw  a5,8(sp)                                              
  time_buffer->minute = time_buffer->minute / RTEMS_SECS_PER_MINUTE;                      
40004278:   0315d5b3            divu    a1,a1,a7                                          
  time_buffer->ticks  = now.tv_usec /                                                     
4000427c:   02e7d7b3            divu    a5,a5,a4                                          
  time_buffer->minute = time_buffer->minute / RTEMS_SECS_PER_MINUTE;                      
40004280:   00b4a823            sw  a1,16(s1)                                             
  time_buffer->ticks  = now.tv_usec /                                                     
40004284:   00f4ac23            sw  a5,24(s1)                                             
}                                                                                         
40004288:   02c12083            lw  ra,44(sp)                                             
4000428c:   02812403            lw  s0,40(sp)                                             
40004290:   02412483            lw  s1,36(sp)                                             
40004294:   02012903            lw  s2,32(sp)                                             
40004298:   01c12983            lw  s3,28(sp)                                             
4000429c:   03010113            addi    sp,sp,48                                          
400042a0:   00008067            ret                                                       
  return (((year % 4) == 0) && ((year % 100) != 0)) || ((year % 400) == 0);               
400042a4:   0037f693            andi    a3,a5,3                                           
400042a8:   02069263            bnez    a3,400042cc <rtems_clock_get_tod+0x198>           
400042ac:   0317f8b3            remu    a7,a5,a7                                          
400042b0:   02089a63            bnez    a7,400042e4 <rtems_clock_get_tod+0x1b0>           
400042b4:   02b7f5b3            remu    a1,a5,a1                                          
400042b8:   02058663            beqz    a1,400042e4 <rtems_clock_get_tod+0x1b0>           
  time_buffer->year   = year;                                                             
400042bc:   00f4a023            sw  a5,0(s1)                                              
  return (((year % 4) == 0) && ((year % 100) != 0)) || ((year % 400) == 0);               
400042c0:   f39ff06f            j   400041f8 <rtems_clock_get_tod+0xc4>                   
  *day -= *(days_to_date - 1);                                                            
400042c4:   ffe7d603            lhu a2,-2(a5)                                             
400042c8:   f75ff06f            j   4000423c <rtems_clock_get_tod+0x108>                  
  time_buffer->year   = year;                                                             
400042cc:   02b7f5b3            remu    a1,a5,a1                                          
  return (((year % 4) == 0) && ((year % 100) != 0)) || ((year % 400) == 0);               
400042d0:   00058a63            beqz    a1,400042e4 <rtems_clock_get_tod+0x1b0>           <== NEVER TAKEN
  time_buffer->year   = year;                                                             
400042d4:   00f4a023            sw  a5,0(s1)                                              
    days_to_date = _TOD_Days_to_date[0];                                                  
400042d8:   400127b7            lui a5,0x40012                                            
400042dc:   58c78793            addi    a5,a5,1420 # 4001258c <_TOD_Days_to_date>         
400042e0:   f39ff06f            j   40004218 <rtems_clock_get_tod+0xe4>                   
      year_days += 1;                                                                     
400042e4:   00170713            addi    a4,a4,1                                           
400042e8:   f09ff06f            j   400041f0 <rtems_clock_get_tod+0xbc>                   
    return RTEMS_INVALID_ADDRESS;                                                         
400042ec:   00900513            li  a0,9                                                  
}                                                                                         
400042f0:   00008067            ret                                                       
                                                                                          

40004488 <rtems_clock_tick>: #include <rtems/rtems/clock.h> #include <rtems/score/timecounter.h> #include <rtems/score/threadimpl.h> rtems_status_code rtems_clock_tick( void ) {
40004488:   fe010113            addi    sp,sp,-32                                         
4000448c:   00112e23            sw  ra,28(sp)                                             
  __asm__ volatile (                                                                      
40004490:   300477f3            csrrci  a5,mstatus,8                                      
  return mstatus & RISCV_MSTATUS_MIE;                                                     
40004494:   0087f793            andi    a5,a5,8                                           
  ISR_lock_Context lock_context;                                                          
                                                                                          
  _Timecounter_Acquire( &lock_context );                                                  
40004498:   00f12623            sw  a5,12(sp)                                             
  _Timecounter_Tick_simple(                                                               
4000449c:   8181a503            lw  a0,-2024(gp) # 40013748 <_Watchdog_Microseconds_per_tick>
400044a0:   00c10613            addi    a2,sp,12                                          
400044a4:   00000593            li  a1,0                                                  
400044a8:   269010ef            jal ra,40005f10 <_Timecounter_Tick_simple>                
400044ac:   400157b7            lui a5,0x40015                                            
400044b0:   3c078793            addi    a5,a5,960 # 400153c0 <_Per_CPU_Information>       
400044b4:   0307a783            lw  a5,48(a5)                                             
    rtems_configuration_get_microseconds_per_tick(),                                      
    0,                                                                                    
    &lock_context                                                                         
  );                                                                                      
                                                                                          
  if ( _Thread_Dispatch_is_enabled() ) {                                                  
400044b8:   00078a63            beqz    a5,400044cc <rtems_clock_tick+0x44>               <== ALWAYS TAKEN
    _Thread_Dispatch();                                                                   
  }                                                                                       
                                                                                          
  return RTEMS_SUCCESSFUL;                                                                
}                                                                                         
400044bc:   01c12083            lw  ra,28(sp)                                             <== NOT EXECUTED
400044c0:   00000513            li  a0,0                                                  <== NOT EXECUTED
400044c4:   02010113            addi    sp,sp,32                                          <== NOT EXECUTED
400044c8:   00008067            ret                                                       <== NOT EXECUTED
    _Thread_Dispatch();                                                                   
400044cc:   0e9020ef            jal ra,40006db4 <_Thread_Dispatch>                        
}                                                                                         
400044d0:   01c12083            lw  ra,28(sp)                                             
400044d4:   00000513            li  a0,0                                                  
400044d8:   02010113            addi    sp,sp,32                                          
400044dc:   00008067            ret                                                       
                                                                                          

40004950 <rtems_object_get_class_information>: int i; /* * Validate parameters and look up information structure. */ if ( !info ) 40004950: 08060a63 beqz a2,400049e4 <rtems_object_get_class_information+0x94> return RTEMS_INVALID_ADDRESS; obj_info = _Objects_Get_information( the_api, the_class );
40004954:   01059593            slli    a1,a1,0x10                                        
{                                                                                         
40004958:   ff010113            addi    sp,sp,-16                                         
  obj_info = _Objects_Get_information( the_api, the_class );                              
4000495c:   0105d593            srli    a1,a1,0x10                                        
{                                                                                         
40004960:   00812423            sw  s0,8(sp)                                              
40004964:   00112623            sw  ra,12(sp)                                             
40004968:   00060413            mv  s0,a2                                                 
  obj_info = _Objects_Get_information( the_api, the_class );                              
4000496c:   360010ef            jal ra,40005ccc <_Objects_Get_information>                
  if ( !obj_info )                                                                        
40004970:   06050e63            beqz    a0,400049ec <rtems_object_get_class_information+0x9c>
    return RTEMS_INVALID_NUMBER;                                                          
                                                                                          
  /*                                                                                      
   * Return information about this object class to the user.                              
   */                                                                                     
  info->minimum_id  = _Objects_Get_minimum_id( obj_info->maximum_id );                    
40004974:   00052603            lw  a2,0(a0)                                              
 */                                                                                       
RTEMS_INLINE_ROUTINE Objects_Maximum _Objects_Is_auto_extend(                             
  const Objects_Information *information                                                  
)                                                                                         
{                                                                                         
  return information->objects_per_block != 0;                                             
40004978:   01255703            lhu a4,18(a0)                                             
  id &= ~OBJECTS_INDEX_MASK;                                                              
4000497c:   ffff07b7            lui a5,0xffff0                                            
40004980:   00f677b3            and a5,a2,a5                                              
  return id;                                                                              
40004984:   01061693            slli    a3,a2,0x10                                        
  id += (Objects_Id) OBJECTS_INDEX_MINIMUM << OBJECTS_INDEX_START_BIT;                    
40004988:   00178793            addi    a5,a5,1 # ffff0001 <RamEnd+0xbeff0001>            
  return information->objects_per_block != 0;                                             
4000498c:   00e03733            snez    a4,a4                                             
40004990:   0106d693            srli    a3,a3,0x10                                        
40004994:   00f42023            sw  a5,0(s0)                                              
  info->maximum_id  = obj_info->maximum_id;                                               
40004998:   00c42223            sw  a2,4(s0)                                              
4000499c:   00e40623            sb  a4,12(s0)                                             
  info->auto_extend = _Objects_Is_auto_extend( obj_info );                                
  info->maximum     = _Objects_Get_maximum_index( obj_info );                             
400049a0:   00d42423            sw  a3,8(s0)                                              
                                                                                          
  for ( unallocated=0, i=1 ; i <= info->maximum ; i++ )                                   
400049a4:   02068463            beqz    a3,400049cc <rtems_object_get_class_information+0x7c><== NEVER TAKEN
400049a8:   00452783            lw  a5,4(a0)                                              
400049ac:   00269593            slli    a1,a3,0x2                                         
400049b0:   00000693            li  a3,0                                                  
400049b4:   00f585b3            add a1,a1,a5                                              
    if ( !obj_info->local_table[i] )                                                      
400049b8:   0047a703            lw  a4,4(a5)                                              
  for ( unallocated=0, i=1 ; i <= info->maximum ; i++ )                                   
400049bc:   00478793            addi    a5,a5,4                                           
      unallocated++;                                                                      
400049c0:   00173713            seqz    a4,a4                                             
400049c4:   00e686b3            add a3,a3,a4                                              
  for ( unallocated=0, i=1 ; i <= info->maximum ; i++ )                                   
400049c8:   feb798e3            bne a5,a1,400049b8 <rtems_object_get_class_information+0x68>
                                                                                          
  info->unallocated = unallocated;                                                        
400049cc:   00d42823            sw  a3,16(s0)                                             
                                                                                          
  return RTEMS_SUCCESSFUL;                                                                
400049d0:   00000513            li  a0,0                                                  
}                                                                                         
400049d4:   00c12083            lw  ra,12(sp)                                             
400049d8:   00812403            lw  s0,8(sp)                                              
400049dc:   01010113            addi    sp,sp,16                                          
400049e0:   00008067            ret                                                       
    return RTEMS_INVALID_ADDRESS;                                                         
400049e4:   00900513            li  a0,9                                                  
}                                                                                         
400049e8:   00008067            ret                                                       
    return RTEMS_INVALID_NUMBER;                                                          
400049ec:   00a00513            li  a0,10                                                 
400049f0:   fe5ff06f            j   400049d4 <rtems_object_get_class_information+0x84>    
                                                                                          

4000364c <rtems_object_set_name>: Objects_Information *information; Objects_Control *the_object; Objects_Id tmpId; Status_Control status; if ( !name ) 4000364c: 0a058863 beqz a1,400036fc <rtems_object_set_name+0xb0> {
40003650:   ff010113            addi    sp,sp,-16                                         
40003654:   00812423            sw  s0,8(sp)                                              
40003658:   01212023            sw  s2,0(sp)                                              
4000365c:   00112623            sw  ra,12(sp)                                             
40003660:   00912223            sw  s1,4(sp)                                              
40003664:   00058913            mv  s2,a1                                                 
40003668:   00050413            mv  s0,a0                                                 
    return RTEMS_INVALID_ADDRESS;                                                         
                                                                                          
  tmpId = (id == OBJECTS_ID_OF_SELF) ? rtems_task_self() : id;                            
4000366c:   04050e63            beqz    a0,400036c8 <rtems_object_set_name+0x7c>          
                                                                                          
  information  = _Objects_Get_information_id( tmpId );                                    
40003670:   00040513            mv  a0,s0                                                 
40003674:   345000ef            jal ra,400041b8 <_Objects_Get_information_id>             
40003678:   00050493            mv  s1,a0                                                 
  if ( !information )                                                                     
4000367c:   06050263            beqz    a0,400036e0 <rtems_object_set_name+0x94>          
 *                                                                                        
 * @see _Objects_Allocator_unlock() and _Objects_Allocate().                              
 */                                                                                       
RTEMS_INLINE_ROUTINE void _Objects_Allocator_lock( void )                                 
{                                                                                         
  _RTEMS_Lock_allocator();                                                                
40003680:   204000ef            jal ra,40003884 <_RTEMS_Lock_allocator>                   
    return RTEMS_INVALID_ID;                                                              
                                                                                          
  _Objects_Allocator_lock();                                                              
  the_object = _Objects_Get_no_protection( tmpId, information );                          
40003684:   00048593            mv  a1,s1                                                 
40003688:   00040513            mv  a0,s0                                                 
4000368c:   4fd000ef            jal ra,40004388 <_Objects_Get_no_protection>              
40003690:   00050593            mv  a1,a0                                                 
                                                                                          
  if ( the_object == NULL ) {                                                             
40003694:   06050863            beqz    a0,40003704 <rtems_object_set_name+0xb8>          
    _Objects_Allocator_unlock();                                                          
    return RTEMS_INVALID_ID;                                                              
  }                                                                                       
                                                                                          
  status = _Objects_Set_name( information, the_object, name );                            
40003698:   00090613            mv  a2,s2                                                 
4000369c:   00048513            mv  a0,s1                                                 
400036a0:   525000ef            jal ra,400043c4 <_Objects_Set_name>                       
400036a4:   00050413            mv  s0,a0                                                 
 * previous thread life protection state and thus may not return if the                   
 * executing thread was restarted or deleted in the mean-time.                            
 */                                                                                       
RTEMS_INLINE_ROUTINE void _Objects_Allocator_unlock( void )                               
{                                                                                         
  _RTEMS_Unlock_allocator();                                                              
400036a8:   1e8000ef            jal ra,40003890 <_RTEMS_Unlock_allocator>                 
  _Objects_Allocator_unlock();                                                            
  return STATUS_GET_CLASSIC( status );                                                    
400036ac:   0ff47513            andi    a0,s0,255                                         
}                                                                                         
400036b0:   00c12083            lw  ra,12(sp)                                             
400036b4:   00812403            lw  s0,8(sp)                                              
400036b8:   00412483            lw  s1,4(sp)                                              
400036bc:   00012903            lw  s2,0(sp)                                              
400036c0:   01010113            addi    sp,sp,16                                          
400036c4:   00008067            ret                                                       
  tmpId = (id == OBJECTS_ID_OF_SELF) ? rtems_task_self() : id;                            
400036c8:   0cc000ef            jal ra,40003794 <rtems_task_self>                         
400036cc:   00050413            mv  s0,a0                                                 
  information  = _Objects_Get_information_id( tmpId );                                    
400036d0:   00040513            mv  a0,s0                                                 
400036d4:   2e5000ef            jal ra,400041b8 <_Objects_Get_information_id>             
400036d8:   00050493            mv  s1,a0                                                 
  if ( !information )                                                                     
400036dc:   fa0512e3            bnez    a0,40003680 <rtems_object_set_name+0x34>          <== ALWAYS TAKEN
}                                                                                         
400036e0:   00c12083            lw  ra,12(sp)                                             
400036e4:   00812403            lw  s0,8(sp)                                              
400036e8:   00412483            lw  s1,4(sp)                                              
400036ec:   00012903            lw  s2,0(sp)                                              
    return RTEMS_INVALID_ID;                                                              
400036f0:   00400513            li  a0,4                                                  
}                                                                                         
400036f4:   01010113            addi    sp,sp,16                                          
400036f8:   00008067            ret                                                       
    return RTEMS_INVALID_ADDRESS;                                                         
400036fc:   00900513            li  a0,9                                                  
}                                                                                         
40003700:   00008067            ret                                                       
40003704:   18c000ef            jal ra,40003890 <_RTEMS_Unlock_allocator>                 
    return RTEMS_INVALID_ID;                                                              
40003708:   00400513            li  a0,4                                                  
4000370c:   fa5ff06f            j   400036b0 <rtems_object_set_name+0x64>                 
                                                                                          

4000f570 <rtems_partition_create>: {
4000f570:   fd010113            addi    sp,sp,-48                                         
4000f574:   03212023            sw  s2,32(sp)                                             
4000f578:   02112623            sw  ra,44(sp)                                             
4000f57c:   02812423            sw  s0,40(sp)                                             
4000f580:   02912223            sw  s1,36(sp)                                             
4000f584:   01312e23            sw  s3,28(sp)                                             
4000f588:   01412c23            sw  s4,24(sp)                                             
4000f58c:   01512a23            sw  s5,20(sp)                                             
4000f590:   00e12223            sw  a4,4(sp)                                              
    return RTEMS_INVALID_NAME;                                                            
4000f594:   00300913            li  s2,3                                                  
  if ( !rtems_is_name_valid( name ) ) {                                                   
4000f598:   0a050863            beqz    a0,4000f648 <rtems_partition_create+0xd8>         
4000f59c:   00078a93            mv  s5,a5                                                 
  if ( id == NULL ) {                                                                     
4000f5a0:   0c078863            beqz    a5,4000f670 <rtems_partition_create+0x100>        <== NEVER TAKEN
  if ( starting_address == NULL ) {                                                       
4000f5a4:   0c058663            beqz    a1,4000f670 <rtems_partition_create+0x100>        
4000f5a8:   00060413            mv  s0,a2                                                 
    return RTEMS_INVALID_SIZE;                                                            
4000f5ac:   00800913            li  s2,8                                                  
  if ( length == 0 )                                                                      
4000f5b0:   08060c63            beqz    a2,4000f648 <rtems_partition_create+0xd8>         
  if ( buffer_size == 0 )                                                                 
4000f5b4:   00700613            li  a2,7                                                  
4000f5b8:   08d67863            bgeu    a2,a3,4000f648 <rtems_partition_create+0xd8>      
  if ( length < buffer_size )                                                             
4000f5bc:   08d46663            bltu    s0,a3,4000f648 <rtems_partition_create+0xd8>      
  if ( buffer_size % CPU_SIZEOF_POINTER != 0 ) {                                          
4000f5c0:   0036f613            andi    a2,a3,3                                           
4000f5c4:   00d12423            sw  a3,8(sp)                                              
4000f5c8:   08061063            bnez    a2,4000f648 <rtems_partition_create+0xd8>         <== NEVER TAKEN
  if ( (uintptr_t) starting_address % CPU_SIZEOF_POINTER != 0 ) {                         
4000f5cc:   0035f913            andi    s2,a1,3                                           
4000f5d0:   00b12623            sw  a1,12(sp)                                             
4000f5d4:   08091e63            bnez    s2,4000f670 <rtems_partition_create+0x100>        
  return (Partition_Control *) _Objects_Allocate( &_Partition_Information );              
4000f5d8:   4003ea37            lui s4,0x4003e                                            
4000f5dc:   00050493            mv  s1,a0                                                 
4000f5e0:   310a0513            addi    a0,s4,784 # 4003e310 <_Partition_Information>     
4000f5e4:   7dc020ef            jal ra,40011dc0 <_Objects_Allocate>                       
  if ( !the_partition ) {                                                                 
4000f5e8:   00c12583            lw  a1,12(sp)                                             
4000f5ec:   00812683            lw  a3,8(sp)                                              
4000f5f0:   00412703            lw  a4,4(sp)                                              
  return (Partition_Control *) _Objects_Allocate( &_Partition_Information );              
4000f5f4:   00050993            mv  s3,a0                                                 
  if ( !the_partition ) {                                                                 
4000f5f8:   08050063            beqz    a0,4000f678 <rtems_partition_create+0x108>        
  _Chain_Initialize(                                                                      
4000f5fc:   02d45633            divu    a2,s0,a3                                          
  the_partition->buffer_size           = buffer_size;                                     
4000f600:   00d52c23            sw  a3,24(a0)                                             
  the_partition->attribute_set         = attribute_set;                                   
4000f604:   00e52e23            sw  a4,28(a0)                                             
  the_partition->starting_address      = starting_address;                                
4000f608:   00b52823            sw  a1,16(a0)                                             
  the_partition->length                = length;                                          
4000f60c:   00852a23            sw  s0,20(a0)                                             
  the_partition->number_of_used_blocks = 0;                                               
4000f610:   02052023            sw  zero,32(a0)                                           
  _Chain_Initialize(                                                                      
4000f614:   02450513            addi    a0,a0,36                                          
  information->local_table[ index - OBJECTS_INDEX_MINIMUM ] = the_object;                 
4000f618:   310a0a13            addi    s4,s4,784                                         
4000f61c:   669000ef            jal ra,40010484 <_Chain_Initialize>                       
    _Objects_Get_index( the_object->id ),                                                 
4000f620:   0089a603            lw  a2,8(s3)                                              
  information->local_table[ index - OBJECTS_INDEX_MINIMUM ] = the_object;                 
4000f624:   004a2703            lw  a4,4(s4)                                              
  the_object->name = name;                                                                
4000f628:   0099a623            sw  s1,12(s3)                                             
  information->local_table[ index - OBJECTS_INDEX_MINIMUM ] = the_object;                 
4000f62c:   01061693            slli    a3,a2,0x10                                        
4000f630:   0106d693            srli    a3,a3,0x10                                        
4000f634:   00269693            slli    a3,a3,0x2                                         
4000f638:   00d70733            add a4,a4,a3                                              
4000f63c:   ff372e23            sw  s3,-4(a4)                                             
  *id = the_partition->Object.id;                                                         
4000f640:   00caa023            sw  a2,0(s5)                                              
  _RTEMS_Unlock_allocator();                                                              
4000f644:   5a1000ef            jal ra,400103e4 <_RTEMS_Unlock_allocator>                 
}                                                                                         
4000f648:   02c12083            lw  ra,44(sp)                                             
4000f64c:   02812403            lw  s0,40(sp)                                             
4000f650:   02412483            lw  s1,36(sp)                                             
4000f654:   01c12983            lw  s3,28(sp)                                             
4000f658:   01812a03            lw  s4,24(sp)                                             
4000f65c:   01412a83            lw  s5,20(sp)                                             
4000f660:   00090513            mv  a0,s2                                                 
4000f664:   02012903            lw  s2,32(sp)                                             
4000f668:   03010113            addi    sp,sp,48                                          
4000f66c:   00008067            ret                                                       
    return RTEMS_INVALID_ADDRESS;                                                         
4000f670:   00900913            li  s2,9                                                  
4000f674:   fd5ff06f            j   4000f648 <rtems_partition_create+0xd8>                
4000f678:   56d000ef            jal ra,400103e4 <_RTEMS_Unlock_allocator>                 
    return RTEMS_TOO_MANY;                                                                
4000f67c:   00500913            li  s2,5                                                  
4000f680:   fc9ff06f            j   4000f648 <rtems_partition_create+0xd8>                
                                                                                          

40003a1c <rtems_region_resize_segment>: rtems_id id, void *segment, uintptr_t size, uintptr_t *old_size ) {
40003a1c:   fd010113            addi    sp,sp,-48                                         
40003a20:   02112623            sw  ra,44(sp)                                             
40003a24:   02812423            sw  s0,40(sp)                                             
40003a28:   02912223            sw  s1,36(sp)                                             
40003a2c:   03212023            sw  s2,32(sp)                                             
40003a30:   01312e23            sw  s3,28(sp)                                             
40003a34:   01412c23            sw  s4,24(sp)                                             
  uintptr_t           osize;                                                              
  rtems_status_code   status;                                                             
  Heap_Resize_status  resize_status;                                                      
  Region_Control     *the_region;                                                         
                                                                                          
  if ( old_size == NULL ) {                                                               
40003a38:   0a068063            beqz    a3,40003ad8 <rtems_region_resize_segment+0xbc>    
40003a3c:   00068493            mv  s1,a3                                                 
40003a40:   00050413            mv  s0,a0                                                 
40003a44:   00058993            mv  s3,a1                                                 
40003a48:   00060a13            mv  s4,a2                                                 
  _RTEMS_Lock_allocator();                                                                
40003a4c:   45c000ef            jal ra,40003ea8 <_RTEMS_Lock_allocator>                   
    _Objects_Get_no_protection( id, &_Region_Information );                               
40003a50:   400125b7            lui a1,0x40012                                            
40003a54:   8fc58593            addi    a1,a1,-1796 # 400118fc <_Region_Information>      
40003a58:   00040513            mv  a0,s0                                                 
40003a5c:   7cc010ef            jal ra,40005228 <_Objects_Get_no_protection>              
40003a60:   00050913            mv  s2,a0                                                 
  if ( the_region != NULL ) {                                                             
40003a64:   06050e63            beqz    a0,40003ae0 <rtems_region_resize_segment+0xc4>    
                                                                                          
  if ( the_region == NULL ) {                                                             
    return RTEMS_INVALID_ID;                                                              
  }                                                                                       
                                                                                          
  resize_status = _Heap_Resize_block(                                                     
40003a68:   00810713            addi    a4,sp,8                                           
40003a6c:   00c10693            addi    a3,sp,12                                          
40003a70:   000a0613            mv  a2,s4                                                 
40003a74:   00098593            mv  a1,s3                                                 
40003a78:   02850513            addi    a0,a0,40                                          
40003a7c:   4f9000ef            jal ra,40004774 <_Heap_Resize_block>                      
    segment,                                                                              
    (uint32_t) size,                                                                      
    &osize,                                                                               
    &avail_size                                                                           
  );                                                                                      
  *old_size = (uint32_t) osize;                                                           
40003a80:   00c12783            lw  a5,12(sp)                                             
  resize_status = _Heap_Resize_block(                                                     
40003a84:   00050413            mv  s0,a0                                                 
  *old_size = (uint32_t) osize;                                                           
40003a88:   00f4a023            sw  a5,0(s1)                                              
                                                                                          
  switch ( resize_status ) {                                                              
40003a8c:   04050063            beqz    a0,40003acc <rtems_region_resize_segment+0xb0>    
40003a90:   00100793            li  a5,1                                                  
40003a94:   02f51863            bne a0,a5,40003ac4 <rtems_region_resize_segment+0xa8>     
      /* Unlocks allocator */                                                             
      _Region_Process_queue( the_region );                                                
      return RTEMS_SUCCESSFUL;                                                            
                                                                                          
    case HEAP_RESIZE_UNSATISFIED:                                                         
      status = RTEMS_UNSATISFIED;                                                         
40003a98:   00d00413            li  s0,13                                                 <== NOT EXECUTED
  _RTEMS_Unlock_allocator();                                                              
40003a9c:   418000ef            jal ra,40003eb4 <_RTEMS_Unlock_allocator>                 
      break;                                                                              
  }                                                                                       
                                                                                          
  _Region_Unlock( the_region );                                                           
  return status;                                                                          
}                                                                                         
40003aa0:   02c12083            lw  ra,44(sp)                                             
40003aa4:   00040513            mv  a0,s0                                                 
40003aa8:   02812403            lw  s0,40(sp)                                             
40003aac:   02412483            lw  s1,36(sp)                                             
40003ab0:   02012903            lw  s2,32(sp)                                             
40003ab4:   01c12983            lw  s3,28(sp)                                             
40003ab8:   01812a03            lw  s4,24(sp)                                             
40003abc:   03010113            addi    sp,sp,48                                          
40003ac0:   00008067            ret                                                       
  switch ( resize_status ) {                                                              
40003ac4:   00900413            li  s0,9                                                  
40003ac8:   fd5ff06f            j   40003a9c <rtems_region_resize_segment+0x80>           
      _Region_Process_queue( the_region );                                                
40003acc:   00090513            mv  a0,s2                                                 
40003ad0:   424050ef            jal ra,40008ef4 <_Region_Process_queue>                   
      return RTEMS_SUCCESSFUL;                                                            
40003ad4:   fcdff06f            j   40003aa0 <rtems_region_resize_segment+0x84>           
    return RTEMS_INVALID_ADDRESS;                                                         
40003ad8:   00900413            li  s0,9                                                  
40003adc:   fc5ff06f            j   40003aa0 <rtems_region_resize_segment+0x84>           
  _RTEMS_Unlock_allocator();                                                              
40003ae0:   3d4000ef            jal ra,40003eb4 <_RTEMS_Unlock_allocator>                 
    return RTEMS_INVALID_ID;                                                              
40003ae4:   00400413            li  s0,4                                                  
40003ae8:   fb9ff06f            j   40003aa0 <rtems_region_resize_segment+0x84>           
                                                                                          

40005d24 <rtems_scheduler_ident_by_processor_set>: rtems_status_code rtems_scheduler_ident_by_processor_set( size_t cpusetsize, const cpu_set_t *cpuset, rtems_id *id ) {
40005d24:   fe010113            addi    sp,sp,-32                                         
40005d28:   00812c23            sw  s0,24(sp)                                             
40005d2c:   00112e23            sw  ra,28(sp)                                             
40005d30:   00912a23            sw  s1,20(sp)                                             
40005d34:   00060413            mv  s0,a2                                                 
  Processor_mask              set;                                                        
  Processor_mask_Copy_status  status;                                                     
  uint32_t                    cpu_index;                                                  
  const Scheduler_Control    *scheduler;                                                  
                                                                                          
  if ( id == NULL ) {                                                                     
40005d38:   06060263            beqz    a2,40005d9c <rtems_scheduler_ident_by_processor_set+0x78>
    return RTEMS_INVALID_ADDRESS;                                                         
  }                                                                                       
                                                                                          
  status = _Processor_mask_From_cpu_set_t( &set, cpusetsize, cpuset );                    
40005d3c:   00050693            mv  a3,a0                                                 
40005d40:   00058613            mv  a2,a1                                                 
  Processor_mask  *dst,                                                                   
  size_t           src_size,                                                              
  const cpu_set_t *src                                                                    
)                                                                                         
{                                                                                         
  return _Processor_mask_Copy(                                                            
40005d44:   00c10513            addi    a0,sp,12                                          
40005d48:   00400593            li  a1,4                                                  
40005d4c:   334020ef            jal ra,40008080 <_Processor_mask_Copy>                    
  if ( status == PROCESSOR_MASK_COPY_INVALID_SIZE ) {                                     
40005d50:   00300793            li  a5,3                                                  
40005d54:   06f50263            beq a0,a5,40005db8 <rtems_scheduler_ident_by_processor_set+0x94>
  BIT_AND2( CPU_MAXIMUM_PROCESSORS, a, b, c );                                            
40005d58:   8381a503            lw  a0,-1992(gp) # 40015220 <_Processor_mask_The_one_and_only>
40005d5c:   00c12783            lw  a5,12(sp)                                             
  }                                                                                       
                                                                                          
  _Processor_mask_And( &set, &set, _SMP_Get_online_processors() );                        
  cpu_index = _Processor_mask_Find_last_set( &set );                                      
  if ( cpu_index == 0 ) {                                                                 
    return RTEMS_INVALID_NAME;                                                            
40005d60:   00300493            li  s1,3                                                  
40005d64:   00f57533            and a0,a0,a5                                              
  return (uint32_t) BIT_FLS( CPU_MAXIMUM_PROCESSORS, a );                                 
40005d68:   00050e63            beqz    a0,40005d84 <rtems_scheduler_ident_by_processor_set+0x60>
40005d6c:   5ac0c0ef            jal ra,40012318 <flsl>                                    
  if ( cpu_index == 0 ) {                                                                 
40005d70:   00050a63            beqz    a0,40005d84 <rtems_scheduler_ident_by_processor_set+0x60><== NEVER TAKEN
  }                                                                                       
#else                                                                                     
  _Assert( scheduler != NULL );                                                           
#endif                                                                                    
                                                                                          
  *id = _Scheduler_Build_id( _Scheduler_Get_index( scheduler ) );                         
40005d74:   0f0107b7            lui a5,0xf010                                             
40005d78:   00178793            addi    a5,a5,1 # f010001 <RamSize+0xe010001>             
40005d7c:   00f42023            sw  a5,0(s0)                                              
  return RTEMS_SUCCESSFUL;                                                                
40005d80:   00000493            li  s1,0                                                  
}                                                                                         
40005d84:   01c12083            lw  ra,28(sp)                                             
40005d88:   01812403            lw  s0,24(sp)                                             
40005d8c:   00048513            mv  a0,s1                                                 
40005d90:   01412483            lw  s1,20(sp)                                             
40005d94:   02010113            addi    sp,sp,32                                          
40005d98:   00008067            ret                                                       
40005d9c:   01c12083            lw  ra,28(sp)                                             
40005da0:   01812403            lw  s0,24(sp)                                             
    return RTEMS_INVALID_ADDRESS;                                                         
40005da4:   00900493            li  s1,9                                                  
}                                                                                         
40005da8:   00048513            mv  a0,s1                                                 
40005dac:   01412483            lw  s1,20(sp)                                             
40005db0:   02010113            addi    sp,sp,32                                          
40005db4:   00008067            ret                                                       
40005db8:   01c12083            lw  ra,28(sp)                                             
40005dbc:   01812403            lw  s0,24(sp)                                             
    return RTEMS_INVALID_SIZE;                                                            
40005dc0:   00800493            li  s1,8                                                  
}                                                                                         
40005dc4:   00048513            mv  a0,s1                                                 
40005dc8:   01412483            lw  s1,20(sp)                                             
40005dcc:   02010113            addi    sp,sp,32                                          
40005dd0:   00008067            ret                                                       
                                                                                          

40005e64 <rtems_scheduler_map_priority_to_posix>: int *posix_priority ) { const Scheduler_Control *scheduler; if ( posix_priority == NULL ) { 40005e64: 04060663 beqz a2,40005eb0 <rtems_scheduler_map_priority_to_posix+0x4c>
40005e68:   0f0107b7            lui a5,0xf010                                             
40005e6c:   00178793            addi    a5,a5,1 # f010001 <RamSize+0xe010001>             
40005e70:   02f51863            bne a0,a5,40005ea0 <rtems_scheduler_map_priority_to_posix+0x3c>
  if ( scheduler == NULL ) {                                                              
    return RTEMS_INVALID_ID;                                                              
  }                                                                                       
                                                                                          
  if ( priority < 1 ) {                                                                   
    return RTEMS_INVALID_PRIORITY;                                                        
40005e74:   01300513            li  a0,19                                                 
  if ( priority < 1 ) {                                                                   
40005e78:   02058663            beqz    a1,40005ea4 <rtems_scheduler_map_priority_to_posix+0x40>
  }                                                                                       
                                                                                          
  if ( priority >= scheduler->maximum_priority ) {                                        
40005e7c:   400137b7            lui a5,0x40013                                            
40005e80:   57878793            addi    a5,a5,1400 # 40013578 <_Scheduler_Table>          
40005e84:   0447a703            lw  a4,68(a5)                                             
40005e88:   0407a783            lw  a5,64(a5)                                             
40005e8c:   00070e63            beqz    a4,40005ea8 <rtems_scheduler_map_priority_to_posix+0x44><== ALWAYS TAKEN
    return RTEMS_INVALID_PRIORITY;                                                        
  }                                                                                       
                                                                                          
  *posix_priority = (int) ( scheduler->maximum_priority - priority );                     
40005e90:   40b785b3            sub a1,a5,a1                                              
40005e94:   00b62023            sw  a1,0(a2)                                              
  return RTEMS_SUCCESSFUL;                                                                
40005e98:   00000513            li  a0,0                                                  
40005e9c:   00008067            ret                                                       
    return RTEMS_INVALID_ID;                                                              
40005ea0:   00400513            li  a0,4                                                  
}                                                                                         
40005ea4:   00008067            ret                                                       
  if ( priority >= scheduler->maximum_priority ) {                                        
40005ea8:   fef5e4e3            bltu    a1,a5,40005e90 <rtems_scheduler_map_priority_to_posix+0x2c>
40005eac:   ff9ff06f            j   40005ea4 <rtems_scheduler_map_priority_to_posix+0x40> 
    return RTEMS_INVALID_ADDRESS;                                                         
40005eb0:   00900513            li  a0,9                                                  
40005eb4:   00008067            ret                                                       
                                                                                          

400098b0 <rtems_semaphore_create>: if ( !rtems_is_name_valid( name ) ) 400098b0: 16050263 beqz a0,40009a14 <rtems_semaphore_create+0x164> {
400098b4:   f8010113            addi    sp,sp,-128                                        
400098b8:   07312623            sw  s3,108(sp)                                            
400098bc:   06112e23            sw  ra,124(sp)                                            
400098c0:   06812c23            sw  s0,120(sp)                                            
400098c4:   06912a23            sw  s1,116(sp)                                            
400098c8:   07212823            sw  s2,112(sp)                                            
400098cc:   07412423            sw  s4,104(sp)                                            
400098d0:   07512223            sw  s5,100(sp)                                            
400098d4:   07612023            sw  s6,96(sp)                                             
400098d8:   05712e23            sw  s7,92(sp)                                             
400098dc:   05812c23            sw  s8,88(sp)                                             
400098e0:   05912a23            sw  s9,84(sp)                                             
400098e4:   05a12823            sw  s10,80(sp)                                            
400098e8:   05b12623            sw  s11,76(sp)                                            
400098ec:   00070993            mv  s3,a4                                                 
  if ( !id )                                                                              
400098f0:   22070463            beqz    a4,40009b18 <rtems_semaphore_create+0x268>        
  maybe_global = attribute_set & SEMAPHORE_KIND_MASK;                                     
400098f4:   1f067793            andi    a5,a2,496                                         
400098f8:   00050b13            mv  s6,a0                                                 
400098fc:   00058b93            mv  s7,a1                                                 
40009900:   00060413            mv  s0,a2                                                 
40009904:   00068a13            mv  s4,a3                                                 
  if ( maybe_global == RTEMS_COUNTING_SEMAPHORE ) {                                       
40009908:   04078463            beqz    a5,40009950 <rtems_semaphore_create+0xa0>         
  } else if ( count > 1 ) {                                                               
4000990c:   00100713            li  a4,1                                                  
    return RTEMS_INVALID_NUMBER;                                                          
40009910:   00a00513            li  a0,10                                                 
  } else if ( count > 1 ) {                                                               
40009914:   0cb76263            bltu    a4,a1,400099d8 <rtems_semaphore_create+0x128>     
  } else if ( maybe_global == RTEMS_SIMPLE_BINARY_SEMAPHORE ) {                           
40009918:   02000713            li  a4,32                                                 
4000991c:   1ee78a63            beq a5,a4,40009b10 <rtems_semaphore_create+0x260>         
  } else if ( maybe_global == RTEMS_BINARY_SEMAPHORE ) {                                  
40009920:   01000713            li  a4,16                                                 
40009924:   0ee78c63            beq a5,a4,40009a1c <rtems_semaphore_create+0x16c>         
  mutex_with_protocol =                                                                   
40009928:   1f667793            andi    a5,a2,502                                         
  } else if (                                                                             
4000992c:   05400713            li  a4,84                                                 
40009930:   1ee78863            beq a5,a4,40009b20 <rtems_semaphore_create+0x270>         
  } else if (                                                                             
40009934:   09400713            li  a4,148                                                
40009938:   00e78863            beq a5,a4,40009948 <rtems_semaphore_create+0x98>          
  } else if (                                                                             
4000993c:   11000713            li  a4,272                                                
    return RTEMS_NOT_DEFINED;                                                             
40009940:   00b00513            li  a0,11                                                 
  } else if (                                                                             
40009944:   08e79a63            bne a5,a4,400099d8 <rtems_semaphore_create+0x128>         
    variant = SEMAPHORE_VARIANT_MUTEX_PRIORITY_CEILING;                                   
40009948:   00100913            li  s2,1                                                  
4000994c:   0080006f            j   40009954 <rtems_semaphore_create+0xa4>                
    variant = SEMAPHORE_VARIANT_COUNTING;                                                 
40009950:   00400913            li  s2,4                                                  
 *  This function allocates a semaphore control block from                                
 *  the inactive chain of free semaphore control blocks.                                  
 */                                                                                       
RTEMS_INLINE_ROUTINE Semaphore_Control *_Semaphore_Allocate( void )                       
{                                                                                         
  return (Semaphore_Control *) _Objects_Allocate( &_Semaphore_Information );              
40009954:   4001dab7            lui s5,0x4001d                                            
40009958:   6a4a8513            addi    a0,s5,1700 # 4001d6a4 <_Semaphore_Information>    
4000995c:   669010ef            jal ra,4000b7c4 <_Objects_Allocate>                       
40009960:   00050493            mv  s1,a0                                                 
  if ( !the_semaphore ) {                                                                 
40009964:   1c050263            beqz    a0,40009b28 <rtems_semaphore_create+0x278>        
 */                                                                                       
RTEMS_INLINE_ROUTINE bool _Attributes_Is_priority(                                        
  rtems_attribute attribute_set                                                           
)                                                                                         
{                                                                                         
   return ( attribute_set & RTEMS_PRIORITY ) ? true : false;                              
40009968:   00245413            srli    s0,s0,0x2                                         
  if ( _Attributes_Is_priority( attribute_set ) ) {                                       
4000996c:   00147413            andi    s0,s0,1                                           
40009970:   00090793            mv  a5,s2                                                 
40009974:   00041463            bnez    s0,4000997c <rtems_semaphore_create+0xcc>         
  return flags | ( discipline << 3 );                                                     
40009978:   00896793            ori a5,s2,8                                               
4000997c:   40021c37            lui s8,0x40021                                            
40009980:   880c0413            addi    s0,s8,-1920 # 40020880 <_Per_CPU_Information>     
  the_semaphore->Object.Node.previous = (Chain_Node *) flags;                             
40009984:   00f4a223            sw  a5,4(s1)                                              
  switch ( variant ) {                                                                    
40009988:   00100793            li  a5,1                                                  
4000998c:   03842c83            lw  s9,56(s0)                                             
40009990:   0af90663            beq s2,a5,40009a3c <rtems_semaphore_create+0x18c>         
40009994:   ffd97913            andi    s2,s2,-3                                          
40009998:   08090663            beqz    s2,40009a24 <rtems_semaphore_create+0x174>        
      _CORE_semaphore_Initialize(                                                         
4000999c:   000b8593            mv  a1,s7                                                 
400099a0:   01048513            addi    a0,s1,16                                          
400099a4:   7b9000ef            jal ra,4000a95c <_CORE_semaphore_Initialize>              
                                                                                          
  the_object->name = name;                                                                
                                                                                          
  _Objects_Set_local_object(                                                              
    information,                                                                          
    _Objects_Get_index( the_object->id ),                                                 
400099a8:   0084a683            lw  a3,8(s1)                                              
  information->local_table[ index - OBJECTS_INDEX_MINIMUM ] = the_object;                 
400099ac:   6a4a8793            addi    a5,s5,1700                                        
400099b0:   0047a783            lw  a5,4(a5)                                              
400099b4:   01069713            slli    a4,a3,0x10                                        
400099b8:   01075713            srli    a4,a4,0x10                                        
400099bc:   00271713            slli    a4,a4,0x2                                         
  the_object->name = name;                                                                
400099c0:   0164a623            sw  s6,12(s1)                                             
  information->local_table[ index - OBJECTS_INDEX_MINIMUM ] = the_object;                 
400099c4:   00e787b3            add a5,a5,a4                                              
400099c8:   fe97ae23            sw  s1,-4(a5)                                             
  *id = the_semaphore->Object.id;                                                         
400099cc:   00d9a023            sw  a3,0(s3)                                              
 * previous thread life protection state and thus may not return if the                   
 * executing thread was restarted or deleted in the mean-time.                            
 */                                                                                       
RTEMS_INLINE_ROUTINE void _Objects_Allocator_unlock( void )                               
{                                                                                         
  _RTEMS_Unlock_allocator();                                                              
400099d0:   559000ef            jal ra,4000a728 <_RTEMS_Unlock_allocator>                 
  return RTEMS_SUCCESSFUL;                                                                
400099d4:   00000513            li  a0,0                                                  
}                                                                                         
400099d8:   07c12083            lw  ra,124(sp)                                            
400099dc:   07812403            lw  s0,120(sp)                                            
400099e0:   07412483            lw  s1,116(sp)                                            
400099e4:   07012903            lw  s2,112(sp)                                            
400099e8:   06c12983            lw  s3,108(sp)                                            
400099ec:   06812a03            lw  s4,104(sp)                                            
400099f0:   06412a83            lw  s5,100(sp)                                            
400099f4:   06012b03            lw  s6,96(sp)                                             
400099f8:   05c12b83            lw  s7,92(sp)                                             
400099fc:   05812c03            lw  s8,88(sp)                                             
40009a00:   05412c83            lw  s9,84(sp)                                             
40009a04:   05012d03            lw  s10,80(sp)                                            
40009a08:   04c12d83            lw  s11,76(sp)                                            
40009a0c:   08010113            addi    sp,sp,128                                         
40009a10:   00008067            ret                                                       
    return RTEMS_INVALID_NAME;                                                            
40009a14:   00300513            li  a0,3                                                  
}                                                                                         
40009a18:   00008067            ret                                                       
    variant = SEMAPHORE_VARIANT_MUTEX_NO_PROTOCOL;                                        
40009a1c:   00200913            li  s2,2                                                  
40009a20:   f35ff06f            j   40009954 <rtems_semaphore_create+0xa4>                
 */                                                                                       
RTEMS_INLINE_ROUTINE void _CORE_mutex_Initialize(                                         
  CORE_mutex_Control *the_mutex                                                           
)                                                                                         
{                                                                                         
  _Thread_queue_Object_initialize( &the_mutex->Wait_queue );                              
40009a24:   01048513            addi    a0,s1,16                                          
40009a28:   220030ef            jal ra,4000cc48 <_Thread_queue_Object_initialize>         
RTEMS_INLINE_ROUTINE void _CORE_recursive_mutex_Initialize(                               
  CORE_recursive_mutex_Control *the_mutex                                                 
)                                                                                         
{                                                                                         
  _CORE_mutex_Initialize( &the_mutex->Mutex );                                            
  the_mutex->nest_level = 0;                                                              
40009a2c:   0004ae23            sw  zero,28(s1)                                           
      if ( count == 0 ) {                                                                 
40009a30:   f60b9ce3            bnez    s7,400099a8 <rtems_semaphore_create+0xf8>         
  the_mutex->Wait_queue.Queue.owner = owner;                                              
40009a34:   0194aa23            sw  s9,20(s1)                                             
}                                                                                         
40009a38:   f71ff06f            j   400099a8 <rtems_semaphore_create+0xf8>                
  const Scheduler_Control *scheduler,                                                     
  rtems_task_priority      priority,                                                      
  bool                    *valid                                                          
)                                                                                         
{                                                                                         
  *valid = ( priority <= scheduler->maximum_priority );                                   
40009a3c:   4001b537            lui a0,0x4001b                                            
40009a40:   55850793            addi    a5,a0,1368 # 4001b558 <_Scheduler_Table>          
RTEMS_INLINE_ROUTINE Priority_Control _Scheduler_Map_priority(                            
  const Scheduler_Control *scheduler,                                                     
  Priority_Control         priority                                                       
)                                                                                         
{                                                                                         
  return ( *scheduler->Operations.map_priority )( scheduler, priority );                  
40009a44:   01c7a683            lw  a3,28(a5)                                             
40009a48:   0447ad03            lw  s10,68(a5)                                            
40009a4c:   0407a783            lw  a5,64(a5)                                             
40009a50:   000a0593            mv  a1,s4                                                 
40009a54:   00000613            li  a2,0                                                  
40009a58:   55850513            addi    a0,a0,1368                                        
40009a5c:   00f12623            sw  a5,12(sp)                                             
40009a60:   000680e7            jalr    a3                                                
40009a64:   00050d93            mv  s11,a0                                                
40009a68:   00058913            mv  s2,a1                                                 
      if ( valid ) {                                                                      
40009a6c:   020d1663            bnez    s10,40009a98 <rtems_semaphore_create+0x1e8>       <== NEVER TAKEN
40009a70:   00c12783            lw  a5,12(sp)                                             
40009a74:   0347f263            bgeu    a5,s4,40009a98 <rtems_semaphore_create+0x1e8>     
  Objects_Control     *the_object                                                         
)                                                                                         
{                                                                                         
  _Assert( _Objects_Allocator_is_owner() );                                               
  _Assert( information->deallocate != NULL );                                             
  ( *information->deallocate )( information, the_object );                                
40009a78:   6a4a8793            addi    a5,s5,1700                                        
40009a7c:   00c7a783            lw  a5,12(a5)                                             
40009a80:   6a4a8513            addi    a0,s5,1700                                        
40009a84:   00048593            mv  a1,s1                                                 
40009a88:   000780e7            jalr    a5                                                
  _RTEMS_Unlock_allocator();                                                              
40009a8c:   49d000ef            jal ra,4000a728 <_RTEMS_Unlock_allocator>                 
    return _Status_Get( status );                                                         
40009a90:   01300513            li  a0,19                                                 
40009a94:   f45ff06f            j   400099d8 <rtems_semaphore_create+0x128>               
  _Thread_queue_Object_initialize( &the_mutex->Wait_queue );                              
40009a98:   01048513            addi    a0,s1,16                                          
40009a9c:   1ac030ef            jal ra,4000cc48 <_Thread_queue_Object_initialize>         
  the_mutex->nest_level = 0;                                                              
40009aa0:   0004ae23            sw  zero,28(s1)                                           
RTEMS_INLINE_ROUTINE void _Priority_Node_initialize(                                      
  Priority_Node    *node,                                                                 
  Priority_Control  priority                                                              
)                                                                                         
{                                                                                         
  node->priority = priority;                                                              
40009aa4:   03b4a823            sw  s11,48(s1)                                            
40009aa8:   0324aa23            sw  s2,52(s1)                                             
        if ( count == 0 ) {                                                               
40009aac:   ee0b9ee3            bnez    s7,400099a8 <rtems_semaphore_create+0xf8>         
 */                                                                                       
RTEMS_INLINE_ROUTINE void _Thread_queue_Context_clear_priority_updates(                   
  Thread_queue_Context *queue_context                                                     
)                                                                                         
{                                                                                         
  queue_context->Priority.update_count = 0;                                               
40009ab0:   02012823            sw  zero,48(sp)                                           
  __asm__ volatile (                                                                      
40009ab4:   300477f3            csrrci  a5,mstatus,8                                      
  return mstatus & RISCV_MSTATUS_MIE;                                                     
40009ab8:   0087f793            andi    a5,a5,8                                           
          _ISR_lock_ISR_disable( &queue_context.Lock_context.Lock_context );              
40009abc:   00f12e23            sw  a5,28(sp)                                             
 */                                                                                       
RTEMS_INLINE_ROUTINE Priority_Control _Priority_Get_priority(                             
  const Priority_Aggregation *aggregation                                                 
)                                                                                         
{                                                                                         
  return aggregation->Node.priority;                                                      
40009ac0:   038ca683            lw  a3,56(s9)                                             
                                                                                          
  _Thread_Wait_acquire_default_critical( owner, &lock_context );                          
                                                                                          
  scheduler_node = _Thread_Scheduler_get_home_node( owner );                              
                                                                                          
  if (                                                                                    
40009ac4:   0344a703            lw  a4,52(s1)                                             
40009ac8:   01c6a783            lw  a5,28(a3)                                             
40009acc:   06e7ea63            bltu    a5,a4,40009b40 <rtems_semaphore_create+0x290>     
40009ad0:   06f70263            beq a4,a5,40009b34 <rtems_semaphore_create+0x284>         
  the_mutex->Wait_queue.Queue.owner = owner;                                              
40009ad4:   0194aa23            sw  s9,20(s1)                                             
    return STATUS_MUTEX_CEILING_VIOLATED;                                                 
  }                                                                                       
                                                                                          
  _CORE_mutex_Set_owner( &the_mutex->Recursive.Mutex, owner );                            
  _Thread_Resource_count_increment( owner );                                              
  _Thread_Priority_add(                                                                   
40009ad8:   01c10613            addi    a2,sp,28                                          
40009adc:   02048593            addi    a1,s1,32                                          
40009ae0:   000c8513            mv  a0,s9                                                 
40009ae4:   38d020ef            jal ra,4000c670 <_Thread_Priority_add>                    
  disable_level = cpu_self->thread_dispatch_disable_level;                                
40009ae8:   03042783            lw  a5,48(s0)                                             
  cpu_self->thread_dispatch_disable_level = disable_level + 1;                            
40009aec:   00178793            addi    a5,a5,1                                           
40009af0:   02f42823            sw  a5,48(s0)                                             
  __asm__ volatile ( "csrrs zero, mstatus, %0" : : "r" ( level ) );                       
40009af4:   01c12783            lw  a5,28(sp)                                             
40009af8:   3007a073            csrs    mstatus,a5                                        
  );                                                                                      
  _Thread_Wait_release_default_critical( owner, &lock_context );                          
                                                                                          
  cpu_self = _Thread_queue_Dispatch_disable( queue_context );                             
  _CORE_mutex_Release( &the_mutex->Recursive.Mutex, queue_context );                      
  _Thread_Priority_update( queue_context );                                               
40009afc:   01c10513            addi    a0,sp,28                                          
40009b00:   545020ef            jal ra,4000c844 <_Thread_Priority_update>                 
  _Thread_Dispatch_enable( cpu_self );                                                    
40009b04:   880c0513            addi    a0,s8,-1920                                       
40009b08:   7fd020ef            jal ra,4000cb04 <_Thread_Dispatch_enable>                 
  if ( status != STATUS_SUCCESSFUL ) {                                                    
40009b0c:   e9dff06f            j   400099a8 <rtems_semaphore_create+0xf8>                
    variant = SEMAPHORE_VARIANT_SIMPLE_BINARY;                                            
40009b10:   00300913            li  s2,3                                                  
40009b14:   e41ff06f            j   40009954 <rtems_semaphore_create+0xa4>                
    return RTEMS_INVALID_ADDRESS;                                                         
40009b18:   00900513            li  a0,9                                                  
40009b1c:   ebdff06f            j   400099d8 <rtems_semaphore_create+0x128>               
    variant = SEMAPHORE_VARIANT_MUTEX_INHERIT_PRIORITY;                                   
40009b20:   00000913            li  s2,0                                                  
40009b24:   e31ff06f            j   40009954 <rtems_semaphore_create+0xa4>                
40009b28:   401000ef            jal ra,4000a728 <_RTEMS_Unlock_allocator>                 
    return RTEMS_TOO_MANY;                                                                
40009b2c:   00500513            li  a0,5                                                  
40009b30:   ea9ff06f            j   400099d8 <rtems_semaphore_create+0x128>               
  if (                                                                                    
40009b34:   0304a703            lw  a4,48(s1)                                             
40009b38:   0186a783            lw  a5,24(a3)                                             
40009b3c:   f8e7fce3            bgeu    a5,a4,40009ad4 <rtems_semaphore_create+0x224>     
40009b40:   01c12783            lw  a5,28(sp)                                             
40009b44:   3007a073            csrs    mstatus,a5                                        
  if ( status != STATUS_SUCCESSFUL ) {                                                    
40009b48:   f31ff06f            j   40009a78 <rtems_semaphore_create+0x1c8>               
                                                                                          

400039d4 <rtems_semaphore_flush>: #endif #include <rtems/rtems/semimpl.h> rtems_status_code rtems_semaphore_flush( rtems_id id ) {
400039d4:   fc010113            addi    sp,sp,-64                                         
  Objects_Id            id,                                                               
  Thread_queue_Context *queue_context                                                     
)                                                                                         
{                                                                                         
  _Thread_queue_Context_initialize( queue_context );                                      
  return (Semaphore_Control *) _Objects_Get(                                              
400039d8:   40011637            lui a2,0x40011                                            
400039dc:   2b460613            addi    a2,a2,692 # 400112b4 <_Semaphore_Information>     
400039e0:   00c10593            addi    a1,sp,12                                          
400039e4:   02112e23            sw  ra,60(sp)                                             
400039e8:   134010ef            jal ra,40004b1c <_Objects_Get>                            
  uintptr_t             flags;                                                            
  Semaphore_Variant     variant;                                                          
                                                                                          
  the_semaphore = _Semaphore_Get( id, &queue_context );                                   
                                                                                          
  if ( the_semaphore == NULL ) {                                                          
400039ec:   06050063            beqz    a0,40003a4c <rtems_semaphore_flush+0x78>          
  return (uintptr_t) the_semaphore->Object.Node.previous;                                 
400039f0:   00452783            lw  a5,4(a0)                                              
          || variant == SEMAPHORE_VARIANT_MUTEX_PRIORITY_CEILING                          
          || variant == SEMAPHORE_VARIANT_MUTEX_NO_PROTOCOL                               
          || variant == SEMAPHORE_VARIANT_SIMPLE_BINARY                                   
          || variant == SEMAPHORE_VARIANT_COUNTING                                        
      );                                                                                  
      _Thread_queue_Flush_critical(                                                       
400039f4:   01050513            addi    a0,a0,16                                          
  return (Semaphore_Discipline) ( flags & 0x7 );                                          
400039f8:   0077f713            andi    a4,a5,7                                           
  if (                                                                                    
400039fc:   04070263            beqz    a4,40003a40 <rtems_semaphore_flush+0x6c>          
  return (Semaphore_Discipline) ( ( flags >> 3 ) & 0x1 );                                 
40003a00:   0037d793            srli    a5,a5,0x3                                         
40003a04:   0017f793            andi    a5,a5,1                                           
  if ( _Semaphore_Get_discipline( flags ) == SEMAPHORE_DISCIPLINE_PRIORITY ) {            
40003a08:   02078663            beqz    a5,40003a34 <rtems_semaphore_flush+0x60>          <== NEVER TAKEN
  return &_Thread_queue_Operations_FIFO;                                                  
40003a0c:   400105b7            lui a1,0x40010                                            
40003a10:   eec58593            addi    a1,a1,-276 # 4000feec <_Thread_queue_Operations_FIFO>
40003a14:   40006637            lui a2,0x40006                                            
40003a18:   00c10693            addi    a3,sp,12                                          
40003a1c:   09060613            addi    a2,a2,144 # 40006090 <_Thread_queue_Flush_status_unavailable>
40003a20:   680020ef            jal ra,400060a0 <_Thread_queue_Flush_critical>            
      );                                                                                  
      break;                                                                              
  }                                                                                       
                                                                                          
  return RTEMS_SUCCESSFUL;                                                                
}                                                                                         
40003a24:   03c12083            lw  ra,60(sp)                                             
  return RTEMS_SUCCESSFUL;                                                                
40003a28:   00000513            li  a0,0                                                  
}                                                                                         
40003a2c:   04010113            addi    sp,sp,64                                          
40003a30:   00008067            ret                                                       
    return &_Thread_queue_Operations_priority;                                            
40003a34:   400105b7            lui a1,0x40010                                            <== NOT EXECUTED
40003a38:   f1458593            addi    a1,a1,-236 # 4000ff14 <_Thread_queue_Operations_priority><== NOT EXECUTED
40003a3c:   fd9ff06f            j   40003a14 <rtems_semaphore_flush+0x40>                 <== NOT EXECUTED
    return &_Thread_queue_Operations_priority_inherit;                                    
40003a40:   400105b7            lui a1,0x40010                                            
40003a44:   f2858593            addi    a1,a1,-216 # 4000ff28 <_Thread_queue_Operations_priority_inherit>
40003a48:   fcdff06f            j   40003a14 <rtems_semaphore_flush+0x40>                 
40003a4c:   03c12083            lw  ra,60(sp)                                             
    return RTEMS_INVALID_ID;                                                              
40003a50:   00400513            li  a0,4                                                  
}                                                                                         
40003a54:   04010113            addi    sp,sp,64                                          
40003a58:   00008067            ret                                                       
                                                                                          

40009e38 <rtems_semaphore_release>: #include <rtems/rtems/semimpl.h> #include <rtems/rtems/statusimpl.h> rtems_status_code rtems_semaphore_release( rtems_id id ) {
40009e38:   fa010113            addi    sp,sp,-96                                         
  return (Semaphore_Control *) _Objects_Get(                                              
40009e3c:   4001d637            lui a2,0x4001d                                            
40009e40:   6a460613            addi    a2,a2,1700 # 4001d6a4 <_Semaphore_Information>    
40009e44:   00c10593            addi    a1,sp,12                                          
40009e48:   04112e23            sw  ra,92(sp)                                             
40009e4c:   04812c23            sw  s0,88(sp)                                             
40009e50:   04912a23            sw  s1,84(sp)                                             
40009e54:   05212823            sw  s2,80(sp)                                             
40009e58:   05312623            sw  s3,76(sp)                                             
40009e5c:   05412423            sw  s4,72(sp)                                             
40009e60:   05512223            sw  s5,68(sp)                                             
40009e64:   05612023            sw  s6,64(sp)                                             
40009e68:   03712e23            sw  s7,60(sp)                                             
40009e6c:   1cd010ef            jal ra,4000b838 <_Objects_Get>                            
  Semaphore_Variant     variant;                                                          
  Status_Control        status;                                                           
                                                                                          
  the_semaphore = _Semaphore_Get( id, &queue_context );                                   
                                                                                          
  if ( the_semaphore == NULL ) {                                                          
40009e70:   22050863            beqz    a0,4000a0a0 <rtems_semaphore_release+0x268>       
  return (uintptr_t) the_semaphore->Object.Node.previous;                                 
40009e74:   00452703            lw  a4,4(a0)                                              
40009e78:   400219b7            lui s3,0x40021                                            
40009e7c:   00050413            mv  s0,a0                                                 
40009e80:   88098913            addi    s2,s3,-1920 # 40020880 <_Per_CPU_Information>     
  return (Semaphore_Discipline) ( flags & 0x7 );                                          
40009e84:   00777793            andi    a5,a4,7                                           
    _Semaphore_Core_mutex_mp_support                                                      
  );                                                                                      
  flags = _Semaphore_Get_flags( the_semaphore );                                          
  variant = _Semaphore_Get_variant( flags );                                              
                                                                                          
  switch ( variant ) {                                                                    
40009e88:   00200693            li  a3,2                                                  
40009e8c:   03892503            lw  a0,56(s2)                                             
    case SEMAPHORE_VARIANT_MUTEX_INHERIT_PRIORITY:                                        
      status = _CORE_recursive_mutex_Surrender(                                           
40009e90:   01040a13            addi    s4,s0,16                                          
  switch ( variant ) {                                                                    
40009e94:   12d78863            beq a5,a3,40009fc4 <rtems_semaphore_release+0x18c>        
40009e98:   08f6ec63            bltu    a3,a5,40009f30 <rtems_semaphore_release+0xf8>     
40009e9c:   1a078a63            beqz    a5,4000a050 <rtems_semaphore_release+0x218>       
40009ea0:   00100693            li  a3,1                                                  
40009ea4:   16d79263            bne a5,a3,4000a008 <rtems_semaphore_release+0x1d0>        
  Per_CPU_Control  *cpu_self;                                                             
  Thread_Control   *new_owner;                                                            
                                                                                          
  _CORE_mutex_Acquire_critical( &the_mutex->Recursive.Mutex, queue_context );             
                                                                                          
  if ( !_CORE_mutex_Is_owner( &the_mutex->Recursive.Mutex, executing ) ) {                
40009ea8:   01442783            lw  a5,20(s0)                                             
40009eac:   0cf51863            bne a0,a5,40009f7c <rtems_semaphore_release+0x144>        
    _CORE_mutex_Release( &the_mutex->Recursive.Mutex, queue_context );                    
    return STATUS_NOT_OWNER;                                                              
  }                                                                                       
                                                                                          
  nest_level = the_mutex->Recursive.nest_level;                                           
40009eb0:   01c42483            lw  s1,28(s0)                                             
                                                                                          
  if ( nest_level > 0 ) {                                                                 
40009eb4:   1c049a63            bnez    s1,4000a088 <rtems_semaphore_release+0x250>       <== NEVER TAKEN
                                                                                          
  _Thread_Resource_count_decrement( executing );                                          
                                                                                          
  _Thread_queue_Context_clear_priority_updates( queue_context );                          
  _Thread_Wait_acquire_default_critical( executing, &lock_context );                      
  _Thread_Priority_remove(                                                                
40009eb8:   02040b13            addi    s6,s0,32                                          
40009ebc:   00c10613            addi    a2,sp,12                                          
40009ec0:   000b0593            mv  a1,s6                                                 
40009ec4:   02012023            sw  zero,32(sp)                                           
40009ec8:   041020ef            jal ra,4000c708 <_Thread_Priority_remove>                 
RTEMS_INLINE_ROUTINE Thread_Control *_Thread_queue_First_locked(                          
  Thread_queue_Control          *the_thread_queue,                                        
  const Thread_queue_Operations *operations                                               
)                                                                                         
{                                                                                         
  Thread_queue_Heads *heads = the_thread_queue->Queue.heads;                              
40009ecc:   01042503            lw  a0,16(s0)                                             
                                                                                          
  if ( heads != NULL ) {                                                                  
40009ed0:   22050063            beqz    a0,4000a0f0 <rtems_semaphore_release+0x2b8>       
    return ( *operations->first )( heads );                                               
40009ed4:   4001cbb7            lui s7,0x4001c                                            
40009ed8:   edcb8793            addi    a5,s7,-292 # 4001bedc <_Thread_queue_Operations_priority>
40009edc:   0107a783            lw  a5,16(a5)                                             
40009ee0:   000780e7            jalr    a5                                                
  disable_level = cpu_self->thread_dispatch_disable_level;                                
40009ee4:   03092783            lw  a5,48(s2)                                             
  the_mutex->Wait_queue.Queue.owner = owner;                                              
40009ee8:   00a42a23            sw  a0,20(s0)                                             
40009eec:   00050a93            mv  s5,a0                                                 
  cpu_self->thread_dispatch_disable_level = disable_level + 1;                            
40009ef0:   00178793            addi    a5,a5,1                                           
40009ef4:   02f92823            sw  a5,48(s2)                                             
                                                                                          
  cpu_self = _Thread_Dispatch_disable_critical(                                           
    &queue_context->Lock_context.Lock_context                                             
  );                                                                                      
                                                                                          
  if ( new_owner != NULL ) {                                                              
40009ef8:   20050463            beqz    a0,4000a100 <rtems_semaphore_release+0x2c8>       <== NEVER TAKEN
#if defined(RTEMS_MULTIPROCESSING)                                                        
    if ( _Objects_Is_local_id( new_owner->Object.id ) )                                   
#endif                                                                                    
    {                                                                                     
      _Thread_Resource_count_increment( new_owner );                                      
      _Thread_Priority_add(                                                               
40009efc:   000b0593            mv  a1,s6                                                 
40009f00:   00c10613            addi    a2,sp,12                                          
40009f04:   76c020ef            jal ra,4000c670 <_Thread_Priority_add>                    
        &the_mutex->Priority_ceiling,                                                     
        queue_context                                                                     
      );                                                                                  
    }                                                                                     
                                                                                          
    _Thread_queue_Extract_critical(                                                       
40009f08:   00c10693            addi    a3,sp,12                                          
40009f0c:   000a8613            mv  a2,s5                                                 
40009f10:   edcb8593            addi    a1,s7,-292                                        
40009f14:   000a0513            mv  a0,s4                                                 
40009f18:   7b1020ef            jal ra,4000cec8 <_Thread_queue_Extract_critical>          
    );                                                                                    
  } else {                                                                                
    _CORE_mutex_Release( &the_mutex->Recursive.Mutex, queue_context );                    
  }                                                                                       
                                                                                          
  _Thread_Priority_update( queue_context );                                               
40009f1c:   00c10513            addi    a0,sp,12                                          
40009f20:   125020ef            jal ra,4000c844 <_Thread_Priority_update>                 
  _Thread_Dispatch_enable( cpu_self );                                                    
40009f24:   88098513            addi    a0,s3,-1920                                       
40009f28:   3dd020ef            jal ra,4000cb04 <_Thread_Dispatch_enable>                 
  return STATUS_SUCCESSFUL;                                                               
40009f2c:   05c0006f            j   40009f88 <rtems_semaphore_release+0x150>              
40009f30:   00300693            li  a3,3                                                  
40009f34:   0cd79a63            bne a5,a3,4000a008 <rtems_semaphore_release+0x1d0>        
  return (Semaphore_Discipline) ( ( flags >> 3 ) & 0x1 );                                 
40009f38:   00375713            srli    a4,a4,0x3                                         
40009f3c:   00177713            andi    a4,a4,1                                           
  if ( _Semaphore_Get_discipline( flags ) == SEMAPHORE_DISCIPLINE_PRIORITY ) {            
40009f40:   06070c63            beqz    a4,40009fb8 <rtems_semaphore_release+0x180>       
  return &_Thread_queue_Operations_FIFO;                                                  
40009f44:   4001c4b7            lui s1,0x4001c                                            
40009f48:   eb448493            addi    s1,s1,-332 # 4001beb4 <_Thread_queue_Operations_FIFO>
  Thread_queue_Heads *heads = the_thread_queue->Queue.heads;                              
40009f4c:   01042503            lw  a0,16(s0)                                             
  if ( heads != NULL ) {                                                                  
40009f50:   14050c63            beqz    a0,4000a0a8 <rtems_semaphore_release+0x270>       
    return ( *operations->first )( heads );                                               
40009f54:   0104a783            lw  a5,16(s1)                                             
40009f58:   000780e7            jalr    a5                                                
40009f5c:   00050613            mv  a2,a0                                                 
  if ( the_thread != NULL ) {                                                             
40009f60:   14050463            beqz    a0,4000a0a8 <rtems_semaphore_release+0x270>       <== NEVER TAKEN
    _Thread_queue_Extract_critical(                                                       
40009f64:   00048593            mv  a1,s1                                                 
40009f68:   00c10693            addi    a3,sp,12                                          
40009f6c:   000a0513            mv  a0,s4                                                 
40009f70:   759020ef            jal ra,4000cec8 <_Thread_queue_Extract_critical>          
40009f74:   00000493            li  s1,0                                                  
40009f78:   0100006f            j   40009f88 <rtems_semaphore_release+0x150>              
40009f7c:   00c12783            lw  a5,12(sp)                                             
40009f80:   3007a073            csrs    mstatus,a5                                        
    return STATUS_NOT_OWNER;                                                              
40009f84:   01700493            li  s1,23                                                 
      );                                                                                  
      break;                                                                              
  }                                                                                       
                                                                                          
  return _Status_Get( status );                                                           
}                                                                                         
40009f88:   05c12083            lw  ra,92(sp)                                             
40009f8c:   05812403            lw  s0,88(sp)                                             
40009f90:   05012903            lw  s2,80(sp)                                             
40009f94:   04c12983            lw  s3,76(sp)                                             
40009f98:   04812a03            lw  s4,72(sp)                                             
40009f9c:   04412a83            lw  s5,68(sp)                                             
40009fa0:   04012b03            lw  s6,64(sp)                                             
40009fa4:   03c12b83            lw  s7,60(sp)                                             
40009fa8:   00048513            mv  a0,s1                                                 
40009fac:   05412483            lw  s1,84(sp)                                             
40009fb0:   06010113            addi    sp,sp,96                                          
40009fb4:   00008067            ret                                                       
    return &_Thread_queue_Operations_priority;                                            
40009fb8:   4001c4b7            lui s1,0x4001c                                            
40009fbc:   edc48493            addi    s1,s1,-292 # 4001bedc <_Thread_queue_Operations_priority>
40009fc0:   f8dff06f            j   40009f4c <rtems_semaphore_release+0x114>              
  return (Semaphore_Discipline) ( ( flags >> 3 ) & 0x1 );                                 
40009fc4:   00375713            srli    a4,a4,0x3                                         
40009fc8:   00177713            andi    a4,a4,1                                           
  if ( _Semaphore_Get_discipline( flags ) == SEMAPHORE_DISCIPLINE_PRIORITY ) {            
40009fcc:   0e070e63            beqz    a4,4000a0c8 <rtems_semaphore_release+0x290>       
  return &_Thread_queue_Operations_FIFO;                                                  
40009fd0:   4001c737            lui a4,0x4001c                                            
40009fd4:   eb470713            addi    a4,a4,-332 # 4001beb4 <_Thread_queue_Operations_FIFO>
  if ( !_CORE_mutex_Is_owner( &the_mutex->Mutex, executing ) ) {                          
40009fd8:   01442783            lw  a5,20(s0)                                             
40009fdc:   faf510e3            bne a0,a5,40009f7c <rtems_semaphore_release+0x144>        
  nest_level = the_mutex->nest_level;                                                     
40009fe0:   01c42483            lw  s1,28(s0)                                             
  if ( nest_level > 0 ) {                                                                 
40009fe4:   0a049263            bnez    s1,4000a088 <rtems_semaphore_release+0x250>       <== NEVER TAKEN
  heads = the_mutex->Mutex.Wait_queue.Queue.heads;                                        
40009fe8:   01042583            lw  a1,16(s0)                                             
  the_mutex->Wait_queue.Queue.owner = owner;                                              
40009fec:   00042a23            sw  zero,20(s0)                                           
  if ( heads == NULL ) {                                                                  
40009ff0:   04058a63            beqz    a1,4000a044 <rtems_semaphore_release+0x20c>       
  _Thread_queue_Surrender(                                                                
40009ff4:   00050613            mv  a2,a0                                                 
40009ff8:   00c10693            addi    a3,sp,12                                          
40009ffc:   000a0513            mv  a0,s4                                                 
4000a000:   028030ef            jal ra,4000d028 <_Thread_queue_Surrender>                 
  return STATUS_SUCCESSFUL;                                                               
4000a004:   f85ff06f            j   40009f88 <rtems_semaphore_release+0x150>              
  return (Semaphore_Discipline) ( ( flags >> 3 ) & 0x1 );                                 
4000a008:   00375713            srli    a4,a4,0x3                                         
4000a00c:   00177713            andi    a4,a4,1                                           
  if ( _Semaphore_Get_discipline( flags ) == SEMAPHORE_DISCIPLINE_PRIORITY ) {            
4000a010:   0c070263            beqz    a4,4000a0d4 <rtems_semaphore_release+0x29c>       
  return &_Thread_queue_Operations_FIFO;                                                  
4000a014:   4001c4b7            lui s1,0x4001c                                            
4000a018:   eb448493            addi    s1,s1,-332 # 4001beb4 <_Thread_queue_Operations_FIFO>
  Thread_queue_Heads *heads = the_thread_queue->Queue.heads;                              
4000a01c:   01042503            lw  a0,16(s0)                                             
  if ( heads != NULL ) {                                                                  
4000a020:   00050a63            beqz    a0,4000a034 <rtems_semaphore_release+0x1fc>       
    return ( *operations->first )( heads );                                               
4000a024:   0104a783            lw  a5,16(s1)                                             
4000a028:   000780e7            jalr    a5                                                
4000a02c:   00050613            mv  a2,a0                                                 
  if ( the_thread != NULL ) {                                                             
4000a030:   f2051ae3            bnez    a0,40009f64 <rtems_semaphore_release+0x12c>       <== ALWAYS TAKEN
    if ( the_semaphore->count < maximum_count )                                           
4000a034:   01c42783            lw  a5,28(s0)                                             
4000a038:   fff00713            li  a4,-1                                                 
4000a03c:   00d00493            li  s1,13                                                 
4000a040:   0ae79063            bne a5,a4,4000a0e0 <rtems_semaphore_release+0x2a8>        
4000a044:   00c12783            lw  a5,12(sp)                                             
4000a048:   3007a073            csrs    mstatus,a5                                        
  return _Status_Get( status );                                                           
4000a04c:   f3dff06f            j   40009f88 <rtems_semaphore_release+0x150>              
  if ( !_CORE_mutex_Is_owner( &the_mutex->Mutex, executing ) ) {                          
4000a050:   01442783            lw  a5,20(s0)                                             
4000a054:   f2f514e3            bne a0,a5,40009f7c <rtems_semaphore_release+0x144>        
  nest_level = the_mutex->nest_level;                                                     
4000a058:   01c42483            lw  s1,28(s0)                                             
  if ( nest_level > 0 ) {                                                                 
4000a05c:   02049663            bnez    s1,4000a088 <rtems_semaphore_release+0x250>       
  heads = the_mutex->Mutex.Wait_queue.Queue.heads;                                        
4000a060:   01042583            lw  a1,16(s0)                                             
  the_mutex->Wait_queue.Queue.owner = owner;                                              
4000a064:   00042a23            sw  zero,20(s0)                                           
  if ( heads == NULL ) {                                                                  
4000a068:   fc058ee3            beqz    a1,4000a044 <rtems_semaphore_release+0x20c>       
  _Thread_queue_Surrender(                                                                
4000a06c:   4001c737            lui a4,0x4001c                                            
4000a070:   00050613            mv  a2,a0                                                 
4000a074:   ef070713            addi    a4,a4,-272 # 4001bef0 <_Thread_queue_Operations_priority_inherit>
4000a078:   00c10693            addi    a3,sp,12                                          
4000a07c:   000a0513            mv  a0,s4                                                 
4000a080:   7a9020ef            jal ra,4000d028 <_Thread_queue_Surrender>                 
  return STATUS_SUCCESSFUL;                                                               
4000a084:   f05ff06f            j   40009f88 <rtems_semaphore_release+0x150>              
    the_mutex->nest_level = nest_level - 1;                                               
4000a088:   fff48493            addi    s1,s1,-1                                          
4000a08c:   00942e23            sw  s1,28(s0)                                             
4000a090:   00c12783            lw  a5,12(sp)                                             
4000a094:   3007a073            csrs    mstatus,a5                                        
    return STATUS_SUCCESSFUL;                                                             
4000a098:   00000493            li  s1,0                                                  
4000a09c:   eedff06f            j   40009f88 <rtems_semaphore_release+0x150>              
    return RTEMS_INVALID_ID;                                                              
4000a0a0:   00400493            li  s1,4                                                  
4000a0a4:   ee5ff06f            j   40009f88 <rtems_semaphore_release+0x150>              
4000a0a8:   01c42783            lw  a5,28(s0)                                             
4000a0ac:   00079663            bnez    a5,4000a0b8 <rtems_semaphore_release+0x280>       
      the_semaphore->count += 1;                                                          
4000a0b0:   00100793            li  a5,1                                                  
4000a0b4:   00f42e23            sw  a5,28(s0)                                             
4000a0b8:   00c12783            lw  a5,12(sp)                                             
4000a0bc:   3007a073            csrs    mstatus,a5                                        
4000a0c0:   00000493            li  s1,0                                                  
4000a0c4:   ec5ff06f            j   40009f88 <rtems_semaphore_release+0x150>              
    return &_Thread_queue_Operations_priority;                                            
4000a0c8:   4001c737            lui a4,0x4001c                                            
4000a0cc:   edc70713            addi    a4,a4,-292 # 4001bedc <_Thread_queue_Operations_priority>
4000a0d0:   f09ff06f            j   40009fd8 <rtems_semaphore_release+0x1a0>              
4000a0d4:   4001c4b7            lui s1,0x4001c                                            
4000a0d8:   edc48493            addi    s1,s1,-292 # 4001bedc <_Thread_queue_Operations_priority>
4000a0dc:   f41ff06f            j   4000a01c <rtems_semaphore_release+0x1e4>              
4000a0e0:   00178793            addi    a5,a5,1                                           
4000a0e4:   00f42e23            sw  a5,28(s0)                                             
4000a0e8:   00000493            li  s1,0                                                  
4000a0ec:   f59ff06f            j   4000a044 <rtems_semaphore_release+0x20c>              
  disable_level = cpu_self->thread_dispatch_disable_level;                                
4000a0f0:   03092783            lw  a5,48(s2)                                             
  the_mutex->Wait_queue.Queue.owner = owner;                                              
4000a0f4:   00042a23            sw  zero,20(s0)                                           
  cpu_self->thread_dispatch_disable_level = disable_level + 1;                            
4000a0f8:   00178793            addi    a5,a5,1                                           
4000a0fc:   02f92823            sw  a5,48(s2)                                             
4000a100:   00c12783            lw  a5,12(sp)                                             
4000a104:   3007a073            csrs    mstatus,a5                                        
}                                                                                         
4000a108:   e15ff06f            j   40009f1c <rtems_semaphore_release+0xe4>               
                                                                                          

40004560 <rtems_semaphore_set_priority>: rtems_id semaphore_id, rtems_id scheduler_id, rtems_task_priority new_priority, rtems_task_priority *old_priority ) {
40004560:   fb010113            addi    sp,sp,-80                                         
40004564:   04112623            sw  ra,76(sp)                                             
40004568:   04812423            sw  s0,72(sp)                                             
4000456c:   04912223            sw  s1,68(sp)                                             
40004570:   05212023            sw  s2,64(sp)                                             
40004574:   03312e23            sw  s3,60(sp)                                             
40004578:   03412c23            sw  s4,56(sp)                                             
4000457c:   03612a23            sw  s6,52(sp)                                             
40004580:   03712823            sw  s7,48(sp)                                             
  const Scheduler_Control *scheduler;                                                     
  Semaphore_Control       *the_semaphore;                                                 
  Thread_queue_Context     queue_context;                                                 
                                                                                          
  if ( old_priority == NULL ) {                                                           
40004584:   16068063            beqz    a3,400046e4 <rtems_semaphore_set_priority+0x184>  
{                                                                                         
  uint32_t index;                                                                         
                                                                                          
  index = _Scheduler_Get_index_by_id( id );                                               
                                                                                          
  if ( index >= _Scheduler_Count ) {                                                      
40004588:   0f0107b7            lui a5,0xf010                                             
4000458c:   00178793            addi    a5,a5,1 # f010001 <RamSize+0xe010001>             
40004590:   10f59263            bne a1,a5,40004694 <rtems_semaphore_set_priority+0x134>   
40004594:   00060493            mv  s1,a2                                                 
  return (Semaphore_Control *) _Objects_Get(                                              
40004598:   40012637            lui a2,0x40012                                            
4000459c:   15460613            addi    a2,a2,340 # 40012154 <_Semaphore_Information>     
400045a0:   00c10593            addi    a1,sp,12                                          
400045a4:   00068413            mv  s0,a3                                                 
400045a8:   234010ef            jal ra,400057dc <_Objects_Get>                            
400045ac:   00050913            mv  s2,a0                                                 
    return RTEMS_INVALID_ID;                                                              
  }                                                                                       
                                                                                          
  the_semaphore = _Semaphore_Get( semaphore_id, &queue_context );                         
                                                                                          
  if ( the_semaphore == NULL ) {                                                          
400045b0:   0e050263            beqz    a0,40004694 <rtems_semaphore_set_priority+0x134>  
400045b4:   40011a37            lui s4,0x40011                                            
400045b8:   928a0993            addi    s3,s4,-1752 # 40010928 <_Scheduler_Table>         
  return ( *scheduler->Operations.map_priority )( scheduler, priority );                  
400045bc:   01c9a783            lw  a5,28(s3)                                             
400045c0:   00048593            mv  a1,s1                                                 
400045c4:   00000613            li  a2,0                                                  
400045c8:   928a0513            addi    a0,s4,-1752                                       
400045cc:   0409ab83            lw  s7,64(s3)                                             
400045d0:   0449ab03            lw  s6,68(s3)                                             
400045d4:   000780e7            jalr    a5                                                
  if ( new_priority != RTEMS_CURRENT_PRIORITY && !valid ) {                               
400045d8:   08048c63            beqz    s1,40004670 <rtems_semaphore_set_priority+0x110>  
400045dc:   100b0863            beqz    s6,400046ec <rtems_semaphore_set_priority+0x18c>  <== ALWAYS TAKEN
  return (Semaphore_Discipline) ( flags & 0x7 );                                          
400045e0:   00492783            lw  a5,4(s2)                                              
  switch ( variant ) {                                                                    
400045e4:   00100713            li  a4,1                                                  
  queue_context->Priority.update_count = 0;                                               
400045e8:   02012023            sw  zero,32(sp)                                           
400045ec:   0077f793            andi    a5,a5,7                                           
400045f0:   0ae78663            beq a5,a4,4000469c <rtems_semaphore_set_priority+0x13c>   
      old_priority = 0;                                                                   
400045f4:   00000b13            li  s6,0                                                  
400045f8:   00000b93            li  s7,0                                                  
      sc = RTEMS_NOT_DEFINED;                                                             
400045fc:   00b00493            li  s1,11                                                 
  disable_level = cpu_self->thread_dispatch_disable_level;                                
40004600:   40014937            lui s2,0x40014                                            
40004604:   20090713            addi    a4,s2,512 # 40014200 <_Per_CPU_Information>       
40004608:   03072783            lw  a5,48(a4)                                             
  cpu_self->thread_dispatch_disable_level = disable_level + 1;                            
4000460c:   00178793            addi    a5,a5,1                                           
40004610:   02f72823            sw  a5,48(a4)                                             
40004614:   00c12783            lw  a5,12(sp)                                             
40004618:   3007a073            csrs    mstatus,a5                                        
  _Thread_Priority_update( queue_context );                                               
4000461c:   00c10513            addi    a0,sp,12                                          
40004620:   1a0020ef            jal ra,400067c0 <_Thread_Priority_update>                 
  _Thread_Dispatch_enable( cpu_self );                                                    
40004624:   20090513            addi    a0,s2,512                                         
40004628:   394020ef            jal ra,400069bc <_Thread_Dispatch_enable>                 
  return ( *scheduler->Operations.unmap_priority )( scheduler, priority );                
4000462c:   0209a783            lw  a5,32(s3)                                             
40004630:   000b0593            mv  a1,s6                                                 
40004634:   000b8613            mv  a2,s7                                                 
40004638:   928a0513            addi    a0,s4,-1752                                       
4000463c:   000780e7            jalr    a5                                                
RTEMS_INLINE_ROUTINE rtems_task_priority _RTEMS_Priority_From_core(                       
  const Scheduler_Control *scheduler,                                                     
  Priority_Control         priority                                                       
)                                                                                         
{                                                                                         
  return (rtems_task_priority)                                                            
40004640:   00a42023            sw  a0,0(s0)                                              
    scheduler,                                                                            
    new_priority,                                                                         
    old_priority,                                                                         
    &queue_context                                                                        
  );                                                                                      
}                                                                                         
40004644:   04c12083            lw  ra,76(sp)                                             
40004648:   04812403            lw  s0,72(sp)                                             
4000464c:   04012903            lw  s2,64(sp)                                             
40004650:   03c12983            lw  s3,60(sp)                                             
40004654:   03812a03            lw  s4,56(sp)                                             
40004658:   03412b03            lw  s6,52(sp)                                             
4000465c:   03012b83            lw  s7,48(sp)                                             
40004660:   00048513            mv  a0,s1                                                 
40004664:   04412483            lw  s1,68(sp)                                             
40004668:   05010113            addi    sp,sp,80                                          
4000466c:   00008067            ret                                                       
40004670:   00492783            lw  a5,4(s2)                                              
  switch ( variant ) {                                                                    
40004674:   00100713            li  a4,1                                                  
40004678:   02012023            sw  zero,32(sp)                                           
4000467c:   0077f793            andi    a5,a5,7                                           
40004680:   f6e79ae3            bne a5,a4,400045f4 <rtems_semaphore_set_priority+0x94>    
  return the_mutex->Priority_ceiling.priority;                                            
40004684:   03092b03            lw  s6,48(s2)                                             
40004688:   03492b83            lw  s7,52(s2)                                             
      sc = _Semaphore_Is_scheduler_valid(                                                 
4000468c:   00000493            li  s1,0                                                  
40004690:   f71ff06f            j   40004600 <rtems_semaphore_set_priority+0xa0>          
    return RTEMS_INVALID_ID;                                                              
40004694:   00400493            li  s1,4                                                  
40004698:   fadff06f            j   40004644 <rtems_semaphore_set_priority+0xe4>          
  return the_mutex->Wait_queue.Queue.owner;                                               
4000469c:   01492783            lw  a5,20(s2)                                             
  return the_mutex->Priority_ceiling.priority;                                            
400046a0:   03092b03            lw  s6,48(s2)                                             
400046a4:   03492b83            lw  s7,52(s2)                                             
  if ( owner != NULL ) {                                                                  
400046a8:   04078c63            beqz    a5,40004700 <rtems_semaphore_set_priority+0x1a0>  <== ALWAYS TAKEN
  __asm__ volatile (                                                                      
400046ac:   30047773            csrrci  a4,mstatus,8                                      <== NOT EXECUTED
  return mstatus & RISCV_MSTATUS_MIE;                                                     
400046b0:   00877713            andi    a4,a4,8                                           <== NOT EXECUTED
RTEMS_INLINE_ROUTINE void _Thread_Wait_acquire(                                           
  Thread_Control       *the_thread,                                                       
  Thread_queue_Context *queue_context                                                     
)                                                                                         
{                                                                                         
  _ISR_lock_ISR_disable( &queue_context->Lock_context.Lock_context );                     
400046b4:   00e12623            sw  a4,12(sp)                                             <== NOT EXECUTED
  _Thread_Priority_changed(                                                               
400046b8:   00000613            li  a2,0                                                  <== NOT EXECUTED
  node->priority = priority;                                                              
400046bc:   02a92823            sw  a0,48(s2)                                             <== NOT EXECUTED
400046c0:   02b92a23            sw  a1,52(s2)                                             <== NOT EXECUTED
400046c4:   00c10693            addi    a3,sp,12                                          <== NOT EXECUTED
400046c8:   02090593            addi    a1,s2,32                                          <== NOT EXECUTED
400046cc:   00078513            mv  a0,a5                                                 <== NOT EXECUTED
400046d0:   050020ef            jal ra,40006720 <_Thread_Priority_changed>                <== NOT EXECUTED
  __asm__ volatile ( "csrrs zero, mstatus, %0" : : "r" ( level ) );                       
400046d4:   00c12783            lw  a5,12(sp)                                             <== NOT EXECUTED
400046d8:   3007a073            csrs    mstatus,a5                                        <== NOT EXECUTED
      sc = _Semaphore_Is_scheduler_valid(                                                 
400046dc:   00000493            li  s1,0                                                  <== NOT EXECUTED
  Thread_queue_Context *queue_context                                                     
)                                                                                         
{                                                                                         
  _Thread_Wait_release_critical( the_thread, queue_context );                             
  _ISR_lock_ISR_enable( &queue_context->Lock_context.Lock_context );                      
}                                                                                         
400046e0:   f21ff06f            j   40004600 <rtems_semaphore_set_priority+0xa0>          <== NOT EXECUTED
    return RTEMS_INVALID_ADDRESS;                                                         
400046e4:   00900493            li  s1,9                                                  
400046e8:   f5dff06f            j   40004644 <rtems_semaphore_set_priority+0xe4>          
  if ( new_priority != RTEMS_CURRENT_PRIORITY && !valid ) {                               
400046ec:   ee9bfae3            bgeu    s7,s1,400045e0 <rtems_semaphore_set_priority+0x80>
400046f0:   00c12783            lw  a5,12(sp)                                             
400046f4:   3007a073            csrs    mstatus,a5                                        
    return RTEMS_INVALID_PRIORITY;                                                        
400046f8:   01300493            li  s1,19                                                 
400046fc:   f49ff06f            j   40004644 <rtems_semaphore_set_priority+0xe4>          
    the_mutex->Priority_ceiling.priority = priority_ceiling;                              
40004700:   02a92823            sw  a0,48(s2)                                             
40004704:   02b92a23            sw  a1,52(s2)                                             
      sc = _Semaphore_Is_scheduler_valid(                                                 
40004708:   00000493            li  s1,0                                                  
4000470c:   ef5ff06f            j   40004600 <rtems_semaphore_set_priority+0xa0>          
                                                                                          

4000f9cc <rtems_task_delete>: #include <rtems/score/threadimpl.h> rtems_status_code rtems_task_delete( rtems_id id ) {
4000f9cc:   fc010113            addi    sp,sp,-64                                         
  Thread_Control       *the_thread;                                                       
  Thread_Close_context  context;                                                          
  Thread_Control       *executing;                                                        
                                                                                          
  _Thread_queue_Context_initialize( &context.Base );                                      
  the_thread = _Thread_Get( id, &context.Base.Lock_context.Lock_context );                
4000f9d0:   00810593            addi    a1,sp,8                                           
{                                                                                         
4000f9d4:   02112e23            sw  ra,60(sp)                                             
4000f9d8:   02812c23            sw  s0,56(sp)                                             
  the_thread = _Thread_Get( id, &context.Base.Lock_context.Lock_context );                
4000f9dc:   f9df90ef            jal ra,40009978 <_Thread_Get>                             
                                                                                          
  if ( the_thread == NULL ) {                                                             
4000f9e0:   06050663            beqz    a0,4000fa4c <rtems_task_delete+0x80>              
4000f9e4:   40023437            lui s0,0x40023                                            
4000f9e8:   f8040713            addi    a4,s0,-128 # 40022f80 <_Per_CPU_Information>      
4000f9ec:   03872583            lw  a1,56(a4)                                             
    return RTEMS_INVALID_ID;                                                              
  }                                                                                       
                                                                                          
  executing = _Thread_Executing;                                                          
                                                                                          
  if ( the_thread == executing ) {                                                        
4000f9f0:   02b50063            beq a0,a1,4000fa10 <rtems_task_delete+0x44>               
      THREAD_LIFE_TERMINATING | THREAD_LIFE_DETACHED,                                     
      NULL                                                                                
    );                                                                                    
    _Thread_Dispatch_enable( cpu_self );                                                  
  } else {                                                                                
    _Thread_Close( the_thread, executing, &context );                                     
4000f9f4:   00810613            addi    a2,sp,8                                           
4000f9f8:   cb4fb0ef            jal ra,4000aeac <_Thread_Close>                           
  }                                                                                       
                                                                                          
  return RTEMS_SUCCESSFUL;                                                                
}                                                                                         
4000f9fc:   03c12083            lw  ra,60(sp)                                             
4000fa00:   03812403            lw  s0,56(sp)                                             
  return RTEMS_SUCCESSFUL;                                                                
4000fa04:   00000513            li  a0,0                                                  
}                                                                                         
4000fa08:   04010113            addi    sp,sp,64                                          
4000fa0c:   00008067            ret                                                       
  disable_level = cpu_self->thread_dispatch_disable_level;                                
4000fa10:   03072783            lw  a5,48(a4)                                             
  cpu_self->thread_dispatch_disable_level = disable_level + 1;                            
4000fa14:   00178793            addi    a5,a5,1                                           
4000fa18:   02f72823            sw  a5,48(a4)                                             
4000fa1c:   00812783            lw  a5,8(sp)                                              
4000fa20:   3007a073            csrs    mstatus,a5                                        
    _Thread_Exit(                                                                         
4000fa24:   00000613            li  a2,0                                                  
4000fa28:   01400593            li  a1,20                                                 
4000fa2c:   cb4fb0ef            jal ra,4000aee0 <_Thread_Exit>                            
    _Thread_Dispatch_enable( cpu_self );                                                  
4000fa30:   f8040513            addi    a0,s0,-128                                        
4000fa34:   ef9f90ef            jal ra,4000992c <_Thread_Dispatch_enable>                 
}                                                                                         
4000fa38:   03c12083            lw  ra,60(sp)                                             <== NOT EXECUTED
4000fa3c:   03812403            lw  s0,56(sp)                                             <== NOT EXECUTED
  return RTEMS_SUCCESSFUL;                                                                
4000fa40:   00000513            li  a0,0                                                  <== NOT EXECUTED
}                                                                                         
4000fa44:   04010113            addi    sp,sp,64                                          <== NOT EXECUTED
4000fa48:   00008067            ret                                                       <== NOT EXECUTED
4000fa4c:   03c12083            lw  ra,60(sp)                                             
4000fa50:   03812403            lw  s0,56(sp)                                             
    return RTEMS_INVALID_ID;                                                              
4000fa54:   00400513            li  a0,4                                                  
}                                                                                         
4000fa58:   04010113            addi    sp,sp,64                                          
4000fa5c:   00008067            ret                                                       
                                                                                          

40006d34 <rtems_task_mode>: bool needs_asr_dispatching; rtems_mode old_mode; executing = _Thread_Get_executing(); if ( !previous_mode_set ) 40006d34: 1e060263 beqz a2,40006f18 <rtems_task_mode+0x1e4> {
40006d38:   fd010113            addi    sp,sp,-48                                         
40006d3c:   02912223            sw  s1,36(sp)                                             
40006d40:   01412c23            sw  s4,24(sp)                                             
40006d44:   01512a23            sw  s5,20(sp)                                             
40006d48:   01612823            sw  s6,16(sp)                                             
40006d4c:   02112623            sw  ra,44(sp)                                             
40006d50:   02812423            sw  s0,40(sp)                                             
40006d54:   03212023            sw  s2,32(sp)                                             
40006d58:   01312e23            sw  s3,28(sp)                                             
40006d5c:   01712623            sw  s7,12(sp)                                             
40006d60:   01812423            sw  s8,8(sp)                                              
40006d64:   01912223            sw  s9,4(sp)                                              
  }                                                                                       
#endif                                                                                    
                                                                                          
#if defined(RTEMS_SMP) || CPU_ENABLE_ROBUST_THREAD_DISPATCH == TRUE                       
  if (                                                                                    
    ( mask & RTEMS_INTERRUPT_MASK ) != 0                                                  
40006d68:   0015fa93            andi    s5,a1,1                                           
40006d6c:   00060a13            mv  s4,a2                                                 
40006d70:   00050b13            mv  s6,a0                                                 
40006d74:   00058493            mv  s1,a1                                                 
  if (                                                                                    
40006d78:   000a8863            beqz    s5,40006d88 <rtems_task_mode+0x54>                
 */                                                                                       
RTEMS_INLINE_ROUTINE ISR_Level _Modes_Get_interrupt_level (                               
  rtems_mode mode_set                                                                     
)                                                                                         
{                                                                                         
  return ( mode_set & RTEMS_INTERRUPT_MASK );                                             
40006d7c:   00157793            andi    a5,a0,1                                           
      && _Modes_Get_interrupt_level( mode_set ) != 0                                      
#if CPU_ENABLE_ROBUST_THREAD_DISPATCH == FALSE                                            
      && _SMP_Need_inter_processor_interrupts()                                           
#endif                                                                                    
  ) {                                                                                     
    return RTEMS_NOT_IMPLEMENTED;                                                         
40006d80:   01800513            li  a0,24                                                 
      && _Modes_Get_interrupt_level( mode_set ) != 0                                      
40006d84:   12079a63            bnez    a5,40006eb8 <rtems_task_mode+0x184>               
40006d88:   400209b7            lui s3,0x40020                                            
40006d8c:   f0098c93            addi    s9,s3,-256 # 4001ff00 <_Per_CPU_Information>      
40006d90:   038cac03            lw  s8,56(s9)                                             
   */                                                                                     
                                                                                          
  api = executing->API_Extensions[ THREAD_API_RTEMS ];                                    
  asr = &api->Signal;                                                                     
                                                                                          
  old_mode  = (executing->is_preemptible) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT;             
40006d94:   089c4403            lbu s0,137(s8)                                            
                                                                                          
  if ( executing->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_NONE )                  
40006d98:   090c2783            lw  a5,144(s8)                                            
  api = executing->API_Extensions[ THREAD_API_RTEMS ];                                    
40006d9c:   194c2b83            lw  s7,404(s8)                                            
  old_mode  = (executing->is_preemptible) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT;             
40006da0:   00143913            seqz    s2,s0                                             
40006da4:   00891913            slli    s2,s2,0x8                                         
  if ( executing->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_NONE )                  
40006da8:   14079a63            bnez    a5,40006efc <rtems_task_mode+0x1c8>               
    old_mode |= RTEMS_NO_TIMESLICE;                                                       
  else                                                                                    
    old_mode |= RTEMS_TIMESLICE;                                                          
                                                                                          
  old_mode |= (asr->is_enabled) ? RTEMS_ASR : RTEMS_NO_ASR;                               
40006dac:   008bc403            lbu s0,8(s7)                                              
  old_mode |= _ISR_Get_level();                                                           
40006db0:   3d8050ef            jal ra,4000c188 <_CPU_ISR_Get_level>                      
                                                                                          
  /*                                                                                      
   *  These are generic thread scheduling characteristics.                                
   */                                                                                     
  preempt_enabled = false;                                                                
  if ( mask & RTEMS_PREEMPT_MASK ) {                                                      
40006db4:   1004f713            andi    a4,s1,256                                         
  old_mode |= (asr->is_enabled) ? RTEMS_ASR : RTEMS_NO_ASR;                               
40006db8:   00143413            seqz    s0,s0                                             
40006dbc:   00a41413            slli    s0,s0,0xa                                         
  old_mode |= _ISR_Get_level();                                                           
40006dc0:   00a46433            or  s0,s0,a0                                              
40006dc4:   01246433            or  s0,s0,s2                                              
  *previous_mode_set = old_mode;                                                          
40006dc8:   008a2023            sw  s0,0(s4)                                              
  preempt_enabled = false;                                                                
40006dcc:   00000693            li  a3,0                                                  
  if ( mask & RTEMS_PREEMPT_MASK ) {                                                      
40006dd0:   02070063            beqz    a4,40006df0 <rtems_task_mode+0xbc>                
    bool is_preempt_enabled = _Modes_Is_preempt( mode_set );                              
                                                                                          
    preempt_enabled = !executing->is_preemptible && is_preempt_enabled;                   
40006dd4:   089c4783            lbu a5,137(s8)                                            
   return (mode_set & RTEMS_PREEMPT_MASK) == RTEMS_PREEMPT;                               
40006dd8:   008b5713            srli    a4,s6,0x8                                         
40006ddc:   00174713            xori    a4,a4,1                                           
40006de0:   00177713            andi    a4,a4,1                                           
40006de4:   00079463            bnez    a5,40006dec <rtems_task_mode+0xb8>                
40006de8:   00070693            mv  a3,a4                                                 
    executing->is_preemptible = is_preempt_enabled;                                       
40006dec:   08ec04a3            sb  a4,137(s8)                                            
  }                                                                                       
                                                                                          
  if ( mask & RTEMS_TIMESLICE_MASK ) {                                                    
40006df0:   2004f793            andi    a5,s1,512                                         
40006df4:   00078e63            beqz    a5,40006e10 <rtems_task_mode+0xdc>                
  return (mode_set & RTEMS_TIMESLICE_MASK) == RTEMS_TIMESLICE;                            
40006df8:   200b7793            andi    a5,s6,512                                         
    if ( _Modes_Is_timeslice(mode_set) ) {                                                
40006dfc:   10078463            beqz    a5,40006f04 <rtems_task_mode+0x1d0>               
      executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE;          
      executing->cpu_time_budget =                                                        
40006e00:   8ac1a783            lw  a5,-1876(gp) # 4001d284 <_Watchdog_Ticks_per_timeslice>
      executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE;          
40006e04:   00100713            li  a4,1                                                  
40006e08:   08ec2823            sw  a4,144(s8)                                            
      executing->cpu_time_budget =                                                        
40006e0c:   08fc2623            sw  a5,140(s8)                                            
  }                                                                                       
                                                                                          
  /*                                                                                      
   *  Set the new interrupt level                                                         
   */                                                                                     
  if ( mask & RTEMS_INTERRUPT_MASK ) {                                                    
40006e10:   000a8863            beqz    s5,40006e20 <rtems_task_mode+0xec>                
  return ( mode_set & RTEMS_INTERRUPT_MASK );                                             
40006e14:   001b7793            andi    a5,s6,1                                           
  return ( level & RISCV_MSTATUS_MIE ) != 0;                                              
}                                                                                         
                                                                                          
RTEMS_INLINE_ROUTINE void _CPU_ISR_Set_level( uint32_t level )                            
{                                                                                         
  if ( ( level & CPU_MODES_INTERRUPT_MASK) == 0 ) {                                       
40006e18:   0e079c63            bnez    a5,40006f10 <rtems_task_mode+0x1dc>               <== NEVER TAKEN
    __asm__ volatile (                                                                    
40006e1c:   30046073            csrsi   mstatus,8                                         
                                                                                          
  /*                                                                                      
   *  This is specific to the RTEMS API                                                   
   */                                                                                     
  needs_asr_dispatching = false;                                                          
  if ( mask & RTEMS_ASR_MASK ) {                                                          
40006e20:   4004f493            andi    s1,s1,1024                                        
40006e24:   0c048663            beqz    s1,40006ef0 <rtems_task_mode+0x1bc>               
    bool is_asr_enabled = !_Modes_Is_asr_disabled( mode_set );                            
40006e28:   00ab5793            srli    a5,s6,0xa                                         
40006e2c:   0017c793            xori    a5,a5,1                                           
40006e30:   0017f793            andi    a5,a5,1                                           
  __asm__ volatile (                                                                      
40006e34:   30047773            csrrci  a4,mstatus,8                                      
  return mstatus & RISCV_MSTATUS_MIE;                                                     
40006e38:   00877713            andi    a4,a4,8                                           
                                                                                          
    _Thread_State_acquire( executing, &lock_context );                                    
                                                                                          
    if ( is_asr_enabled != asr->is_enabled ) {                                            
40006e3c:   008bc603            lbu a2,8(s7)                                              
40006e40:   0af60663            beq a2,a5,40006eec <rtems_task_mode+0x1b8>                
                                                                                          
RTEMS_INLINE_ROUTINE rtems_signal_set _ASR_Swap_signals( ASR_Information *asr )           
{                                                                                         
  rtems_signal_set new_signals_posted;                                                    
                                                                                          
  new_signals_posted   = asr->signals_pending;                                            
40006e44:   018ba603            lw  a2,24(s7)                                             
  asr->signals_pending = asr->signals_posted;                                             
40006e48:   014ba583            lw  a1,20(s7)                                             
      asr->is_enabled = is_asr_enabled;                                                   
40006e4c:   00fb8423            sb  a5,8(s7)                                              
  asr->signals_posted  = new_signals_posted;                                              
40006e50:   00cbaa23            sw  a2,20(s7)                                             
  asr->signals_pending = asr->signals_posted;                                             
40006e54:   00bbac23            sw  a1,24(s7)                                             
                                                                                          
      if ( _ASR_Swap_signals( asr ) != 0 ) {                                              
40006e58:   08060a63            beqz    a2,40006eec <rtems_task_mode+0x1b8>               
  action->handler = handler;                                                              
40006e5c:   4000d7b7            lui a5,0x4000d                                            
40006e60:   5f878793            addi    a5,a5,1528 # 4000d5f8 <_Signal_Action_handler>    
RTEMS_INLINE_ROUTINE void _Chain_Append_if_is_off_chain_unprotected(                      
  Chain_Control *the_chain,                                                               
  Chain_Node    *the_node                                                                 
)                                                                                         
{                                                                                         
  if ( _Chain_Is_node_off_chain( the_node ) ) {                                           
40006e64:   020ba683            lw  a3,32(s7)                                             
40006e68:   02fba423            sw  a5,40(s7)                                             
  } else {                                                                                
    _Atomic_Fetch_or_ulong( &cpu_target->message, 0, ATOMIC_ORDER_RELEASE );              
    _CPU_SMP_Send_interrupt( _Per_CPU_Get_index( cpu_target ) );                          
  }                                                                                       
#else                                                                                     
 cpu_self->dispatch_necessary = true;                                                     
40006e6c:   00100793            li  a5,1                                                  
40006e70:   02fc8a23            sb  a5,52(s9)                                             
40006e74:   0a068663            beqz    a3,40006f20 <rtems_task_mode+0x1ec>               <== ALWAYS TAKEN
  __asm__ volatile ( "csrrs zero, mstatus, %0" : : "r" ( level ) );                       
40006e78:   30072073            csrs    mstatus,a4                                        <== NOT EXECUTED
  disable_level = cpu_self->thread_dispatch_disable_level;                                
40006e7c:   030ca783            lw  a5,48(s9)                                             
  cpu_self->thread_dispatch_disable_level = disable_level + 1;                            
40006e80:   00178793            addi    a5,a5,1                                           
40006e84:   02fca823            sw  a5,48(s9)                                             
  __asm__ volatile (                                                                      
40006e88:   30047473            csrrci  s0,mstatus,8                                      
  ( *scheduler->Operations.schedule )( scheduler, the_thread );                           
40006e8c:   4001a537            lui a0,0x4001a                                            
40006e90:   7a850793            addi    a5,a0,1960 # 4001a7a8 <_Scheduler_Table>          
40006e94:   0087a783            lw  a5,8(a5)                                              
40006e98:   000c0593            mv  a1,s8                                                 
40006e9c:   7a850513            addi    a0,a0,1960                                        
40006ea0:   000780e7            jalr    a5                                                
  return mstatus & RISCV_MSTATUS_MIE;                                                     
40006ea4:   00847413            andi    s0,s0,8                                           
  __asm__ volatile ( "csrrs zero, mstatus, %0" : : "r" ( level ) );                       
40006ea8:   30042073            csrs    mstatus,s0                                        
                                                                                          
    cpu_self = _Thread_Dispatch_disable();                                                
    _Thread_State_acquire( executing, &lock_context );                                    
    _Scheduler_Schedule( executing );                                                     
    _Thread_State_release( executing, &lock_context );                                    
    _Thread_Dispatch_direct( cpu_self );                                                  
40006eac:   f0098513            addi    a0,s3,-256                                        
40006eb0:   77d020ef            jal ra,40009e2c <_Thread_Dispatch_direct>                 
  }                                                                                       
                                                                                          
  return RTEMS_SUCCESSFUL;                                                                
40006eb4:   00000513            li  a0,0                                                  
}                                                                                         
40006eb8:   02c12083            lw  ra,44(sp)                                             
40006ebc:   02812403            lw  s0,40(sp)                                             
40006ec0:   02412483            lw  s1,36(sp)                                             
40006ec4:   02012903            lw  s2,32(sp)                                             
40006ec8:   01c12983            lw  s3,28(sp)                                             
40006ecc:   01812a03            lw  s4,24(sp)                                             
40006ed0:   01412a83            lw  s5,20(sp)                                             
40006ed4:   01012b03            lw  s6,16(sp)                                             
40006ed8:   00c12b83            lw  s7,12(sp)                                             
40006edc:   00812c03            lw  s8,8(sp)                                              
40006ee0:   00412c83            lw  s9,4(sp)                                              
40006ee4:   03010113            addi    sp,sp,48                                          
40006ee8:   00008067            ret                                                       
40006eec:   30072073            csrs    mstatus,a4                                        
  return RTEMS_SUCCESSFUL;                                                                
40006ef0:   00000513            li  a0,0                                                  
  if ( preempt_enabled || needs_asr_dispatching ) {                                       
40006ef4:   fc0682e3            beqz    a3,40006eb8 <rtems_task_mode+0x184>               
40006ef8:   f85ff06f            j   40006e7c <rtems_task_mode+0x148>                      
    old_mode |= RTEMS_TIMESLICE;                                                          
40006efc:   20096913            ori s2,s2,512                                             
40006f00:   eadff06f            j   40006dac <rtems_task_mode+0x78>                       
      executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE;                     
40006f04:   080c2823            sw  zero,144(s8)                                          
  if ( mask & RTEMS_INTERRUPT_MASK ) {                                                    
40006f08:   f00a8ce3            beqz    s5,40006e20 <rtems_task_mode+0xec>                
40006f0c:   f09ff06f            j   40006e14 <rtems_task_mode+0xe0>                       
      "csrrs zero, mstatus, " RTEMS_XSTRING( RISCV_MSTATUS_MIE )                          
    );                                                                                    
  } else {                                                                                
    __asm__ volatile (                                                                    
40006f10:   30047073            csrci   mstatus,8                                         <== NOT EXECUTED
 */                                                                                       
RTEMS_INLINE_ROUTINE void _Modes_Set_interrupt_level (                                    
  rtems_mode mode_set                                                                     
)                                                                                         
{                                                                                         
  _ISR_Set_level( _Modes_Get_interrupt_level( mode_set ) );                               
40006f14:   f0dff06f            j   40006e20 <rtems_task_mode+0xec>                       <== NOT EXECUTED
    return RTEMS_INVALID_ADDRESS;                                                         
40006f18:   00900513            li  a0,9                                                  
}                                                                                         
40006f1c:   00008067            ret                                                       
  old_last = tail->previous;                                                              
40006f20:   0e0c2783            lw  a5,224(s8)                                            
  return &the_chain->Tail.Node;                                                           
40006f24:   0dcc0613            addi    a2,s8,220                                         
  _Chain_Append_if_is_off_chain_unprotected(                                              
40006f28:   020b8693            addi    a3,s7,32                                          
  the_node->next = tail;                                                                  
40006f2c:   02cba023            sw  a2,32(s7)                                             
  tail->previous = the_node;                                                              
40006f30:   0edc2023            sw  a3,224(s8)                                            
  old_last->next = the_node;                                                              
40006f34:   00d7a023            sw  a3,0(a5)                                              
  the_node->previous = old_last;                                                          
40006f38:   02fba223            sw  a5,36(s7)                                             
  __asm__ volatile ( "csrrs zero, mstatus, %0" : : "r" ( level ) );                       
40006f3c:   30072073            csrs    mstatus,a4                                        
  if ( preempt_enabled || needs_asr_dispatching ) {                                       
40006f40:   f3dff06f            j   40006e7c <rtems_task_mode+0x148>                      
                                                                                          

4000816c <rtems_task_set_priority>: rtems_status_code rtems_task_set_priority( rtems_id id, rtems_task_priority new_priority, rtems_task_priority *old_priority_p ) {
4000816c:   fa010113            addi    sp,sp,-96                                         
40008170:   04112e23            sw  ra,92(sp)                                             
40008174:   04812c23            sw  s0,88(sp)                                             
40008178:   04912a23            sw  s1,84(sp)                                             
4000817c:   05212823            sw  s2,80(sp)                                             
40008180:   05312623            sw  s3,76(sp)                                             
40008184:   05412423            sw  s4,72(sp)                                             
40008188:   05512223            sw  s5,68(sp)                                             
4000818c:   05612023            sw  s6,64(sp)                                             
40008190:   03712e23            sw  s7,60(sp)                                             
40008194:   03812c23            sw  s8,56(sp)                                             
  Thread_queue_Context     queue_context;                                                 
  const Scheduler_Control *scheduler;                                                     
  Priority_Control         old_priority;                                                  
  rtems_status_code        status;                                                        
                                                                                          
  if ( old_priority_p == NULL ) {                                                         
40008198:   10060e63            beqz    a2,400082b4 <rtems_task_set_priority+0x148>       
4000819c:   00058913            mv  s2,a1                                                 
    return RTEMS_INVALID_ADDRESS;                                                         
  }                                                                                       
                                                                                          
  _Thread_queue_Context_initialize( &queue_context );                                     
  _Thread_queue_Context_clear_priority_updates( &queue_context );                         
  the_thread = _Thread_Get( id, &queue_context.Lock_context.Lock_context );               
400081a0:   00c10593            addi    a1,sp,12                                          
400081a4:   00060413            mv  s0,a2                                                 
 */                                                                                       
RTEMS_INLINE_ROUTINE void _Thread_queue_Context_clear_priority_updates(                   
  Thread_queue_Context *queue_context                                                     
)                                                                                         
{                                                                                         
  queue_context->Priority.update_count = 0;                                               
400081a8:   02012023            sw  zero,32(sp)                                           
400081ac:   460020ef            jal ra,4000a60c <_Thread_Get>                             
400081b0:   00050493            mv  s1,a0                                                 
                                                                                          
  if ( the_thread == NULL ) {                                                             
400081b4:   10050463            beqz    a0,400082bc <rtems_task_set_priority+0x150>       
 */                                                                                       
RTEMS_INLINE_ROUTINE Priority_Control _Priority_Get_priority(                             
  const Priority_Aggregation *aggregation                                                 
)                                                                                         
{                                                                                         
  return aggregation->Node.priority;                                                      
400081b8:   03852783            lw  a5,56(a0)                                             
400081bc:   0187ab03            lw  s6,24(a5)                                             
400081c0:   01c7ab83            lw  s7,28(a5)                                             
  _Thread_Wait_acquire_critical( the_thread, &queue_context );                            
                                                                                          
  scheduler = _Thread_Scheduler_get_home( the_thread );                                   
  old_priority = _Thread_Get_priority( the_thread );                                      
                                                                                          
  if ( new_priority != RTEMS_CURRENT_PRIORITY ) {                                         
400081c4:   06091263            bnez    s2,40008228 <rtems_task_set_priority+0xbc>        
400081c8:   00c12783            lw  a5,12(sp)                                             
400081cc:   3007a073            csrs    mstatus,a5                                        
      new_priority,                                                                       
      &queue_context                                                                      
    );                                                                                    
  } else {                                                                                
    _Thread_Wait_release( the_thread, &queue_context );                                   
    status = RTEMS_SUCCESSFUL;                                                            
400081d0:   400139b7            lui s3,0x40013                                            
400081d4:   00000493            li  s1,0                                                  
400081d8:   45098a13            addi    s4,s3,1104 # 40013450 <_Scheduler_Table>          
RTEMS_INLINE_ROUTINE Priority_Control _Scheduler_Unmap_priority(                          
  const Scheduler_Control *scheduler,                                                     
  Priority_Control         priority                                                       
)                                                                                         
{                                                                                         
  return ( *scheduler->Operations.unmap_priority )( scheduler, priority );                
400081dc:   020a2783            lw  a5,32(s4)                                             
400081e0:   000b0593            mv  a1,s6                                                 
400081e4:   000b8613            mv  a2,s7                                                 
400081e8:   45098513            addi    a0,s3,1104                                        
400081ec:   000780e7            jalr    a5                                                
RTEMS_INLINE_ROUTINE rtems_task_priority _RTEMS_Priority_From_core(                       
  const Scheduler_Control *scheduler,                                                     
  Priority_Control         priority                                                       
)                                                                                         
{                                                                                         
  return (rtems_task_priority)                                                            
400081f0:   00a42023            sw  a0,0(s0)                                              
  }                                                                                       
                                                                                          
  *old_priority_p = _RTEMS_Priority_From_core( scheduler, old_priority );                 
  return status;                                                                          
}                                                                                         
400081f4:   05c12083            lw  ra,92(sp)                                             
400081f8:   05812403            lw  s0,88(sp)                                             
400081fc:   05012903            lw  s2,80(sp)                                             
40008200:   04c12983            lw  s3,76(sp)                                             
40008204:   04812a03            lw  s4,72(sp)                                             
40008208:   04412a83            lw  s5,68(sp)                                             
4000820c:   04012b03            lw  s6,64(sp)                                             
40008210:   03c12b83            lw  s7,60(sp)                                             
40008214:   03812c03            lw  s8,56(sp)                                             
40008218:   00048513            mv  a0,s1                                                 
4000821c:   05412483            lw  s1,84(sp)                                             
40008220:   06010113            addi    sp,sp,96                                          
40008224:   00008067            ret                                                       
  *valid = ( priority <= scheduler->maximum_priority );                                   
40008228:   400139b7            lui s3,0x40013                                            
4000822c:   45098a13            addi    s4,s3,1104 # 40013450 <_Scheduler_Table>          
40008230:   044a2c03            lw  s8,68(s4)                                             
  return ( *scheduler->Operations.map_priority )( scheduler, priority );                  
40008234:   01ca2783            lw  a5,28(s4)                                             
40008238:   00090593            mv  a1,s2                                                 
4000823c:   00000613            li  a2,0                                                  
40008240:   45098513            addi    a0,s3,1104                                        
40008244:   040a2a83            lw  s5,64(s4)                                             
40008248:   000780e7            jalr    a5                                                
  if ( !valid ) {                                                                         
4000824c:   040c0a63            beqz    s8,400082a0 <rtems_task_set_priority+0x134>       <== ALWAYS TAKEN
  node->priority = priority;                                                              
40008250:   02a4a823            sw  a0,48(s1)                                             
40008254:   02b4aa23            sw  a1,52(s1)                                             
  _Thread_Priority_changed(                                                               
40008258:   00048513            mv  a0,s1                                                 
4000825c:   02048593            addi    a1,s1,32                                          
40008260:   00c10693            addi    a3,sp,12                                          
40008264:   00000613            li  a2,0                                                  
40008268:   7f9010ef            jal ra,4000a260 <_Thread_Priority_changed>                
  disable_level = cpu_self->thread_dispatch_disable_level;                                
4000826c:   400184b7            lui s1,0x40018                                            
40008270:   d0048713            addi    a4,s1,-768 # 40017d00 <_Per_CPU_Information>      
40008274:   03072783            lw  a5,48(a4)                                             
  cpu_self->thread_dispatch_disable_level = disable_level + 1;                            
40008278:   00178793            addi    a5,a5,1                                           
4000827c:   02f72823            sw  a5,48(a4)                                             
40008280:   00c12783            lw  a5,12(sp)                                             
40008284:   3007a073            csrs    mstatus,a5                                        
  _Thread_Priority_update( queue_context );                                               
40008288:   00c10513            addi    a0,sp,12                                          
4000828c:   074020ef            jal ra,4000a300 <_Thread_Priority_update>                 
  _Thread_Dispatch_enable( cpu_self );                                                    
40008290:   d0048513            addi    a0,s1,-768                                        
40008294:   32c020ef            jal ra,4000a5c0 <_Thread_Dispatch_enable>                 
  return RTEMS_SUCCESSFUL;                                                                
40008298:   00000493            li  s1,0                                                  
4000829c:   f41ff06f            j   400081dc <rtems_task_set_priority+0x70>               
  if ( !valid ) {                                                                         
400082a0:   fb2af8e3            bgeu    s5,s2,40008250 <rtems_task_set_priority+0xe4>     
400082a4:   00c12783            lw  a5,12(sp)                                             
400082a8:   3007a073            csrs    mstatus,a5                                        
    return RTEMS_INVALID_PRIORITY;                                                        
400082ac:   01300493            li  s1,19                                                 
400082b0:   f2dff06f            j   400081dc <rtems_task_set_priority+0x70>               
    return RTEMS_INVALID_ADDRESS;                                                         
400082b4:   00900493            li  s1,9                                                  
400082b8:   f3dff06f            j   400081f4 <rtems_task_set_priority+0x88>               
    return RTEMS_INVALID_ID;                                                              
400082bc:   00400493            li  s1,4                                                  
400082c0:   f35ff06f            j   400081f4 <rtems_task_set_priority+0x88>               
                                                                                          

40006f24 <rtems_task_set_scheduler>: rtems_status_code rtems_task_set_scheduler( rtems_id task_id, rtems_id scheduler_id, rtems_task_priority priority ) {
40006f24:   fa010113            addi    sp,sp,-96                                         
  if ( index >= _Scheduler_Count ) {                                                      
40006f28:   0f0107b7            lui a5,0xf010                                             
40006f2c:   04112e23            sw  ra,92(sp)                                             
40006f30:   04812c23            sw  s0,88(sp)                                             
40006f34:   04912a23            sw  s1,84(sp)                                             
40006f38:   05212823            sw  s2,80(sp)                                             
40006f3c:   05312623            sw  s3,76(sp)                                             
40006f40:   05412423            sw  s4,72(sp)                                             
40006f44:   05512223            sw  s5,68(sp)                                             
40006f48:   05612023            sw  s6,64(sp)                                             
40006f4c:   03712e23            sw  s7,60(sp)                                             
40006f50:   03812c23            sw  s8,56(sp)                                             
40006f54:   00178793            addi    a5,a5,1 # f010001 <RamSize+0xe010001>             
40006f58:   0af59a63            bne a1,a5,4000700c <rtems_task_set_scheduler+0xe8>        
40006f5c:   40013ab7            lui s5,0x40013                                            
40006f60:   578a8913            addi    s2,s5,1400 # 40013578 <_Scheduler_Table>          
  return ( *scheduler->Operations.map_priority )( scheduler, priority );                  
40006f64:   01c92783            lw  a5,28(s2)                                             
40006f68:   04492b03            lw  s6,68(s2)                                             
40006f6c:   00060593            mv  a1,a2                                                 
40006f70:   00050493            mv  s1,a0                                                 
40006f74:   00060413            mv  s0,a2                                                 
40006f78:   578a8513            addi    a0,s5,1400                                        
40006f7c:   00000613            li  a2,0                                                  
40006f80:   04092b83            lw  s7,64(s2)                                             
40006f84:   000780e7            jalr    a5                                                
40006f88:   00050993            mv  s3,a0                                                 
40006f8c:   00058a13            mv  s4,a1                                                 
  if ( scheduler == NULL ) {                                                              
    return RTEMS_INVALID_ID;                                                              
  }                                                                                       
                                                                                          
  core_priority = _RTEMS_Priority_To_core( scheduler, priority, &valid );                 
  if ( !valid ) {                                                                         
40006f90:   080b0263            beqz    s6,40007014 <rtems_task_set_scheduler+0xf0>       <== ALWAYS TAKEN
    return RTEMS_INVALID_PRIORITY;                                                        
  }                                                                                       
                                                                                          
  _Thread_queue_Context_initialize( &queue_context );                                     
  the_thread = _Thread_Get( task_id, &queue_context.Lock_context.Lock_context );          
40006f94:   00c10593            addi    a1,sp,12                                          
40006f98:   00048513            mv  a0,s1                                                 
40006f9c:   0c9020ef            jal ra,40009864 <_Thread_Get>                             
40006fa0:   00050413            mv  s0,a0                                                 
                                                                                          
  if ( the_thread == NULL ) {                                                             
40006fa4:   06050463            beqz    a0,4000700c <rtems_task_set_scheduler+0xe8>       
  disable_level = cpu_self->thread_dispatch_disable_level;                                
40006fa8:   400174b7            lui s1,0x40017                                            
40006fac:   e8048713            addi    a4,s1,-384 # 40016e80 <_Per_CPU_Information>      
40006fb0:   03072783            lw  a5,48(a4)                                             
  ISR_lock_Context         lock_context;                                                  
  const Scheduler_Control *old_scheduler;                                                 
                                                                                          
#endif                                                                                    
                                                                                          
  if ( the_thread->Wait.queue != NULL ) {                                                 
40006fb4:   05452683            lw  a3,84(a0)                                             
40006fb8:   00c00b13            li  s6,12                                                 
  cpu_self->thread_dispatch_disable_level = disable_level + 1;                            
40006fbc:   00178793            addi    a5,a5,1                                           
40006fc0:   02f72823            sw  a5,48(a4)                                             
40006fc4:   04068e63            beqz    a3,40007020 <rtems_task_set_scheduler+0xfc>       
40006fc8:   00c12783            lw  a5,12(sp)                                             
40006fcc:   3007a073            csrs    mstatus,a5                                        
                                                                                          
  status = _Scheduler_Set( scheduler, the_thread, core_priority );                        
                                                                                          
  _Thread_State_release_critical( the_thread, &state_context );                           
  _Thread_Wait_release( the_thread, &queue_context );                                     
  _Thread_Dispatch_enable( cpu_self );                                                    
40006fd0:   e8048513            addi    a0,s1,-384                                        
40006fd4:   045020ef            jal ra,40009818 <_Thread_Dispatch_enable>                 
  return _Status_Get( status );                                                           
}                                                                                         
40006fd8:   05c12083            lw  ra,92(sp)                                             
40006fdc:   05812403            lw  s0,88(sp)                                             
40006fe0:   05412483            lw  s1,84(sp)                                             
40006fe4:   05012903            lw  s2,80(sp)                                             
40006fe8:   04c12983            lw  s3,76(sp)                                             
40006fec:   04812a03            lw  s4,72(sp)                                             
40006ff0:   04412a83            lw  s5,68(sp)                                             
40006ff4:   03c12b83            lw  s7,60(sp)                                             
40006ff8:   03812c03            lw  s8,56(sp)                                             
40006ffc:   000b0513            mv  a0,s6                                                 
40007000:   04012b03            lw  s6,64(sp)                                             
40007004:   06010113            addi    sp,sp,96                                          
40007008:   00008067            ret                                                       
    return RTEMS_INVALID_ID;                                                              
4000700c:   00400b13            li  s6,4                                                  
40007010:   fc9ff06f            j   40006fd8 <rtems_task_set_scheduler+0xb4>              
    return RTEMS_INVALID_PRIORITY;                                                        
40007014:   01300b13            li  s6,19                                                 
  if ( !valid ) {                                                                         
40007018:   f68bfee3            bgeu    s7,s0,40006f94 <rtems_task_set_scheduler+0x70>    
4000701c:   fbdff06f            j   40006fd8 <rtems_task_set_scheduler+0xb4>              
  _Assert( !_Chain_Is_empty( &the_thread->Scheduler.Wait_nodes ) );                       
  return SCHEDULER_NODE_OF_THREAD_WAIT_NODE(                                              
    _Chain_First( &the_thread->Scheduler.Wait_nodes )                                     
  );                                                                                      
#else                                                                                     
  return the_thread->Scheduler.nodes;                                                     
40007020:   03852b03            lw  s6,56(a0)                                             
RTEMS_INLINE_ROUTINE void _Priority_Plain_extract(                                        
  Priority_Aggregation *aggregation,                                                      
  Priority_Node        *node                                                              
)                                                                                         
{                                                                                         
  _RBTree_Extract( &aggregation->Contributors, &node->Node.RBTree );                      
40007024:   02050b93            addi    s7,a0,32                                          
40007028:   000b8593            mv  a1,s7                                                 
4000702c:   020b0c13            addi    s8,s6,32                                          
40007030:   000c0513            mv  a0,s8                                                 
40007034:   0e8010ef            jal ra,4000811c <_RBTree_Extract>                         
 */                                                                                       
RTEMS_INLINE_ROUTINE bool _RBTree_Is_empty(                                               
  const RBTree_Control *the_rbtree                                                        
)                                                                                         
{                                                                                         
  return RB_EMPTY( the_rbtree );                                                          
40007038:   020b2783            lw  a5,32(s6)                                             
  _Priority_Plain_extract(                                                                
    &old_scheduler_node->Wait.Priority,                                                   
    &the_thread->Real_priority                                                            
  );                                                                                      
                                                                                          
  if (                                                                                    
4000703c:   04079c63            bnez    a5,40007094 <rtems_task_set_scheduler+0x170>      <== NEVER TAKEN
  _Thread_Scheduler_process_requests( the_thread );                                       
#else                                                                                     
  new_scheduler_node = old_scheduler_node;                                                
#endif                                                                                    
                                                                                          
  the_thread->Start.initial_priority = priority;                                          
40007040:   0d342023            sw  s3,192(s0)                                            
  node->priority = priority;                                                              
40007044:   03342823            sw  s3,48(s0)                                             
40007048:   0d442223            sw  s4,196(s0)                                            
4000704c:   03442a23            sw  s4,52(s0)                                             
  node->priority = priority;                                                              
40007050:   013b2c23            sw  s3,24(s6)                                             
40007054:   014b2e23            sw  s4,28(s6)                                             
  RBTree_Control *the_rbtree,                                                             
  RBTree_Node    *the_node                                                                
)                                                                                         
{                                                                                         
  _Assert( _RBTree_Is_node_off_tree( the_node ) );                                        
  RB_ROOT( the_rbtree ) = the_node;                                                       
40007058:   037b2023            sw  s7,32(s6)                                             
  ( *scheduler->Operations.update_priority )(                                             
4000705c:   03842603            lw  a2,56(s0)                                             
40007060:   01892783            lw  a5,24(s2)                                             
  RB_PARENT( the_node, Node ) = NULL;                                                     
40007064:   02042423            sw  zero,40(s0)                                           
  RB_LEFT( the_node, Node ) = NULL;                                                       
40007068:   02042023            sw  zero,32(s0)                                           
  RB_RIGHT( the_node, Node ) = NULL;                                                      
4000706c:   02042223            sw  zero,36(s0)                                           
  RB_COLOR( the_node, Node ) = RB_BLACK;                                                  
40007070:   02042623            sw  zero,44(s0)                                           
  unsigned int seq;                                                                       
                                                                                          
  seq = _SMP_sequence_lock_Write_begin( &node->Priority.Lock );                           
#endif                                                                                    
                                                                                          
  new_priority |= ( prepend_it ? 0 : SCHEDULER_PRIORITY_APPEND_FLAG );                    
40007074:   0019e993            ori s3,s3,1                                               
40007078:   033b2823            sw  s3,48(s6)                                             
4000707c:   034b2a23            sw  s4,52(s6)                                             
40007080:   00040593            mv  a1,s0                                                 
40007084:   578a8513            addi    a0,s5,1400                                        
40007088:   000780e7            jalr    a5                                                
  }                                                                                       
#endif                                                                                    
                                                                                          
  _Scheduler_Node_set_priority( new_scheduler_node, priority, false );                    
  _Scheduler_Update_priority( the_thread );                                               
  return STATUS_SUCCESSFUL;                                                               
4000708c:   00000b13            li  s6,0                                                  
40007090:   f39ff06f            j   40006fc8 <rtems_task_set_scheduler+0xa4>              
    _Priority_Plain_insert(                                                               
40007094:   03042583            lw  a1,48(s0)                                             <== NOT EXECUTED
40007098:   03442603            lw  a2,52(s0)                                             <== NOT EXECUTED
  is_new_minimum = true;                                                                  
                                                                                          
  while ( *link != NULL ) {                                                               
    parent = *link;                                                                       
                                                                                          
    if ( ( *less )( key, parent ) ) {                                                     
4000709c:   0147a703            lw  a4,20(a5)                                             <== NOT EXECUTED
  return &RB_LEFT( the_node, Node );                                                      
400070a0:   00078693            mv  a3,a5                                                 <== NOT EXECUTED
    if ( ( *less )( key, parent ) ) {                                                     
400070a4:   00e66863            bltu    a2,a4,400070b4 <rtems_task_set_scheduler+0x190>   <== NOT EXECUTED
400070a8:   00c71e63            bne a4,a2,400070c4 <rtems_task_set_scheduler+0x1a0>       <== NOT EXECUTED
400070ac:   0107a703            lw  a4,16(a5)                                             <== NOT EXECUTED
400070b0:   00e5fa63            bgeu    a1,a4,400070c4 <rtems_task_set_scheduler+0x1a0>   <== NOT EXECUTED
  while ( *link != NULL ) {                                                               
400070b4:   0006a703            lw  a4,0(a3)                                              <== NOT EXECUTED
400070b8:   00070a63            beqz    a4,400070cc <rtems_task_set_scheduler+0x1a8>      <== NOT EXECUTED
400070bc:   00070793            mv  a5,a4                                                 <== NOT EXECUTED
400070c0:   fddff06f            j   4000709c <rtems_task_set_scheduler+0x178>             <== NOT EXECUTED
  return &RB_RIGHT( the_node, Node );                                                     
400070c4:   00478693            addi    a3,a5,4                                           <== NOT EXECUTED
      link = _RBTree_Left_reference( parent );                                            
    } else {                                                                              
      link = _RBTree_Right_reference( parent );                                           
      is_new_minimum = false;                                                             
400070c8:   fedff06f            j   400070b4 <rtems_task_set_scheduler+0x190>             <== NOT EXECUTED
  RB_SET( child, parent, Node );                                                          
400070cc:   02f42423            sw  a5,40(s0)                                             <== NOT EXECUTED
400070d0:   00100793            li  a5,1                                                  <== NOT EXECUTED
400070d4:   02042223            sw  zero,36(s0)                                           <== NOT EXECUTED
400070d8:   02042023            sw  zero,32(s0)                                           <== NOT EXECUTED
400070dc:   02f42623            sw  a5,44(s0)                                             <== NOT EXECUTED
  *link = child;                                                                          
400070e0:   0176a023            sw  s7,0(a3)                                              <== NOT EXECUTED
    }                                                                                     
  }                                                                                       
                                                                                          
  _RBTree_Add_child( the_node, parent, link );                                            
  _RBTree_Insert_color( the_rbtree, the_node );                                           
400070e4:   000b8593            mv  a1,s7                                                 <== NOT EXECUTED
400070e8:   000c0513            mv  a0,s8                                                 <== NOT EXECUTED
400070ec:   45c010ef            jal ra,40008548 <_RBTree_Insert_color>                    <== NOT EXECUTED
    return STATUS_RESOURCE_IN_USE;                                                        
400070f0:   00c00b13            li  s6,12                                                 <== NOT EXECUTED
400070f4:   ed5ff06f            j   40006fc8 <rtems_task_set_scheduler+0xa4>              <== NOT EXECUTED