root/platform/n/sub/taskhook.S

/* [<][>][^][v][top][bottom][index][help] */
   1 "    STMFD   SP!, {R0}\n"
   2                                         //R3 = Pointer to task function to create
   3 /*** INSTALL capt_seq_task() hook ***/
   4 "    LDR     R0, =task_CaptSeq\n"       // DryOS original code function ptr.
   5 "    CMP     R0, R3\n"                  // is the given taskptr equal to our searched function?
   6 "    LDREQ   R3, =capt_seq_task\n"      // if so replace with our task function base ptr.
   7 "    BEQ     exitHook\n"                // below compares not necessary if this check has found something.
   8 
   9 /*** INSTALL exp_drv_task() hook ***/
  10 "    LDR     R0, =task_ExpDrv\n"
  11 "    CMP     R0, R3\n"
  12 "    LDREQ   R3, =exp_drv_task\n"
  13 "    BEQ     exitHook\n"
  14 
  15 /*** INSTALL filewrite() hook ***/
  16 "    LDR     R0, =task_FileWrite\n"
  17 "    CMP     R0, R3\n"
  18 "    LDREQ   R3, =filewritetask\n"
  19 "    BEQ     exitHook\n"
  20 
  21 /*** INSTALL movie_record_task() hook ***/
  22 //"    LDR     R0, =task_MovieRecord\n"
  23 //"    CMP     R0, R3\n"
  24 //"    LDREQ   R3, =movie_record_task\n"
  25 //"    BEQ     exitHook\n"
  26 
  27 /*** INSTALL init_file_modules_task() hook ***/
  28 "    LDR     R0, =task_InitFileModules\n"
  29 "    CMP     R0, R3\n"
  30 "    LDREQ   R3, =init_file_modules_task\n"
  31 
  32 /*** INSTALL touch_task() hook ***/
  33 "    LDR     R0, =task_TouchPanel\n"
  34 "    CMP     R0, R3\n"
  35 "    LDREQ   R3, =task_TouchPanel_my\n"
  36 
  37 "exitHook:\n"                     // restore overwritten registers
  38 "    LDMFD   SP!, {R0}\n"         // Execute overwritten instructions from original code, then jump to firmware

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