############################################################################## # # # IAR ARM ANSI C/C++ Compiler V4.42A/W32 EVALUATION 07/May/2008 11:15:00 # # Copyright 1999-2005 IAR Systems. All rights reserved. # # # # Cpu mode = interwork # # Endian = little # # Stack alignment = 4 # # Source file = C:\ARM\Vibralocker Rus\main.c # # Command line = "C:\ARM\Vibralocker Rus\main.c" -lC # # "C:\ARM\Vibralocker Rus\Release\List\" -o # # "C:\ARM\Vibralocker Rus\Release\Obj\" -s9 # # --no_unroll --no_clustering --cpu_mode arm --endian # # little --cpu ARM926EJ-S --stack_align 4 --interwork # # -e --fpu None -I "C:\Program Files\Embedded # # Workbench 4.0 Evaluation\ARM\INC\" # # --inline_threshold=2 # # List file = C:\ARM\Vibralocker Rus\Release\List\main.lst # # Object file = C:\ARM\Vibralocker Rus\Release\Obj\main.r79 # # # # # ############################################################################## C:\ARM\Vibralocker Rus\main.c 1 #include "c:\arm\inc\swilib.h" 2 #include "conf_loader.h" 3 #define MIN_UPTIME 1 4 #define MAX(a,b) (a)>(b)?(a):(b) 5 void StartWorkTimer(); 6 void InitSettings(); 7 \ In segment DATA_Z, align 4, align-sorted 8 GBSTMR timer; \ timer: \ 00000000 DS8 16 \ In segment DATA_Z, align 4, align-sorted 9 GBSTMR tmr_vibra; \ tmr_vibra: \ 00000000 DS8 16 10 extern const int ENA_WAV; 11 extern const int ENA_HELLO_MSG; \ In segment DATA_C, align 4, align-sorted 12 const int minus11=-11; \ minus11: \ 00000000 F5FFFFFF DC32 -11 13 extern const unsigned int cfgUpTime; \ In segment DATA_Z, align 4, align-sorted 14 unsigned int uiUpdateTime; \ uiUpdateTime: \ 00000000 DS8 4 15 extern const char unlockfname[128]; 16 extern const char lockfname[128]; 17 extern const unsigned int MelVolume; 18 extern const unsigned int vibra_count; 19 extern const unsigned int vibra_power; \ In segment DATA_Z, align 4, align-sorted 20 unsigned int vibra_count1; \ vibra_count1: \ 00000000 DS8 4 \ In segment DATA_Z, align 4, align-sorted 21 unsigned int volume; \ volume: \ 00000000 DS8 4 22 \ In segment DATA_Z, align 4, align-sorted 23 int m=0; \ m: \ 00000000 DS8 4 24 25 typedef struct 26 {CSM_RAM csm; 27 }MAIN_CSM; 28 \ In segment DATA_Z, align 4, align-sorted 29 CSM_RAM *under_idle; \ under_idle: \ 00000000 DS8 4 30 31 extern void kill_data(void *p, void (*func_p)(void *)); 32 33 #pragma inline=forced 34 35 int toupper(int c) 36 {if ((c>='a')&&(c<='z')) c+='A'-'a'; 37 return(c); 38 } 39 \ In segment CODE, align 4, keep-with-next 40 int strcmp_nocase(const char *s1,const char *s2) 41 {int i,c; 42 while(!(i=(c=toupper(*s1++))-toupper(*s2++))) if (!c) break; \ strcmp_nocase: \ ??strcmp_nocase_0: \ 00000000 0020D0E5 LDRB R2,[R0, #+0] \ 00000004 610052E3 CMP R2,#+97 \ 00000008 010000BA BLT ??strcmp_nocase_1 \ 0000000C 7B0052E3 CMP R2,#+123 \ 00000010 202042B2 SUBLT R2,R2,#+32 \ ??strcmp_nocase_1: \ 00000014 00C0D1E5 LDRB R12,[R1, #+0] \ 00000018 010080E2 ADD R0,R0,#+1 \ 0000001C 0230A0E1 MOV R3,R2 \ 00000020 61005CE3 CMP R12,#+97 \ 00000024 010000BA BLT ??strcmp_nocase_2 \ 00000028 7B005CE3 CMP R12,#+123 \ 0000002C 20C04CB2 SUBLT R12,R12,#+32 \ ??strcmp_nocase_2: \ 00000030 011081E2 ADD R1,R1,#+1 \ 00000034 0C2052E0 SUBS R2,R2,R12 \ 00000038 0100001A BNE ??strcmp_nocase_3 \ 0000003C 000053E3 CMP R3,#+0 \ 00000040 EEFFFF1A BNE ??strcmp_nocase_0 43 return(i); \ ??strcmp_nocase_3: \ 00000044 0200A0E1 MOV R0,R2 \ 00000048 1EFF2FE1 BX LR ;; return 44 } 45 \ In segment CODE, align 4, keep-with-next 46 int maincsm_onmessage(CSM_RAM* data,GBS_MSG* msg) 47 {if(msg->msg == MSG_RECONFIGURE_REQ) \ maincsm_onmessage: \ 00000000 00402DE9 PUSH {LR} \ 00000004 F200D1E1 LDRSH R0,[R1, #+2] \ 00000008 F120A0E3 MOV R2,#+241 \ 0000000C C02F82E3 ORR R2,R2,#0x300 \ 00000010 020050E1 CMP R0,R2 \ 00000014 0900001A BNE ??maincsm_onmessage_0 48 {extern const char *successed_config_filename; 49 if(strcmp_nocase(successed_config_filename,(char *)msg->data0)==0) \ 00000018 28009FE5 LDR R0,??maincsm_onmessage_1 ;; successed_config_filename \ 0000001C 081091E5 LDR R1,[R1, #+8] \ 00000020 000090E5 LDR R0,[R0, #+0] \ 00000024 ........ BL strcmp_nocase \ 00000028 000050E3 CMP R0,#+0 \ 0000002C 0300001A BNE ??maincsm_onmessage_0 50 {ShowMSG(1,(int)"Настройки Vibralocker обновлены!"); \ 00000030 14109FE5 LDR R1,??maincsm_onmessage_1+0x4 ;; `?>1,stop_vibra); \ 0000001C 10209FE5 LDR R2,??start_vibra_0+0x4 ;; stop_vibra \ 00000020 ........ LDR R0,??DataTable5 ;; tmr_vibra \ 00000024 6C10A0E3 MOV R1,#+108 \ 00000028 4D0000EF SWI +77 155 } 156 } \ 0000002C 0080BDE8 POP {PC} ;; return \ ??start_vibra_0: \ 00000030 ........ DC32 vibra_power \ 00000034 ........ DC32 stop_vibra 157 \ In segment CODE, align 4, keep-with-next 158 void stop_vibra(void) 159 {SetVibration(0); \ stop_vibra: \ 00000000 00402DE9 PUSH {LR} \ 00000004 0000A0E3 MOV R0,#+0 \ 00000008 7C0000EF SWI +124 160 if (--vibra_count1) GBS_StartTimerProc(&tmr_vibra,216>>1,start_vibra); \ 0000000C ........ LDR R0,??DataTable6 ;; vibra_count1 \ 00000010 001090E5 LDR R1,[R0, #+0] \ 00000014 011051E2 SUBS R1,R1,#+1 \ 00000018 001080E5 STR R1,[R0, #+0] \ 0000001C 0080BD08 POPEQ {PC} \ 00000020 0C209FE5 LDR R2,??stop_vibra_0 ;; start_vibra \ 00000024 ........ LDR R0,??DataTable5 ;; tmr_vibra \ 00000028 6C10A0E3 MOV R1,#+108 \ 0000002C 4D0000EF SWI +77 161 } \ 00000030 0080BDE8 POP {PC} ;; return \ ??stop_vibra_0: \ 00000034 ........ DC32 start_vibra 162 \ In segment CODE, align 4, keep-with-next 163 void StartWorkTimer() 164 {if((!IsUnlocked())&&(m==0)) \ StartWorkTimer: \ 00000000 BC009FE5 LDR R0,??StartWorkTimer_0 ;; vibra_count \ 00000004 F0402DE9 PUSH {R4-R7,LR} \ 00000008 004090E5 LDR R4,[R0, #+0] \ 0000000C ........ LDR R5,??DataTable6 ;; vibra_count1 \ 00000010 B0709FE5 LDR R7,??StartWorkTimer_0+0x4 ;; m \ 00000014 ........ LDR R6,??DataTable7 ;; volume \ 00000018 430000EF SWI +67 \ 0000001C 000050E3 CMP R0,#+0 \ 00000020 00009705 LDREQ R0,[R7, #+0] \ 00000024 00005003 CMPEQ R0,#+0 \ 00000028 0C00001A BNE ??StartWorkTimer_1 165 {start_vibra(); \ 0000002C ........ BL start_vibra 166 volume=MelVolume; \ 00000030 94009FE5 LDR R0,??StartWorkTimer_0+0x8 ;; MelVolume \ 00000034 000090E5 LDR R0,[R0, #+0] \ 00000038 000086E5 STR R0,[R6, #+0] 167 if(ENA_WAV) Play(lockfname); \ 0000003C 8C009FE5 LDR R0,??StartWorkTimer_0+0xC ;; ENA_WAV \ 00000040 000090E5 LDR R0,[R0, #+0] \ 00000044 000050E3 CMP R0,#+0 \ 00000048 0100000A BEQ ??StartWorkTimer_2 \ 0000004C 80009FE5 LDR R0,??StartWorkTimer_0+0x10 ;; lockfname \ 00000050 ........ BL Play 168 vibra_count1=vibra_count; \ ??StartWorkTimer_2: \ 00000054 004085E5 STR R4,[R5, #+0] 169 m=1; \ 00000058 0100A0E3 MOV R0,#+1 \ 0000005C 000087E5 STR R0,[R7, #+0] 170 } 171 if((IsUnlocked())&&(m==1)) \ ??StartWorkTimer_1: \ 00000060 430000EF SWI +67 \ 00000064 000050E3 CMP R0,#+0 \ 00000068 0F00000A BEQ ??StartWorkTimer_3 \ 0000006C 000097E5 LDR R0,[R7, #+0] \ 00000070 010050E3 CMP R0,#+1 \ 00000074 0C00001A BNE ??StartWorkTimer_3 172 {start_vibra(); \ 00000078 ........ BL start_vibra 173 volume=MelVolume; \ 0000007C 48009FE5 LDR R0,??StartWorkTimer_0+0x8 ;; MelVolume \ 00000080 000090E5 LDR R0,[R0, #+0] \ 00000084 000086E5 STR R0,[R6, #+0] 174 if(ENA_WAV) Play(unlockfname); \ 00000088 40009FE5 LDR R0,??StartWorkTimer_0+0xC ;; ENA_WAV \ 0000008C 000090E5 LDR R0,[R0, #+0] \ 00000090 000050E3 CMP R0,#+0 \ 00000094 0100000A BEQ ??StartWorkTimer_4 \ 00000098 38009FE5 LDR R0,??StartWorkTimer_0+0x14 ;; unlockfname \ 0000009C ........ BL Play 175 vibra_count1=vibra_count; \ ??StartWorkTimer_4: \ 000000A0 004085E5 STR R4,[R5, #+0] 176 m=0; \ 000000A4 0000A0E3 MOV R0,#+0 \ 000000A8 000087E5 STR R0,[R7, #+0] 177 } 178 GBS_StartTimerProc(&timer, uiUpdateTime, StartWorkTimer); \ ??StartWorkTimer_3: \ 000000AC ........ LDR R0,??DataTable10 ;; uiUpdateTime \ 000000B0 24209FE5 LDR R2,??StartWorkTimer_0+0x18 ;; StartWorkTimer \ 000000B4 001090E5 LDR R1,[R0, #+0] \ 000000B8 ........ LDR R0,??DataTable9 ;; timer \ 000000BC 4D0000EF SWI +77 179 } \ 000000C0 F080BDE8 POP {R4-R7,PC} ;; return \ ??StartWorkTimer_0: \ 000000C4 ........ DC32 vibra_count \ 000000C8 ........ DC32 m \ 000000CC ........ DC32 MelVolume \ 000000D0 ........ DC32 ENA_WAV \ 000000D4 ........ DC32 lockfname \ 000000D8 ........ DC32 unlockfname \ 000000DC ........ DC32 StartWorkTimer 180 \ In segment CODE, align 4, keep-with-next 181 void InitSettings() 182 {InitConfig(); \ InitSettings: \ 00000000 00402DE9 PUSH {LR} \ 00000004 ........ _BLF InitConfig,??InitConfig??rA 183 if(ENA_HELLO_MSG) ShowMSG(1,(int)"Vibralocker установлен! (c)SimaFish"); \ 00000008 48009FE5 LDR R0,??InitSettings_0 ;; ENA_HELLO_MSG \ 0000000C 000090E5 LDR R0,[R0, #+0] \ 00000010 000050E3 CMP R0,#+0 \ 00000014 0200000A BEQ ??InitSettings_1 \ 00000018 3C109FE5 LDR R1,??InitSettings_0+0x4 ;; `?` \ 00000014 180084E2 ADD R0,R4,#+24 \ 00000018 240100EF SWI +292 194 LockSched(); \ 0000001C 460100EF SWI +326 195 save_cmpc=CSM_root()->csm_q->current_msg_processing_csm; \ 00000020 068100EF SWI +33030 \ 00000024 080090E5 LDR R0,[R0, #+8] \ 00000028 045090E5 LDR R5,[R0, #+4] 196 CSM_root()->csm_q->current_msg_processing_csm=CSM_root()->csm_q->csm.first; \ 0000002C 068100EF SWI +33030 \ 00000030 0060A0E1 MOV R6,R0 \ 00000034 068100EF SWI +33030 \ 00000038 080090E5 LDR R0,[R0, #+8] \ 0000003C 081096E5 LDR R1,[R6, #+8] \ 00000040 080090E5 LDR R0,[R0, #+8] 197 CreateCSM(&MAINCSM.maincsm,dummy,0); \ 00000044 0020A0E3 MOV R2,#+0 \ 00000048 040081E5 STR R0,[R1, #+4] \ 0000004C 0D10A0E1 MOV R1,SP \ 00000050 0400A0E1 MOV R0,R4 \ 00000054 070100EF SWI +263 198 CSM_root()->csm_q->current_msg_processing_csm=save_cmpc; \ 00000058 068100EF SWI +33030 \ 0000005C 080090E5 LDR R0,[R0, #+8] \ 00000060 045080E5 STR R5,[R0, #+4] 199 UnlockSched(); \ 00000064 470100EF SWI +327 200 } \ 00000068 28D08DE2 ADD SP,SP,#+40 \ 0000006C 7080BDE8 POP {R4-R6,PC} ;; return \ ??main_0: \ 00000070 ........ DC32 MAINCSM \ 00000074 ........ DC32 `?` \ In segment CODE, align 4, keep-with-next \ ??DataTable5: \ 00000000 ........ DC32 tmr_vibra \ In segment CODE, align 4, keep-with-next \ ??DataTable6: \ 00000000 ........ DC32 vibra_count1 \ In segment CODE, align 4, keep-with-next \ ??DataTable7: \ 00000000 ........ DC32 volume \ In segment CODE, align 4, keep-with-next \ ??DataTable9: \ 00000000 ........ DC32 timer \ In segment CODE, align 4, keep-with-next \ ??DataTable10: \ 00000000 ........ DC32 uiUpdateTime \ In segment DATA_C, align 4, align-sorted \ `?`: \ 00000000 56696272616C DC8 "Vibralocker - (c)SimaFish" \ 6F636B657220 \ 2D2028632953 \ 696D61466973 \ 6800 \ 0000001A 0000 DC8 0, 0 \ In segment DATA_C, align 4, align-sorted \ `? 28 ?