root/platform/sx530hs/sub/taskhook.S

/* [<][>][^][v][top][bottom][index][help] */
   1 "    STMFD   SP!, {R0}\n"
   2 //R3 = Pointer to task function to create
   3 
   4 /*** INSTALL capt_seq_task() hook ***/
   5 "    LDR     R0, =task_CaptSeq\n"       // DryOS original code function ptr.
   6 "    CMP     R0, R3\n"                  // is the given taskptr equal to our searched function?
   7 "    LDREQ   R3, =capt_seq_task\n"      // if so replace with our task function base ptr.
   8 "    BEQ     exitHook\n"                // below compares not necessary if this check has found something.
   9 
  10 /*** INSTALL exp_drv_task() hook ***/
  11 // hook not fully implemented in capt_seq.c - reyalp
  12 /*
  13 "    LDR     R0, =task_ExpDrv\n"
  14 "    CMP     R0, R3\n"
  15 "    LDREQ   R3, =exp_drv_task\n"
  16 "    BEQ     exitHook\n"
  17 */
  18 
  19 /*** INSTALL filewrite() hook ***/
  20 //"    LDR     R0, =task_FileWrite\n"
  21 //"    CMP     R0, R3\n"
  22 //"    LDREQ   R3, =filewritetask\n"
  23 //"    BEQ     exitHook\n"
  24 
  25 /*** INSTALL JogDial() hook ***/
  26 // was commented out in boot.c from http://chdk.setepontos.com/index.php?topic=12418.msg123489#msg123489
  27 // but not in codegen file - reyalp
  28 //"    LDR     R0, =task_RotaryEncoder\n"
  29 //"    CMP     R0, R3\n"
  30 //"    LDREQ   R3, =JogDial_task_my\n"
  31 //"    BEQ     exitHook\n"
  32 
  33 /*** INSTALL movie_record_task() hook ***/
  34 "    LDR     R0, =task_MovieRecord\n"
  35 "    CMP     R0, R3\n"
  36 "    LDREQ   R3, =movie_record_task\n"
  37 "    BEQ     exitHook\n"
  38 
  39 /*** INSTALL liveimage_task() hook ***/
  40 "    LDR     R0, =task_LiveImageTask\n"
  41 "    CMP     R0, R3\n"
  42 "    LDREQ   R3, =liveimage_task\n"
  43 "    BEQ     exitHook\n"
  44 
  45 /*** INSTALL init_file_modules_task() hook ***/
  46 "    LDR     R0, =task_InitFileModules\n"
  47 "    CMP     R0, R3\n"
  48 "    LDREQ   R3, =init_file_modules_task\n"
  49 
  50 "exitHook:\n" 
  51 // restore overwritten registers
  52 "    LDMFD   SP!, {R0}\n"
  53 // Execute overwritten instructions from original code, then jump to firmware

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