RTEMS-6
Annotated Report
libbspcmdline
Sun Feb 28 22:30:18 2021

4000447c <rtems_bsp_cmdline_get_param>:                                                   
const char *rtems_bsp_cmdline_get_param(                                                  
  const char *name,                                                                       
  char       *value,                                                                      
  size_t      length                                                                      
)                                                                                         
{                                                                                         
4000447c:   9d e3 bf a0     save  %sp, -96, %sp                                           
  const char *p;                                                                          
                                                                                          
  if ( !name )                                                                            
    return NULL;                                                                          
                                                                                          
  if ( !value )                                                                           
40004480:   80 a0 00 19     cmp  %g0, %i1                                                 
40004484:   84 60 3f ff     subx  %g0, -1, %g2                                            
    return NULL;                                                                          
                                                                                          
  if ( !length )                                                                          
40004488:   80 a0 00 1a     cmp  %g0, %i2                                                 
4000448c:   82 60 3f ff     subx  %g0, -1, %g1                                            
40004490:   80 90 80 01     orcc  %g2, %g1, %g0                                           
40004494:   12 80 00 30     bne  40004554 <rtems_bsp_cmdline_get_param+0xd8>              
40004498:   80 a6 20 00     cmp  %i0, 0                                                   
4000449c:   02 80 00 2e     be  40004554 <rtems_bsp_cmdline_get_param+0xd8>               
400044a0:   01 00 00 00     nop                                                           
    return NULL;                                                                          
                                                                                          
  value[0] = '\0';                                                                        
400044a4:   c0 2e 40 00     clrb  [ %i1 ]                                                 
                                                                                          
  p = rtems_bsp_cmdline_get_param_raw( name );                                            
400044a8:   40 00 00 2d     call  4000455c <rtems_bsp_cmdline_get_param_raw>              
400044ac:   90 10 00 18     mov  %i0, %o0                                                 
                                                                                          
  if ( !p )                                                                               
400044b0:   80 a2 20 00     cmp  %o0, 0                                                   
400044b4:   02 80 00 28     be  40004554 <rtems_bsp_cmdline_get_param+0xd8>               
400044b8:   01 00 00 00     nop                                                           
  for (i=0 ; *p && i<length-1; ) {                                                        
400044bc:   c6 0a 00 00     ldub  [ %o0 ], %g3                                            
400044c0:   85 28 e0 18     sll  %g3, 0x18, %g2                                           
400044c4:   80 a0 a0 00     cmp  %g2, 0                                                   
400044c8:   02 80 00 21     be  4000454c <rtems_bsp_cmdline_get_param+0xd0>               <== NEVER TAKEN
400044cc:   b4 86 bf ff     addcc  %i2, -1, %i2                                           
400044d0:   02 80 00 1f     be  4000454c <rtems_bsp_cmdline_get_param+0xd0>               <== NEVER TAKEN
400044d4:   82 10 20 00     clr  %g1                                                      
  quotes=0;                                                                               
400044d8:   10 80 00 11     b  4000451c <rtems_bsp_cmdline_get_param+0xa0>                
400044dc:   88 10 20 00     clr  %g4                                                      
    } else if ( ((quotes % 2) == 0) && *p == ' ' )                                        
400044e0:   12 80 00 04     bne  400044f0 <rtems_bsp_cmdline_get_param+0x74>              
400044e4:   80 a0 a0 20     cmp  %g2, 0x20                                                
400044e8:   02 80 00 19     be  4000454c <rtems_bsp_cmdline_get_param+0xd0>               
400044ec:   01 00 00 00     nop                                                           
    value[i++] = *p++;                                                                    
400044f0:   c6 2e 40 01     stb  %g3, [ %i1 + %g1 ]                                       
    value[i] = '\0';                                                                      
400044f4:   82 00 60 01     inc  %g1                                                      
400044f8:   c0 2e 40 01     clrb  [ %i1 + %g1 ]                                           
  for (i=0 ; *p && i<length-1; ) {                                                        
400044fc:   c6 0a 00 01     ldub  [ %o0 + %g1 ], %g3                                      
40004500:   85 28 e0 18     sll  %g3, 0x18, %g2                                           
40004504:   80 a0 a0 00     cmp  %g2, 0                                                   
40004508:   02 80 00 11     be  4000454c <rtems_bsp_cmdline_get_param+0xd0>               
4000450c:   01 00 00 00     nop                                                           
40004510:   80 a6 80 01     cmp  %i2, %g1                                                 
40004514:   02 80 00 0e     be  4000454c <rtems_bsp_cmdline_get_param+0xd0>               
40004518:   01 00 00 00     nop                                                           
    if ( *p == '\"' ) {                                                                   
4000451c:   85 38 a0 18     sra  %g2, 0x18, %g2                                           
40004520:   80 a0 a0 22     cmp  %g2, 0x22                                                
40004524:   12 bf ff ef     bne  400044e0 <rtems_bsp_cmdline_get_param+0x64>              
40004528:   80 89 20 01     btst  1, %g4                                                  
    value[i++] = *p++;                                                                    
4000452c:   c6 2e 40 01     stb  %g3, [ %i1 + %g1 ]                                       
40004530:   82 00 60 01     inc  %g1                                                      
    value[i] = '\0';                                                                      
40004534:   c0 2e 40 01     clrb  [ %i1 + %g1 ]                                           
  for (i=0 ; *p && i<length-1; ) {                                                        
40004538:   c6 0a 00 01     ldub  [ %o0 + %g1 ], %g3                                      
4000453c:   85 28 e0 18     sll  %g3, 0x18, %g2                                           
40004540:   80 a0 a0 00     cmp  %g2, 0                                                   
40004544:   12 bf ff f3     bne  40004510 <rtems_bsp_cmdline_get_param+0x94>              <== ALWAYS TAKEN
40004548:   88 01 20 01     inc  %g4                                                      
  quotes=0;                                                                               
4000454c:   81 c7 e0 08     ret                                                           
40004550:   91 e8 00 19     restore  %g0, %i1, %o0                                        
    return NULL;                                                                          
                                                                                          
  copy_string( p, value, length );                                                        
                                                                                          
  return value;                                                                           
}                                                                                         
40004554:   81 c7 e0 08     ret                                                           
40004558:   91 e8 20 00     restore  %g0, 0, %o0