root/platform/ixus140_elph130/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 "    LDR     R0, =task_ExpDrv\n"
  12 "    CMP     R0, R3\n"
  13 "    LDREQ   R3, =exp_drv_task\n"
  14 "    BEQ     exitHook\n"
  15 
  16 /*** INSTALL filewrite() hook ***/
  17 "    LDR     R0, =task_FileWrite\n"
  18 "    CMP     R0, R3\n"
  19 "    LDREQ   R3, =filewritetask\n"
  20 "    BEQ     exitHook\n"
  21 
  22 /*** INSTALL movie_record_task() hook ***/
  23 /*
  24 "    LDR     R0, =task_MovieRecord\n"
  25 "    CMP     R0, R3\n"
  26 "    LDREQ   R3, =movie_record_task\n"
  27 "    BEQ     exitHook\n"
  28 */
  29 
  30 /*** INSTALL init_file_modules_task() hook ***/
  31 "    LDR     R0, =task_InitFileModules\n"
  32 "    CMP     R0, R3\n"
  33 "    LDREQ   R3, =init_file_modules_task\n"
  34 
  35 "exitHook:\n" 
  36 // restore overwritten registers
  37 "    LDMFD   SP!, {R0}\n"
  38 // Execute overwritten instructions from original code, then jump to firmware

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