root/platform/ixus140_elph130/sub/100a/boot.c

/* [<][>][^][v][top][bottom][index][help] */

DEFINITIONS

This source file includes following definitions.
  1. CreateTask_spytask
  2. boot
  3. CreateTask_my
  4. sub_FF000380_my
  5. sub_FF001100_my
  6. sub_FF004200_my
  7. sub_FF00A610_my
  8. sub_FF031094_my
  9. task_Startup_my
  10. taskcreatePhySw_my
  11. init_file_modules_task

   1 /*
   2  * boot.c - auto-generated by CHDK code_gen.
   3  */
   4 #include "lolevel.h"
   5 #include "platform.h"
   6 #include "core.h"
   7 #include "dryos31.h"
   8 
   9 #define offsetof(TYPE, MEMBER) ((int) &((TYPE *)0)->MEMBER)
  10 
  11 const char * const new_sa = &_end;
  12 
  13 extern void task_CaptSeq();
  14 extern void task_InitFileModules();
  15 extern void task_MovieRecord();
  16 extern void task_ExpDrv();
  17 extern void task_FileWrite();
  18 
  19 /*----------------------------------------------------------------------
  20     CreateTask_spytask
  21 -----------------------------------------------------------------------*/
  22 void CreateTask_spytask()
  23 {
  24     _CreateTask("SpyTask", 0x19, 0x2000, core_spytask, 0);
  25 }
  26 
  27 /*----------------------------------------------------------------------
  28     boot()
  29 
  30     Main entry point for the CHDK code
  31 -----------------------------------------------------------------------*/
  32 
  33 /*************************************************************/
  34 //** boot @ 0xFF00000C - 0xFF000170, length=90
  35 void __attribute__((naked,noinline)) boot() {
  36 asm volatile (
  37 "    LDR     R1, =0xC0410000 \n"
  38 "    MOV     R0, #0 \n"
  39 "    STR     R0, [R1] \n"
  40 "    MOV     R1, #0x78 \n"
  41 "    MCR     p15, 0, R1, c1, c0 \n"
  42 "    MOV     R1, #0 \n"
  43 "    MCR     p15, 0, R1, c7, c10, 4 \n"
  44 "    MCR     p15, 0, R1, c7, c5 \n"
  45 "    MCR     p15, 0, R1, c7, c6 \n"
  46 "    MOV     R0, #0x3D \n"
  47 "    MCR     p15, 0, R0, c6, c0 \n"
  48 "    MOV     R0, #0xC000002F \n"
  49 "    MCR     p15, 0, R0, c6, c1 \n"
  50 "    MOV     R0, #0x33 \n"
  51 "    MCR     p15, 0, R0, c6, c2 \n"
  52 "    MOV     R0, #0x40000033 \n"
  53 "    MCR     p15, 0, R0, c6, c3 \n"
  54 "    MOV     R0, #0x80000017 \n"
  55 "    MCR     p15, 0, R0, c6, c4 \n"
  56 "    LDR     R0, =0xFF00002F \n"
  57 "    MCR     p15, 0, R0, c6, c5 \n"
  58 "    MOV     R0, #0x34 \n"
  59 "    MCR     p15, 0, R0, c2, c0 \n"
  60 "    MOV     R0, #0x34 \n"
  61 "    MCR     p15, 0, R0, c2, c0, 1 \n"
  62 "    MOV     R0, #0x34 \n"
  63 "    MCR     p15, 0, R0, c3, c0 \n"
  64 "    LDR     R0, =0x3333330 \n"
  65 "    MCR     p15, 0, R0, c5, c0, 2 \n"
  66 "    LDR     R0, =0x3333330 \n"
  67 "    MCR     p15, 0, R0, c5, c0, 3 \n"
  68 "    MRC     p15, 0, R0, c1, c0 \n"
  69 "    ORR     R0, R0, #0x1000 \n"
  70 "    ORR     R0, R0, #4 \n"
  71 "    ORR     R0, R0, #1 \n"
  72 "    MCR     p15, 0, R0, c1, c0 \n"
  73 "    MOV     R1, #0x80000006 \n"
  74 "    MCR     p15, 0, R1, c9, c1 \n"
  75 "    MOV     R1, #6 \n"
  76 "    MCR     p15, 0, R1, c9, c1, 1 \n"
  77 "    MRC     p15, 0, R1, c1, c0 \n"
  78 "    ORR     R1, R1, #0x50000 \n"
  79 "    MCR     p15, 0, R1, c1, c0 \n"
  80 "    LDR     R2, =0xC0200000 \n"
  81 "    MOV     R1, #1 \n"
  82 "    STR     R1, [R2, #0x10C] \n"
  83 "    MOV     R1, #0xFF \n"
  84 "    STR     R1, [R2, #0xC] \n"
  85 "    STR     R1, [R2, #0x1C] \n"
  86 "    STR     R1, [R2, #0x2C] \n"
  87 "    STR     R1, [R2, #0x3C] \n"
  88 "    STR     R1, [R2, #0x4C] \n"
  89 "    STR     R1, [R2, #0x5C] \n"
  90 "    STR     R1, [R2, #0x6C] \n"
  91 "    STR     R1, [R2, #0x7C] \n"
  92 "    STR     R1, [R2, #0x8C] \n"
  93 "    STR     R1, [R2, #0x9C] \n"
  94 "    STR     R1, [R2, #0xAC] \n"
  95 "    STR     R1, [R2, #0xBC] \n"
  96 "    STR     R1, [R2, #0xCC] \n"
  97 "    STR     R1, [R2, #0xDC] \n"
  98 "    STR     R1, [R2, #0xEC] \n"
  99 "    STR     R1, [R2, #0xFC] \n"
 100 "    LDR     R1, =0xC0400008 \n"
 101 "    LDR     R2, =0x430005 \n"
 102 "    STR     R2, [R1] \n"
 103 "    LDR     R2, =0xC0242010 \n"
 104 "    LDR     R1, [R2] \n"
 105 "    ORR     R1, R1, #1 \n"
 106 "    STR     R1, [R2] \n"
 107 "    LDR     R0, =0xFF6982D4 \n"
 108 "    LDR     R1, =0x671000 \n"
 109 "    LDR     R3, =0x69BADC \n"
 110 
 111 "loc_FF000130:\n"
 112 "    CMP     R1, R3 \n"
 113 "    LDRCC   R2, [R0], #4 \n"
 114 "    STRCC   R2, [R1], #4 \n"
 115 "    BCC     loc_FF000130 \n"
 116 "    LDR     R0, =0xFF684650 \n"
 117 "    LDR     R1, =0x1900 \n"
 118 "    LDR     R3, =0x15584 \n"
 119 
 120 "loc_FF00014C:\n"
 121 "    CMP     R1, R3 \n"
 122 "    LDRCC   R2, [R0], #4 \n"
 123 "    STRCC   R2, [R1], #4 \n"
 124 "    BCC     loc_FF00014C \n"
 125 "    LDR     R1, =0x242F28 \n"
 126 "    MOV     R2, #0 \n"
 127 
 128 "loc_FF000164:\n"
 129 "    CMP     R3, R1 \n"
 130 "    STRCC   R2, [R3], #4 \n"
 131 "    BCC     loc_FF000164 \n"
 132 /* Install task hooks via 0x193x is not possible with this new dryos version
 133    So the below code patches the CreateTask function in RAM to install our
 134    hook -- ERR99
 135 */
 136 // Install CreateTask patch
 137 "    LDR     R0, =patch_CreateTask\n"   // Patch data
 138 "    LDM     R0, {R1,R2}\n"             // Get two patch instructions
 139 "    LDR     R0, =hook_CreateTask\n"    // Address to patch
 140 "    STM     R0, {R1,R2}\n"             // Store patch instructions
 141 
 142 "    B       sub_FF000380_my \n"  // --> Patched. Old value = 0xFF000380.
 143 
 144 "patch_CreateTask:\n"
 145 "    LDR     PC, [PC,#-0x4]\n"          // Do jump to absolute address CreateTask_my
 146 "    .long   CreateTask_my\n"
 147 );
 148 }
 149 
 150 /*************************************************************/
 151 //** CreateTask_my @ 0x006768B0 - 0x006768B4, length=2
 152 void __attribute__((naked,noinline)) CreateTask_my() {
 153 asm volatile (
 154 "    STMFD   SP!, {R0}\n"
 155 //R3 = Pointer to task function to create
 156 
 157 /*** INSTALL capt_seq_task() hook ***/
 158 "    LDR     R0, =task_CaptSeq\n"       // DryOS original code function ptr.
 159 "    CMP     R0, R3\n"                  // is the given taskptr equal to our searched function?
 160 "    LDREQ   R3, =capt_seq_task\n"      // if so replace with our task function base ptr.
 161 "    BEQ     exitHook\n"                // below compares not necessary if this check has found something.
 162 
 163 /*** INSTALL exp_drv_task() hook ***/
 164 "    LDR     R0, =task_ExpDrv\n"
 165 "    CMP     R0, R3\n"
 166 "    LDREQ   R3, =exp_drv_task\n"
 167 "    BEQ     exitHook\n"
 168 
 169 /*** INSTALL filewrite() hook ***/
 170 "    LDR     R0, =task_FileWrite\n"
 171 "    CMP     R0, R3\n"
 172 "    LDREQ   R3, =filewritetask\n"
 173 "    BEQ     exitHook\n"
 174 
 175 /*** INSTALL movie_record_task() hook ***/
 176 /*
 177 "    LDR     R0, =task_MovieRecord\n"
 178 "    CMP     R0, R3\n"
 179 "    LDREQ   R3, =movie_record_task\n"
 180 "    BEQ     exitHook\n"
 181 */
 182 
 183 /*** INSTALL init_file_modules_task() hook ***/
 184 "    LDR     R0, =task_InitFileModules\n"
 185 "    CMP     R0, R3\n"
 186 "    LDREQ   R3, =init_file_modules_task\n"
 187 
 188 "exitHook:\n" 
 189 // restore overwritten registers
 190 "    LDMFD   SP!, {R0}\n"
 191 // Execute overwritten instructions from original code, then jump to firmware
 192 "    STMFD   SP!, {R1-R9,LR} \n"
 193 "    MOV     R4, R0 \n"
 194 "    LDR     PC, =0x006768B8 \n"  // Continue in firmware
 195 );
 196 }
 197 
 198 /*************************************************************/
 199 //** sub_FF000380_my @ 0xFF000380 - 0xFF0003E8, length=27
 200 void __attribute__((naked,noinline)) sub_FF000380_my() {
 201 
 202     //Replacement of sub_ for correct power-on.
 203     //(short press = playback mode, long press = record mode)
 204 
 205         // look at power-on switch sub_FF031094
 206         // value and pointer from sub_FF090140 
 207     if ((*(int*) 0xC0220100) & 1)       
 208         *(int*)(0x2F30) = 0x200000; // Playmode 
 209     else
 210         *(int*)(0x2f30) = 0x100000; // Shootingmode
 211 
 212 asm volatile (
 213 "    LDR     R0, =0xFF0003F8 \n"
 214 "    MOV     R1, #0 \n"
 215 "    LDR     R3, =0xFF000430 \n"
 216 
 217 "loc_FF00038C:\n"
 218 "    CMP     R0, R3 \n"
 219 "    LDRCC   R2, [R0], #4 \n"
 220 "    STRCC   R2, [R1], #4 \n"
 221 "    BCC     loc_FF00038C \n"
 222 "    LDR     R0, =0xFF000430 \n"
 223 "    MOV     R1, #0x1B0 \n"
 224 "    LDR     R3, =0xFF000618 \n"
 225 
 226 "loc_FF0003A8:\n"
 227 "    CMP     R0, R3 \n"
 228 "    LDRCC   R2, [R0], #4 \n"
 229 "    STRCC   R2, [R1], #4 \n"
 230 "    BCC     loc_FF0003A8 \n"
 231 "    MOV     R0, #0xD2 \n"
 232 "    MSR     CPSR_cxsf, R0 \n"
 233 "    MOV     SP, #0x1000 \n"
 234 "    MOV     R0, #0xD3 \n"
 235 "    MSR     CPSR_cxsf, R0 \n"
 236 "    MOV     SP, #0x1000 \n"
 237 "    LDR     R0, =0x398 \n"
 238 "    LDR     R2, =0xEEEEEEEE \n"
 239 "    MOV     R3, #0x1000 \n"
 240 
 241 "loc_FF0003DC:\n"
 242 "    CMP     R0, R3 \n"
 243 "    STRCC   R2, [R0], #4 \n"
 244 "    BCC     loc_FF0003DC \n"
 245 "    BL      sub_FF001100_my \n"  // --> Patched. Old value = 0xFF001100.
 246 );
 247 }
 248 
 249 /*************************************************************/
 250 //** sub_FF001100_my @ 0xFF001100 - 0xFF0011B4, length=46
 251 void __attribute__((naked,noinline)) sub_FF001100_my() {
 252 asm volatile (
 253 "    STR     LR, [SP, #-4]! \n"
 254 "    SUB     SP, SP, #0x74 \n"
 255 "    MOV     R1, #0x74 \n"
 256 "    MOV     R0, SP \n"
 257 "    BL      sub_006953A4 \n"
 258 "    MOV     R0, #0x73000 \n"
 259 "    STR     R0, [SP, #4] \n"
 260 
 261 #if defined(CHDK_NOT_IN_CANON_HEAP) // use original heap offset if CHDK is loaded in high memory
 262 "    LDR     R0, =0x242F28 \n"
 263 #else
 264 "    LDR     R0, =new_sa\n"   // otherwise use patched value
 265 "    LDR     R0, [R0]\n"      //
 266 #endif
 267 
 268 "    LDR     R2, =0x54F15C \n"
 269 "    STR     R0, [SP, #8] \n"
 270 "    SUB     R0, R2, R0 \n"
 271 "    STR     R0, [SP, #0xC] \n"
 272 "    MOV     R0, #0x22 \n"
 273 "    STR     R0, [SP, #0x18] \n"
 274 "    MOV     R0, #0x98 \n"
 275 "    STR     R0, [SP, #0x1C] \n"
 276 "    LDR     R0, =0x1E2 \n"
 277 "    LDR     R1, =0x559C00 \n"
 278 "    STR     R2, [SP, #0x10] \n"
 279 "    STR     R0, [SP, #0x20] \n"
 280 "    MOV     R0, #0xF6 \n"
 281 "    STR     R1, [SP] \n"
 282 "    STR     R1, [SP, #0x14] \n"
 283 "    STR     R0, [SP, #0x24] \n"
 284 "    MOV     R0, #0xB6 \n"
 285 "    STR     R0, [SP, #0x28] \n"
 286 "    MOV     R0, #0x85 \n"
 287 "    STR     R0, [SP, #0x2C] \n"
 288 "    MOV     R0, #0x40 \n"
 289 "    STR     R0, [SP, #0x30] \n"
 290 "    MOV     R0, #4 \n"
 291 "    STR     R0, [SP, #0x34] \n"
 292 "    MOV     R0, #0x10 \n"
 293 "    STR     R0, [SP, #0x5C] \n"
 294 "    MOV     R0, #0x800 \n"
 295 "    STR     R0, [SP, #0x60] \n"
 296 "    MOV     R0, #0xA0 \n"
 297 "    STR     R0, [SP, #0x64] \n"
 298 "    MOV     R0, #0x280 \n"
 299 "    STR     R0, [SP, #0x68] \n"
 300 "    LDR     R1, =sub_FF004200_my \n"  // --> Patched. Old value = 0xFF004200.
 301 "    MOV     R2, #0 \n"
 302 "    MOV     R0, SP \n"
 303 "    BL      sub_006727E8 \n"
 304 "    ADD     SP, SP, #0x74 \n"
 305 "    LDR     PC, [SP], #4 \n"
 306 );
 307 }
 308 
 309 /*************************************************************/
 310 //** sub_FF004200_my @ 0xFF004200 - 0xFF004274, length=30
 311 void __attribute__((naked,noinline)) sub_FF004200_my() {
 312 asm volatile (
 313 "    STMFD   SP!, {R4,LR} \n"
 314 "    BL      sub_FF000ADC \n"
 315 "    BL      sub_FF005144 \n"
 316 "    CMP     R0, #0 \n"
 317 "    LDRLT   R0, =0xFF004340 /*'dmSetup'*/ \n"
 318 "    BLLT    _err_init_task \n"
 319 "    BL      sub_FF003E38 \n"
 320 "    CMP     R0, #0 \n"
 321 "    LDRLT   R0, =0xFF004348 /*'termDriverInit'*/ \n"
 322 "    BLLT    _err_init_task \n"
 323 "    LDR     R0, =0xFF004358 /*'/_term'*/ \n"
 324 "    BL      sub_FF003F20 \n"
 325 "    CMP     R0, #0 \n"
 326 "    LDRLT   R0, =0xFF004360 /*'termDeviceCreate'*/ \n"
 327 "    BLLT    _err_init_task \n"
 328 "    LDR     R0, =0xFF004358 /*'/_term'*/ \n"
 329 "    BL      sub_FF002940 \n"
 330 "    CMP     R0, #0 \n"
 331 "    LDRLT   R0, =0xFF004374 /*'stdioSetup'*/ \n"
 332 "    BLLT    _err_init_task \n"
 333 "    BL      sub_FF004AE0 \n"
 334 "    CMP     R0, #0 \n"
 335 "    LDRLT   R0, =0xFF004380 /*'stdlibSetup'*/ \n"
 336 "    BLLT    _err_init_task \n"
 337 "    BL      sub_FF0015F8 \n"
 338 "    CMP     R0, #0 \n"
 339 "    LDRLT   R0, =0xFF00438C /*'armlib_setup'*/ \n"
 340 "    BLLT    _err_init_task \n"
 341 "    LDMFD   SP!, {R4,LR} \n"
 342 "    B       sub_FF00A610_my \n"  // --> Patched. Old value = 0xFF00A610.
 343 );
 344 }
 345 
 346 /*************************************************************/
 347 //** sub_FF00A610_my @ 0xFF00A610 - 0xFF00A680, length=29
 348 void __attribute__((naked,noinline)) sub_FF00A610_my() {
 349 asm volatile (
 350 "    STMFD   SP!, {R3,LR} \n"
 351 "    BL      sub_FF036EE4 \n"
 352 "    BL      sub_FF0382CC \n"
 353 "    CMP     R0, #0 \n"
 354 "    BNE     loc_FF00A634 \n"
 355 "    BL      sub_FF033228 /*_IsNormalCameraMode_FW*/ \n"
 356 "    CMP     R0, #0 \n"
 357 "    MOVNE   R0, #1 \n"
 358 "    BNE     loc_FF00A638 \n"
 359 
 360 "loc_FF00A634:\n"
 361 "    MOV     R0, #0 \n"
 362 
 363 "loc_FF00A638:\n"
 364 "    BL      sub_FF031094_my \n"  // --> Patched. Old value = 0xFF031094.
 365 "    CMP     R0, #0 \n"
 366 "    BNE     loc_FF00A64C \n"
 367 "    BL      sub_FF03097C \n"
 368 
 369 "loc_FF00A648:\n"
 370 "    B       loc_FF00A648 \n"
 371 
 372 "loc_FF00A64C:\n"
 373 "    BL      sub_006779E0 \n"
 374 "    LDR     R1, =0x5CE000 \n"
 375 "    MOV     R0, #0 \n"
 376 "    BL      sub_FF03881C \n"
 377 "    BL      sub_00677BF8 \n"
 378 "    MOV     R3, #0 \n"
 379 "    STR     R3, [SP] \n"
 380 "    LDR     R3, =task_Startup_my \n"  // --> Patched. Old value = 0xFF00A5A8.
 381 "    MOV     R2, #0 \n"
 382 "    MOV     R1, #0x19 \n"
 383 "    LDR     R0, =0xFF00A68C /*'Startup'*/ \n"
 384 "    BL      _CreateTask \n"
 385 "    MOV     R0, #0 \n"
 386 "    LDMFD   SP!, {R3,PC} \n"
 387 );
 388 }
 389 
 390 /*************************************************************/
 391 //** sub_FF031094_my @ 0xFF031094 - 0xFF0310F8, length=26
 392 void __attribute__((naked,noinline)) sub_FF031094_my() {
 393 asm volatile (
 394 "    STMFD   SP!, {R2-R8,LR} \n"
 395 "    MOV     R6, #0 \n"
 396 "    MOV     R8, R0 \n"
 397 "    MOV     R7, R6 \n"
 398 //"  BL      _sub_FF090138 \n"  // --> Nullsub call removed.
 399 "    LDR     R0, =0xC0220100 \n"
 400 "    BL      sub_FF08E538 \n"
 401 "    MOV     R4, #1 \n"
 402 "    BIC     R5, R4, R0 \n"
 403 "    LDR     R0, =0xC0220104 \n"
 404 "    BL      sub_FF08E538 \n"
 405 "    CMP     R8, #0 \n"
 406 "    BIC     R4, R4, R0 \n"
 407 "    BEQ     loc_FF0310D4 \n"
 408 "    ORRS    R0, R5, R4 \n"
 409 "    BEQ     loc_FF0310F8 \n"
 410 
 411 "loc_FF0310D4:\n"
 412 "    BL      sub_FF0382CC \n"
 413 "    MOV     R2, R0 \n"
 414 "    MOV     R3, #0 \n"
 415 "    MOV     R1, R4 \n"
 416 "    MOV     R0, R5 \n"
 417 "    STRD    R6, [SP] \n"
 418 //"  BL      _sub_FF090140 \n"  // Disable StartUpChecks
 419 //"  BL      _sub_FF09013C \n"  // --> Nullsub call removed.
 420 "    MOV     R0, #1 \n"
 421 
 422 "loc_FF0310F8:\n"
 423 "    LDMFD   SP!, {R2-R8,PC} \n"
 424 );
 425 }
 426 
 427 /*************************************************************/
 428 //** task_Startup_my @ 0xFF00A5A8 - 0xFF00A60C, length=26
 429 void __attribute__((naked,noinline)) task_Startup_my() {
 430 asm volatile (
 431 "    STMFD   SP!, {R4,LR} \n"
 432 "    BL      sub_FF004898 \n"
 433 "    BL      sub_FF0322B8 \n"
 434 "    BL      sub_FF030928 \n"
 435 //"  BL      _sub_FF0907D0 \n"  // --> Nullsub call removed.
 436 "    BL      sub_FF03853C \n"
 437 //"  BL      _sub_FF0383C4 \n"  // load DISKBOOT.BIN
 438 "    BL      sub_FF0386B8 \n"
 439 "    BL      sub_FF038E90 \n"
 440 "    BL      sub_FF03867C \n"
 441 "    BL      sub_FF038574 \n"
 442 "    BL      sub_FF036E1C \n"
 443 "    BL      sub_FF038E98 \n"
 444 "    BL      CreateTask_spytask\n" // added
 445 "    BL      taskcreatePhySw_my \n"  // --> Patched. Old value = 0xFF030F38.
 446 "    BL      sub_FF035068 \n"
 447 "    BL      sub_FF0D5BE8 \n"
 448 "    BL      sub_FF02E738 \n"
 449 "    BL      sub_FF0302A0 \n"
 450 "    BL      sub_FF0380FC \n"
 451 "    BL      sub_FF0308DC \n"
 452 "    BL      sub_FF03023C \n"
 453 "    BL      sub_FF07D400 \n"
 454 "    BL      sub_FF02F390 \n"
 455 "    BL      sub_FF030200 \n"
 456 "    LDMFD   SP!, {R4,LR} \n"
 457 "    B       sub_FF0049B8 \n"
 458 );
 459 }
 460 
 461 /*************************************************************/
 462 //** taskcreatePhySw_my @ 0xFF030F38 - 0xFF030F88, length=21
 463 void __attribute__((naked,noinline)) taskcreatePhySw_my() {
 464 asm volatile (
 465 "    STMFD   SP!, {R3-R5,LR} \n"
 466 "    LDR     R4, =0x1DEC \n"
 467 "    LDR     R0, [R4, #4] \n"
 468 "    CMP     R0, #0 \n"
 469 "    BNE     loc_FF030F6C \n"
 470 "    MOV     R3, #0 \n"
 471 "    STR     R3, [SP] \n"
 472 "    LDR     R3, =mykbd_task \n"  // --> Patched. Old value = 0xFF030F04.
 473 "    MOV     R2, #0x2000 \n"  // --> Patched. Old value = 0x800. stack size for new task_PhySw so we don't have to do stack switch
 474 "    MOV     R1, #0x17 \n"
 475 "    LDR     R0, =0xFF0311F0 /*'PhySw'*/ \n"
 476 "    BL      sub_00677C50 /*_CreateTaskStrictly*/ \n"
 477 "    STR     R0, [R4, #4] \n"
 478 
 479 "loc_FF030F6C:\n"
 480 "    BL      sub_FF0C099C \n"
 481 "    BL      sub_FF033178 /*_IsFactoryMode_FW*/ \n"
 482 "    CMP     R0, #0 \n"
 483 "    BNE     loc_FF030F88 \n"
 484 "    LDR     R1, =0x3A95C \n"
 485 "    MOV     R0, #0 \n"
 486 "    BL      sub_FF0C0908 /*_OpLog.Start_FW*/ \n"
 487 
 488 "loc_FF030F88:\n"
 489 "    LDMFD   SP!, {R3-R5,PC} \n"
 490 );
 491 }
 492 
 493 /*************************************************************/
 494 //** init_file_modules_task @ 0xFF0820B8 - 0xFF0820EC, length=14
 495 void __attribute__((naked,noinline)) init_file_modules_task() {
 496 asm volatile (
 497 "    STMFD   SP!, {R4-R6,LR} \n"
 498 "    BL      sub_FF0C329C \n"
 499 "    LDR     R5, =0x5006 \n"
 500 "    MOVS    R4, R0 \n"
 501 "    MOVNE   R1, #0 \n"
 502 "    MOVNE   R0, R5 \n"
 503 "    BLNE    _PostLogicalEventToUI \n"
 504 "    BL      sub_FF0C32D0 \n"
 505 "    BL      core_spytask_can_start\n"  // CHDK: Set "it's-safe-to-start" flag for spytask
 506 "    CMP     R4, #0 \n"
 507 "    LDMNEFD SP!, {R4-R6,PC} \n"
 508 "    MOV     R0, R5 \n"
 509 "    LDMFD   SP!, {R4-R6,LR} \n"
 510 "    MOV     R1, #0 \n"
 511 "    B       _PostLogicalEventToUI \n"
 512 );
 513 }

/* [<][>][^][v][top][bottom][index][help] */