root/platform/ixus160_elph160/sub/taskhook.S

/* [<][>][^][v][top][bottom][index][help] */
   1 " STMFD SP!, {R1}\n"
   2 //R0 = Pointer to task function to create
   3 
   4 /*** INSTALL capt_seq_task() hook ***/
   5 "    LDR     R1, =task_CaptSeq\n"       // DryOS original code function ptr.
   6 "    CMP     R1, R0\n"                  // is the given taskptr equal to our searched function?
   7 "    LDREQ   R0, =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     R1, =task_ExpDrv\n"
  12 "    CMP     R1, R0\n"
  13 "    LDREQ   R0, =exp_drv_task\n"
  14 "    BEQ exitHook\n"
  15 
  16 /*** INSTALL filewrite() hook ***/
  17 "    LDR     R1, =task_FileWrite\n"
  18 "    CMP     R1, R0\n"
  19 "    LDREQ   R0, =filewritetask\n"
  20 "    BEQ exitHook\n"
  21 
  22 /*** INSTALL movie_record_task() hook ***/
  23 "    LDR     R1, =task_MovieRecord\n"
  24 "    CMP     R1, R0\n"
  25 "    LDREQ   R0, =movie_record_task\n"
  26 "    BEQ exitHook\n"
  27 
  28 /*** INSTALL init_file_modules_task() hook ***/
  29 "   LDR     R1, =task_InitFileModules\n"
  30 "   CMP     R1, R0\n"
  31 "   LDREQ   R0, =init_file_modules_task\n"
  32 
  33 "exitHook:\n"
  34 // restore overwritten registers
  35 "    LDMFD SP!, {R1}\n"
  36 // Execute overwritten instructions from original code, then jump to firmware

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