##############################################################################
#                                                                            #
# IAR ARM ANSI C/C++ Compiler V4.40A/W32 EVALUATION    18/Aug/2007  09:29:11 #
# Copyright 1999-2005 IAR Systems. All rights reserved.                      #
#                                                                            #
#    Cpu mode        =  interwork                                            #
#    Endian          =  little                                               #
#    Stack alignment =  4                                                    #
#    Source file     =  C:\ARM\ivoplay\conf_skin_loader.c                    #
#    Command line    =  C:\ARM\ivoplay\conf_skin_loader.c -D X75 -lC         #
#                       C:\ARM\ivoplay\Release\List\ -lA                     #
#                       C:\ARM\ivoplay\Release\List\ -o                      #
#                       C:\ARM\ivoplay\Release\Obj\ -s9 --no_cse             #
#                       --no_unroll --no_inline --no_code_motion --no_tbaa   #
#                       --no_clustering --no_scheduling --cpu_mode arm       #
#                       --endian little --cpu ARM926EJ-S --stack_align 4     #
#                       --interwork -e --fpu None -I D:\arm\ARM\INC\         #
#    List file       =  C:\ARM\ivoplay\Release\List\conf_skin_loader.lst     #
#    Object file     =  C:\ARM\ivoplay\Release\Obj\conf_skin_loader.r79      #
#                                                                            #
#                                                                            #
##############################################################################

C:\ARM\ivoplay\conf_skin_loader.c
      1          #include "..\inc\swilib.h"
      2          #include "..\inc\cfg_items.h"
      3          #include "conf_loader.h"
      4          

   \                                 In segment DATA_I, align 4, align-sorted
      5          const char *successed_config_filename="";
   \                     successed_config_filename:
   \   00000000                      DS8 4
   \   00000004                      REQUIRE `?<Initializer for successed_config_filename>`
      6          
      7          #pragma segment="CONFIG_C"

   \                                 In segment CODE, align 4, keep-with-next
      8          int LoadConfigData(const char *fname)
      9          {
   \                     LoadConfigData:
   \   00000000   F0432DE9           PUSH     {R4-R9,LR}
   \   00000004   04D04DE2           SUB      SP,SP,#+4
   \   00000008   0040A0E1           MOV      R4,R0
     10            int f;
     11            unsigned int ul;
     12            char *buf;
     13            int result=0;
   \   0000000C   0050A0E3           MOV      R5,#+0
     14            void *cfg;
     15          
     16            extern const CFG_HDR cfghdr0; //first var in CONFIG
     17            cfg=(void*)&cfghdr0;
   \   00000010   E0609FE5           LDR      R6,??LoadConfigData_0  ;; cfghdr0
     18          
     19            unsigned int len=(int)__segment_end("CONFIG_C")-(int)__segment_begin("CONFIG_C");
   \   00000014   E0709FE5           LDR      R7,??LoadConfigData_0+0x4  ;; SFE(CONFIG_C) - SFB(CONFIG_C)
     20          
     21            if (!(buf=malloc(len))) return -1;
   \   00000018   0700A0E1           MOV      R0,R7
   \   0000001C   140000EF           SWI      +20
   \   00000020   0080B0E1           MOVS     R8,R0
   \   00000024   0500E001           MVNEQ    R0,R5
   \   00000028   3000000A           BEQ      ??LoadConfigData_1
     22            if ((f=fopen(fname,A_ReadOnly+A_BIN,0,&ul))!=-1)
   \   0000002C   0D30A0E1           MOV      R3,SP
   \   00000030   0020A0E3           MOV      R2,#+0
   \   00000034   801CA0E3           MOV      R1,#+32768
   \   00000038   0400A0E1           MOV      R0,R4
   \   0000003C   0A0000EF           SWI      +10
   \   00000040   0090A0E1           MOV      R9,R0
   \   00000044   010079E3           CMN      R9,#+1
   \   00000048   1000000A           BEQ      ??LoadConfigData_2
     23            {
     24              if (fread(f,buf,len,&ul)==len)
   \   0000004C   0D30A0E1           MOV      R3,SP
   \   00000050   0720A0E1           MOV      R2,R7
   \   00000054   0810A0E1           MOV      R1,R8
   \   00000058   0B0000EF           SWI      +11
   \   0000005C   070050E1           CMP      R0,R7
   \   00000060   0700001A           BNE      ??LoadConfigData_3
     25              {
     26                memcpy(cfg,buf,len);
   \   00000064   0720A0E1           MOV      R2,R7
   \   00000068   0810A0E1           MOV      R1,R8
   \   0000006C   0600A0E1           MOV      R0,R6
   \   00000070   1E0100EF           SWI      +286
     27                fclose(f,&ul);
   \                     ??LoadConfigData_4:
   \   00000074   0D10A0E1           MOV      R1,SP
   \   00000078   0900A0E1           MOV      R0,R9
   \   0000007C   0D0000EF           SWI      +13
   \   00000080   140000EA           B        ??LoadConfigData_5
     28              }
     29              else
     30              {
     31                fclose(f,&ul);
   \                     ??LoadConfigData_3:
   \   00000084   0D10A0E1           MOV      R1,SP
   \   00000088   0900A0E1           MOV      R0,R9
   \   0000008C   0D0000EF           SWI      +13
     32                goto L_SAVENEWCFG;
     33              }
     34            }
     35            else
     36            {
     37            L_SAVENEWCFG:
     38              if ((f=fopen(fname,A_ReadWrite+A_Create+A_Truncate,P_READ+P_WRITE,&ul))!=-1)
   \                     ??LoadConfigData_2:
   \   00000090   0D30A0E1           MOV      R3,SP
   \   00000094   602FA0E3           MOV      R2,#+384
   \   00000098   0210A0E3           MOV      R1,#+2
   \   0000009C   C01F81E3           ORR      R1,R1,#0x300
   \   000000A0   0400A0E1           MOV      R0,R4
   \   000000A4   0A0000EF           SWI      +10
   \   000000A8   0090A0E1           MOV      R9,R0
   \   000000AC   010079E3           CMN      R9,#+1
   \   000000B0   0700000A           BEQ      ??LoadConfigData_6
     39              {
     40                if (fwrite(f,cfg,len,&ul)!=len) result=-1;
   \   000000B4   0D30A0E1           MOV      R3,SP
   \   000000B8   0720A0E1           MOV      R2,R7
   \   000000BC   0610A0E1           MOV      R1,R6
   \   000000C0   0C0000EF           SWI      +12
   \   000000C4   070050E1           CMP      R0,R7
   \   000000C8   E9FFFF0A           BEQ      ??LoadConfigData_4
   \   000000CC   0550E0E1           MVN      R5,R5
     41                fclose(f,&ul);
   \   000000D0   E7FFFFEA           B        ??LoadConfigData_4
     42              }
     43              else
     44                result=-1;
   \                     ??LoadConfigData_6:
   \   000000D4   0550E0E1           MVN      R5,R5
     45            }
     46            mfree(buf);
   \                     ??LoadConfigData_5:
   \   000000D8   0800A0E1           MOV      R0,R8
   \   000000DC   150000EF           SWI      +21
     47            if (result>=0) successed_config_filename=fname;
   \   000000E0   000055E3           CMP      R5,#+0
   \   000000E4   14009F55           LDRPL    R0,??LoadConfigData_0+0x8  ;; successed_config_filename
   \   000000E8   00408055           STRPL    R4,[R0, #+0]
     48            return(result);
   \   000000EC   0500A0E1           MOV      R0,R5
   \                     ??LoadConfigData_1:
   \   000000F0   04D08DE2           ADD      SP,SP,#+4        ;; stack cleaning
   \   000000F4   F083BDE8           POP      {R4-R9,PC}       ;; return
   \                     ??LoadConfigData_0:
   \   000000F8   ........           DC32     cfghdr0
   \   000000FC   ........           DC32     SFE(CONFIG_C) - SFB(CONFIG_C)
   \   00000100   ........           DC32     successed_config_filename
     49          }
     50          

   \                                 In segment CODE, align 4, keep-with-next
     51          void InitConfig()
     52          {
   \                     InitConfig:
   \   00000000   00402DE9           PUSH     {LR}
     53            if (LoadConfigData("4:\\ZBin\\etc\\ivoplay.bcfg")<0)
   \   00000004   14009FE5           LDR      R0,??InitConfig_0  ;; `?<Constant "4:\\\\ZBin\\\\etc\\\\ivoplay.bcfg">`
   \   00000008   ........           BL       LoadConfigData
   \   0000000C   000050E3           CMP      R0,#+0
   \   00000010   0080BD58           POPPL    {PC}
     54            {
     55              LoadConfigData("0:\\ZBin\\etc\\ivoplay.bcfg");
   \   00000014   08009FE5           LDR      R0,??InitConfig_0+0x4  ;; `?<Constant "0:\\\\ZBin\\\\etc\\\\ivoplay.bcfg">`
   \   00000018   0040BDE8           POP      {LR}             ;; Pop
   \   0000001C   ........           B        LoadConfigData   ;; tailcall
   \                     ??InitConfig_0:
   \   00000020   ........           DC32     `?<Constant "4:\\\\ZBin\\\\etc\\\\ivoplay.bcfg">`
   \   00000024   ........           DC32     `?<Constant "0:\\\\ZBin\\\\etc\\\\ivoplay.bcfg">`
     56            }
     57          }
     58          

   \                                 In segment CODE, align 4, keep-with-next
     59          void InitSkinConfig(char *initskin)
     60          {
     61              LoadConfigData(initskin);
   \                     InitSkinConfig:
   \   00000000   ........           B        LoadConfigData   ;; tailcall
     62          }

   \                                 In segment DATA_ID, align 4, align-sorted
   \                     `?<Initializer for successed_config_filename>`:
   \   00000000   ........           DC32 `?<Constant "">`

   \                                 In segment CONFIG_C, align 1

   \                                 In segment DATA_C, align 1, align-sorted
   \                     `?<Constant "">`:
   \   00000000   00                 DC8 ""

   \                                 In segment DATA_C, align 4, align-sorted
   \                     `?<Constant "0:\\\\ZBin\\\\etc\\\\ivoplay.bcfg">`:
   \   00000000   303A5C5A4269       DC8 "0:\\ZBin\\etc\\ivoplay.bcfg"
   \              6E5C6574635C
   \              69766F706C61
   \              792E62636667
   \              00          
   \   00000019   000000             DC8 0, 0, 0

   \                                 In segment DATA_C, align 4, align-sorted
   \                     `?<Constant "4:\\\\ZBin\\\\etc\\\\ivoplay.bcfg">`:
   \   00000000   343A5C5A4269       DC8 "4:\\ZBin\\etc\\ivoplay.bcfg"
   \              6E5C6574635C
   \              69766F706C61
   \              792E62636667
   \              00          
   \   00000019   000000             DC8 0, 0, 0

   Maximum stack usage in bytes:

     Function       CSTACK
     --------       ------
     InitConfig         4
     InitSkinConfig     4
     LoadConfigData    32


   Segment part sizes:

     Function/Label                 Bytes
     --------------                 -----
     successed_config_filename         4
     LoadConfigData                  260
     InitConfig                       40
     InitSkinConfig                    4
     ?<Initializer for successed_config_filename>
                                       4
     ?<Constant "">                    1
     ?<Constant "0:\\ZBin\\etc\\ivoplay.bcfg">
                                      28
     ?<Constant "4:\\ZBin\\etc\\ivoplay.bcfg">
                                      28
      Others                          24

 
 316 bytes in segment CODE
  57 bytes in segment DATA_C
   4 bytes in segment DATA_I
   4 bytes in segment DATA_ID
  12 bytes in segment INITTAB
 
 304 bytes of CODE  memory (+ 24 bytes shared)
  61 bytes of CONST memory
   4 bytes of DATA  memory

Errors: none
Warnings: none
