root/platform/sx610hs/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 #ifdef CAM_HAS_FILEWRITETASK_HOOK
  18 "    LDR     R0, =task_FileWrite\n"
  19 "    CMP     R0, R3\n"
  20 "    LDREQ   R3, =filewritetask\n"
  21 "    BEQ     exitHook\n"
  22 #endif
  23 /*** INSTALL movie_record_task() hook ***/
  24 //"    LDR     R0, =task_MovieRecord\n"
  25 //"    CMP     R0, R3\n"
  26 //"    LDREQ   R3, =movie_record_task\n"
  27 //"    BEQ     exitHook\n"
  28 
  29 /*** INSTALL liveimage_task() hook ***/
  30 //"    LDR     R0, =task_LiveImageTask\n"
  31 //"    CMP     R0, R3\n"
  32 //"    LDREQ   R3, =liveimage_task\n"
  33 //"    BEQ     exitHook\n"
  34 
  35 /*** INSTALL init_file_modules_task() hook ***/
  36 "    LDR     R0, =task_InitFileModules\n"
  37 "    CMP     R0, R3\n"
  38 "    LDREQ   R3, =init_file_modules_task\n"
  39 
  40 "exitHook:\n" 
  41 // restore overwritten registers
  42 "    LDMFD   SP!, {R0}\n"
  43 // Execute overwritten instructions from original code, then jump to firmware

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